texoff_probe: validate oracle batch/word payloads and handle run errors #1684
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!1684
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/texoff-probe-oracle-validation"
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:
TEXOFF-PROBE-ORACLE-VALIDATION(claimed in https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7156550196)Summary
tools/texoff_probe.py):oracle.run([k])returns alist/tupleof length1, and that its non-string element is alist/tupleof exact lengthlen(rows)containing only non-boolintwords (maskingw & 0xFFFFFFFFbefore thetsharp.POISONcheck andstruct.pack("<I", ...)), returning exit2cleanly instead of crashing withIndexError/TypeError/struct.erroror accepting extra/bool words.runner.Unavailable(exit77) andRuntimeError(exit2) raised duringoracle.run()insidetry ... finally: oracle.close().tests/test_texoff_probe.py):runner.Unavailableduringrun()-> exit77, andRuntimeErrorduringrun()-> exit2, verifyingoracle.close()on every path.Checklist & Verification
python3 -I scripts/check_no_game_data.py tools/texoff_probe.py tests/test_texoff_probe.pypassed)python3 -W error -I tests/test_texoff_probe.py -v:Ran 13 tests ... OKtests/test_texoff_probe.pyagainst unpatchedmaintools/texoff_probe.py):Ran 13 tests ... FAILED (failures=8, errors=11)python3 -m compileall -q make_game.py tools tests: passedpython3 -I tests/test_text_write_line_endings.py:Ran 3 tests ... OKIndependent verification (Windows, Python 3.11.9
-I): oracle.run must return exactly-1 batch of list/tuple of non-bool ints (previouslyraw[0]could IndexError/TypeError); words masked beforetsharp.POISONpack;Unavailable->77,RuntimeError->2 inside try/finally close.test_texoff_probe.py13 OK; neighbors tex_mode_probe 37, d16_image_probe 13, image_d16_probe 22 all OK;--oracle hw->77 / bogus->exit 2; compileall + line-endings +check_no_game_dataclean. AI-assisted verification.Red/green:
pytest tests/test_texoff_probe.pyfails on main (19 failed, 7 passed, 14 subtests passed) and passes on head 74295d02e3ef merged with main (13 passed, 34 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)