Tests: verify RDNA2 integer V_CMP, V_CMPX, SAVEEXEC, and CBRANCH ops #1449

Open
Vadson159 wants to merge 1 commit from upstream-pr/1459 into main
Vadson159 commented 2026-11-24 16:25:16 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Vadson159 on 2026-11-24T16:25:16Z.


Add DXC compilation and GPU verification tests for RDNA2 integer/64-bit V_CMP_*, V_CMPX_*, all S_*_SAVEEXEC_* / S_*_WREXEC_* wave-mask operations, scalar conditional branches, and V_CNDMASK_B32 with non-VCC SGPR masks against public AMD RDNA2 ISA semantics.

Over ~800 lines because all five tests share the local ProgBuilder, wave-configuration helpers, and DXC/runner harness in one standalone integration test binary instead of duplicating the harness across separate PRs or modifying shared test harnesses.

What is in it

  • crates/xcl/tests/gpu_recomp_exec_cmp.rs: adds 5 tests (exec_cmp_translate_and_compile_with_dxc, gpu_v_cmp_integer_and_64bit_all_predicates, gpu_v_cmpx_exec_masking_and_encodings, gpu_saveexec_and_wrexec_all_forms, gpu_cbranch_masks_and_v_cndmask_sgpr) across all four translation/DXC wave options (wave64, split-wave64, wave32, wave32@hw64) and adapter-supported GPU wave configurations, covering:
    • integer V_CMP_* (I32, U32, I16, U16, I64, U64) across all ISA predicates (F, LT, EQ, LE, GT, NE, GE, T) in ENC_VOPC and ENC_VOP3, SDST = NULL, inline/SGPR/literal sources, ignored upper 16 bits on 16-bit comparisons, and wave32 odd-SGPR preservation
    • V_CMPX_* (ENC_VOPC and ENC_VOP3) across integer and float/CLASS forms (F32, F16, CLASS_F32, CLASS_F16), verifying EXEC_after == EXEC_before & cond, VDST non-interference in ENC_VOP3, and post-V_CMPX lane masking
    • all 24 S_*_SAVEEXEC_* and S_*_WREXEC_* ops (_B32 across wave modes and _B64 on 64-lane waves), checking SDST (old vs new EXEC), EXEC, SCC, and _B32 upper-half preservation
    • S_CBRANCH_{VCCZ,VCCNZ,EXECZ,EXECNZ,SCC0,SCC1} (including upper-half-only 64-bit masks and a divergent V_CMPX + S_CBRANCH_EXECNZ loop) and V_CNDMASK_B32 (ENC_VOP3) with lane-local and constant SGPR masks

Tested

  • AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Ryzen 7 9800X3D 8-Core Processor, Microsoft Windows 11 Pro (10.0.26300 build 26300), rustc 1.100.0 (0ef1bc386 2026-11-09), debug build, DXC dxcompiler 1.8.2502.11 (23992152) / dxil 1.8.2502.11 (Windows SDK 10.0.26100.0)
  • $env:XCL_REQUIRE_GPU="wave64,mesh"; .\scripts\test.ps1 (cargo build --workspace && cargo test --workspace -- --test-threads=4): 775 passed, 0 failed, 41 ignored, 0 GPU tests skipped (tests/gpu_recomp_exec_cmp.rs: 5 passed, 0 failed, 0 ignored)
  • rustfmt --check crates\xcl\tests\gpu_recomp_exec_cmp.rs and cargo clippy -p xcl --test gpu_recomp_exec_cmp -- --no-deps: 0 warnings in crates/xcl/tests/gpu_recomp_exec_cmp.rs

Regression run

  • Not required: test-only change under crates/xcl/tests/ (crates/xcl/src/ outside tests and runtime build manifests are untouched).

Not tested

  • Retail game titles (XCL_SAMPLE_RPF, XCL_SAMPLE_DLLS, XCL_SAMPLE_TTPF, XCL_SAMPLE_BCPACK, XCL_SAMPLE_BK2, XCL_SAMPLE_BVH4, XCL_SAMPLE_AWC, XCL_SAMPLE_XG, XCL_SAMPLE_DXC are unset locally; no scripts/smoke.ps1 run)
  • Release build (cargo test --release) and non-RDNA4 / NVIDIA / wave32-only GPUs

AI use

  • Antigravity, Gemini 4: identified untested RDNA2 mask/comparison instructions from public ISA specifications and repository code, wrote crates/xcl/tests/gpu_recomp_exec_cmp.rs, and ran formatting, clippy, and the workspace GPU test suite.
<!-- greyfinch-sync:ivall/xcl:issue:5476125015 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1459). Originally posted by [Vadson159](https://github.com/Vadson159) on 2026-11-24T16:25:16Z. --- Add DXC compilation and GPU verification tests for RDNA2 integer/64-bit `V_CMP_*`, `V_CMPX_*`, all `S_*_SAVEEXEC_*` / `S_*_WREXEC_*` wave-mask operations, scalar conditional branches, and `V_CNDMASK_B32` with non-VCC SGPR masks against public AMD RDNA2 ISA semantics. Over ~800 lines because all five tests share the local `ProgBuilder`, wave-configuration helpers, and DXC/runner harness in one standalone integration test binary instead of duplicating the harness across separate PRs or modifying shared test harnesses. **What is in it** - `crates/xcl/tests/gpu_recomp_exec_cmp.rs`: adds 5 tests (`exec_cmp_translate_and_compile_with_dxc`, `gpu_v_cmp_integer_and_64bit_all_predicates`, `gpu_v_cmpx_exec_masking_and_encodings`, `gpu_saveexec_and_wrexec_all_forms`, `gpu_cbranch_masks_and_v_cndmask_sgpr`) across all four translation/DXC wave options (`wave64`, `split-wave64`, `wave32`, `wave32@hw64`) and adapter-supported GPU wave configurations, covering: - integer `V_CMP_*` (`I32`, `U32`, `I16`, `U16`, `I64`, `U64`) across all ISA predicates (`F`, `LT`, `EQ`, `LE`, `GT`, `NE`, `GE`, `T`) in `ENC_VOPC` and `ENC_VOP3`, `SDST = NULL`, inline/SGPR/literal sources, ignored upper 16 bits on 16-bit comparisons, and `wave32` odd-SGPR preservation - `V_CMPX_*` (`ENC_VOPC` and `ENC_VOP3`) across integer and float/`CLASS` forms (`F32`, `F16`, `CLASS_F32`, `CLASS_F16`), verifying `EXEC_after == EXEC_before & cond`, `VDST` non-interference in `ENC_VOP3`, and post-`V_CMPX` lane masking - all 24 `S_*_SAVEEXEC_*` and `S_*_WREXEC_*` ops (`_B32` across wave modes and `_B64` on 64-lane waves), checking `SDST` (old vs new `EXEC`), `EXEC`, `SCC`, and `_B32` upper-half preservation - `S_CBRANCH_{VCCZ,VCCNZ,EXECZ,EXECNZ,SCC0,SCC1}` (including upper-half-only 64-bit masks and a divergent `V_CMPX` + `S_CBRANCH_EXECNZ` loop) and `V_CNDMASK_B32` (`ENC_VOP3`) with lane-local and constant SGPR masks **Tested** - AMD Radeon RX 9070 XT (driver 32.0.32029.2010), AMD Ryzen 7 9800X3D 8-Core Processor, Microsoft Windows 11 Pro (10.0.26300 build 26300), `rustc 1.100.0 (0ef1bc386 2026-11-09)`, debug build, DXC `dxcompiler 1.8.2502.11 (23992152)` / `dxil 1.8.2502.11` (Windows SDK `10.0.26100.0`) - `$env:XCL_REQUIRE_GPU="wave64,mesh"; .\scripts\test.ps1` (`cargo build --workspace && cargo test --workspace -- --test-threads=4`): 775 passed, 0 failed, 41 ignored, 0 GPU tests skipped (`tests/gpu_recomp_exec_cmp.rs`: 5 passed, 0 failed, 0 ignored) - `rustfmt --check crates\xcl\tests\gpu_recomp_exec_cmp.rs` and `cargo clippy -p xcl --test gpu_recomp_exec_cmp -- --no-deps`: 0 warnings in `crates/xcl/tests/gpu_recomp_exec_cmp.rs` **Regression run** - Not required: test-only change under `crates/xcl/tests/` (`crates/xcl/src/` outside tests and runtime build manifests are untouched). **Not tested** - Retail game titles (`XCL_SAMPLE_RPF`, `XCL_SAMPLE_DLLS`, `XCL_SAMPLE_TTPF`, `XCL_SAMPLE_BCPACK`, `XCL_SAMPLE_BK2`, `XCL_SAMPLE_BVH4`, `XCL_SAMPLE_AWC`, `XCL_SAMPLE_XG`, `XCL_SAMPLE_DXC` are unset locally; no `scripts/smoke.ps1` run) - Release build (`cargo test --release`) and non-RDNA4 / NVIDIA / wave32-only GPUs **AI use** - Antigravity, Gemini 4: identified untested RDNA2 mask/comparison instructions from public ISA specifications and repository code, wrote `crates/xcl/tests/gpu_recomp_exec_cmp.rs`, and ran formatting, clippy, and the workspace GPU test suite.
DarkPanda69 commented 2026-11-24 17:06:30 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DarkPanda69 on 2026-11-24T16:34:40Z.


NVIDIA run (32 lanes only), which this PR lists as not tested, plus a second RDNA4 one.

Tested: pass, head 0b3f4c7 applied on its base main b7aa9f3, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17.
cargo test -p xcl --test gpu_recomp_exec_cmp -- --test-threads=4 with XCL_ADAPTER set to each GPU:

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

All five ok on both: exec_cmp_translate_and_compile_with_dxc, gpu_v_cmp_integer_and_64bit_all_predicates, gpu_v_cmpx_exec_masking_and_encodings, gpu_saveexec_and_wrexec_all_forms, gpu_cbranch_masks_and_v_cndmask_sgpr.

Not tested: release build; Intel; the whole workspace suite.

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

<!-- greyfinch-sync:ivall/xcl:comment:7137883560 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1459#issuecomment-7137883560). Originally posted by [DarkPanda69](https://github.com/DarkPanda69) on 2026-11-24T16:34:40Z. --- NVIDIA run (32 lanes only), which this PR lists as not tested, plus a second RDNA4 one. **Tested:** pass, head `0b3f4c7` applied on its base `main` `b7aa9f3`, debug, Rust 1.100.0, Windows 11 Pro 26200, Ryzen 7 5800X, DXC 1.9.2602.17. `cargo test -p xcl --test gpu_recomp_exec_cmp -- --test-threads=4` with `XCL_ADAPTER` set to each GPU: - NVIDIA RTX 3060, driver 32.0.16.1088, waves 32 only: 5 passed, 0 failed, 0 SKIPPED. - AMD RX 9070 XT (RDNA4), driver 32.0.32029.2010, waves 32..64: 5 passed, 0 failed, 0 SKIPPED. All five ok on both: `exec_cmp_translate_and_compile_with_dxc`, `gpu_v_cmp_integer_and_64bit_all_predicates`, `gpu_v_cmpx_exec_masking_and_encodings`, `gpu_saveexec_and_wrexec_all_forms`, `gpu_cbranch_masks_and_v_cndmask_sgpr`. **Not tested:** release build; Intel; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report.
DavidM1911 commented 2026-11-24 19:07:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:54Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7141282720 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1459#issuecomment-7141282720). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T18:52:54Z. --- 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!
github-actions[bot] commented 2026-11-28 08:00:38 +00:00 (Migrated from github.com)

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


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:7236302461 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1459#issuecomment-7236302461). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T08:00:38Z. --- 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 05:50:06 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:50:06Z.


Triage (#1607) – head 0b3f4c7

Test-only: a new crates/xcl/tests/gpu_recomp_exec_cmp.rs. No open or merged PR adds the same V_CMP / V_CMPX / SAVEEXEC / CBRANCH coverage, and the runner and encoder APIs it uses (wave64_programs_supported, graphics_wave32, rdna2::encode, Options::split_wave64/hw_wave) are unchanged on main. No problems found in the diff. At 1523 lines it is over the size guideline; the description says why.
Recommendation: keep open.

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:7302187929 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1459#issuecomment-7302187929). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:50:06Z. --- **Triage (#1607)** – head 0b3f4c7 Test-only: a new `crates/xcl/tests/gpu_recomp_exec_cmp.rs`. No open or merged PR adds the same V_CMP / V_CMPX / SAVEEXEC / CBRANCH coverage, and the runner and encoder APIs it uses (`wave64_programs_supported`, `graphics_wave32`, `rdna2::encode`, `Options::split_wave64/hw_wave`) are unchanged on main. No problems found in the diff. At 1523 lines it is over the size guideline; the description says why. Recommendation: keep open. 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/1459:upstream-pr/1459'
git switch 'upstream-pr/1459'

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/1459'
git switch 'upstream-pr/1459'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1459'
git switch 'upstream-pr/1459'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1459'
git switch 'main'
git merge --squash 'upstream-pr/1459'
git switch 'main'
git merge --ff-only 'upstream-pr/1459'
git switch 'main'
git merge 'upstream-pr/1459'
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!1449
No description provided.