tools: close oracle in vcmp16_opsel_probe, support argv in main, and guard results (VCMP16-PROBE-GUARDS) #561
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/561"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T08:13:33Z.
What and why
tools/vcmp16_opsel_probe.pyopened the hardware oracle without closing it in afinallyblock, accepted noargvargument inmain(), and indexedoracle.run()directly without verifying whether the runner returned an empty, None, or short result list.CLI /
main()invocation:argvinmain(argv=None)and forward toap.parse_args(argv).Oracle lifecycle:
try ... finally: oracle.close()block so hardware resources / device state are cleaned up on all exit paths.Runner error guards:
oracle.run()output: flag empty results,Noneresults, or result lists shorter/longer than the expected word count as harness errors with exit code 2 instead of raising unhandledIndexError/TypeError.Unit test coverage:
MainAndOracleLifecycleTestintests/test_vcmp16_opsel_probe.pycovering rule mode, hardware success, mismatch, kernel rejection, empty/None/short result lists, and runner unavailability.Claimed in the coordination issue as: VCMP16-PROBE-GUARDS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7125854727)
Standard library and synthetic unit tests only; no GPU or game files required.
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T09:26:48Z.
Merging. Why merged: vcmp16_opsel_probe always closes the hardware oracle, accepts argv, and refuses empty, None or short results.
Why it's good: test_vcmp16_opsel_probe 7 -> 15 passed (8 of the new tests fail on main); clean on main
7430f59; consistency 565/0.AI-assisted (Claude Code, Claude Opus 5.5).