tools: close hardware oracle in mode_round_probe (PROBE-MODEROUND-ORACLE-CLOSE) #589

Manually merged
github merged 1 commit from gh-pr/589/head into gh-pr/589/base 2026-11-26 09:10:19 +00:00
Owner

@⁠trigger337 on GitHub · 2026-11-24 09:19 UTC · original
trigger337:fix/probe-moderound-oracle-close → main · +64 −24 · 2 files · 1 commits · merged 2026-11-25 21:03 UTC

Claimed in the coordination issue as: PROBE-MODEROUND-ORACLE-CLOSE (#14)

What and why

tools/mode_round_probe.py opens runner.open_oracle() but does not call oracle.close() inside a try ... finally block, leaking hardware oracle resources if oracle.arch is not GFX10 (exit 77), on normal completion, report write errors, or probe exceptions.

This wraps the oracle usage in a try ... finally block ensuring oracle.close() is called on all exits.

Tested

  • python3 -m unittest tests/test_mode_round_probe.py: 14/14 passed (including new tests for oracle closure on normal success, non-GFX10 exit 77, and probe exceptions).
  • python3 scripts/check_no_game_data.py: clean. No game files.

AI-assisted: yes
agent: yes

**@⁠trigger337** on GitHub · 2026-11-24 09:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/589) `trigger337:fix/probe-moderound-oracle-close` → `main` · +64 −24 · 2 files · 1 commits · merged 2026-11-25 21:03 UTC Claimed in the coordination issue as: PROBE-MODEROUND-ORACLE-CLOSE (#14) ### What and why `tools/mode_round_probe.py` opens `runner.open_oracle()` but does not call `oracle.close()` inside a `try ... finally` block, leaking hardware oracle resources if `oracle.arch` is not GFX10 (exit 77), on normal completion, report write errors, or probe exceptions. This wraps the oracle usage in a `try ... finally` block ensuring `oracle.close()` is called on all exits. ### Tested - `python3 -m unittest tests/test_mode_round_probe.py`: 14/14 passed (including new tests for oracle closure on normal success, non-GFX10 exit 77, and probe exceptions). - `python3 scripts/check_no_game_data.py`: clean. No game files. AI-assisted: yes agent: yes
Claimed in the coordination issue as: PROBE-MODEROUND-ORACLE-CLOSE (#14)

Wrap hardware oracle execution in tools/mode_round_probe.py in a
try/finally block so oracle.close() is called on normal completion,
non-GFX10 exit (code 77), report write errors, and probe exceptions.

Add unit tests in tests/test_mode_round_probe.py verifying oracle closure
on normal success, non-GFX10 skip, and probe exceptions.

AI-assisted: yes
agent: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:10:17 +00:00
github manually merged commit 87aceb8422 into gh-pr/589/base 2026-11-26 09:10:19 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 00:57 UTC · original

Reviewed 87aceb8: same shape as #587. The whitespace-insensitive diff of tools/mode_round_probe.py is only the new try:/finally: oracle.close() around the body of main() (the rest of the +52/-24 is re-indentation), so the oracle's workdir is now removed on success, on a mismatch exit, on the non-GFX10 skip and when a probe raises. python3 -I tests/test_mode_round_probe.py passes on the PR (14 tests); the same file copied onto main (b4b7756e) fails exactly the three new test_oracle_closed_* tests. scripts/check_no_game_data.py is clean on both files and the branch merges cleanly into current main. Run in a network-less sandbox on Linux; no GPU paths exercised (not needed for this change). No findings.

AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 00:57 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/589#issuecomment-7149057911) Reviewed 87aceb8: same shape as #587. The whitespace-insensitive diff of `tools/mode_round_probe.py` is only the new `try:`/`finally: oracle.close()` around the body of `main()` (the rest of the +52/-24 is re-indentation), so the oracle's workdir is now removed on success, on a mismatch exit, on the non-GFX10 skip and when a probe raises. `python3 -I tests/test_mode_round_probe.py` passes on the PR (14 tests); the same file copied onto `main` (b4b7756e) fails exactly the three new `test_oracle_closed_*` tests. `scripts/check_no_game_data.py` is clean on both files and the branch merges cleanly into current `main`. Run in a network-less sandbox on Linux; no GPU paths exercised (not needed for this change). No findings. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 21:03 UTC · original

Merged, thanks! The new test fails on main and passes with this.

  • Checked on main ac50c414f + 87aceb842: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_mode_round_probe pass; the 15 docs and writer tests pass; check_no_game_data.py is clean on the 2 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 21:03 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/589#issuecomment-7174560433) Merged, thanks! The new test fails on `main` and passes with this. - **Checked on `main` `ac50c414f` + `87aceb842`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_mode_round_probe` pass; the 15 docs and writer tests pass; `check_no_game_data.py` is clean on the 2 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.