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

Merged
trigger337 merged 1 commit from upstream-pr/589 into main 2026-11-25 21:03:48 +00:00
trigger337 commented 2026-11-24 09:19:46 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T09:19:46Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5469399260 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/589). Originally posted by [trigger337](https://github.com/trigger337) on 2026-11-24T09:19:46Z. --- 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
PierreEbele commented 2026-11-25 00:57:13 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T00:57:13Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149057911 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/589#issuecomment-7149057911). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T00:57:13Z. --- 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
aslan2142 commented 2026-11-25 21:03:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T21:03:50Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7174560433 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/589#issuecomment-7174560433). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T21:03:50Z. --- 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).
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!589
No description provided.