vcmp16_opsel_probe: validate oracle batch/word types and handle run errors #1687

Merged
IlyassRS3 merged 1 commit from upstream-pr/1687 into main 2026-11-28 14:55:09 +00:00
IlyassRS3 commented 2026-11-25 08:13:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by IlyassRS3 on 2026-11-25T08:13:00Z.


Item ID: VCMP16-OPSEL-PROBE-ORACLE-VALIDATION (claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156727807)

Summary

  • Hardware oracle payload validation (tools/vcmp16_opsel_probe.py):
    • Require oracle.run(...) to return a list/tuple of exact length 1 (preventing non-sequence TypeError, string indexing, or silent extra-result drops).
    • Reject bool and non-int word elements inside the kernel word list with "harness error:" and exit 2 (masking valid ints to 32 bits).
  • Runtime error lifecycle:
    • Catch runner.Unavailable (exit 77) and RuntimeError (exit 2) raised during oracle.run() inside try ... finally: oracle.close().
  • Regression tests (tests/test_vcmp16_opsel_probe.py):
    • Added tests covering string/int/extra batch results, bool/None word elements, runner.Unavailable during run() -> exit 77, and RuntimeError during run() -> exit 2, verifying oracle.close() on every path.

Checklist & Verification

  • AI-assisted: yes
  • Game data included: none (python3 -I scripts/check_no_game_data.py tools/vcmp16_opsel_probe.py tests/test_vcmp16_opsel_probe.py passed)
  • GPUs tested: none (hostless macOS synthetic/unit test run)
  • Tests run:
    • python3 -W error -I tests/test_vcmp16_opsel_probe.py -v: Ran 16 tests ... OK
    • Mutation test (new tests/test_vcmp16_opsel_probe.py against unpatched main tools/vcmp16_opsel_probe.py): Ran 16 tests ... FAILED (failures=3, errors=3)
    • python3 -m compileall -q make_game.py tools tests: passed
    • python3 -I tests/test_text_write_line_endings.py: Ran 3 tests ... OK
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5487620203 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1687). Originally posted by [IlyassRS3](https://github.com/IlyassRS3) on 2026-11-25T08:13:00Z. --- Item ID: `VCMP16-OPSEL-PROBE-ORACLE-VALIDATION` (claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156727807) ## Summary - **Hardware oracle payload validation (`tools/vcmp16_opsel_probe.py`)**: - Require `oracle.run(...)` to return a `list`/`tuple` of exact length `1` (preventing non-sequence `TypeError`, string indexing, or silent extra-result drops). - Reject `bool` and non-`int` word elements inside the kernel word list with `"harness error:"` and exit `2` (masking valid ints to 32 bits). - **Runtime error lifecycle**: - Catch `runner.Unavailable` (exit `77`) and `RuntimeError` (exit `2`) raised during `oracle.run()` inside `try ... finally: oracle.close()`. - **Regression tests (`tests/test_vcmp16_opsel_probe.py`)**: - Added tests covering string/int/extra batch results, `bool`/`None` word elements, `runner.Unavailable` during `run()` -> exit `77`, and `RuntimeError` during `run()` -> exit `2`, verifying `oracle.close()` on every path. ## Checklist & Verification - **AI-assisted**: yes - **Game data included**: none (`python3 -I scripts/check_no_game_data.py tools/vcmp16_opsel_probe.py tests/test_vcmp16_opsel_probe.py` passed) - **GPUs tested**: none (hostless macOS synthetic/unit test run) - **Tests run**: - `python3 -W error -I tests/test_vcmp16_opsel_probe.py -v`: `Ran 16 tests ... OK` - Mutation test (new `tests/test_vcmp16_opsel_probe.py` against unpatched `main` `tools/vcmp16_opsel_probe.py`): `Ran 16 tests ... FAILED (failures=3, errors=3)` - `python3 -m compileall -q make_game.py tools tests`: passed - `python3 -I tests/test_text_write_line_endings.py`: `Ran 3 tests ... OK`
copilot-pull-request-reviewer[bot] commented 2026-11-25 08:13:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T08:13:09Z.

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6053956305 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1687#pullrequestreview-6053956305). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T08:13:09Z. **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.
whoalin1 commented 2026-11-25 08:41:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T08:41:52Z.


Independent verification (Windows, Python 3.11.9 -I): oracle batch/word validation present — exactly-1 batch result, list/tuple of non-bool ints masked to 32 bits, Unavailable->77 / RuntimeError->2 with finally: oracle.close(). test_vcmp16_opsel_probe.py 16 tests OK; neighbors (fspx_prologue 6, texoff 12, fspx_unpack 34, fspx_shaders_stage 24, tex_mode_probe 37) all OK; CLI probes exit 2/77 correctly; compileall + line-endings + check_no_game_data clean. AI-assisted verification.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7157358450 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1687#issuecomment-7157358450). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T08:41:52Z. --- Independent verification (Windows, Python 3.11.9 `-I`): oracle batch/word validation present — exactly-1 batch result, list/tuple of non-bool ints masked to 32 bits, `Unavailable`->77 / `RuntimeError`->2 with `finally: oracle.close()`. `test_vcmp16_opsel_probe.py` 16 tests OK; neighbors (fspx_prologue 6, texoff 12, fspx_unpack 34, fspx_shaders_stage 24, tex_mode_probe 37) all OK; CLI probes exit 2/77 correctly; compileall + line-endings + `check_no_game_data` clean. AI-assisted verification.
MoonEyes commented 2026-11-28 14:55:06 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T14:55:06Z.


Red/green: classified READY by cloud-4 (red on main 09c153948, green on head merged with main); head 36f0b75246 unchanged since 2026-11-25, before that run.
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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7241036665 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1687#issuecomment-7241036665). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T14:55:06Z. --- Red/green: classified READY by cloud-4 (red on main 09c153948, green on head merged with main); head 36f0b7524671 unchanged since 2026-11-25, before that run. 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)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1687
No description provided.