tooling: report disasm_rdna2 CLI input errors and honor --output with --hex #1975

Merged
RenzoWit35 merged 1 commit from upstream-pr/1982 into main 2026-11-24 22:59:31 +00:00
RenzoWit35 commented 2026-11-24 22:36:42 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by RenzoWit35 on 2026-11-24T22:36:42Z.


Change

In tools/disasm_rdna2.py main():

  • --hex now adds its listing to the shared --output writer (previously it returned before it, so the file was never written).
  • An odd-length or non-hex --hex value now ends in parser.error (exit 2, one line) instead of a ValueError traceback.
  • A target that is neither a file nor a directory prints error: <path>: not found to stderr and the tool exits 1 after processing the other targets (previously exit 0, no output).

Stdout of successful runs is unchanged. A regression case sits next to test_cli_hex_entry_point.

Verification

Environment: Windows 11, Python 3.14.5.

  • python -B tests/rdna2_tools_check.py after the change: Ran 153 tests, OK (skipped=19).
  • Negative control: the same file against unmodified tools/disasm_rdna2.py: test_cli_hex_output_and_input_errors ERROR, Ran 153, FAILED (errors=1, skipped=19).
  • --hex 000080bf stdout hash identical before and after.

Not run: the rest of the suite, CMake.

Evidence and follow-up

Rebased on current main. No open PR touches tools/disasm_rdna2.py. The sibling PRs for VOPC DPP and the SMEM signed offset change other parts of the same two files; the three merge in any order.

AI-assisted.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6592797162 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1982). Originally posted by [RenzoWit35](https://github.com/RenzoWit35) on 2026-11-24T22:36:42Z. --- ## Change In `tools/disasm_rdna2.py` `main()`: - `--hex` now adds its listing to the shared `--output` writer (previously it returned before it, so the file was never written). - An odd-length or non-hex `--hex` value now ends in `parser.error` (exit 2, one line) instead of a `ValueError` traceback. - A target that is neither a file nor a directory prints `error: <path>: not found` to stderr and the tool exits 1 after processing the other targets (previously exit 0, no output). Stdout of successful runs is unchanged. A regression case sits next to `test_cli_hex_entry_point`. ## Verification Environment: Windows 11, Python 3.14.5. - `python -B tests/rdna2_tools_check.py` after the change: Ran 153 tests, OK (skipped=19). - Negative control: the same file against unmodified `tools/disasm_rdna2.py`: `test_cli_hex_output_and_input_errors` ERROR, Ran 153, FAILED (errors=1, skipped=19). - `--hex 000080bf` stdout hash identical before and after. Not run: the rest of the suite, CMake. ## Evidence and follow-up Rebased on current `main`. No open PR touches `tools/disasm_rdna2.py`. The sibling PRs for VOPC DPP and the SMEM signed offset change other parts of the same two files; the three merge in any order. AI-assisted.
upstream-sync closed this pull request 2026-11-24 23:03:25 +00:00
tedin7 commented 2026-11-24 23:03:25 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T22:45:27Z.

Review: COMMENTED


Review of head 20fa94a9b2 (2 files: tools/disasm_rdna2.py, tests/rdna2_tools_check.py; no CMake changes, clean-room OK).

Semantics: --hex now reports bad input through parser.error (exit 2, no traceback), --output is honored together with --hex, and missing targets print error: <path>: not found and exit 1. Behavior is correct and the test covers all three paths.

Commands executed locally:

  • python3 -B tests/rdna2_tools_check.py : OK (153 tests, 19 skipped)
  • python3 tests/docs_links_check.py : PASS
  • python3 tests/bidi_controls_check.py : PASS
  • git diff --check origin/main...HEAD : clean
  • git merge-tree --write-tree --name-only origin/main HEAD : no conflicts
  • python3 x2w_pipe.py win2025 1982 --wait 900 : Debug 18/18 and Release /O2 18/18 passed
  • Mutation 1: return 1 if missing else 0 -> return 0 : test_cli_hex_output_and_input_errors FAILED (killed)
  • Mutation 2: disable the --output write block : test FAILED (killed)

P1: 0. P2: 0.

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6048580787 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1982#pullrequestreview-6048580787). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T22:45:27Z. **Review:** COMMENTED --- Review of head 20fa94a9b24585f5de1f7a3b0a89312656d73a54 (2 files: tools/disasm_rdna2.py, tests/rdna2_tools_check.py; no CMake changes, clean-room OK). Semantics: `--hex` now reports bad input through `parser.error` (exit 2, no traceback), `--output` is honored together with `--hex`, and missing targets print `error: <path>: not found` and exit 1. Behavior is correct and the test covers all three paths. Commands executed locally: - `python3 -B tests/rdna2_tools_check.py` : OK (153 tests, 19 skipped) - `python3 tests/docs_links_check.py` : PASS - `python3 tests/bidi_controls_check.py` : PASS - `git diff --check origin/main...HEAD` : clean - `git merge-tree --write-tree --name-only origin/main HEAD` : no conflicts - `python3 x2w_pipe.py win2025 1982 --wait 900` : Debug 18/18 and Release /O2 18/18 passed - Mutation 1: `return 1 if missing else 0` -> `return 0` : test_cli_hex_output_and_input_errors FAILED (killed) - Mutation 2: disable the `--output` write block : test FAILED (killed) P1: 0. P2: 0. AI-assisted; commands listed were executed locally.
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
R0Y00/Xbox2Windows!1975
No description provided.