CLI: xcl <command> --help prints the usage #1468

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

@⁠Royalflamejlh on GitHub · 2026-11-24 16:34 UTC · original
Royalflamejlh:fix/cli-command-help → main · +19 −0 · 2 files · 1 commits · open

xcl shaders --help answered xcl shaders: --help: File not found. (os error 2) and exit 2. Every command reads its second argument as the file or folder to open, so only xcl --help reached the usage. --help or -h right after a command now prints the usage and exits 0.

What is in it

  • crates/xcl/src/main.rs: one match arm ahead of the commands.
  • crates/xcl/tests/cli_help.rs: runs the binary for run, inspect, disasm, shaders and rpf with --help and with -h, and expects exit 0 and the usage on stdout. Before the change it failed on xcl run --help (exit 2, xcl: --help: File not found. (os error 2)).

Tested

  • Linux through Wine and vkd3d-proton. NVIDIA GeForce RTX 4070 12 GB for the test suite and RTX 4060 Ti 16 GB for the regression runs (driver 615.71.09), Ryzen 9 9950X3D, Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b, rustc 1.98.0, release, x86_64-pc-windows-gnu.
  • cargo test --workspace --release --target x86_64-pc-windows-gnu -- --test-threads=4 on bcb28d2: 765 passed, 4 failed, 41 ignored (lib 719 / 1 / 21, the other test binaries 46 / 3 / 20). SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64).
  • The 4 failures are the same on main b7aa9f3 in the same setup (764 passed, 4 failed, 41 ignored there): gpu_depth_buffer_created_for_unordered_access_is_placed (lib), test_title_runs_and_game_folder_is_untouched, disk_free_space_ex_reports_pls_quota, set_predication_buffer_state_and_kickoff.
  • Two lib tests hang in a full lib run under Wine, on main as well, and are not in the counts (--skip): d32s8_targets_take_their_own_size_of_video_memory and reservable_agrees_with_the_driver. Each passes when run alone on main.
  • The new test: 1 failed before the change, 1 passed after it.
  • Native Windows 11, 2 machines, cargo test --workspace --release --no-fail-fast -j 8 -- --test-threads=4 on bcb28d2, MSVC toolchain, 1 run each, started over SSH: RTX 5070 Ti 16 GB (driver 621.24, Ryzen 7 9800X3D, 26H2 build 26300.9974, rustc 1.99.1) and RTX 2070 SUPER 8 GB (driver 621.01, Ryzen 7 5700X3D, 25H2 build 26200.9711, rustc 1.100.0). On the first machine the processor's integrated AMD graphics (driver 32.0.21030.2001) is DXGI adapter 0 over SSH, so a test that takes adapter 0 ran on it and not on the RTX 5070 Ti. On each: 770 passed, 1 failed, 41 ignored (lib 722 / 0 / 21), SKIPPED the same two as above, and help_after_a_command_prints_the_usage passed. The one failure is test_title_runs_and_game_folder_is_untouched, and it is the way the run was started: an SSH session has no desktop (session 0), and the test title's swap chain cannot be made (CreateSwapChainForHwnd … 0x887A0022). Started in the logged-in desktop session on the RTX 2070 SUPER machine, cargo test -p xcl --test e2e --release on bcb28d2 gave 3 passed, 0 failed (1 run). (On the RTX 5070 Ti machine the suite ran before the workspace was built, so there that test stopped at "build first"; rerun after cargo build --workspace --release, still over SSH, it stopped at the swap chain as well. Started in the desktop session there too, the same command gave 3 passed, 0 failed, with the test title on the RTX 5070 Ti (1 run).)
  • The same command on bcb28d2 on the RTX 5070 Ti machine, started in the logged-in desktop session (1 run): 771 passed, 0 failed, 41 ignored (lib 722 / 0 / 21), SKIPPED the same two, and help_after_a_command_prints_the_usage passed. There the test that takes adapter 0 ran on the RTX 5070 Ti (its targets had that card's sizes, 41,811,968 bytes each).

Regression run
Both blocks are from scripts/smoke.ps1, unchanged, run by PowerShell 7 on Linux with xcl.exe started through Wine, on a retail title, with XCL_PSO_PRELOAD=0. Under Wine "peak commit" reads 0 MB, and exit: 0x89 is the wrapper ending Wine after XCL's own process ends, not XCL's exit code. The blocks say RTX 4060 Ti 8GB because that is the name vkd3d-proton gives this 16 GB card.

main:

xcl-smoke v1
commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7
gpu: NVIDIA GeForce RTX 4060 Ti 8GB
title: 7952987A
seconds: 60
exit: 0x89
frames shown: 1553 (PresentX 1553)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

PR:

xcl-smoke v1
commit: bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c
gpu: NVIDIA GeForce RTX 4060 Ti 8GB
title: 7952987A
seconds: 60
exit: 0x89
frames shown: 1593 (PresentX 1593)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 0 MB

Not tested

  • The title run does not reach the changed code, which is the command line's argument handling; the new test does.

AI use

  • Claude Code (Claude Fable 5.2) found this while running the offline shader pass, wrote the change and the test, ran the suite and the regression runs on this machine, ran the suite on two Windows machines over SSH, and wrote this description.
**@⁠Royalflamejlh** on GitHub · 2026-11-24 16:34 UTC · [original](https://github.com/xcl-dev/xcl/pull/1468) `Royalflamejlh:fix/cli-command-help` → `main` · +19 −0 · 2 files · 1 commits · open `xcl shaders --help` answered `xcl shaders: --help: File not found. (os error 2)` and exit 2. Every command reads its second argument as the file or folder to open, so only `xcl --help` reached the usage. `--help` or `-h` right after a command now prints the usage and exits 0. **What is in it** - `crates/xcl/src/main.rs`: one match arm ahead of the commands. - `crates/xcl/tests/cli_help.rs`: runs the binary for `run`, `inspect`, `disasm`, `shaders` and `rpf` with `--help` and with `-h`, and expects exit 0 and the usage on stdout. Before the change it failed on `xcl run --help` (exit 2, `xcl: --help: File not found. (os error 2)`). **Tested** - Linux through Wine and vkd3d-proton. NVIDIA GeForce RTX 4070 12 GB for the test suite and RTX 4060 Ti 16 GB for the regression runs (driver 615.71.09), Ryzen 9 9950X3D, Fedora 44, Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b, rustc 1.98.0, release, `x86_64-pc-windows-gnu`. - `cargo test --workspace --release --target x86_64-pc-windows-gnu -- --test-threads=4` on `bcb28d2`: 765 passed, 4 failed, 41 ignored (lib 719 / 1 / 21, the other test binaries 46 / 3 / 20). SKIPPED: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64). - The 4 failures are the same on `main` `b7aa9f3` in the same setup (764 passed, 4 failed, 41 ignored there): `gpu_depth_buffer_created_for_unordered_access_is_placed` (lib), `test_title_runs_and_game_folder_is_untouched`, `disk_free_space_ex_reports_pls_quota`, `set_predication_buffer_state_and_kickoff`. - Two lib tests hang in a full lib run under Wine, on `main` as well, and are not in the counts (`--skip`): `d32s8_targets_take_their_own_size_of_video_memory` and `reservable_agrees_with_the_driver`. Each passes when run alone on `main`. - The new test: 1 failed before the change, 1 passed after it. - Native Windows 11, 2 machines, `cargo test --workspace --release --no-fail-fast -j 8 -- --test-threads=4` on `bcb28d2`, MSVC toolchain, 1 run each, started over SSH: RTX 5070 Ti 16 GB (driver 621.24, Ryzen 7 9800X3D, 26H2 build 26300.9974, rustc 1.99.1) and RTX 2070 SUPER 8 GB (driver 621.01, Ryzen 7 5700X3D, 25H2 build 26200.9711, rustc 1.100.0). On the first machine the processor's integrated AMD graphics (driver 32.0.21030.2001) is DXGI adapter 0 over SSH, so a test that takes adapter 0 ran on it and not on the RTX 5070 Ti. On each: 770 passed, 1 failed, 41 ignored (lib 722 / 0 / 21), SKIPPED the same two as above, and `help_after_a_command_prints_the_usage` passed. The one failure is `test_title_runs_and_game_folder_is_untouched`, and it is the way the run was started: an SSH session has no desktop (session 0), and the test title's swap chain cannot be made (`CreateSwapChainForHwnd` … `0x887A0022`). Started in the logged-in desktop session on the RTX 2070 SUPER machine, `cargo test -p xcl --test e2e --release` on `bcb28d2` gave 3 passed, 0 failed (1 run). (On the RTX 5070 Ti machine the suite ran before the workspace was built, so there that test stopped at "build first"; rerun after `cargo build --workspace --release`, still over SSH, it stopped at the swap chain as well. Started in the desktop session there too, the same command gave 3 passed, 0 failed, with the test title on the RTX 5070 Ti (1 run).) - The same command on `bcb28d2` on the RTX 5070 Ti machine, started in the logged-in desktop session (1 run): 771 passed, 0 failed, 41 ignored (lib 722 / 0 / 21), SKIPPED the same two, and `help_after_a_command_prints_the_usage` passed. There the test that takes adapter 0 ran on the RTX 5070 Ti (its targets had that card's sizes, 41,811,968 bytes each). **Regression run** Both blocks are from `scripts/smoke.ps1`, unchanged, run by PowerShell 7 on Linux with `xcl.exe` started through Wine, on a retail title, with `XCL_PSO_PRELOAD=0`. Under Wine "peak commit" reads 0 MB, and `exit: 0x89` is the wrapper ending Wine after XCL's own `process ends`, not XCL's exit code. The blocks say `RTX 4060 Ti 8GB` because that is the name vkd3d-proton gives this 16 GB card. main: ``` xcl-smoke v1 commit: b7aa9f3bd212088e0d927439284dc5ed325ce3c7 gpu: NVIDIA GeForce RTX 4060 Ti 8GB title: 7952987A seconds: 60 exit: 0x89 frames shown: 1553 (PresentX 1553) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` PR: ``` xcl-smoke v1 commit: bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c gpu: NVIDIA GeForce RTX 4060 Ti 8GB title: 7952987A seconds: 60 exit: 0x89 frames shown: 1593 (PresentX 1593) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 0 MB ``` **Not tested** - The title run does not reach the changed code, which is the command line's argument handling; the new test does. **AI use** - Claude Code (Claude Fable 5.2) found this while running the offline shader pass, wrote the change and the test, ran the suite and the regression runs on this machine, ran the suite on two Windows machines over SSH, and wrote this description.
`xcl shaders --help` answered `xcl shaders: --help: File not found.
(os error 2)` and exit 2: every command takes its second argument as the
file or folder to open, and only `xcl --help` reached the usage text. The
same for `run`, `inspect`, `disasm` and `rpf`, and for `-h`.

`--help` or `-h` right after a command now prints the usage and exits 0.

tests/cli_help.rs runs the binary for the five commands with both flags;
it failed on `xcl run --help` (exit 2) before the change.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EXxEVfrZcxL41HQ29zqwHo
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:54:42 +00:00
Author
Owner

@⁠nnonno91 on GitHub · 2026-11-24 17:05 UTC · original

Independent native Windows test of bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c.

Tested

  • Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug.
  • cargo build --workspace --locked passed. cargo test --locked -p xcl --test cli_help -- --nocapture passed. cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output finished with 771 passed, 0 failed, 41 ignored, and no SKIPPED GPU lines. The bundled title test passed.
  • I also built b7aa9f3bd212088e0d927439284dc5ed325ce3c7 with cargo build --locked -p xcl --bin xcl and called each build directly. All ten combinations of run, inspect, disasm, shaders, or rpf with --help or -h gave a file error and exit 2 on the base. On the PR they printed the same usage as top-level --help, with exit 0 and empty stderr.
  • Control cases matched on both builds. shaders with a genuinely missing file returned the same error and exit 2. inspect <same locally built xcl.exe> --json returned identical valid JSON and exit 0.

Not tested

Retail-title smoke runs, release builds, and Wine. The base build was used for the CLI comparison.

AI use

OpenAI Codex (GPT-6 family, exact variant unavailable) ran the checks and drafted this report.

**@⁠nnonno91** on GitHub · 2026-11-24 17:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/1468#issuecomment-7138666536) Independent native Windows test of `bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c`. **Tested** - Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62), Rust 1.100.0 MSVC, DXC 1.8.2502.11, debug. - `cargo build --workspace --locked` passed. `cargo test --locked -p xcl --test cli_help -- --nocapture` passed. `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --show-output` finished with 771 passed, 0 failed, 41 ignored, and no `SKIPPED` GPU lines. The bundled title test passed. - I also built `b7aa9f3bd212088e0d927439284dc5ed325ce3c7` with `cargo build --locked -p xcl --bin xcl` and called each build directly. All ten combinations of `run`, `inspect`, `disasm`, `shaders`, or `rpf` with `--help` or `-h` gave a file error and exit 2 on the base. On the PR they printed the same usage as top-level `--help`, with exit 0 and empty stderr. - Control cases matched on both builds. `shaders` with a genuinely missing file returned the same error and exit 2. `inspect <same locally built xcl.exe> --json` returned identical valid JSON and exit 0. **Not tested** Retail-title smoke runs, release builds, and Wine. The base build was used for the CLI comparison. **AI use** OpenAI Codex (GPT-6 family, exact variant unavailable) ran the checks and drafted this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 18:53 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 18:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/1468#issuecomment-7141287432) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠S1m0ne1997 on GitHub · 2026-11-25 15:20 UTC · original

Test report for bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c (this PR's head), for #1607.

Tested

  • NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, rustc 1.100.0 (0ef1bc386 2026-11-09) x86_64-pc-windows-msvc, debug.
  • cargo build --workspace, then cargo test --workspace -- --test-threads=4 at the head: 771 passed, 0 failed, 41 ignored.
  • SKIPPED (2): gpu_geometry_wave32_prefix_count_over_a_mask (no wave64), gpu_wave32_program_in_wave64_hardware (no wave64).

Regression run (retail title, scripts/smoke.ps1 -Seconds 60, release; main built from the commit in its block, this PR from its head with no changes to crates/, both run with the scripts/smoke.ps1 of main, which hashes the name of the game folder)

main:

xcl-smoke v1
commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1599 (PresentX 1599)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 16384 MB

this PR:

xcl-smoke v1
commit: bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c
gpu: NVIDIA GeForce RTX 4090
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1666 (PresentX 1666)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 21203 MB

Peak commit is over the 125 % rule: this PR's run peaked at 21203 MB, 129 % of main's 16384 MB (frames: within 80 %). I can't tell from this whether the PR causes it: this branch is based on b7aa9f3, 440 commits older than the main commit (06c9f55) its run is compared with, and each side was run once. A smoke run of the base itself, or of this PR rebased onto current main, would separate the two.

Not tested

  • AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only.

AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.

**@⁠S1m0ne1997** on GitHub · 2026-11-25 15:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/1468#issuecomment-7166698161) Test report for `bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c` (this PR's head), for #1607. **Tested** - NVIDIA GeForce RTX 4090 24 GB (driver 621.40), AMD Ryzen 9 9950X3D, 47 GB RAM, Windows 11 Home 10.0.26300, `rustc 1.100.0 (0ef1bc386 2026-11-09)` `x86_64-pc-windows-msvc`, debug. - `cargo build --workspace`, then `cargo test --workspace -- --test-threads=4` at the head: **771 passed, 0 failed, 41 ignored**. - SKIPPED (2): `gpu_geometry_wave32_prefix_count_over_a_mask` (no wave64), `gpu_wave32_program_in_wave64_hardware` (no wave64). **Regression run** (retail title, `scripts/smoke.ps1 -Seconds 60`, release; `main` built from the commit in its block, this PR from its head with no changes to `crates/`, both run with the `scripts/smoke.ps1` of `main`, which hashes the name of the game folder) main: ``` xcl-smoke v1 commit: 06c9f5505f63f10c5ec49ef932d75b2c28177324 gpu: NVIDIA GeForce RTX 4090 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1599 (PresentX 1599) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 16384 MB ``` this PR: ``` xcl-smoke v1 commit: bcb28d2ae1f2bab1c6bfa22e3e08287923e9627c gpu: NVIDIA GeForce RTX 4090 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1666 (PresentX 1666) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 21203 MB ``` **Peak commit is over the 125 % rule:** this PR's run peaked at 21203 MB, 129 % of `main`'s 16384 MB (frames: within 80 %). I can't tell from this whether the PR causes it: this branch is based on `b7aa9f3`, 440 commits older than the `main` commit (`06c9f55`) its run is compared with, and each side was run once. A smoke run of the base itself, or of this PR rebased onto current `main`, would separate the two. **Not tested** - AMD, other NVIDIA cards and drivers, Linux. I did not review the diff; this report is the build, the suite and the regression run only. *AI use: Claude Code with Claude Opus 5.5 ran the build, the suite and the regression run and wrote this report at my request.*
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 09:30 UTC · original · reviewed

On bcb28d2, the new second-argument help arm matches Some(_) before command dispatch. xcl shdaers --help (misspelled/unknown command) now prints global usage and exits 0, where the normal unknown-command path on main exits 2. It also preempts cases such as xcl --version --help, which previously reported the version. The added integration test exercises only the five known commands, so it misses this change in CLI error behavior.

Could the guard match only run, inspect, disasm, shaders, and rpf? A cli_help control with an unknown command followed by --help should retain the nonzero exit while the ten known command/flag pairs keep passing. This is exact-head source review only; I did not run the binary.

**@⁠luckyteagirl** on GitHub · 2026-11-26 09:30 UTC · [original](https://github.com/xcl-dev/xcl/pull/1468#pullrequestreview-6071570865) · **reviewed** On `bcb28d2`, the new second-argument help arm matches `Some(_)` before command dispatch. `xcl shdaers --help` (misspelled/unknown command) now prints global usage and exits 0, where the normal unknown-command path on main exits 2. It also preempts cases such as `xcl --version --help`, which previously reported the version. The added integration test exercises only the five known commands, so it misses this change in CLI error behavior. Could the guard match only `run`, `inspect`, `disasm`, `shaders`, and `rpf`? A `cli_help` control with an unknown command followed by `--help` should retain the nonzero exit while the ten known command/flag pairs keep passing. This is exact-head source review only; I did not run the binary.
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/1468/head:github-bot/gh-1468'
git switch 'github-bot/gh-1468'

Merge

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