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

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

@⁠trigger337 on GitHub · 2026-11-24 09:16 UTC · original
trigger337:fix/probe-bufferstore-oracle-close → main · +72 −31 · 2 files · 1 commits · merged 2026-11-25 19:49 UTC

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

**@⁠trigger337** on GitHub · 2026-11-24 09:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/585) `trigger337:fix/probe-bufferstore-oracle-close` → `main` · +72 −31 · 2 files · 1 commits · merged 2026-11-25 19:49 UTC 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
Claimed in the coordination issue as: PROBE-BUFFERSTORE-ORACLE-CLOSE (#14)

Wrap hardware oracle execution in tools/buffer_store_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_buffer_store_probe.py exercising oracle
closure on 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:00 +00:00
github manually merged commit 3aa4f7243a into gh-pr/585/base 2026-11-26 09:10:02 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 01:06 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 01:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/585#issuecomment-7149208077) 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
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 19:49 UTC · original

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

**@⁠aslan2142** on GitHub · 2026-11-25 19:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/585#issuecomment-7172817705) 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).
This discussion has been locked. Commenting is limited to contributors.
No description provided.