mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1680] interp_hw_probe: harden CLI parsing, oracle batch/word validation, and error lifecycle #1694
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#1694
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/1680
Author: @IlyassRS3
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:fix/interp-hw-probe-cli-and-oracle📝 Commits (1)
73e9627interp_hw_probe: harden CLI parsing, oracle batch/word validation, and error lifecycle📊 Changes
2 files changed (+145 additions, -11 deletions)
View changed files
📝
tests/test_interp_hw_probe.py(+103 -0)📝
tools/interp_hw_probe.py(+42 -11)📄 Description
Item ID:
INTERP-HW-PROBE-CLI-AND-ORACLE(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156453676)Summary
tools/interp_hw_probe.py):--arch, non-positive--kernels < 1, and empty/trailing-comma--seedstokens with argparse exit code2.--seedswhile preserving order so identical random kernel batches are not run twice._validate_batch()used for both the random kernel batches and the tie kernel to verify thato.run()returns alist/tuplematching the exact kernel count and that each non-string entry is alist/tupleof at leastexpected_wordsnon-boolintwords (masking to 32 bits), preventing false passes on empty/short responses and uncaughtIndexError/TypeError.runner.Unavailable(exit77) andRuntimeError(exit2) raised duringo.run()insidetry ... finally: o.close().2iftallyis empty (no checks executed).(o[i2] & 0xFFFFFFFF) >> 16 == 0xDEADincheck_random().tests/test_interp_hw_probe.py):--arch, non-positive--kernels, malformed/deduplicated--seeds, malformed oracle batch/word responses,runner.Unavailable-> exit77,RuntimeError-> exit2, and 32-bit canary masking incheck_random().Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/interp_hw_probe.py tests/test_interp_hw_probe.pypassed)python3 -W error -I tests/test_interp_hw_probe.py -v:Ran 24 tests ... OKtests/test_interp_hw_probe.pyagainst unpatchedmaintools/interp_hw_probe.py):Ran 24 tests ... FAILED (failures=8, errors=5)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.