f64_omod_probe: harden oracle validation, CLI parsing, f32 overflow, and atomic JSON write #1666
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1666
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/f64-omod-probe-json-and-cli"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Item ID:
F64-OMOD-PROBE-JSON-AND-CLI(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156055033)Summary
tools/f64_omod_probe.py):evaluate(), validate thatraw_resultsis alist/tuplematchinglen(meta), surfacestrkernel rejections fromhw_oracle.runner.run()as explicitRuntimeErrors instead of iterating characters, require"words"in dict results and integer (non-bool) elements, and require at leastlen(cases) * len(MODS) * stepwords per kernel instead of crashing with an uncaughtIndexError.main(), catchValueErrorfromasm.family(oracle.arch)andrunner.Unavailableraised duringoracle.run()inside thetry/finallyblock so both exit77cleanly while closing the oracle.scalar_bits()f32 overflow handling:OverflowErroronstruct.pack("<f", value)by returning signed infinity (0x7F800000/0xFF800000), matching_f16_bits().--hw-archand--json, reject empty/trailing-comma entries in--modesand--waves, and deduplicate repeated modes/waves while preserving order so duplicate GPU kernels are not launched.--jsonvalidation & atomic report writing:validate_report_path()before opening the oracle so a blocked parent path fails fast with exit2.write_report()to create missing parent folders, serialize strictly (allow_nan=False) with a trailing, support non-regular targets like/dev/null, preserve symlink targets and file permissions viafile_mode.published_mode(), fsync temp files, replace atomically viareplace_retry.replace(), and emit write errors tostderr.tests/test_f64_omod_probe.py):Unavailableduringrun(), CLI validation / deduplication / upfront--jsonparent failure, and nested atomicwrite_report()behavior.Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/f64_omod_probe.py tests/test_f64_omod_probe.pypassed)python3 -W error -I tests/test_f64_omod_probe.py -v:Ran 12 tests ... OKtests/test_f64_omod_probe.pyagainst unpatchedmaintools/f64_omod_probe.py):Ran 12 tests ... FAILED (failures=11, errors=1)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK#1666 | head 456497d7091b607d65bae6669798217b68edbbb0 (merged cleanly with main 95b2e6c67) |
python -I tests/test_f64_omod_probe.py| red on main:FAILED (failures=11, errors=1)(OverflowErrorinscalar_bits(1e40, "f32"), false0exit / uncaughtIndexErroron malformed oracle batch/word payloads, duplicate--modes/--wavesrunning kernels twice, and blocked--jsonparent not checked upfront) | green on PR+main:12 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
scalar_bitssigned-infinityOverflowErrorhandling,evaluatebatch/type/bool/length validation,validate_report_path, atomicwrite_report(allow_nan=False,published_mode,replace_retry), andasm.family/runner.Unavailable -> exit 77intools/f64_omod_probe.py. Also passedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.py.Red/green:
pytest tests/test_f64_omod_probe.pyfails on main (12 failed, 8 passed) and passes on head 456497d7091b merged with main (12 passed, 8 subtests passed).Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957bb in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)