mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:45:53 +01:00
[PR #1666] f64_omod_probe: harden oracle validation, CLI parsing, f32 overflow, and atomic JSON write #1681
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1681
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1666
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/f64-omod-probe-json-and-cli📝 Commits (1)
456497df64_omod_probe: harden oracle validation, CLI parsing, f32 overflow, and atomic JSON write📊 Changes
2 files changed (+253 additions, -15 deletions)
View changed files
📝
tests/test_f64_omod_probe.py(+138 -0)📝
tools/f64_omod_probe.py(+115 -15)📄 Description
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🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.