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

Open
github-bot wants to merge 1 commit from github-bot/gh-1687 into main AGit
Owner

@⁠IlyassRS3 on GitHub · 2026-11-25 08:13 UTC · original
IlyassRS3:fix/vcmp16-opsel-probe-oracle-validation → main · +61 −3 · 2 files · 1 commits · open

Item ID: VCMP16-OPSEL-PROBE-ORACLE-VALIDATION (claimed in #1608)

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
**@⁠IlyassRS3** on GitHub · 2026-11-25 08:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1687) `IlyassRS3:fix/vcmp16-opsel-probe-oracle-validation` → `main` · +61 −3 · 2 files · 1 commits · open Item ID: `VCMP16-OPSEL-PROBE-ORACLE-VALIDATION` (claimed in https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ## 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`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:00:50 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 08:13 UTC · original · reviewed

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.

**@⁠copilot-pull-request-reviewer[bot]** on GitHub · 2026-11-25 08:13 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1687#pullrequestreview-6053956305) · **reviewed** 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.
Author
Owner

@⁠whoalin1 on GitHub · 2026-11-25 08:41 UTC · original

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.

**@⁠whoalin1** on GitHub · 2026-11-25 08:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1687#issuecomment-7157358450) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1687/head:github-bot/gh-1687'
git switch 'github-bot/gh-1687'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1687'
git switch 'github-bot/gh-1687'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1687'
git switch 'github-bot/gh-1687'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1687'
git switch 'main'
git merge --squash 'github-bot/gh-1687'
git switch 'main'
git merge --ff-only 'github-bot/gh-1687'
git switch 'main'
git merge 'github-bot/gh-1687'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.