Tests: cover split-wave64 mask liveness and mesh_wave analysis #1637

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

@⁠kilvynsilveira-tech on GitHub · 2026-11-24 18:27 UTC · original
kilvynsilveira-tech:tests/recomp-split-masks-and-mesh-wave → main · +420 −0 · 1 files · 1 commits · open

Add an integration test suite (crates/xcl/tests/recomp_wave64_contract.rs) covering previously untested public contracts in x64_masks (paired with translate + DXC cs_6_6 compilation in split-wave64 compute mode) and mesh_wave::analyze.

What is in it

  • crates/xcl/tests/recomp_wave64_contract.rs: 4 integration tests covering:
    • V_SUB_CO_CI_U32 / V_SUBREV_CO_CI_U32 borrow chains and scalar NULL (125) staying half-local (xcl_x_ballot_local, zero xcl_x_ballot) in x64_masks::by_pc and emitted split_wave64 HLSL, validated with DXC cs_6_6.
    • src_execz (252) vs src_vccz (251) whole-mask liveness and cross-half ballot emission, plus unresolved S_SWAPPC_B64 conservative liveness (!(3 << 30)).
    • mesh_wave::analyze across all 6 LaneValueProvenance variants (Entry, Memory, MaskSelect, Move, PrefixCount, Arithmetic) and all 3 LaneReadKind variants (ReadFirst, ReadLane, WriteLane, including SGPR-sourced V_WRITELANE_B32).
    • mesh_wave::analyze across all 4 BranchMask variants (ExecZero, ExecNonZero, VccZero, VccNonZero), S_SENDMSG nibble filtering (SIMM16 & 0xf == 9), and unreachable S_CBRANCH_SCC1 suppression after S_ENDPGM.

Tested

  • Hardware / OS / Rust: AMD Radeon RX 580 2048SP (driver 31.0.21925.1001, Feature Level 12_0 / pre-SM 6.6), AMD Ryzen 7 5700X 8-Core Processor, Windows 10 Home Single Language build 19045, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC dxcompiler 1.8.2502.11 (dxil 1.8.2502.11), debug build.
  • cargo test -p xcl --test recomp_wave64_contract -- --nocapture on b8d92f9: 4 passed, 0 failed, 0 ignored (DXC cs_6_6 compiled all emitted shaders).
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on d7be554 (same runtime base; b8d92f9 adds the 1u128 << 125 assertion): 779 passed, 1 failed, 41 ignored (219 SKIPPED SM 6.6 GPU tests on RX 580; the 1 failure is pre-existing on main in gpu::recomp::heap_window_tests::gpu_raw_window_view_reaches_its_top, addressed in #1736). With XCL_ADAPTER=warp, cargo test -p xcl --lib -- --test-threads=4: 727 passed, 0 failed, 21 ignored.

Regression run

  • Not needed: test-only addition under crates/xcl/tests/.

Not tested

  • GPU execution on an SM 6.6 / native-wave64 adapter (host GPU is RX 580, pre-SM 6.6).
  • Retail Xbox Series X|S titles.

AI use

  • Antigravity (Gemini 4 Carbon): audited x64_masks and mesh_wave coverage, wrote crates/xcl/tests/recomp_wave64_contract.rs and this PR description, and ran the test suite on the user's machine under the user's direction.
**@⁠kilvynsilveira-tech** on GitHub · 2026-11-24 18:27 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637) `kilvynsilveira-tech:tests/recomp-split-masks-and-mesh-wave` → `main` · +420 −0 · 1 files · 1 commits · open Add an integration test suite (`crates/xcl/tests/recomp_wave64_contract.rs`) covering previously untested public contracts in `x64_masks` (paired with `translate` + DXC `cs_6_6` compilation in split-wave64 compute mode) and `mesh_wave::analyze`. **What is in it** - `crates/xcl/tests/recomp_wave64_contract.rs`: 4 integration tests covering: - `V_SUB_CO_CI_U32` / `V_SUBREV_CO_CI_U32` borrow chains and scalar `NULL` (`125`) staying half-local (`xcl_x_ballot_local`, zero `xcl_x_ballot`) in `x64_masks::by_pc` and emitted `split_wave64` HLSL, validated with DXC `cs_6_6`. - `src_execz` (`252`) vs `src_vccz` (`251`) whole-mask liveness and cross-half ballot emission, plus unresolved `S_SWAPPC_B64` conservative liveness (`!(3 << 30)`). - `mesh_wave::analyze` across all 6 `LaneValueProvenance` variants (`Entry`, `Memory`, `MaskSelect`, `Move`, `PrefixCount`, `Arithmetic`) and all 3 `LaneReadKind` variants (`ReadFirst`, `ReadLane`, `WriteLane`, including SGPR-sourced `V_WRITELANE_B32`). - `mesh_wave::analyze` across all 4 `BranchMask` variants (`ExecZero`, `ExecNonZero`, `VccZero`, `VccNonZero`), `S_SENDMSG` nibble filtering (`SIMM16 & 0xf == 9`), and unreachable `S_CBRANCH_SCC1` suppression after `S_ENDPGM`. **Tested** - Hardware / OS / Rust: AMD Radeon RX 580 2048SP (driver 31.0.21925.1001, Feature Level 12_0 / pre-SM 6.6), AMD Ryzen 7 5700X 8-Core Processor, Windows 10 Home Single Language build 19045, `rustc 1.100.0 (0ef1bc386 2026-11-09)`, DXC `dxcompiler 1.8.2502.11` (`dxil 1.8.2502.11`), debug build. - `cargo test -p xcl --test recomp_wave64_contract -- --nocapture` on `b8d92f9`: 4 passed, 0 failed, 0 ignored (DXC `cs_6_6` compiled all emitted shaders). - `cargo test --workspace --no-fail-fast -- --test-threads=4` on `d7be554` (same runtime base; `b8d92f9` adds the `1u128 << 125` assertion): 779 passed, 1 failed, 41 ignored (219 SKIPPED SM 6.6 GPU tests on RX 580; the 1 failure is pre-existing on `main` in `gpu::recomp::heap_window_tests::gpu_raw_window_view_reaches_its_top`, addressed in #1736). With `XCL_ADAPTER=warp`, `cargo test -p xcl --lib -- --test-threads=4`: 727 passed, 0 failed, 21 ignored. **Regression run** - Not needed: test-only addition under `crates/xcl/tests/`. **Not tested** - GPU execution on an SM 6.6 / native-wave64 adapter (host GPU is RX 580, pre-SM 6.6). - Retail Xbox Series X|S titles. **AI use** - Antigravity (Gemini 4 Carbon): audited `x64_masks` and `mesh_wave` coverage, wrote `crates/xcl/tests/recomp_wave64_contract.rs` and this PR description, and ran the test suite on the user's machine under the user's direction.
Add integration tests in crates/xcl/tests/recomp_wave64_contract.rs exercising split-wave64 borrow chains, NULL/src_vccz/src_execz scalar operands, S_SWAPPC_B64 liveness, DXC cs_6_6 compilation of emitted ballot HLSL, and mesh_wave provenance, whole-mask branches, S_SENDMSG filtering, and unreachable SCC branches.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:00:11 +00:00
Author
Owner

@⁠mantavisual on GitHub · 2026-11-24 20:28 UTC · original

Test report for d7be554ad18b5abb1e7ad70ccfdc9317ee9692d6.

Tested

  • RTX 4060 8 GB (driver 616.92, wave32), i5-13600K, 32 GB, Windows 11 Pro 22631, Rust 1.100.0 MSVC, DXC 1.9.2602.17 (SDK 10.0.26100), debug.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 780 passed, 0 failed, 41 ignored. All 4 new tests ran.
  • Merged locally with main b9b6ea6: 893 passed, 0 failed, 42 ignored.
  • SKIPPED at the head: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Do the tests notice a broken analysis?

  • Gap: split_wave64_sub_borrow_chains_and_null_operands_stay_half_local still passes when NULL (125) is treated as an SGPR (the 125 => 0 arm of scalar_code removed). assert_eq!(live_by_pc[&decoded[3].pc] & (1u128 << 125), 0); passes normally and fails with that break.
  • 9 other breaks in x64_masks.rs and mesh_wave.rs were caught.

Not tested: AMD, native wave64, retail title.

AI use: Claude Code (Claude Opus 5.5) ran this on my machine, wrote the report and posted it for me.

**@⁠mantavisual** on GitHub · 2026-11-24 20:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637#issuecomment-7143598517) Test report for `d7be554ad18b5abb1e7ad70ccfdc9317ee9692d6`. **Tested** - RTX 4060 8 GB (driver 616.92, wave32), i5-13600K, 32 GB, Windows 11 Pro 22631, Rust 1.100.0 MSVC, DXC 1.9.2602.17 (SDK 10.0.26100), debug. - `cargo test --workspace --locked --no-fail-fast -- --test-threads=4`: 780 passed, 0 failed, 41 ignored. All 4 new tests ran. - Merged locally with main `b9b6ea6`: 893 passed, 0 failed, 42 ignored. - SKIPPED at the head: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). **Do the tests notice a broken analysis?** - Gap: `split_wave64_sub_borrow_chains_and_null_operands_stay_half_local` still passes when NULL (125) is treated as an SGPR (the `125 => 0` arm of `scalar_code` removed). `assert_eq!(live_by_pc[&decoded[3].pc] & (1u128 << 125), 0);` passes normally and fails with that break. - 9 other breaks in `x64_masks.rs` and `mesh_wave.rs` were caught. **Not tested:** AMD, native wave64, retail title. **AI use:** Claude Code (Claude Opus 5.5) ran this on my machine, wrote the report and posted it for me.
Author
Owner

@⁠IgorAntunes66 on GitHub · 2026-11-24 20:37 UTC · original

Test report on an SM 6.6 GPU (the author's RX 580 could not run the GPU tests):

RTX 5070 12 GB (wave32 only), driver 621.24, Windows 11 26H2, rustc 1.100.0, DXC 1.9.2602.17, PR head d7be554.

  • cargo test -p xcl --test recomp_wave64_contract: 4 passed, 0 failed.
  • .\scripts\test.ps1: 780 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64, 1 no heap windows); no TDR or
    device removal. gpu::recomp::heap_window_tests::gpu_raw_window_view_reaches_its_top, which failed on the RX 580, passes here.

Not tested: AMD / native wave64, release build.

AI use: Claude Code (claude-opus-5-5) ran the tests and drafted this comment; I reviewed it.

**@⁠IgorAntunes66** on GitHub · 2026-11-24 20:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637#issuecomment-7143842780) Test report on an SM 6.6 GPU (the author's RX 580 could not run the GPU tests): RTX 5070 12 GB (wave32 only), driver 621.24, Windows 11 26H2, rustc 1.100.0, DXC 1.9.2602.17, PR head d7be554. - `cargo test -p xcl --test recomp_wave64_contract`: 4 passed, 0 failed. - `.\scripts\test.ps1`: 780 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64, 1 no heap windows); no TDR or device removal. `gpu::recomp::heap_window_tests::gpu_raw_window_view_reaches_its_top`, which failed on the RX 580, passes here. Not tested: AMD / native wave64, release build. AI use: Claude Code (claude-opus-5-5) ran the tests and drafted this comment; I reviewed it.
Author
Owner

@⁠kilvynsilveira-tech on GitHub · 2026-11-24 20:50 UTC · original

Added the \live_by_pc[&decoded[3].pc] & (1u128 << 125) == 0\ check in \split_wave64_sub_borrow_chains_and_null_operands_stay_half_local\ (squashed into \8d92f9). Thanks @⁠mantavisual and @⁠IgorAntunes66 for the SM 6.6 runs!

**@⁠kilvynsilveira-tech** on GitHub · 2026-11-24 20:50 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637#issuecomment-7144136133) Added the \live_by_pc[&decoded[3].pc] & (1u128 << 125) == 0\ check in \split_wave64_sub_borrow_chains_and_null_operands_stay_half_local\ (squashed into \8d92f9\). Thanks @⁠mantavisual and @⁠IgorAntunes66 for the SM 6.6 runs!
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 20:56 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored.

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 20:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637#issuecomment-7144256061) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 ignored. Thanks!
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-26 05:58 UTC · original

Re-verification on RTX 3060 Ti (Windows 11), new head merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.

Thanks!

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-26 05:58 UTC · [original](https://github.com/xcl-dev/xcl/pull/1637#issuecomment-7183969163) Re-verification on RTX 3060 Ti (Windows 11), new head merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved. Thanks! — Devin
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/1637/head:github-bot/gh-1637'
git switch 'github-bot/gh-1637'

Merge

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