vinterp_hw_probe: harden CLI validation, run_hw batch/tuple handling, and harness error exits #1682
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1682"
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?
Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T08:01:42Z.
Item ID:
VINTERP-HW-PROBE-ORACLE-AND-CLI(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156493260)Summary
tools/vinterp_hw_probe.py):run_hw(), validate thatoracle.run([k] * 4, words=5)returns alist/tupleof length4, accept bothlistandtupleper-kernel entries when selecting CU0 ((r[4] & 0x100) == 0) or falling back to a valid entry, verify at least 5 non-boolintwords per non-string entry (masking to 32 bits), and raiseRuntimeErrorwhen a batch is malformed or all 4 kernels are rejected as strings (instead of crashing withIndexError/TypeErroror misreporting rejections asMISMATCHexit1).--hw-archwith argparse exit code2.rdna2spirv.Unsupported,spirv_mini_interp.UnsupportedConstruct,RuntimeError, andOSErroraroundrun_translator_checks(), plusRuntimeErroraroundrun_hw(), returning exit2cleanly instead of unhandled tracebacks.tests/test_vinterp_hw_probe.py):--hw-arch, translator harness errors -> exit2, tuple CU0 selection over CU1, malformed & all-rejected hardware oracle batches, andRuntimeError/runner.Unavailableraised fromoracle.run(), verifyingoracle.close()on every path.Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/vinterp_hw_probe.py tests/test_vinterp_hw_probe.pypassed)python3 -W error -I tests/test_vinterp_hw_probe.py -v:Ran 7 tests ... OKtests/test_vinterp_hw_probe.pyagainst unpatchedmaintools/vinterp_hw_probe.py):Ran 7 tests ... FAILED (failures=3, errors=1)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OKImported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T08:01:57Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T08:52:21Z.
Independent verification (Windows, Python 3.11.9
-I -W error):run_hwbatch/tuple handling, CU0 preference + first-valid fallback, RuntimeError->exit 2,--hw-archempty guard, str->exit 2 — all match claims.test_vinterp_hw_probe.py7 OK; neighbors hw_oracle 59 + asm_strip + workdir_leak 9 all OK; bad-CLI probes exit 2 correctly; compileall + line-endings + check_no_game_data clean. AI-assisted verification.Imported from ubiquitarianism/leonida. Originally posted by GrahamboJangles on 2026-11-25T12:06:43Z.
Independent review (CPU-only Windows 11, python 3.14.9
-I; headc80e31bc6, current main57ba40bd6).Coordination. Claim 7156493260 (IlyassRS3) was posted at 08:00:13Z — about half a minute AFTER PR creation (07:59:45Z), unlike the sibling items whose claims precede the PR. Roster shows
done: VINTERP-HW-PROBE-ORACLE-AND-CLI -> #1682andgh pr list --search vinterp_hw_probe --state allreturns only this PR, so there is no duplicate work; just flagging the ordering.The new tests bite (inverse check).
tests/test_vinterp_hw_probe.pyat head:Ran 7 tests ... OK; main's copy:Ran 5 tests ... OK— net +2 as claimed. The head test file against main's tool:FAILED (failures=3, errors=1), every failure inside the two new methods — empty/whitespace--hw-archpasses through to the oracle on main (AttributeError traceback), and malformedrun_hwbatches crash withTypeError/IndexErrorinstead of clean exit-2 harness errors. The 5 pre-existing tests stay green against main.Code notes.
batch[0]when no CU0-flagged word came back, so a string rejection flowed into the comparison as a raw string and printedMISMATCHwith exit 1 (a hardware mismatch claim that never happened). The patch raisesRuntimeError(f"... kernel rejected: {rejected[0]}")when all four are strings and picks the first valid fallback row otherwise; verified by the tuple/CU0 subtests at head.run_hwnow accepts tuples as well as lists per kernel result and masks words to 32 bits before comparing, matching the sibling interp_hw_probe hardening (#1680).run_translator_checks()is wrapped with(rdna2spirv.Unsupported, spirv_mini_interp.UnsupportedConstruct, RuntimeError, OSError) -> exit 2: translator failures that used to traceback now get aharness error:line. Exit-code discipline (77 for unavailable oracle, 2 for harness errors) matches the repo's probe-tool convention.RuntimeErrorcatch also swallows genuine harness bugs raised deep inside the check functions — but exit 2 with the message is the intended classification for those, same as the other probe tools in this family.Mergeability & hygiene.
git diff 3f81d46ac..origin/mainover both files: 0 bytes — rebases clean onto moved main.check_no_game_data.pyexits 0 on both files;compileallclean. CI (change-scope,no-game-data) pending at head when I looked.Verdict: LGTM — the crash-to-harness-error conversions are confirmed against unpatched main, the +2 test delta is real, and the branch is disjoint from main's later merges.
AI-assisted (Hermes overnight shift). Complements whoalin1's verification comment with the count-move gate (5→7) and the rebase check.
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:53:17Z.
Red/green: classified READY by cloud-4 (red on main
09c153948, green on head merged with main); headc80e31bc63unchanged since 2026-11-25, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)