tools: close hardware oracle in ds_permute_probe (PROBE-DSPERMUTE-ORACLE-CLOSE) #603

Open
github-bot wants to merge 1 commit from github-bot/gh-603 into main AGit
Owner

@⁠trigger337 on GitHub · 2026-11-24 09:47 UTC · original
trigger337:fix/ds-permute-oracle-close → main · +61 −17 · 2 files · 1 commits · open

Summary

Item: PROBE-DSPERMUTE-ORACLE-CLOSE (claimed in #14)

Closes the hardware oracle opened in tools/ds_permute_probe.py across all exit paths:

  • Non-GFX10 exit 77
  • Mismatch exit 1
  • JSON report write error exit 1
  • Clean exit 0
  • Unexpected exceptions

Changes

  • tools/ds_permute_probe.py: Wrap execution after runner.open_oracle() in try ... finally: if hasattr(oracle, 'close'): oracle.close().
  • tests/test_ds_permute_probe.py: Add test_oracle_closed_on_success_and_failure testing all 4 exit paths.

Validation

  • python3 -m unittest tests/test_ds_permute_probe.py: 8/8 tests pass.
  • scripts/check_no_game_data.py: Clean, 0 game files.

agent: yes
AI-assisted: yes

**@⁠trigger337** on GitHub · 2026-11-24 09:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/603) `trigger337:fix/ds-permute-oracle-close` → `main` · +61 −17 · 2 files · 1 commits · open ### Summary Item: `PROBE-DSPERMUTE-ORACLE-CLOSE` (claimed in #14) Closes the hardware oracle opened in `tools/ds_permute_probe.py` across all exit paths: - Non-GFX10 exit 77 - Mismatch exit 1 - JSON report write error exit 1 - Clean exit 0 - Unexpected exceptions ### Changes - `tools/ds_permute_probe.py`: Wrap execution after `runner.open_oracle()` in `try ... finally: if hasattr(oracle, 'close'): oracle.close()`. - `tests/test_ds_permute_probe.py`: Add `test_oracle_closed_on_success_and_failure` testing all 4 exit paths. ### Validation - `python3 -m unittest tests/test_ds_permute_probe.py`: 8/8 tests pass. - `scripts/check_no_game_data.py`: Clean, 0 game files. agent: yes AI-assisted: yes
Ensure tools/ds_permute_probe.py closes the opened hardware oracle on all
exit paths (non-GFX10 exit 77, mismatch return 1, report write error, and
exceptions) using a try ... finally block with hasattr(oracle, 'close').

Added unit tests in tests/test_ds_permute_probe.py verifying close() is
invoked on all variants.

Item: PROBE-DSPERMUTE-ORACLE-CLOSE

agent: yes
AI-assisted: yes
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:11:07 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-24 21:04 UTC · original

Reviewed cd88d57: ran python3 -I tests/test_ds_permute_probe.py (8 OK; the added test fails on
main, where close is never called), the tool's --self-test, compileall, and a mocked-oracle probe
over every exit path: close() now runs exactly once on success/mismatch/non-GFX10/--json write
error/exception with rc and output identical to main; the main-side leak is the
leonida-hw-oracle-* temp workdir that close() removes. Worth a follow-up finding:
buffer_store_probe.py, f16_widen_probe.py and mode_round_probe.py have the same unclosed oracle.
AI-assisted review.

**@⁠PierreEbele** on GitHub · 2026-11-24 21:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/603#issuecomment-7144450395) Reviewed cd88d57: ran `python3 -I tests/test_ds_permute_probe.py` (8 OK; the added test fails on main, where close is never called), the tool's --self-test, compileall, and a mocked-oracle probe over every exit path: close() now runs exactly once on success/mismatch/non-GFX10/--json write error/exception with rc and output identical to main; the main-side leak is the leonida-hw-oracle-* temp workdir that close() removes. Worth a follow-up finding: buffer_store_probe.py, f16_widen_probe.py and mode_round_probe.py have the same unclosed oracle. AI-assisted review.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/603/head:github-bot/gh-603'
git switch 'github-bot/gh-603'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-603'
git switch 'github-bot/gh-603'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-603'
git switch 'github-bot/gh-603'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-603'
git switch 'main'
git merge --squash 'github-bot/gh-603'
git switch 'main'
git merge --ff-only 'github-bot/gh-603'
git switch 'main'
git merge 'github-bot/gh-603'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.