mad_denorm_probe: harden CLI parsing, hw oracle validation, and error lifecycle #1674
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!1674
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mad-denorm-probe-cli-and-oracle"
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:
MAD-DENORM-PROBE-CLI-AND-ORACLE(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156204400)Summary
tools/mad_denorm_probe.py):_extract_hw_words()used by bothcheck_mode_denorm_effect()andrun_hw()to validate thatoracle.run()returns alist/tuplematching the exact kernel count and that every non-string element is a non-emptylist/tuplewith a non-boolintfirst word, preventing false passes on empty/truncated sweep responses and uncaughtIndexError/TypeErroron malformed payloads.asm.valu_skip_reason("v_mad_f32", oracle.arch)inside thetry ... finally: oracle.close()block so the oracle is always closed on every exit path.runner.Unavailable(exit77) andRuntimeError(exit2) raised duringoracle.run()insidetry ... finally.--hw-archand empty/trailing-comma--oracletokens ("","hw,",",translator") with argparse exit code2.tests/test_mad_denorm_probe.py):runner.Unavailableduringrun()-> exit77, andRuntimeErrorduringrun()-> exit2, verifyingoracle.close()on every path.Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/mad_denorm_probe.py tests/test_mad_denorm_probe.pypassed)python3 -W error -I tests/test_mad_denorm_probe.py -v:Ran 5 tests ... OKtests/test_mad_denorm_probe.pyagainst unpatchedmaintools/mad_denorm_probe.py):Ran 5 tests ... FAILED (failures=11, errors=6)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OK#1674 | head 28e797e63c5568ad042e17fd76fe1ba8133bdd44 (merged cleanly with main 95b2e6c67) |
python -I tests/test_mad_denorm_probe.py| red on main:FAILED (failures=11, errors=6)(false0exit on empty/short sweep lists due to silentzip,boolword accepted as0x1, malformed--oracle/--hw-archflags accepted, and uncaughtIndexError/TypeError/Unavailableinrun_hw/check_mode_denorm_effect) | green on PR+main:5 tests OK| Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_extract_hw_words(enforcing exact batch length and strict integer/non-bool32-bit words across bothcheck_mode_denorm_effectandrun_hw), upfront--oracle/--hw-archvalidation, and unifiedtry/finally: oracle.close()handling forvalu_skip_reason,runner.Unavailable -> exit 77, andRuntimeError -> exit 2intools/mad_denorm_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_mad_denorm_probe.pyfails on main (17 failed, 4 passed, 1 subtests passed) and passes on head 28e797e63c55 merged with main (5 passed, 17 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)