fix(hw-oracle): reject invalid dispatch sizes #12326
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12326"
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 boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-28T09:36:22Z.
What
tools/hw-oracle/oracle_hip.pycurrently converts the positionalTHREADSandOUT_DWORDSvalues with rawint(). Non-integer text therefore escapes as aValueErrortraceback before any HIP or input-file work.Convert each dispatch size at the CLI boundary and route malformed text through argparse with a field-specific diagnostic. Existing numeric range validation is unchanged. The regression covers both malformed positions and asserts rejection occurs before input reads or HIP dispatch.
Tested
THREADSand malformedOUT_DWORDSeach exit 1 with a rawValueErrortraceback; numericTHREADS=0already exits 2 cleanly.HipOracleTests- 7 passed, 1 skipped.HipOracleTests- 7 passed, 1 skipped.HipOracleTests- 7 passed, 1 skipped.py -3.12 tools/check_conventions.py --base origin/main- passed.git diff --check origin/main...HEAD- passed.py_compileon both changed files - passed.oracle_hip.py; #12084 shares only the test file in a disjoint class/hunk and synthetic merge is clean.1f38fbf8dc.Checklist
main; no other open PR implements the same behavior.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-28T09:37:45Z.
Review: COMMENTED
🟢 Approval recommended
No active review issues are recorded for the change improving malformed HIP dispatch-size diagnostics.
No open issues 🎉
What changed in this PR
Fixes #12314 by reporting malformed HIP oracle dispatch sizes as argparse errors instead of raw
ValueErrortracebacks.Changes:
THREADSandOUT_DWORDS, preserving existing numeric range checks.tools/hw-oracle/test_hw_oracle.pytools/hw-oracle/oracle_hip.pyReview effort: Balanced
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:38:07Z.
Review: APPROVED
Reviewed exact head
1f38fbf8dc9f661d4254602fe9e874ef102d1f79. The CLI conversion catches malformed positionalTHREADSandOUT_DWORDSat the argument boundary and emits field-specific argparse errors before file reads or HIP dispatch; existing numeric range validation is unchanged. The added regression covers both positions. I ran the exact-headtest_hw_oracle.pysuite locally: 47 passed, 2 skipped.tools/check_conventions.py --base refs/remotes/review/upstream-mainandgit diff --check refs/remotes/review/upstream-main...HEADpassed. The one shared test file with #12084 has a separateSourceEncodingTestsaddition; no overlapping test hunks. Hosted conventions pass; remaining generic relinker jobs are pending and unrelated to this Python-only change.