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

Merged
leonida/mandy
trigger337 merged 1 commit from fix/ds-permute-oracle-close into main 2026-11-28 10:57:28 +00:00

Pull request successfully merged and closed

trigger337 commented 2026-11-24 09:47:52 +00:00

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

### 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
PierreEbele commented 2026-11-24 21:04:57 +00:00

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.

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.
MoonEyes commented 2026-11-28 10:57:24 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.