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

Merged
trigger337 merged 1 commit from upstream-pr/603 into main 2026-11-28 10:57:28 +00:00
trigger337 commented 2026-11-24 09:47:52 +00:00 (Migrated from github.com)

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


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

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5469804562 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/603). Originally posted by [trigger337](https://github.com/trigger337) on 2026-11-24T09:47:52Z. --- ### 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-24T21:04:57Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7144450395 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/603#issuecomment-7144450395). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-24T21:04:57Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T10:57:24Z.


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)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7238230752 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/603#issuecomment-7238230752). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T10:57:24Z. --- 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 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!603
No description provided.