Tests: verify RDNA2 multi-dword, d16, and dual LDS ops on the GPU #544

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

@⁠Vadson159 on GitHub · 2026-11-24 01:36 UTC · original
Vadson159:test/recomp-lds → main · +1233 −0 · 1 files · 1 commits · open

Add GPU verification tests for previously untested RDNA2 LDS (DS_*) instructions against the AMD RDNA 2 ISA specification: wide multi-dword accesses (DS_WRITE_B64/B96/B128, DS_READ_B64/B96/B128, DS_NOP), dual-offset and stride-64 operations (DS_WRITE2_B64, DS_READ2_B64, DS_WRITE2ST64_B32/B64, DS_READ2ST64_B32/B64, DS_WRXCHG2_RTN_B32, DS_WRXCHG2ST64_RTN_B32), 32-bit LDS atomics (DS_INC_RTN_U32, DS_DEC_RTN_U32, DS_RSUB_RTN_U32, DS_WRXCHG_RTN_B32, DS_MSKOR_RTN_B32), and D16 sub-dword accesses (DS_WRITE_B8_D16_HI, DS_WRITE_B16_D16_HI, DS_READ_U8_D16/_HI, DS_READ_I8_D16/_HI, DS_READ_U16_D16/_HI).

Tests only — no runtime code in crates/xcl/src is changed.

What is in it

  • crates/xcl/tests/gpu_recomp_lds.rs:
    • lds_wide_dual_d16_translate_and_compile_with_dxc: verifies HLSL translation, xcl_lds / XCL_X_LDS_TOP emission alongside a cross-half V_READFIRSTLANE_B32 exchange, and DXC compilation across wave64, split-wave64, wave32, and wave32@hw64.
    • gpu_lds_wide_b64_b96_b128_and_addr_overlap: verifies DS_WRITE/READ_B64/B96/B128 and DS_NOP with 16-bit (OFFSET1 << 8) | OFFSET0 byte offsets (cross-checked at offset 0), neighbor (lane ^ 1) reads, VDST == ADDR / VDST + 1 == ADDR overlap hazards, divergent EXEC masking, and split-wave64 coexistence with V_READFIRSTLANE_B32.
    • gpu_lds_dual_stride64_and_atomics: verifies 8-byte (*2_B64), 256-byte (*2ST64_B32), and 512-byte (*2ST64_B64) strides, VDST == ADDR / VDST + 1 == ADDR overlaps, DS_WRXCHG2_RTN_B32 / DS_WRXCHG2ST64_RTN_B32 (including multi-lane shared-slot atomic permutation checks), DS_INC/DEC/RSUB_RTN_U32 / DS_WRXCHG/MSKOR_RTN_B32, and divergent EXEC masking.
    • gpu_lds_d16_subdword_and_sign_extension: verifies concurrent sibling-preserving DS_WRITE_B8_D16_HI (4 lanes/dword) and DS_WRITE_B16_D16_HI (2 lanes/dword), all 6 DS_READ_U8/I8/U16_D16/_HI variants across all 4 byte alignments and nonzero off16, 8-to-16 sign extension, untouched half preservation, VDST == ADDR, and divergent EXEC masking.

Tested

  • Hardware / OS: AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver 32.0.32029.2010; AMD Radeon(TM) Graphics driver 32.0.21045.29003 also present), Windows 10.0.26300.0, rustc 1.100.0 (0ef1bc386 2026-11-09), DXC 1.8.2502.11 (C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64), debug build.
  • XCL_REQUIRE_GPU=wave64,mesh + .\scripts\test.ps1 (cargo test --workspace -- --test-threads=4): 684 passed, 0 failed, 41 ignored (0 GPU tests skipped; XCL_SAMPLE_* unset).
  • cargo test -p xcl --test gpu_recomp_lds: 4 passed, 0 failed, 0 ignored.
  • cargo clippy -p xcl --test gpu_recomp_lds -- --no-deps: 0 warnings in crates/xcl/tests/gpu_recomp_lds.rs.
  • rustfmt --check crates/xcl/tests/gpu_recomp_lds.rs: passed.

Regression run

  • Not needed: tests only (crates/xcl/src is untouched).

Not tested

  • Wave32-only GPUs (NVIDIA / Intel) and RDNA1/2/3 GPUs (split-wave64 and wave32 paths were exercised on the RX 9070 XT).
  • Release build (--release) and retail titles (XCL_SAMPLE_* unset; no game folder locally).

AI use

  • Antigravity (Gemini 4 Hydrogen) wrote the tests and this PR description and ran the build, formatting check, clippy, and test suite on local hardware; all changes and tool outputs were verified before opening.
**@⁠Vadson159** on GitHub · 2026-11-24 01:36 UTC · [original](https://github.com/xcl-dev/xcl/pull/544) `Vadson159:test/recomp-lds` → `main` · +1233 −0 · 1 files · 1 commits · open Add GPU verification tests for previously untested RDNA2 LDS (`DS_*`) instructions against the AMD RDNA 2 ISA specification: wide multi-dword accesses (`DS_WRITE_B64/B96/B128`, `DS_READ_B64/B96/B128`, `DS_NOP`), dual-offset and stride-64 operations (`DS_WRITE2_B64`, `DS_READ2_B64`, `DS_WRITE2ST64_B32/B64`, `DS_READ2ST64_B32/B64`, `DS_WRXCHG2_RTN_B32`, `DS_WRXCHG2ST64_RTN_B32`), 32-bit LDS atomics (`DS_INC_RTN_U32`, `DS_DEC_RTN_U32`, `DS_RSUB_RTN_U32`, `DS_WRXCHG_RTN_B32`, `DS_MSKOR_RTN_B32`), and D16 sub-dword accesses (`DS_WRITE_B8_D16_HI`, `DS_WRITE_B16_D16_HI`, `DS_READ_U8_D16/_HI`, `DS_READ_I8_D16/_HI`, `DS_READ_U16_D16/_HI`). Tests only — no runtime code in `crates/xcl/src` is changed. **What is in it** - `crates/xcl/tests/gpu_recomp_lds.rs`: - `lds_wide_dual_d16_translate_and_compile_with_dxc`: verifies HLSL translation, `xcl_lds` / `XCL_X_LDS_TOP` emission alongside a cross-half `V_READFIRSTLANE_B32` exchange, and DXC compilation across `wave64`, `split-wave64`, `wave32`, and `wave32@hw64`. - `gpu_lds_wide_b64_b96_b128_and_addr_overlap`: verifies `DS_WRITE/READ_B64/B96/B128` and `DS_NOP` with 16-bit `(OFFSET1 << 8) | OFFSET0` byte offsets (cross-checked at offset 0), neighbor `(lane ^ 1)` reads, `VDST == ADDR` / `VDST + 1 == ADDR` overlap hazards, divergent `EXEC` masking, and `split-wave64` coexistence with `V_READFIRSTLANE_B32`. - `gpu_lds_dual_stride64_and_atomics`: verifies 8-byte (`*2_B64`), 256-byte (`*2ST64_B32`), and 512-byte (`*2ST64_B64`) strides, `VDST == ADDR` / `VDST + 1 == ADDR` overlaps, `DS_WRXCHG2_RTN_B32` / `DS_WRXCHG2ST64_RTN_B32` (including multi-lane shared-slot atomic permutation checks), `DS_INC/DEC/RSUB_RTN_U32` / `DS_WRXCHG/MSKOR_RTN_B32`, and divergent `EXEC` masking. - `gpu_lds_d16_subdword_and_sign_extension`: verifies concurrent sibling-preserving `DS_WRITE_B8_D16_HI` (4 lanes/dword) and `DS_WRITE_B16_D16_HI` (2 lanes/dword), all 6 `DS_READ_U8/I8/U16_D16/_HI` variants across all 4 byte alignments and nonzero `off16`, 8-to-16 sign extension, untouched half preservation, `VDST == ADDR`, and divergent `EXEC` masking. **Tested** - Hardware / OS: AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (driver `32.0.32029.2010`; AMD Radeon(TM) Graphics driver `32.0.21045.29003` also present), Windows `10.0.26300.0`, `rustc 1.100.0` (`0ef1bc386 2026-11-09`), DXC `1.8.2502.11` (`C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64`), debug build. - `XCL_REQUIRE_GPU=wave64,mesh` + `.\scripts\test.ps1` (`cargo test --workspace -- --test-threads=4`): **684 passed, 0 failed, 41 ignored** (0 GPU tests skipped; `XCL_SAMPLE_*` unset). - `cargo test -p xcl --test gpu_recomp_lds`: **4 passed, 0 failed, 0 ignored**. - `cargo clippy -p xcl --test gpu_recomp_lds -- --no-deps`: 0 warnings in `crates/xcl/tests/gpu_recomp_lds.rs`. - `rustfmt --check crates/xcl/tests/gpu_recomp_lds.rs`: passed. **Regression run** - Not needed: tests only (`crates/xcl/src` is untouched). **Not tested** - Wave32-only GPUs (NVIDIA / Intel) and RDNA1/2/3 GPUs (`split-wave64` and `wave32` paths were exercised on the RX 9070 XT). - Release build (`--release`) and retail titles (`XCL_SAMPLE_*` unset; no game folder locally). **AI use** - Antigravity (Gemini 4 Hydrogen) wrote the tests and this PR description and ran the build, formatting check, clippy, and test suite on local hardware; all changes and tool outputs were verified before opening.
Add standalone GPU verification tests covering the 21 previously untested RDNA2 LDS instructions (DS_WRITE/READ_B64/B96/B128, DS_WRITE2/READ2_B64, DS_WRITE2ST64/READ2ST64_B32/B64, DS_WRITE_B8/B16_D16_HI, DS_READ_U8/I8/U16_D16/_HI, DS_NOP) plus DS_WRXCHG2_RTN_B32, DS_WRXCHG2ST64_RTN_B32, and 32-bit LDS atomics across all four wave modes.

Assisted-by: Antigravity (Gemini 4 Hydrogen)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:25:11 +00:00
Author
Owner

@⁠thehollowedone on GitHub · 2026-11-24 01:38 UTC · original

Tested

RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug. With XCL_ADAPTER=3080 Ti and XCL_REQUIRE_GPU=1, cargo test --offline --locked -p xcl --test gpu_recomp_lds -- --test-threads=1 --nocapture reported 4 passed, 0 failed, 0 ignored, and no runtime skips. Tested commit 3eab39f

GPU readbacks matched in wave32 and split-wave64 for wide reads and writes, dual-address operations and atomics, and D16 packing and sign extension. The separate translation test compiled all four wave configurations with DXC.

Not tested

Native wave64 execution, the full workspace suite, and retail titles.

AI use

Codex with GPT-6.2 Sol ran the tests and drafted this report.

**@⁠thehollowedone** on GitHub · 2026-11-24 01:38 UTC · [original](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7119306084) **Tested** RTX 3080 Ti (621.35), Ryzen 7 9800X3D, Windows 11 build 26300, Rust 1.99.1 MSVC, DXC 1.8.2502.11, debug. With `XCL_ADAPTER=3080 Ti` and `XCL_REQUIRE_GPU=1`, `cargo test --offline --locked -p xcl --test gpu_recomp_lds -- --test-threads=1 --nocapture` reported 4 passed, 0 failed, 0 ignored, and no runtime skips. [Tested commit 3eab39f](https://github.com/ivall/xcl/commit/3eab39f8d43ea9d8422827fed53387c441ed2eff) GPU readbacks matched in wave32 and split-wave64 for wide reads and writes, dual-address operations and atomics, and D16 packing and sign extension. The separate translation test compiled all four wave configurations with DXC. **Not tested** Native wave64 execution, the full workspace suite, and retail titles. **AI use** Codex with GPT-6.2 Sol ran the tests and drafted this report.
Author
Owner

@⁠joeypercia on GitHub · 2026-11-24 03:39 UTC · original

RDNA2 run (the PR has RDNA4 and an NVIDIA run): 3eab39f merged onto main 91f9a5e (clean merge).

Tested

  • AMD Radeon iGPU (Ryzen 7 7800X3D, RDNA2, 32–64 lanes, no mesh shaders), driver 26.11.2 (32.0.21045.29003); RTX 4070 Ti (616.56, 32 lanes); Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.8.2502.11; debug
  • cargo test -p xcl --test gpu_recomp_lds: 4 passed, 0 failed on the RDNA2 iGPU (native wave64 and the 32-lane forms) and on the RTX 4070 Ti, no SKIPPED
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on the RDNA2 iGPU: 696 passed, 0 failed, 41 ignored; SKIPPED: gpu_geometry_mode_es_gs_strip, gpu_mesh_mode_two_passes (no mesh shaders)

Not tested

  • RDNA1 / RDNA3; release build

Run and report by Claude Code (Claude Opus 5.5).

**@⁠joeypercia** on GitHub · 2026-11-24 03:39 UTC · [original](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7121306101) **RDNA2** run (the PR has RDNA4 and an NVIDIA run): `3eab39f` merged onto `main` `91f9a5e` (clean merge). **Tested** - AMD Radeon iGPU (Ryzen 7 7800X3D, RDNA2, 32–64 lanes, no mesh shaders), driver 26.11.2 (32.0.21045.29003); RTX 4070 Ti (616.56, 32 lanes); Windows 11 Pro 26200; Rust 1.100.0 MSVC; DXC 1.8.2502.11; debug - `cargo test -p xcl --test gpu_recomp_lds`: 4 passed, 0 failed on the RDNA2 iGPU (native wave64 and the 32-lane forms) and on the RTX 4070 Ti, no `SKIPPED` - `cargo test --workspace --no-fail-fast -- --test-threads=4` on the RDNA2 iGPU: 696 passed, 0 failed, 41 ignored; `SKIPPED`: `gpu_geometry_mode_es_gs_strip`, `gpu_mesh_mode_two_passes` (no mesh shaders) **Not tested** - RDNA1 / RDNA3; release build Run and report by Claude Code (Claude Opus 5.5).
Author
Owner

@⁠akimfomin on GitHub · 2026-11-24 10:01 UTC · original · edited 2026-11-24 10:02 UTC

Thanks for adding the D16 coverage. PortBridge picked up this test while I was checking the related translator change in VIctory. The DS_READ_U16_D16_HI probes here appear to read aligned halfwords. If unaligned loads are in scope, would a byte-3 case be useful for the GPU fixture?

I wrote 0xAB123456 and 0xDEADCDBE to adjacent LDS dwords, seeded the destination with 0xCAFE1357, and read at byte offset 3. The translated VIctory shader returned 0xBEAB1357 on both NVIDIA D3D12 and WARP. That exercises the two-word read and preservation of the destination’s low half in one case. The result is for VIctory’s translator. Does the native XCL fixture agree?

VIctory readback and test patch. AI-assisted with Codex.

**@⁠akimfomin** on GitHub · 2026-11-24 10:01 UTC · [original](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7128210080) · edited 2026-11-24 10:02 UTC Thanks for adding the D16 coverage. [PortBridge](https://github.com/akimfomin/PortBridge) picked up this test while I was checking the related translator change in VIctory. The `DS_READ_U16_D16_HI` probes here appear to read aligned halfwords. If unaligned loads are in scope, would a byte-3 case be useful for the GPU fixture? I wrote `0xAB123456` and `0xDEADCDBE` to adjacent LDS dwords, seeded the destination with `0xCAFE1357`, and read at byte offset 3. The translated VIctory shader returned `0xBEAB1357` on both NVIDIA D3D12 and WARP. That exercises the two-word read and preservation of the destination’s low half in one case. The result is for VIctory’s translator. Does the native XCL fixture agree? [VIctory readback and test patch](https://github.com/Marvisak/VIctory/pull/571#issuecomment-7128201680). AI-assisted with Codex.
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 06:53 UTC · original

Empirical test report (3eab39f8)

Independent Intel Arc A770 GPU verification of PR #544 at detached head 3eab39f8d43ea9d8422827fed53387c441ed2eff (clean worktree).

Hardware / environment

  • Intel Arc A770 Graphics (driver 32.0.101.9175), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build 26200.9974.
  • rustc 1.100.0 (0ef1bc386 2026-11-09) (x86_64-pc-windows-msvc), DXC 1.9.2609.5 (01b62ad47) + DXIL 1.9.2609.5, unoptimized Cargo test profile with debug info and incremental compilation disabled.

Commands and results

  • Located prebuilt integration test binary via cargo test -p xcl --tests --no-run --message-format=json outside the GPU lock.
  • Ran inside Invoke-ArcTest.ps1 with XCL_ADAPTER=A770 and RUST_TEST_NOCAPTURE=1:
    • gpu_recomp_lds.exe --nocapture --test-threads=1 (exit 0, 0.69s).
  • 4 passed, 0 failed, 0 ignored, 0 skipped.

Observed behavior

  • gpu_lds_d16_subdword_and_sign_extension, gpu_lds_dual_stride64_and_atomics, gpu_lds_wide_b64_b96_b128_and_addr_overlap, and lds_wide_dual_d16_translate_and_compile_with_dxc all passed on the Intel Arc A770 with DXC 1.9.2609.5.

Not tested

  • Full GPU workspace suite and game smoke runs were omitted.

AI use

Verified and published with T3 Code / Antigravity (gemini-4-neon).

**@⁠JJAutoCompare** on GitHub · 2026-11-25 06:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7155272414) ### Empirical test report (3eab39f8) Independent Intel Arc A770 GPU verification of PR #544 at detached head `3eab39f8d43ea9d8422827fed53387c441ed2eff` (clean worktree). **Hardware / environment** - Intel Arc A770 Graphics (driver `32.0.101.9175`), AMD Ryzen 7 3800X, Windows 11 Enterprise Evaluation x64 build `26200.9974`. - `rustc 1.100.0 (0ef1bc386 2026-11-09)` (`x86_64-pc-windows-msvc`), DXC `1.9.2609.5 (01b62ad47)` + DXIL `1.9.2609.5`, unoptimized Cargo test profile with debug info and incremental compilation disabled. **Commands and results** - Located prebuilt integration test binary via `cargo test -p xcl --tests --no-run --message-format=json` outside the GPU lock. - Ran inside `Invoke-ArcTest.ps1` with `XCL_ADAPTER=A770` and `RUST_TEST_NOCAPTURE=1`: - `gpu_recomp_lds.exe --nocapture --test-threads=1` (exit 0, 0.69s). - **4 passed, 0 failed, 0 ignored, 0 skipped.** **Observed behavior** - `gpu_lds_d16_subdword_and_sign_extension`, `gpu_lds_dual_stride64_and_atomics`, `gpu_lds_wide_b64_b96_b128_and_addr_overlap`, and `lds_wide_dual_d16_translate_and_compile_with_dxc` all passed on the Intel Arc A770 with DXC 1.9.2609.5. **Not tested** - Full GPU workspace suite and game smoke runs were omitted. **AI use** Verified and published with T3 Code / Antigravity (gemini-4-neon).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:43 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~26 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 13:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7164189927) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.) Thanks!
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/544/head:github-bot/gh-544'
git switch 'github-bot/gh-544'

Merge

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