tools: close hardware oracle in buffer_store_probe (PROBE-BUFFERSTORE-ORACLE-CLOSE) #585

Merged
trigger337 merged 1 commit from upstream-pr/585 into main 2026-11-25 19:49:42 +00:00
trigger337 commented 2026-11-24 09:16:40 +00:00 (Migrated from github.com)

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


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

What and why

tools/buffer_store_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_buffer_store_probe.py: 12/12 passed (including new tests for oracle closure on 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:5469355925 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/585). Originally posted by [trigger337](https://github.com/trigger337) on 2026-11-24T09:16:40Z. --- Claimed in the coordination issue as: PROBE-BUFFERSTORE-ORACLE-CLOSE (#14) ### What and why `tools/buffer_store_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_buffer_store_probe.py`: 12/12 passed (including new tests for oracle closure on 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 01:06:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T01:06:12Z.


Reviewed 3aa4f724: ran tests/test_buffer_store_probe.py in the sandbox on the PR (12/12 OK) and with the PR's test file copied onto origin/main (9 OK, 3 failed — all 3 new tests failing Expected 'close' to have been called once. Called 0 times.). --self-test (rc=0), a bare no-GPU run (rc=77), and tests/semantic/test_buffer_store_rdna2.py (5/5 OK) match on both trees, and compileall / check_no_game_data.py are clean. Probing all six exit paths with a stub matching runner.Oracle.close confirms identical return codes everywhere and that the mkdtemp hw-oracle workdir — leaked on every path on main — is removed once on the PR (and an oracle without close() still works). No blocking findings; minor note: test_oracle_closed_on_non_gfx10_skip uses gfx900 (unreachable for a real Oracle, where gfx11/gfx12 is the live skip path), and for the coordination issue ds_permute_probe.py, f16_widen_probe.py, and mode_round_probe.py still have the same close-less pattern on main. AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149208077 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/585#issuecomment-7149208077). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T01:06:12Z. --- Reviewed 3aa4f724: ran `tests/test_buffer_store_probe.py` in the sandbox on the PR (12/12 OK) and with the PR's test file copied onto `origin/main` (9 OK, 3 failed — all 3 new tests failing `Expected 'close' to have been called once. Called 0 times.`). `--self-test` (rc=0), a bare no-GPU run (rc=77), and `tests/semantic/test_buffer_store_rdna2.py` (5/5 OK) match on both trees, and `compileall` / `check_no_game_data.py` are clean. Probing all six exit paths with a stub matching `runner.Oracle.close` confirms identical return codes everywhere and that the `mkdtemp` hw-oracle workdir — leaked on every path on `main` — is removed once on the PR (and an oracle without `close()` still works). No blocking findings; minor note: `test_oracle_closed_on_non_gfx10_skip` uses `gfx900` (unreachable for a real `Oracle`, where `gfx11`/`gfx12` is the live skip path), and for the coordination issue `ds_permute_probe.py`, `f16_widen_probe.py`, and `mode_round_probe.py` still have the same close-less pattern on `main`. AI-assisted review. **Recommendation:** Merge
aslan2142 commented 2026-11-25 19:49:45 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T19:49:45Z.


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

  • Checked on main 747809e70 + 3aa4f7243: the semantic suite passes (491 files, 6,312 tests, 0 files failed); test_buffer_store_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:7172817705 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/585#issuecomment-7172817705). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T19:49:45Z. --- Merged, thanks! The new test fails on `main` and passes with this. - **Checked on `main` `747809e70` + `3aa4f7243`:** the semantic suite passes (491 files, 6,312 tests, 0 files failed); `test_buffer_store_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!585
No description provided.