Tests: check per-lane Direct DXIL wave, mask, and far-jump parity on GPU #1843

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

@⁠microwave805 on GitHub · 2026-11-24 21:42 UTC · original
microwave805:tests-gpu-per-lane-parity → main · +258 −0 · 1 files · 1 commits · open

Add GPU parity and API tests for the per-lane Direct DXIL backend (recomp::lower_dxil) covering features that previously had only CPU-interpreter or no direct tests (S_WQM, S_CSELECT, scalar carry/borrow chains, far jumps, compute_code, compute_split, and survey_compute_code).

What is in it

  • crates/xcl/tests/gpu_per_lane_parity.rs:
    • per_lane_wqm_and_cselect_match_hlsl_on_gpu: validates and runs S_WQM_B32 + S_CSELECT_B32 + V_CNDMASK_B32 (wave32 via lower_dxil::kernel) and S_WQM_B64 + S_CSELECT_B64 + V_CNDMASK_B32 across both 32-lane halves (split wave64 via lower_dxil::kernel_split), comparing every SGPR/VGPR against the HLSL+DXC path.
    • per_lane_scalar_carry_borrow_and_far_jump_match_hlsl_on_gpu: validates and runs chained S_ADD_U32/S_ADDC_U32 + S_SUB_U32/S_SUBB_U32 and a far jump (S_GETPC_B64 + S_ADD_U32 + S_ADDC_U32 + S_SETPC_B64) in both wave32 and split wave64 against HLSL+DXC.
    • per_lane_compute_code_split_and_survey: checks lower_dxil::survey_compute_code on valid and undecodable bytes, then validates and dispatches a compute shader with a far jump through lower_dxil::compute_code (wave32) and lower_dxil::compute_split (split wave64, cross-checked against HLSL+DXC).

Tested

  • NVIDIA GeForce RTX 3070 (driver 32.0.16.1742), AMD Ryzen 5 5600X, Windows 11 Pro (build 22631), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc, debug)
  • On PR head af24810 (based on main c4d37be):
    • cargo test -p xcl --test gpu_per_lane_parity -- --nocapture: 3 passed, 0 failed, 0 ignored (0 skipped)
    • .\scripts\test.ps1 (cargo build --workspace && cargo test --workspace -- --test-threads=4): 962 passed, 0 failed, 43 ignored
    • SKIPPED GPU tests (23 pre-existing, 0 in gpu_per_lane_parity): 18× no wave64 (lower::tests, lower_dxil::tests, recomp::tests), 3× per-lane form: refused (lower_dxil::tests: f16 arithmetic, f16 packed, f32 conversions), 1× no heap windows (heap_window_out_of_memory_falls_back_to_the_switch_form), 1× cannot disable the driver cache (shaders::tests::pso_measurement_compiles_an_exact_synthetic_record)

Regression run

  • Not needed: test-only PR adding crates/xcl/tests/gpu_per_lane_parity.rs (no runtime or build-input files changed).

Not tested

  • Native wave64 AMD GPUs, Intel GPUs, Linux/Wine, and retail titles

AI use

  • Antigravity (Gemini 4 Neon): inspected crates/xcl/src/gpu/recomp/lower.rs and lower_dxil.rs, wrote crates/xcl/tests/gpu_per_lane_parity.rs and this PR description, and ran the verification commands above.
**@⁠microwave805** on GitHub · 2026-11-24 21:42 UTC · [original](https://github.com/xcl-dev/xcl/pull/1843) `microwave805:tests-gpu-per-lane-parity` → `main` · +258 −0 · 1 files · 1 commits · open Add GPU parity and API tests for the per-lane Direct DXIL backend (`recomp::lower_dxil`) covering features that previously had only CPU-interpreter or no direct tests (`S_WQM`, `S_CSELECT`, scalar carry/borrow chains, far jumps, `compute_code`, `compute_split`, and `survey_compute_code`). **What is in it** - `crates/xcl/tests/gpu_per_lane_parity.rs`: - `per_lane_wqm_and_cselect_match_hlsl_on_gpu`: validates and runs `S_WQM_B32` + `S_CSELECT_B32` + `V_CNDMASK_B32` (wave32 via `lower_dxil::kernel`) and `S_WQM_B64` + `S_CSELECT_B64` + `V_CNDMASK_B32` across both 32-lane halves (split wave64 via `lower_dxil::kernel_split`), comparing every SGPR/VGPR against the HLSL+DXC path. - `per_lane_scalar_carry_borrow_and_far_jump_match_hlsl_on_gpu`: validates and runs chained `S_ADD_U32`/`S_ADDC_U32` + `S_SUB_U32`/`S_SUBB_U32` and a far jump (`S_GETPC_B64` + `S_ADD_U32` + `S_ADDC_U32` + `S_SETPC_B64`) in both wave32 and split wave64 against HLSL+DXC. - `per_lane_compute_code_split_and_survey`: checks `lower_dxil::survey_compute_code` on valid and undecodable bytes, then validates and dispatches a compute shader with a far jump through `lower_dxil::compute_code` (wave32) and `lower_dxil::compute_split` (split wave64, cross-checked against HLSL+DXC). **Tested** - NVIDIA GeForce RTX 3070 (driver 32.0.16.1742), AMD Ryzen 5 5600X, Windows 11 Pro (build 22631), DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`, debug) - On PR head `af24810` (based on `main` `c4d37be`): - `cargo test -p xcl --test gpu_per_lane_parity -- --nocapture`: 3 passed, 0 failed, 0 ignored (0 skipped) - `.\scripts\test.ps1` (`cargo build --workspace && cargo test --workspace -- --test-threads=4`): 962 passed, 0 failed, 43 ignored - SKIPPED GPU tests (23 pre-existing, 0 in `gpu_per_lane_parity`): 18× `no wave64` (`lower::tests`, `lower_dxil::tests`, `recomp::tests`), 3× `per-lane form: refused` (`lower_dxil::tests`: `f16 arithmetic`, `f16 packed`, `f32 conversions`), 1× `no heap windows` (`heap_window_out_of_memory_falls_back_to_the_switch_form`), 1× `cannot disable the driver cache` (`shaders::tests::pso_measurement_compiles_an_exact_synthetic_record`) **Regression run** - Not needed: test-only PR adding `crates/xcl/tests/gpu_per_lane_parity.rs` (no runtime or build-input files changed). **Not tested** - Native wave64 AMD GPUs, Intel GPUs, Linux/Wine, and retail titles **AI use** - Antigravity (Gemini 4 Neon): inspected `crates/xcl/src/gpu/recomp/lower.rs` and `lower_dxil.rs`, wrote `crates/xcl/tests/gpu_per_lane_parity.rs` and this PR description, and ran the verification commands above.
Add GPU parity and API tests for recomp::lower_dxil covering areas that previously had only CPU-interpreter or no direct tests: S_WQM_B32/B64 + S_CSELECT_B32/B64 + V_CNDMASK_B32, scalar carry/borrow chains (S_ADDC_U32 / S_SUBB_U32), far jumps (S_GETPC_B64 + S_SETPC_B64), compute_code, compute_split, and survey_compute_code.

Every emitted DXIL container is validated against DXC and run on the GPU in both wave32 (lower_dxil::kernel / compute_code) and split wave64 (lower_dxil::kernel_split / compute_split), compared register-for-register against the HLSL+DXC path.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:07:01 +00:00
Author
Owner

@⁠DarkPanda69 on GitHub · 2026-11-24 22:40 UTC · original

AMD run with native 64-lane waves, which this PR lists as not tested, plus an NVIDIA one.

Tested: pass, head af24810 applied on main 689f2db, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.
cargo test -p xcl --test gpu_per_lane_parity -- --test-threads=4 with XCL_ADAPTER set to each GPU:

  • AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 3 passed, 0 failed, 0 SKIPPED.
  • NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 3 passed, 0 failed, 0 SKIPPED.

cargo test -p xcl --lib -- gpu::recomp --test-threads=4 with this PR applied: 261 passed, 0 failed, 18 ignored on both; the SKIPPED lines are the same as on main.

Not tested: Intel; Linux / Wine; the whole workspace suite.

AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.

**@⁠DarkPanda69** on GitHub · 2026-11-24 22:40 UTC · [original](https://github.com/xcl-dev/xcl/pull/1843#issuecomment-7146514338) AMD run with native 64-lane waves, which this PR lists as not tested, plus an NVIDIA one. **Tested:** pass, head `af24810` applied on `main` `689f2db`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. `cargo test -p xcl --test gpu_per_lane_parity -- --test-threads=4` with `XCL_ADAPTER` set to each GPU: - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 3 passed, 0 failed, 0 SKIPPED. - NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 3 passed, 0 failed, 0 SKIPPED. `cargo test -p xcl --lib -- gpu::recomp --test-threads=4` with this PR applied: 261 passed, 0 failed, 18 ignored on both; the SKIPPED lines are the same as on `main`. **Not tested:** Intel; Linux / Wine; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 01:15 UTC · original

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 / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-25 01:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/1843#issuecomment-7149364369) 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 / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 03:21 UTC · original

Tested

On PR #1843 head af2481013ed9d2a09ce778a71cf8200b2e887838 in a clean detached checkout on STOR-WINLAB. Intel Arc A770 (driver 32.0.101.9175), Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974, Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc, unoptimized test profile), DXC and DXIL 1.9.2609.5.

Built with cargo test -p xcl --locked --test gpu_per_lane_parity --no-run. With XCL_ADAPTER=A770, ran the generated binary serially under the Arc lock:

gpu_per_lane_parity-c6643ecfeadd9932.exe per_lane_wqm_and_cselect_match_hlsl_on_gpu --exact --nocapture --test-threads=1
gpu_per_lane_parity-c6643ecfeadd9932.exe per_lane_scalar_carry_borrow_and_far_jump_match_hlsl_on_gpu --exact --nocapture --test-threads=1

2 passed, 0 failed, 0 ignored, 0 explicit GPU skips. Each test passed its Direct DXIL vs. HLSL+DXC register comparisons and expected-value assertions in both modes.

GPU mode WQM and CSELECT Scalar carry/borrow and far jump
Native wave32 Passed on 32 lanes Both kernels passed on 32 lanes
Split wave64 (two hardware wave32s) Passed across both halves Both kernels passed across both halves

Not tested

Native hardware wave64, other adapters, the compute/survey fixture (including undecodable input), parallel test execution, the full workspace suite, retail titles, and Linux/Wine.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the checked-in tests and wrote this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 03:21 UTC · [original](https://github.com/xcl-dev/xcl/pull/1843#issuecomment-7151835040) ### Tested On PR #1843 head `af2481013ed9d2a09ce778a71cf8200b2e887838` in a clean detached checkout on STOR-WINLAB. Intel Arc A770 (driver 32.0.101.9175), Ryzen 7 3800X, Windows 11 Enterprise Evaluation 26200.9974, Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc, unoptimized test profile), DXC and DXIL 1.9.2609.5. Built with `cargo test -p xcl --locked --test gpu_per_lane_parity --no-run`. With `XCL_ADAPTER=A770`, ran the generated binary serially under the Arc lock: ```text gpu_per_lane_parity-c6643ecfeadd9932.exe per_lane_wqm_and_cselect_match_hlsl_on_gpu --exact --nocapture --test-threads=1 gpu_per_lane_parity-c6643ecfeadd9932.exe per_lane_scalar_carry_borrow_and_far_jump_match_hlsl_on_gpu --exact --nocapture --test-threads=1 ``` 2 passed, 0 failed, 0 ignored, 0 explicit GPU skips. Each test passed its Direct DXIL vs. HLSL+DXC register comparisons and expected-value assertions in both modes. | GPU mode | WQM and CSELECT | Scalar carry/borrow and far jump | | --- | --- | --- | | Native wave32 | Passed on 32 lanes | Both kernels passed on 32 lanes | | Split wave64 (two hardware wave32s) | Passed across both halves | Both kernels passed across both halves | ### Not tested Native hardware wave64, other adapters, the compute/survey fixture (including undecodable input), parallel test execution, the full workspace suite, retail titles, and Linux/Wine. ### AI use T3 Code / Codex (gpt-6.2-sol) ran the checked-in tests and wrote this report.
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/1843/head:github-bot/gh-1843'
git switch 'github-bot/gh-1843'

Merge

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