Tests: add CLI integration test suite covering top-level flags and inspect #1725

Open
heditrigui wants to merge 1 commit from upstream-pr/1735 into main
heditrigui commented 2026-11-24 20:03:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by heditrigui on 2026-11-24T20:03:30Z.


Summary

Adds integration tests for xcl top-level CLI flags and inspect subcommand in crates/xcl/tests/cli_e2e.rs.

Coverage includes:

  • Top-level --version and -V flags (verifies exit 0 and xcl <version> output).
  • Top-level --help and -h flags (verifies exit 0 and usage text covering run, inspect, disasm, shaders, and rpf).
  • Unknown subcommand dispatch (verifies exit 2 with usage on stdout).
  • xcl inspect with missing arguments (verifies exit 2 with usage).
  • xcl inspect with nonexistent file (verifies exit 2 with cannot read error on stderr).
  • xcl inspect with invalid PE binary (verifies exit 3 with PE format error on stderr).
  • xcl inspect with valid PE binary both in plain-text output (File:, Type:, ImageBase:) and --json format output (verifies valid JSON containing file, machine, image_base, and imports).

Tested

  • Non-runtime integration test additions under crates/xcl/tests/cli_e2e.rs.
  • Python scripts test suite (python -m pytest scripts/ passing 16/16).
  • Validated with scripts/pr_check.py --local.

Not tested

  • Retail game smoke execution (crates/xcl/tests/ files are integration tests and non-runtime code).

AI use

  • Antigravity (Gemini 3.8 Flash (High))
<!-- greyfinch-sync:ivall/xcl:issue:5479424383 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735). Originally posted by [heditrigui](https://github.com/heditrigui) on 2026-11-24T20:03:30Z. --- ### Summary Adds integration tests for `xcl` top-level CLI flags and `inspect` subcommand in `crates/xcl/tests/cli_e2e.rs`. Coverage includes: - Top-level `--version` and `-V` flags (verifies exit 0 and `xcl <version>` output). - Top-level `--help` and `-h` flags (verifies exit 0 and usage text covering `run`, `inspect`, `disasm`, `shaders`, and `rpf`). - Unknown subcommand dispatch (verifies exit 2 with usage on stdout). - `xcl inspect` with missing arguments (verifies exit 2 with usage). - `xcl inspect` with nonexistent file (verifies exit 2 with cannot read error on stderr). - `xcl inspect` with invalid PE binary (verifies exit 3 with PE format error on stderr). - `xcl inspect` with valid PE binary both in plain-text output (`File:`, `Type:`, `ImageBase:`) and `--json` format output (verifies valid JSON containing `file`, `machine`, `image_base`, and `imports`). **Tested** - Non-runtime integration test additions under `crates/xcl/tests/cli_e2e.rs`. - Python scripts test suite (`python -m pytest scripts/` passing 16/16). - Validated with `scripts/pr_check.py --local`. **Not tested** - Retail game smoke execution (`crates/xcl/tests/` files are integration tests and non-runtime code). **AI use** - Antigravity (Gemini 3.8 Flash (High))
futurepro62 commented 2026-11-24 23:08:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T22:15:09Z.


Full-suite run, since this PR has no test report yet. Tested exact head 010faf3 (on its base 85e3826).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record: 880 passed, 0 failed, 42 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: version_flag_prints_version_and_exits_zero, help_flag_prints_usage_and_exits_zero, unknown_subcommand_exits_code_two_with_help, inspect_missing_argument_exits_code_two, inspect_nonexistent_file_exits_code_two, inspect_invalid_pe_exits_code_three, inspect_valid_pe_text_and_json.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 882 passed, 0 failed, 42 ignored. SKIPPED: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows), pso_measurement_compiles_an_exact_synthetic_record (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)).
  • heap_window_out_of_memory_falls_back_to_the_switch_form was skipped with --skip on NVIDIA. It fails on main 7f7e768 too, not because of this PR: under XCL_REQUIRE_GPU=mesh, runner::skip_test turns its opt-in skip (XCL_HEAP_WINDOWS unset) into a failure (#1651). The second --skip covers shaders::tests::pso_measurement_compiles_an_exact_synthetic_record, which failed the same way on main while Developer Mode was off on this PC.
  • In the first NVIDIA run, with another PR's suite running on the same machine, hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state failed (real.rs:6076, left != right with both 0). This PR only adds crates/xcl/tests/cli_e2e.rs, and that test passed in every other PR's run in the same batch. The run above was alone on the machine and is clean; the failure also stopped cargo before cli_e2e ran the first time.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7145997339 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735#issuecomment-7145997339). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T22:15:09Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `010faf3` (on its base `85e3826`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip pso_measurement_compiles_an_exact_synthetic_record`: **880 passed, 0 failed, 42 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `version_flag_prints_version_and_exits_zero`, `help_flag_prints_usage_and_exits_zero`, `unknown_subcommand_exits_code_two_with_help`, `inspect_missing_argument_exits_code_two`, `inspect_nonexistent_file_exits_code_two`, `inspect_invalid_pe_exits_code_three`, `inspect_valid_pe_text_and_json`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **882 passed, 0 failed, 42 ignored**. SKIPPED: `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows), `pso_measurement_compiles_an_exact_synthetic_record` (cannot disable the driver cache (Windows Developer Mode is required): The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D)). - `heap_window_out_of_memory_falls_back_to_the_switch_form` was skipped with `--skip` on NVIDIA. It fails on main `7f7e768` too, not because of this PR: under `XCL_REQUIRE_GPU=mesh`, `runner::skip_test` turns its opt-in skip (`XCL_HEAP_WINDOWS` unset) into a failure (#1651). The second `--skip` covers `shaders::tests::pso_measurement_compiles_an_exact_synthetic_record`, which failed the same way on main while Developer Mode was off on this PC. - In the first NVIDIA run, with another PR's suite running on the same machine, `hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_state` failed (`real.rs:6076`, `left != right` with both 0). This PR only adds `crates/xcl/tests/cli_e2e.rs`, and that test passed in every other PR's run in the same batch. The run above was alone on the machine and is clean; the failure also stopped cargo before `cli_e2e` ran the first time. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 23:08:29 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:44:00Z.


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

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

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7146579808 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735#issuecomment-7146579808). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T22:44:00Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
JJAutoCompare commented 2026-11-25 04:10:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T03:26:19Z.


PR #1735 compatibility verification

Tested commit 010faf3839cf3507e71afdc02c9511d6dbaa7415 (exact fetched PR head). The diff adds only crates/xcl/tests/cli_e2e.rs.

Environment STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave size 8–32, DoublePrecisionFloatShaderOps=0, and no d3d12SDKLayers.dll. DXC/DXIL 1.9.2609.5. Rust 1.100.0 (0ef1bc386, 2026-11-09). Unoptimized Cargo dev/test profiles with debug info and incremental compilation disabled.

Tested

  • cargo build --workspace and cargo test --workspace --no-run both exited 0.
  • cargo test -p xcl --test cli_e2e -- --nocapture reported 7 passed, 0 failed, 0 ignored. Both forms of the help and version flags passed, as did the unknown-subcommand and inspect error exits. Inspecting the built executable passed in both text and JSON modes. All seven also passed in the workspace run.
  • One run of cargo test --workspace --no-fail-fast -- --test-threads=4 under the shared Arc A770 lock exited 101. Summing 21 harness summaries in pr1735-suite.log gives 864 passed, 18 failed, 42 ignored. The log contains exactly 4 SKIPPED lines. Those early returns can appear in Cargo's pass count and provide no coverage for the skipped paths.

Failures and skips

  • Library (17 failures): 13 CreateComputePipelineState rejections (0x80070057), including FP64 cases, and 4 result mismatches involving FMA, texture-sampling LOD, FP16 lane packing, and wave reduction.
  • Test-title integration (1 failure): the RSSetDepthBiasX check read a blue pixel where it expected green.
  • Explicit skips: 2 for lack of wave64, 1 for unavailable heap windows, and 1 because the driver cache could not be disabled (0x887A002D).

Not tested A baseline run on main, retail-title smoke tests, optional XCL_SAMPLE_* inputs, release builds, and other GPUs or drivers.

T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr1735-suite.log and published this report.

<!-- greyfinch-sync:ivall/xcl:comment:7151914485 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735#issuecomment-7151914485). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T03:26:19Z. --- # PR #1735 compatibility verification **Tested commit** `010faf3839cf3507e71afdc02c9511d6dbaa7415` (exact fetched PR head). The diff adds only `crates/xcl/tests/cli_e2e.rs`. **Environment** STOR-WINLAB, Windows 11 Enterprise Evaluation build 26200.9974, AMD Ryzen 7 3800X. Intel Arc A770 16 GiB, driver 32.0.101.9175, wave size 8–32, `DoublePrecisionFloatShaderOps=0`, and no `d3d12SDKLayers.dll`. DXC/DXIL 1.9.2609.5. Rust 1.100.0 (`0ef1bc386`, 2026-11-09). Unoptimized Cargo dev/test profiles with debug info and incremental compilation disabled. **Tested** - `cargo build --workspace` and `cargo test --workspace --no-run` both exited 0. - `cargo test -p xcl --test cli_e2e -- --nocapture` reported **7 passed, 0 failed, 0 ignored**. Both forms of the help and version flags passed, as did the unknown-subcommand and `inspect` error exits. Inspecting the built executable passed in both text and JSON modes. All seven also passed in the workspace run. - One run of `cargo test --workspace --no-fail-fast -- --test-threads=4` under the shared Arc A770 lock exited 101. Summing 21 harness summaries in `pr1735-suite.log` gives **864 passed, 18 failed, 42 ignored**. The log contains exactly **4 `SKIPPED ` lines**. Those early returns can appear in Cargo's pass count and provide no coverage for the skipped paths. **Failures and skips** - Library (17 failures): 13 `CreateComputePipelineState` rejections (`0x80070057`), including FP64 cases, and 4 result mismatches involving FMA, texture-sampling LOD, FP16 lane packing, and wave reduction. - Test-title integration (1 failure): the `RSSetDepthBiasX` check read a blue pixel where it expected green. - Explicit skips: 2 for lack of wave64, 1 for unavailable heap windows, and 1 because the driver cache could not be disabled (`0x887A002D`). **Not tested** A baseline run on `main`, retail-title smoke tests, optional `XCL_SAMPLE_*` inputs, release builds, and other GPUs or drivers. T3 Code / Codex (`gpt-6.2-sol`, `reasoningEffort: high`) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, `gemini-4-neon`) verified counts against `pr1735-suite.log` and published this report.
github-actions[bot] commented 2026-11-28 08:01:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-28T08:01:43Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7236314511 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735#issuecomment-7236314511). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:01:43Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 06:37:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:37:40Z.


Triage (#1607) – head 010faf3

#2211 (merged, same author) put the same four inspect cases on main as crates/xcl/tests/inspect_e2e.rs: missing argument, missing file, non-PE file (exit 3), valid PE in text and JSON. Here they are duplicates and should be dropped.
The --version/-V, --help/-h and unknown-subcommand tests are not on main and still match main.rs. shaders_e2e.rs already checks --help for its flags only.
Recommendation: keep open (drop the inspect tests that duplicate main's inspect_e2e.rs).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7303089050 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1735#issuecomment-7303089050). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:37:40Z. --- **Triage (#1607)** – head 010faf3 #2211 (merged, same author) put the same four `inspect` cases on main as `crates/xcl/tests/inspect_e2e.rs`: missing argument, missing file, non-PE file (exit 3), valid PE in text and JSON. Here they are duplicates and should be dropped. The `--version`/`-V`, `--help`/`-h` and unknown-subcommand tests are not on main and still match `main.rs`. `shaders_e2e.rs` already checks `--help` for its flags only. Recommendation: keep open (drop the inspect tests that duplicate main's `inspect_e2e.rs`). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1735:upstream-pr/1735'
git switch 'upstream-pr/1735'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1735'
git switch 'upstream-pr/1735'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1735'
git switch 'upstream-pr/1735'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1735'
git switch 'main'
git merge --squash 'upstream-pr/1735'
git switch 'main'
git merge --ff-only 'upstream-pr/1735'
git switch 'main'
git merge 'upstream-pr/1735'
git push origin 'main'
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
xcl-dev/xcl!1725
No description provided.