You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fortran binary silently produces all-NaN fit when block_size exceeds frames per thread #292
Found while building the #209 matched-stopping experiment (PR #291): amica15 splits frames across max_threads OpenMP segments BEFORE chunking by block_size; if block_size exceeds one segment's length the run silently produces an all-NaN fit — LL stuck at exactly 0.0, exit code 0, no error message. Bisected precisely: frames=5120, max_threads=4 -> block_size=1280 works, 1281 fails. The experiment script now clamps Fortran's block_size to frames // threads and treats LL==0.0 as degenerate.
Implications: (1) any harness driving the reference binary (validate_implementations.py, the parity tests, benchmarks) should apply the same clamp or degenerate-LL check so a silent NaN reference never poisons a comparison; (2) the #232 auto-tuner must clamp candidate block sizes on the Fortran side of any parity run; (3) worth a note in docs/guides/validation.md's block-size material since users driving amica15 directly at the new larger defaults could hit this on short recordings or high thread counts.
This is reference-binary behavior we document and defend against, not something we patch (amica15.f90 is read-only). Related: #209, #232, #216, PR #291.
Related, from epic #324 Phase 17 (#355): the binary's block_size is per thread; it runs n_samples // (max_threads * block_size) blocks (amica15.f90:1215-1227).
Default:AMICANative now derives its default block_size per thread from pamica's 8192-sample block, capped at the data length, so a default run cannot hit the zero-block case.
Explicit values: an explicit block_size can still hit it; the engine reports that as a degenerate fit.
Docs: the advice to "match block_size on both sides" for bit-for-bit comparisons compares different quantities, since pamica's value is per block and the binary's per thread. It should be restated in total samples per block.
AMICANative reports non-finite weights as a degenerate fit instead of returning them.
Still open:
An explicit block_size passed to AMICANative, or an input.param written directly (validate_implementations.py writes its own), can still exceed the frames per thread.
A clamp or zero-LL check in validate_implementations.py.
The validation.md note on per-thread block sizes, which the earlier comment here describes.
Activity
Give AMICANative pamica's shared defaults
neuromechanist commentedon Sep 24, 2026
Related, from epic #324 Phase 17 (#355): the binary's
block_sizeis per thread; it runsn_samples // (max_threads * block_size)blocks (amica15.f90:1215-1227).AMICANativenow derives its defaultblock_sizeper thread from pamica's 8192-sample block, capped at the data length, so a default run cannot hit the zero-block case.block_sizecan still hit it; the engine reports that as a degenerate fit.block_sizeon both sides" for bit-for-bit comparisons compares different quantities, since pamica's value is per block and the binary's per thread. It should be restated in total samples per block.Phase 17: unify the defaults across entry points (#355)
neuromechanist commentedon Sep 24, 2026
Status after 0.4.0.
Done:
AMICANative's defaultblock_sizeis now derived per thread from pamica's 8192-sample block, capped at the data length (Unify the lrate default and fix raw-backend device auto-selection #354). A default run cannot hit the zero-block case.AMICANativereports non-finite weights as a degenerate fit instead of returning them.Still open:
block_sizepassed toAMICANative, or aninput.paramwritten directly (validate_implementations.pywrites its own), can still exceed the frames per thread.validate_implementations.py.validation.mdnote on per-thread block sizes, which the earlier comment here describes.