Skip to content

Support Float32 fixed-grid density tracking and MEPV - #96

Merged
frankier merged 2 commits into
mainfrom
codex/float32-grid-mepv
Nov 10, 2026
Merged

frankier merged 2 commits into
mainfrom
codex/float32-grid-mepv

Conversation

@frankier

@frankier frankier commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Fixes #94. Builds on the prepared fixed-grid scan merged in #93.

The linear and log trackers keep the precision of the evaluated density. An empty likelihood uses a typed identity derived from the ability coordinate. Append and speculative updates reuse compatible buffers and promote when the response probabilities are wider. EAP and prepared candidate reductions use the resulting precision, including mixed Float32 grids with Float64 priors or banks.

Scalar fixed grids accept coordinates of any Real type supported by the bank and integrator. Prepared scans infer scratch types from the actual weight arithmetic. Scalar variance and exhaustive search preserve criterion precision. Log density storage follows PBB's floating-point weight API. Regression tests also cover Float16, BigFloat, rational coordinates, and a BigFloat selection that changes if scores are rounded to Float64. Regression tests cover the empty history, append, rollback, clearing, rebuilding, and speculative replacements in linear and log space. They compare the full score vector and public selection against an independent Float64 2PL calculation.

FittedItemBanks 0.7.7 widens Float32 guess/slip responses to Float64 (FIB #21). The benchmark uses ordinary 2PL transfer banks so both CAT precisions use the same public path with released dependencies.

Julia 1.13.3 passed all 1,091 local assertions across the prepared MEPV, grid preallocation, and incremental grid test files. The full Julia 1.13 test job and Coveralls upload also passed. CI run

Julia 1.13.3 benchmark

Median milliseconds per complete warmed selection call, including preparation. CAT uses public Stateful.next_item. SuperFastCAT uses get_next_item!. One Julia thread pinned to CPU 2 on an Intel Core Ultra 5 225U, with released PBB 0.8.11 and FittedItemBanks 0.7.7 and SuperFastCAT at 4902fba. Each bank is a prefix of the same seeded 2PL fixture, with ten fixed responses, a standard normal prior, and 33 points on [-4, 4]. The runs used randomized interleaved rounds (51 up to 10,000 items and 31 at 100,000). No timed GC occurred. Timed compiler activity was under 0.14 ms in aggregate per row across all rounds.

Items CAT Float64 (ms) CAT Float32 (ms) SuperFastCAT Float32 (ms) Selected item
32 0.02019 0.01664 0.01334 11
1,000 0.41041 0.24660 0.40007 124
10,000 4.01882 2.37063 3.99155 3,655
100,000 40.06988 23.34674 39.83883 22,604
Items CAT Float64 (bytes / allocs) CAT Float32 (bytes / allocs) SuperFastCAT Float32 (bytes / allocs)
32 4608 / 51 3840 / 52 0 / 0
1,000 4608 / 51 3840 / 52 0 / 0
10,000 4640 / 53 3888 / 55 0 / 0
100,000 4640 / 53 3888 / 55 0 / 0

Every candidate score was compared with CAT Float64. Across all sizes, maximum relative error was 3.82e-7 for CAT Float32 and 3.78e-7 for SuperFastCAT. The actual PBB weight producer, compiled with the closure and buffers from the public prepared state, emitted <8 x float> for Float32 and <4 x double> for Float64.

@coveralls

coveralls commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 42882696374

Coverage increased (+0.6%) to 55.6%

Details

  • Coverage increased (+0.6%) from the base build.
  • Patch coverage: 8 uncovered changes across 4 files (71 of 79 lines covered, 89.87%).
  • 5 coverage regressions across 1 file.

Uncovered Changes

File Changed Covered %
src/NextItemRules/combinators/grid_mepv.jl 30 25 83.33%
src/Aggregators/ability_estimator.jl 3 2 66.67%
src/Aggregators/ability_trackers/grid.jl 14 13 92.86%
src/Responses.jl 6 5 83.33%
Total (9 files) 79 71 89.87%

Coverage Regressions

5 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/NextItemRules/combinators/grid_mepv.jl 5 87.34%

Coverage Stats

Coverage Status
Relevant Lines: 2500
Covered Lines: 1390
Line Coverage: 55.6%
Coverage Strength: 213558.25 hits per line

💛 - Coveralls

@frankier
frankier force-pushed the codex/float32-grid-mepv branch from d11315c to 7a5af02 Compare November 10, 2026 18:50
@frankier
frankier changed the base branch from codex/grid-preallocation-scratch to main November 10, 2026 18:50
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Benchmark Results

main dbb60f7... main / dbb60f7...
next_item_rules/4pl/mean_point_mepv_10 0.0703 ± 0.001 ms 0.0723 ± 0.00059 ms 0.972 ± 0.016
next_item_rules/4pl/mean_point_mepv_bare 12.9 ± 0.43 μs 12.8 ± 0.35 μs 1.01 ± 0.044
next_item_rules/4pl/mode_point_mepv_10 0.0327 ± 0.00049 s 0.0327 ± 0.00068 s 0.999 ± 0.026
next_item_rules/4pl/mode_point_mepv_bare 9.22 ± 1.3 ms 9.37 ± 1.3 ms 0.984 ± 0.19
time_to_load 1.45 ± 0.0091 s 1.45 ± 0.026 s 0.998 ± 0.019

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@frankier
frankier merged commit 3fcfb7e into main Nov 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Float32 density tracking and prepared fixed-grid MEPV selection

2 participants