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

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

Imported from ivall/xcl. Originally posted by Vadson159 on 2026-11-24T01:36:01Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5464406263 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544). Originally posted by [Vadson159](https://github.com/Vadson159) on 2026-11-24T01:36:01Z. --- 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.
towiice commented 2026-11-24 01:57:22 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by towiice on 2026-11-24T01:57:22Z.

Review: COMMENTED


Tested PR head 3eab39f on NVIDIA GeForce GTX 1650 SUPER (Turing / TU116, wave32, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (stable-x86_64-pc-windows-gnullvm), DXC v1.9.2609:

  • cargo test -p xcl --test gpu_recomp_lds -- --test-threads=4: 4 passed, 0 failed (1.43 s):
    • lds_wide_dual_d16_translate_and_compile_with_dxc
    • gpu_lds_d16_subdword_and_sign_extension
    • gpu_lds_wide_b64_b96_b128_and_addr_overlap
    • gpu_lds_dual_stride64_and_atomics

All multi-dword, d16, and dual LDS GPU tests pass on Turing.

<!-- greyfinch-sync:ivall/xcl:review:6032482214 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#pullrequestreview-6032482214). Originally posted by [towiice](https://github.com/towiice) on 2026-11-24T01:57:22Z. **Review:** COMMENTED --- Tested PR head `3eab39f` on **NVIDIA GeForce GTX 1650 SUPER** (Turing / TU116, wave32, driver 610.88), Windows 11 build 10.0.26300 (26H2), Rust 1.100.0 (`stable-x86_64-pc-windows-gnullvm`), DXC `v1.9.2609`: - `cargo test -p xcl --test gpu_recomp_lds -- --test-threads=4`: **4 passed, 0 failed** (1.43 s): - `lds_wide_dual_d16_translate_and_compile_with_dxc` - `gpu_lds_d16_subdword_and_sign_extension` - `gpu_lds_wide_b64_b96_b128_and_addr_overlap` - `gpu_lds_dual_stride64_and_atomics` All multi-dword, d16, and dual LDS GPU tests pass on Turing.
thehollowedone commented 2026-11-24 07:05:20 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by thehollowedone on 2026-11-24T01:38:42Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7119306084 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/544#issuecomment-7119306084). Originally posted by [thehollowedone](https://github.com/thehollowedone) on 2026-11-24T01:38:42Z. --- **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.
joeypercia commented 2026-11-24 07:05:57 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by joeypercia on 2026-11-24T03:39:53Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7121306101 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/544#issuecomment-7121306101). Originally posted by [joeypercia](https://github.com/joeypercia) on 2026-11-24T03:39:53Z. --- **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).
akimfomin commented 2026-11-24 10:04:53 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by akimfomin on 2026-11-24T10:01:33Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7128210080 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/544#issuecomment-7128210080). Originally posted by [akimfomin](https://github.com/akimfomin) on 2026-11-24T10:01:33Z. --- 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.
JJAutoCompare commented 2026-11-25 07:05:42 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:53:52Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7155272414 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7155272414). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T06:53:52Z. --- ### 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).
DavidM1911 commented 2026-11-25 14:10:05 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:43:13Z.


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!

<!-- greyfinch-sync:ivall/xcl:comment:7164189927 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7164189927). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T13:43:13Z. --- 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!
Prime1997 commented 2026-11-26 15:12:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-26T15:12:52Z.

Review: COMMENTED


Focused NVIDIA result: 4 passed, 0 failed, 0 ignored, 0 explicit skips.

Tested this head on an isolated merge tree with nvidia-dev af2cecc40886a8682ecf3267f5328c6dc4b66ad7, using an RTX 3060 Ti (32.0.16.1714) and DXC 1.9.2609.5. Ran the four named gpu_recomp_lds tests individually with --test-threads=1 --nocapture after rebuilding cargo test --locked -p xcl --test gpu_recomp_lds --no-run. Three tests were filtered out on each invocation; every test ran once. The GPU cases covered wave32 and split-wave64 LDS accesses, paired strides and atomics, and D16 packing. DXC compilation covered all four shader modes. Native wave64 execution and the current full workspace suite remain unverified here.

Current main accepts the patch cleanly. Merged #1617 covers part of the stride cases. Open #1177 and #1178 overlap with the wide and D16 cases, while this suite adds masked lanes, shared-slot atomic exchanges, and more overlap cases. Please split the 1,233-line suite along those boundaries or explain in the description why it needs to stay together. Windows CI was awaiting approval at review time. The focused NVIDIA results support the fixtures.

AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary Discord for coordinating contributor work, testing, and comparing results.

<!-- greyfinch-sync:ivall/xcl:review:6076546456 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#pullrequestreview-6076546456). Originally posted by [Prime1997](https://github.com/Prime1997) on 2026-11-26T15:12:52Z. **Review:** COMMENTED --- **Focused NVIDIA result: 4 passed, 0 failed, 0 ignored, 0 explicit skips.** Tested this head on an isolated merge tree with `nvidia-dev` `af2cecc40886a8682ecf3267f5328c6dc4b66ad7`, using an RTX 3060 Ti (32.0.16.1714) and DXC 1.9.2609.5. Ran the four named `gpu_recomp_lds` tests individually with `--test-threads=1 --nocapture` after rebuilding `cargo test --locked -p xcl --test gpu_recomp_lds --no-run`. Three tests were filtered out on each invocation; every test ran once. The GPU cases covered wave32 and split-wave64 LDS accesses, paired strides and atomics, and D16 packing. DXC compilation covered all four shader modes. Native wave64 execution and the current full workspace suite remain unverified here. Current main accepts the patch cleanly. Merged #1617 covers part of the stride cases. Open #1177 and #1178 overlap with the wide and D16 cases, while this suite adds masked lanes, shared-slot atomic exchanges, and more overlap cases. Please split the 1,233-line suite along those boundaries or explain in the description why it needs to stay together. Windows CI was awaiting approval at review time. The focused NVIDIA results support the fixtures. AI use: Codex (GPT-6) reviewed the pinned changes and verified the reported evidence. Optional temporary [Discord](https://discord.gg/gK3y7WRRY) for coordinating contributor work, testing, and comparing results.
coolpersonnn commented 2026-11-30 19:09:07 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:09:07Z.


merge-check claim
head: 3eab39f8d4

<!-- greyfinch-sync:ivall/xcl:comment:7288922429 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7288922429). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-30T19:09:07Z. --- merge-check claim head: 3eab39f8d43ea9d8422827fed53387c441ed2eff
saintwolf commented 2026-11-30 19:10:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T19:10:47Z.


merge-check claim
head: 3eab39f8d4

<!-- greyfinch-sync:ivall/xcl:comment:7288967240 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7288967240). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T19:10:47Z. --- merge-check claim head: 3eab39f8d43ea9d8422827fed53387c441ed2eff
coolpersonnn commented 2026-11-30 19:16:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by coolpersonnn on 2026-11-30T19:16:51Z.


merge-check
base: ff0c364b3d
head: 3eab39f8d4
merge: clean
build: cargo build --workspace -> ok
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2893 passed, 0 failed, 51 ignored (25 SKIPPED: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none; all 4 new tests in tests/gpu_recomp_lds.rs passed in 0.54s (wave32 and split-wave64 executed on GPU; wave64 / wave32@hw64 modes require native wave64 hardware)
review: none. Read the full diff (+1233/-0, new file crates/xcl/tests/gpu_recomp_lds.rs). Pure test-only addition with no runtime changes and no unsafe. Verifies DXC compilation across all 4 wave modes plus GPU execution of wide LDS (b64/b96/b128 + DS_NOP), dual/stride64 loads & stores, dual atomic exchanges (including multi-lane linearizability permutation check) and 32-bit atomics (INC/DEC/RSUB/WRXCHG/MSKOR), D16 sub-dword writes/reads with sibling preservation and sign extension, 16-bit byte offsets, VDST==ADDR / VDST+1==ADDR hazards, divergent EXEC masking, and split-wave64 XCL_X_LDS_TOP coexistence. Uses runner::skip_test properly when GPU/DXC/wave64 is unavailable. No duplicates found in open/merged PRs or #1607 (open #1177 is a much smaller 76-line subset in recomp/tests.rs; #2093 tests direct DXIL vs HLSL parity).
performance: none (test-only change; no runtime code modified; new suite runs in 0.54s)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro build 26300, Rust 1.100.0 / T3 Code (Antigravity), Gemini 4 Neon (Medium)

<!-- greyfinch-sync:ivall/xcl:comment:7289133622 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7289133622). Originally posted by [coolpersonnn](https://github.com/coolpersonnn) on 2026-11-30T19:16:51Z. --- merge-check base: ff0c364b3de011c13ed45865480c21918a79ec89 head: 3eab39f8d43ea9d8422827fed53387c441ed2eff merge: clean build: cargo build --workspace -> ok tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2893 passed, 0 failed, 51 ignored (25 SKIPPED: 22 no wave64, 2 no heap windows, 1 cannot disable the driver cache); failing: none; all 4 new tests in tests/gpu_recomp_lds.rs passed in 0.54s (wave32 and split-wave64 executed on GPU; wave64 / wave32@hw64 modes require native wave64 hardware) review: none. Read the full diff (+1233/-0, new file crates/xcl/tests/gpu_recomp_lds.rs). Pure test-only addition with no runtime changes and no unsafe. Verifies DXC compilation across all 4 wave modes plus GPU execution of wide LDS (b64/b96/b128 + DS_NOP), dual/stride64 loads & stores, dual atomic exchanges (including multi-lane linearizability permutation check) and 32-bit atomics (INC/DEC/RSUB/WRXCHG/MSKOR), D16 sub-dword writes/reads with sibling preservation and sign extension, 16-bit byte offsets, VDST==ADDR / VDST+1==ADDR hazards, divergent EXEC masking, and split-wave64 XCL_X_LDS_TOP coexistence. Uses runner::skip_test properly when GPU/DXC/wave64 is unavailable. No duplicates found in open/merged PRs or #1607 (open #1177 is a much smaller 76-line subset in recomp/tests.rs; #2093 tests direct DXIL vs HLSL parity). performance: none (test-only change; no runtime code modified; new suite runs in 0.54s) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 5090 (driver 32.0.16.2101), AMD Ryzen 9 9950X3D, Windows 11 Pro build 26300, Rust 1.100.0 / T3 Code (Antigravity), Gemini 4 Neon (Medium)
saintwolf commented 2026-11-30 19:18:09 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by saintwolf on 2026-11-30T19:18:09Z.


merge-check
base: ff0c364b3d
head: 3eab39f8d4
merge: clean (trial merge f809566a10f55d0b7e4c64ba44d7d50cae5b3538; git diff --check clean; +1233/-0, new file crates/xcl/tests/gpu_recomp_lds.rs)
build: cargo build --workspace -> ok (39 lib warnings, all pre-existing; none from the new file)
tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2893 passed, 0 failed, 51 ignored (base ff0c364b's 2889 + the 4 new tests; 44 suites = 43 + the new test binary). SKIPPED: 27, the standard set for this card. All 4 new tests ran and passed here (0 SKIPPED in the targeted run, 0.54 s): the three GPU tests ran their split-wave64 and wave32 configs on this wave32-only card (native-w64 / wave32@hw64 are config-gated out on it and are covered on native wave64 hardware by the thread's AMD reports), and the translate/DXC test ran all four wave configs plus DXC compilation on the CPU.
review: read the whole 1233-line file. Test-only PR: four tests in one new integration-test file, no production-code change, no stop-criteria files, no new dependencies (every used API — rdna2::encode, recomp::{translate, Options, dxc, runner::run, KernelState, KernelResult} — verified against main by signature). The tests use exact-value oracles rather than differential comparison, which is sound here because LDS semantics are deterministic per-lane; I hand-verified the fixture math: (1) D16 sub-dword writes — DS_WRITE_B8_D16_HI writes bits [23:16] of DATA0 at the byte address, so four consecutive lanes assemble one dword, and DS_WRITE_B16_D16_HI pairs two lanes per dword; the expected assembled dwords check out byte by byte; (2) the 16-bit (OFFSET1 << 8) | OFFSET0 byte offsets are proven by independent offset-0 single-dword cross-reads at the exact computed addresses; (3) D16 read semantics — U8 replaces bits [7:0], U8_H [15:8], I8/I8_H sign-extend into [15:0]/[23:8], U16/U16_H replace whole halfwords, and the untouched halves keep the preloaded sentinels (0xA1A1_1111, 0xB2B2_2222, …) — every assertion matches; (4) 32-bit LDS atomics run on per-lane private slots (0x2900 + 32l), so old values are deterministic: INC/DEC wrap at the 9 limit, RSUB = 1000 - (100 + l), WRXCHG/MSKOR old/new all match the ISA; (5) the one genuinely racy case — all active lanes contending on the same two dwords in DS_WRXCHG2_RTN_B32 — is checked order-independently: the sorted multiset {returned olds} + {final LDS value} must equal {initial} + {all written tags}, the correct linearizability oracle with no arrival-order assumption; (6) divergent EXEC masking: is_active() uses the 64-bit (lo | hi << 32) mask for wave64/split configs and lo only for wave32, matching how the split halves see EXEC; masked read vs final-memory sentinel assertions check both the active and inactive lanes; (7) s_mov_b64(126, 193) verified: SGPR-source values 193..=208 decode as negative SIMM16 (rdna2.rs:706, emit.rs:818/848), so 193 = -1, i.e. EXEC all-ones — the "EXEC = -1 (all lanes)" comment is accurate; (8) layout hazard audit: every LDS address is below 0x3000, inside the 32 KB xcl_lds below XCL_X_LDS_TOP; the single region overlap (lane 16's atomic block at 0x2B00..0x2B14 vs WRXCHG2ST64 slot1 of lanes 0..4 at 0x2B00 + 4l) is separated by S_BARRIER in program order and each lane later reads only its own private slot, so it is harmless; VDST == ADDR / VDST + 1 == ADDR register hazards are exercised explicitly, including the D16 case where v22 holds its own address and the upper half must survive; (9) the translate test pins the recompiler's LDS ABI (groupshared uint xcl_lds[8192]) and the split-wave64 XCL_X_LDS_TOP / xcl_x_rla_uniform exchange markers and DXC-compiles the output in all four wave configs. Gating follows the standard pattern (runner::wave64_programs_supported + dxc::location with skip_test); the 0-SKIPPED targeted run confirms the GPU configs actually executed rather than silently returning. Thread: four independent reports all 4/4 on this exact head — RTX 3080 Ti (wave32 + split-wave64), RDNA2 iGPU (native wave64 + 32-lane forms) and RTX 4070 Ti, Intel Arc A770, plus DavidM1911's lib pass; akimfomin's note that the d16 probes read aligned halfwords is consistent with the fixture (reads at byte offsets 0x0104..0x0107 inside dwords). Overlap note: #2093 (direct DXIL vs HLSL parity for the same instruction family, different file) already carries two safe checks (BBareth, saintwolf) and will land first — this PR covers the recompiler/HLSL path plus the EXEC/hazard/D16 oracle coverage #2093 does not, so the two are complementary, not duplicates; no #1607 group covers #544, and open #1178 (d16 LDS) is thematically adjacent only.
performance: none; tests only.
verdict: safe to merge
hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B

<!-- greyfinch-sync:ivall/xcl:comment:7289169709 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7289169709). Originally posted by [saintwolf](https://github.com/saintwolf) on 2026-11-30T19:18:09Z. --- merge-check base: ff0c364b3de011c13ed45865480c21918a79ec89 head: 3eab39f8d43ea9d8422827fed53387c441ed2eff merge: clean (trial merge f809566a10f55d0b7e4c64ba44d7d50cae5b3538; git diff --check clean; +1233/-0, new file crates/xcl/tests/gpu_recomp_lds.rs) build: cargo build --workspace -> ok (39 lib warnings, all pre-existing; none from the new file) tests: cargo test --workspace --no-fail-fast -- --test-threads=4 -> 2893 passed, 0 failed, 51 ignored (base ff0c364b's 2889 + the 4 new tests; 44 suites = 43 + the new test binary). SKIPPED: 27, the standard set for this card. All 4 new tests ran and passed here (0 SKIPPED in the targeted run, 0.54 s): the three GPU tests ran their split-wave64 and wave32 configs on this wave32-only card (native-w64 / wave32@hw64 are config-gated out on it and are covered on native wave64 hardware by the thread's AMD reports), and the translate/DXC test ran all four wave configs plus DXC compilation on the CPU. review: read the whole 1233-line file. Test-only PR: four tests in one new integration-test file, no production-code change, no stop-criteria files, no new dependencies (every used API — rdna2::encode, recomp::{translate, Options, dxc, runner::run, KernelState, KernelResult} — verified against main by signature). The tests use exact-value oracles rather than differential comparison, which is sound here because LDS semantics are deterministic per-lane; I hand-verified the fixture math: (1) D16 sub-dword writes — DS_WRITE_B8_D16_HI writes bits [23:16] of DATA0 at the byte address, so four consecutive lanes assemble one dword, and DS_WRITE_B16_D16_HI pairs two lanes per dword; the expected assembled dwords check out byte by byte; (2) the 16-bit (OFFSET1 << 8) | OFFSET0 byte offsets are proven by independent offset-0 single-dword cross-reads at the exact computed addresses; (3) D16 read semantics — U8 replaces bits [7:0], U8_H [15:8], I8/I8_H sign-extend into [15:0]/[23:8], U16/U16_H replace whole halfwords, and the untouched halves keep the preloaded sentinels (0xA1A1_1111, 0xB2B2_2222, …) — every assertion matches; (4) 32-bit LDS atomics run on per-lane private slots (0x2900 + 32*l), so old values are deterministic: INC/DEC wrap at the 9 limit, RSUB = 1000 - (100 + l), WRXCHG/MSKOR old/new all match the ISA; (5) the one genuinely racy case — all active lanes contending on the same two dwords in DS_WRXCHG2_RTN_B32 — is checked order-independently: the sorted multiset {returned olds} + {final LDS value} must equal {initial} + {all written tags}, the correct linearizability oracle with no arrival-order assumption; (6) divergent EXEC masking: is_active() uses the 64-bit (lo | hi << 32) mask for wave64/split configs and lo only for wave32, matching how the split halves see EXEC; masked read vs final-memory sentinel assertions check both the active and inactive lanes; (7) s_mov_b64(126, 193) verified: SGPR-source values 193..=208 decode as negative SIMM16 (rdna2.rs:706, emit.rs:818/848), so 193 = -1, i.e. EXEC all-ones — the "EXEC = -1 (all lanes)" comment is accurate; (8) layout hazard audit: every LDS address is below 0x3000, inside the 32 KB xcl_lds below XCL_X_LDS_TOP; the single region overlap (lane 16's atomic block at 0x2B00..0x2B14 vs WRXCHG2ST64 slot1 of lanes 0..4 at 0x2B00 + 4*l) is separated by S_BARRIER in program order and each lane later reads only its own private slot, so it is harmless; VDST == ADDR / VDST + 1 == ADDR register hazards are exercised explicitly, including the D16 case where v22 holds its own address and the upper half must survive; (9) the translate test pins the recompiler's LDS ABI (groupshared uint xcl_lds[8192]) and the split-wave64 XCL_X_LDS_TOP / xcl_x_rla_uniform exchange markers and DXC-compiles the output in all four wave configs. Gating follows the standard pattern (runner::wave64_programs_supported + dxc::location with skip_test); the 0-SKIPPED targeted run confirms the GPU configs actually executed rather than silently returning. Thread: four independent reports all 4/4 on this exact head — RTX 3080 Ti (wave32 + split-wave64), RDNA2 iGPU (native wave64 + 32-lane forms) and RTX 4070 Ti, Intel Arc A770, plus DavidM1911's lib pass; akimfomin's note that the d16 probes read aligned halfwords is consistent with the fixture (reads at byte offsets 0x0104..0x0107 inside dwords). Overlap note: #2093 (direct DXIL vs HLSL parity for the same instruction family, different file) already carries two safe checks (BBareth, saintwolf) and will land first — this PR covers the recompiler/HLSL path plus the EXEC/hazard/D16 oracle coverage #2093 does not, so the two are complementary, not duplicates; no #1607 group covers #544, and open #1178 (d16 LDS) is thematically adjacent only. performance: none; tests only. verdict: safe to merge hardware / tool and model: RTX 4070 SUPER (driver 32.0.16.2140), Ryzen 7 7800X3D, Windows 11 build 26300, Rust 1.100.0 / OpenCode, Qwen 3.8 27B
Foniass commented 2026-12-01 03:41:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:41:23Z.


Triage (#1607) – head 3eab39f

#1177 (64/96/128-bit and paired LDS loads/stores) and #1178 (d16 LDS loads/stores) test a subset of the same DS ops as ~75-line additions to recomp/tests.rs; this PR was opened first and also covers the 32-bit LDS atomics, DS_WRXCHG2* and four wave modes, in a new 1233-line file. Only DS_READ2ST64_B64 is already exercised on main. No problems found in the diff; gpu_ready skips all of it (wave32 too) on an adapter without wave64 programs.
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:7299963381 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/544#issuecomment-7299963381). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:41:23Z. --- **Triage (#1607)** – head 3eab39f #1177 (64/96/128-bit and paired LDS loads/stores) and #1178 (d16 LDS loads/stores) test a subset of the same DS ops as ~75-line additions to recomp/tests.rs; this PR was opened first and also covers the 32-bit LDS atomics, `DS_WRXCHG2*` and four wave modes, in a new 1233-line file. Only `DS_READ2ST64_B64` is already exercised on main. No problems found in the diff; `gpu_ready` skips all of it (wave32 too) on an adapter without wave64 programs. 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/544:upstream-pr/544'
git switch 'upstream-pr/544'

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