oracle_hip leaks a traceback for non-integer dispatch sizes #12314

Closed
opened 2026-10-28 09:12:16 +00:00 by malekaifa · 0 comments
malekaifa commented 2026-10-28 09:12:16 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-10-28T09:12:16Z.


What happens

tools/hw-oracle/oracle_hip.py::main() converts positional THREADS and OUT_DWORDS with raw int() before the existing dispatch-range validation. On exact current main cccdaa2734, malformed numeric text exits 1 with a raw ValueError traceback.

Reproductions that require neither HIP nor valid input files:

  • py -3.12 tools/hw-oracle/oracle_hip.py code.co not-an-int in.bin out.bin 1
  • py -3.12 tools/hw-oracle/oracle_hip.py code.co 1 in.bin out.bin not-an-int

Both fail at threads, out_dwords = int(threads), int(out_dwords) with ValueError: invalid literal for int() and a traceback. As a control, numeric but out-of-range THREADS=0 already exits through argparse with code 2 and the clean dispatch-range diagnostic.

Expected behavior

Malformed THREADS or OUT_DWORDS text should be reported through the same controlled argparse CLI boundary as invalid numeric ranges: exit code 2, concise diagnostic, and no traceback, before any HIP runtime or input-file work.

Proposed scope

  • Keep the fix local to oracle_hip.main(); do not broadly catch programming errors.
  • Add focused regressions in the existing HipOracleTests for both malformed numeric positions.
  • Assert exit 2 and no traceback before file/HIP access.

Ownership / overlap check

A live scan of all 1,364 open PRs found no PR touching tools/hw-oracle/oracle_hip.py. PR #12084 shares only tools/hw-oracle/test_hw_oracle.py; its patch adds a separate SourceEncodingTests class for hw_oracle.assemble() and does not touch HipOracleTests or oracle_hip.main(). Targeted issue/PR searches found no existing owner for this malformed-dispatch behavior.

Prepared branch: fix/oracle-hip-invalid-dispatch

AI-assisted: yes (OpenAI Codex)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6075948263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/12314). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-10-28T09:12:16Z. --- ### What happens tools/hw-oracle/oracle_hip.py::main() converts positional THREADS and OUT_DWORDS with raw int() before the existing dispatch-range validation. On exact current main cccdaa2734a71d27e6c907325c60fdf2d3baf0af, malformed numeric text exits 1 with a raw ValueError traceback. Reproductions that require neither HIP nor valid input files: - py -3.12 tools/hw-oracle/oracle_hip.py code.co not-an-int in.bin out.bin 1 - py -3.12 tools/hw-oracle/oracle_hip.py code.co 1 in.bin out.bin not-an-int Both fail at threads, out_dwords = int(threads), int(out_dwords) with ValueError: invalid literal for int() and a traceback. As a control, numeric but out-of-range THREADS=0 already exits through argparse with code 2 and the clean dispatch-range diagnostic. ### Expected behavior Malformed THREADS or OUT_DWORDS text should be reported through the same controlled argparse CLI boundary as invalid numeric ranges: exit code 2, concise diagnostic, and no traceback, before any HIP runtime or input-file work. ### Proposed scope - Keep the fix local to oracle_hip.main(); do not broadly catch programming errors. - Add focused regressions in the existing HipOracleTests for both malformed numeric positions. - Assert exit 2 and no traceback before file/HIP access. ### Ownership / overlap check A live scan of all 1,364 open PRs found no PR touching tools/hw-oracle/oracle_hip.py. PR #12084 shares only tools/hw-oracle/test_hw_oracle.py; its patch adds a separate SourceEncodingTests class for hw_oracle.assemble() and does not touch HipOracleTests or oracle_hip.main(). Targeted issue/PR searches found no existing owner for this malformed-dispatch behavior. Prepared branch: fix/oracle-hip-invalid-dispatch AI-assisted: yes (OpenAI Codex)
Sign in to join this conversation.
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
boykopovar/AnyPS5#12314
No description provided.