pk16_diff: restore globals, validate hardware oracle/shrink results and CLI options, and tighten RefError checks #1654
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1654
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pk16-diff-oracle-cli-and-ref"
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?
Pull request successfully merged and closed
Item ID:
PK16-DIFF-ORACLE-CLI-AND-REFClaim: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7155677593
Summary
tools/pk16_diff.py): restoreKNOWNandLITERALSinmain()'sfinallyblock (and handle--list-ops/--self-testbefore mutating them) so in-process runs do not leak flags.hw_run()validatingoracle is not Noneand exact result-list length across bothrun_suite()and shrinkcheck_fn(avoidingAttributeError/IndexErroron empty or short oracle returns); validate 4-word tuples/lists in_diff(); catch transientSkipduring final shrunk recheck and fall back toproblem.--hw-arch,--build, and--work.RefErrorinstead of silent ignores or rawValueError/IndexError/TypeErroron invalid operands, non-SGPR/non-VGPR destinations, wrong source counts, mismatchedop_sel/op_sel_hilengths,op_sel_hion non-packedOPS_16ops, andclampon ops without clamp support.tests/test_pk16_diff.py): add 4 regression tests covering all of the above.Verification
python3 -W error -I tests/test_pk16_diff.py -v: 20 passed, 0 failed (2.612s).main: ran=20, failures=7, errors=6.python3 -m compileall -q tools/pk16_diff.py tests/test_pk16_diff.py,python3 -I tests/test_text_write_line_endings.py,python3 -I scripts/check_no_game_data.py: all pass.AI-assisted: yes
GPUs tested: none (CPU unit tests with stubbed hardware oracle and
spirv_mini_interp; no game data)Independent verification (Windows, Python 3.11.9
-I -W error): same restore-globals pattern confirmed (KNOWN/LITERALSfinally-restored, mutation after oracle connect),hw_run/_diffguards, shrink Skip fallback, CLI empty-string rejection, RefError tightening incl. op_sel_hi rejected on OPS_16 and clamp-without-cl rejected.test_pk16_diff.py20 OK (matches body);--self-test/bad-CLI(2)/hw-unavailable(77) all correct; compileall + line-endings + check_no_game_data clean. AI-assisted verification.#1654 | head
7586cc137e10809b42af3bc601690432302298c6|python3 -I tests/test_pk16_diff.py -v| red: 20 run, 7 failures, 6 errors | green: 20 passed | Red → greenThe suite covers malformed results, CLI/reference checks and restoration of globals. The complete file passed after merging.
Copied the PR tests onto clean main
4a54aedcb6b66525e0c9f72a6ea10263337c9141for the baseline, then merged that main into the recorded PR head and reran those files. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Unittest failure/error counts include subtests where applicable. AI-assisted with OpenAI Codex. Batch claim.Merged, thank you @IlyassRS3! This PR (pk16_diff: restore globals, validate hardware oracle/shrink results and CLI options, and tighten RefError checks) passed its own tests with main merged in during sodove's verification of this shader batch, so it went in with the batch.
AI-assisted (Claude Code, Claude Opus 5.5), posted for the maintainers.