smem_neg_probe: handle Unavailable/RuntimeError during oracle.run() and mask 32-bit words #1690

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

@⁠IlyassRS3 on GitHub · 2026-11-25 08:19 UTC · original
IlyassRS3:fix/smem-neg-probe-run-errors → main · +50 −1 · 2 files · 1 commits · open

Item ID: SMEM-NEG-PROBE-RUN-ERRORS (claimed in #1608)

Summary

  • Runtime error lifecycle & 32-bit word masking (tools/smem_neg_probe.py):
    • Catch runner.Unavailable (exit 77) and RuntimeError (exit 2) raised during oracle.run() inside try ... finally: oracle.close() instead of crashing with unhandled tracebacks.
    • Mask oracle words with & 0xFFFFFFFF before comparing with expected 32-bit words and formatting.
  • Regression tests (tests/test_smem_neg_probe.py):
    • Added tests covering 32-bit word masking, runner.Unavailable during oracle.run() -> exit 77, and RuntimeError during oracle.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/smem_neg_probe.py tests/test_smem_neg_probe.py passed)
  • GPUs tested: none (hostless macOS synthetic/unit test run)
  • Tests run:
    • python3 -W error -I tests/test_smem_neg_probe.py -v: Ran 12 tests ... OK
    • Mutation test (new tests/test_smem_neg_probe.py against unpatched main tools/smem_neg_probe.py): Ran 12 tests ... FAILED (failures=1)
    • 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:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1690) `IlyassRS3:fix/smem-neg-probe-run-errors` → `main` · +50 −1 · 2 files · 1 commits · open Item ID: `SMEM-NEG-PROBE-RUN-ERRORS` (claimed in https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ## Summary - **Runtime error lifecycle & 32-bit word masking (`tools/smem_neg_probe.py`)**: - Catch `runner.Unavailable` (exit `77`) and `RuntimeError` (exit `2`) raised during `oracle.run()` inside `try ... finally: oracle.close()` instead of crashing with unhandled tracebacks. - Mask oracle words with `& 0xFFFFFFFF` before comparing with expected 32-bit words and formatting. - **Regression tests (`tests/test_smem_neg_probe.py`)**: - Added tests covering 32-bit word masking, `runner.Unavailable` during `oracle.run()` -> exit `77`, and `RuntimeError` during `oracle.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/smem_neg_probe.py tests/test_smem_neg_probe.py` passed) - **GPUs tested**: none (hostless macOS synthetic/unit test run) - **Tests run**: - `python3 -W error -I tests/test_smem_neg_probe.py -v`: `Ran 12 tests ... OK` - Mutation test (new `tests/test_smem_neg_probe.py` against unpatched `main` `tools/smem_neg_probe.py`): `Ran 12 tests ... FAILED (failures=1)` - `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:56 +00:00
Author
Owner

@⁠copilot-pull-request-reviewer[bot] on GitHub · 2026-11-25 08:19 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:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1690#pullrequestreview-6054025723) · **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.
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/1690/head:github-bot/gh-1690'
git switch 'github-bot/gh-1690'

Merge

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