Tests: the CLI exit codes and error messages #919

Open
github-bot wants to merge 1 commit from github-bot/gh-919 into main AGit
Owner

@⁠Koro4e on GitHub · 2026-11-24 08:17 UTC · original
Koro4e:cli-errors → main · +130 −0 · 1 files · 1 commits · open

xcl is called from scripts and CI, where the exit code is the interface: 2 for a usage or input error, 3 for a file that is not a PE. Nothing tested those codes, and nothing pinned which stream each message goes to.

Tests only - no code touched.

What is in it

  • crates/xcl/tests/cli_errors.rs - five hermetic cases that need no game, no GPU and no test title:
    • --version is a command (exit 0, xcl <version>); an unknown command prints the usage to stdout and exits 2
    • inspect on a missing file: exit 2, xcl inspect: cannot read ... on stderr, stdout untouched; on a file that is not a PE: exit 3, not a PE file and the XVC/MSIXVC hint
    • disasm on a blob with no shader is not an error (exit 0, "no RDNA2 programs found"); an offset past the end of the file is exit 2
    • rpf on a file that is not an RPF9 package: exit 2, nothing on stdout
    • run on a missing folder and on an empty one: exit 2, xcl: ... naming the target

The assertions are the strings the binary actually prints (checked by running each case by hand first), not guesses.

Tested

  • cargo test -p xcl --test cli_errors: 5 passed, 0 failed
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 722 passed, 0 failed, 41 ignored, 18 test binaries. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64)
  • the same command repeated right after on the same machine: 718 passed, 4 failed, 41 ignored - the four are the VRAM / device-removed cascade in hle::d3d12x (mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares, placed_title_textures_share_vram_and_preserve_pixels, transitions_apply_when_their_list_is_submitted, d32s8_targets_take_their_own_size_of_video_memory) on this 12 GiB RTX 3060 (driver 617.14). All four passed in the run above and pass on their own; this PR's file starts no device at all.
  • Windows 11 build 26200, Rust 1.100.0 (stable-x86_64-pc-windows-msvc)

Not tested

  • AMD GPUs and the retail title: none of these cases creates a device, so neither can show anything about this diff
  • the two Linux-only shader paths: out of scope for exit codes

AI use

  • AI-assisted: yes. Written with an AI agent (DeepAI Code); the model is named on request.
**@⁠Koro4e** on GitHub · 2026-11-24 08:17 UTC · [original](https://github.com/xcl-dev/xcl/pull/919) `Koro4e:cli-errors` → `main` · +130 −0 · 1 files · 1 commits · open `xcl` is called from scripts and CI, where the exit code is the interface: `2` for a usage or input error, `3` for a file that is not a PE. Nothing tested those codes, and nothing pinned which stream each message goes to. Tests only - no code touched. **What is in it** - `crates/xcl/tests/cli_errors.rs` - five hermetic cases that need no game, no GPU and no test title: - `--version` is a command (exit 0, `xcl <version>`); an unknown command prints the usage to stdout and exits 2 - `inspect` on a missing file: exit 2, `xcl inspect: cannot read ...` on stderr, stdout untouched; on a file that is not a PE: exit **3**, `not a PE file` and the XVC/MSIXVC hint - `disasm` on a blob with no shader is **not** an error (exit 0, "no RDNA2 programs found"); an offset past the end of the file is exit 2 - `rpf` on a file that is not an RPF9 package: exit 2, nothing on stdout - `run` on a missing folder and on an empty one: exit 2, `xcl: ...` naming the target The assertions are the strings the binary actually prints (checked by running each case by hand first), not guesses. **Tested** - `cargo test -p xcl --test cli_errors`: 5 passed, 0 failed - `cargo test --workspace --no-fail-fast -- --test-threads=4`: **722 passed, 0 failed, 41 ignored**, 18 test binaries. SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64) - the same command repeated right after on the same machine: 718 passed, 4 failed, 41 ignored - the four are the VRAM / device-removed cascade in `hle::d3d12x` (`mid_list_write64_wait64_split_avoids_cycle_and_reuses_spares`, `placed_title_textures_share_vram_and_preserve_pixels`, `transitions_apply_when_their_list_is_submitted`, `d32s8_targets_take_their_own_size_of_video_memory`) on this 12 GiB RTX 3060 (driver 617.14). All four passed in the run above and pass on their own; this PR's file starts no device at all. - Windows 11 build 26200, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`) **Not tested** - AMD GPUs and the retail title: none of these cases creates a device, so neither can show anything about this diff - the two Linux-only shader paths: out of scope for exit codes **AI use** - AI-assisted: yes. Written with an AI agent (DeepAI Code); the model is named on request.
The exit code is what scripts and CI read: 2 for a usage or input error, 3 for a file that is not a PE. None of those paths was covered. These five cases pin the codes, the messages and which stream each goes to, without a game or a GPU.

Assisted-by: DeepAI Code
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:36:48 +00:00
Author
Owner

@⁠SlopTart on GitHub · 2026-11-24 10:37 UTC · original

Linux / AMD RDNA3 datapoint.

Merged state: head 1aa7d91 onto main 02bfd1d, clean merge.

Full suite, cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 725 passed, 7 failed, 41 ignored; failures are the known Wine-lane set from my #42 rows. CLI exit-code/error-message tests green.

Not tested: retail titles (none here), Windows, RDNA4.
Counts only, no game data.

Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross x86_64-pc-windows-gnu, XCL_NETWORK=0, release profile, --test-threads=4. My Linux rows: #42 / #718.

AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.

**@⁠SlopTart** on GitHub · 2026-11-24 10:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/919#issuecomment-7129026406) Linux / AMD RDNA3 datapoint. **Merged state:** head `1aa7d91` onto main `02bfd1d`, clean merge. **Full suite, `cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4`:** **725 passed, 7 failed, 41 ignored**; failures are the known Wine-lane set from my #42 rows. CLI exit-code/error-message tests green. **Not tested:** retail titles (none here), Windows, RDNA4. Counts only, no game data. **Machine:** RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross `x86_64-pc-windows-gnu`, `XCL_NETWORK=0`, release profile, `--test-threads=4`. My Linux rows: #42 / #718. AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 09:31 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 09:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/919#issuecomment-7158435666) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/919/head:github-bot/gh-919'
git switch 'github-bot/gh-919'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-919'
git switch 'github-bot/gh-919'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-919'
git switch 'github-bot/gh-919'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-919'
git switch 'main'
git merge --squash 'github-bot/gh-919'
git switch 'main'
git merge --ff-only 'github-bot/gh-919'
git switch 'main'
git merge 'github-bot/gh-919'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.