shader: return old values from private LDS word updates #885

Manually merged
github merged 1 commit from gh-pr/885/head into gh-pr/885/base 2026-11-26 22:25:47 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-23 15:49 UTC · original
stan495:codex/gfx1030-ds-add-rtn-u32 → main · +90 −10 · 4 files · 1 commits · merged 2026-11-23 16:11 UTC

Scope

Lower ds_add_rtn_u32, ds_sub_rtn_u32, ds_and_rtn_b32, ds_or_rtn_b32 and ds_xor_rtn_b32 using the private-word update model introduced in #878. Each instruction captures the original operands, returns the old LDS word in the destination VGPR, and updates the private word. The existing checks require zero offset, initialization, a verified private address, full EXEC, and an immediate s_waitcnt lgkmcnt(0).

Verification

Tested daf87ee on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used an AMD Radeon RX 7900 XTX (driver 32.0.32029.2010). WARP used the Microsoft Basic Render Driver (10.0.26100.9818).

cmake --build --preset dev --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = '7900 XTX'
ctest --preset dev --no-tests=error -R '^compute_store_aot_(lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V

7 passed, 0 failed, 0 skipped. The five synthetic kernels each issue two returning updates. The first destination aliases the data VGPR and the second aliases the address VGPR. Both backends matched the CPU reference across the full UAV for one and three groups. Passing LDS dispatches reported zero debug errors and warnings. All five mutants returning the updated value differed at word 0. All five mutants preserving the return value but dropping the second update differed at word 2. For addition, the first mutant produced 40000011 instead of fffffff0, and the second produced 40000011 instead of c0000014.

python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

Passed with LLVM 15.0.7 on WSL Ubuntu 24.04. The gfx1030 Wave32 binaries decoded to the expected DS forms and produced the same HLSL as source assembly through both the direct and CLI paths. The coverage records include all five new forms.

**@⁠stan495** on GitHub · 2026-11-23 15:49 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/885) `stan495:codex/gfx1030-ds-add-rtn-u32` → `main` · +90 −10 · 4 files · 1 commits · merged 2026-11-23 16:11 UTC ## Scope Lower `ds_add_rtn_u32`, `ds_sub_rtn_u32`, `ds_and_rtn_b32`, `ds_or_rtn_b32` and `ds_xor_rtn_b32` using the private-word update model introduced in #878. Each instruction captures the original operands, returns the old LDS word in the destination VGPR, and updates the private word. The existing checks require zero offset, initialization, a verified private address, full EXEC, and an immediate `s_waitcnt lgkmcnt(0)`. ## Verification Tested `daf87ee` on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used an AMD Radeon RX 7900 XTX (driver 32.0.32029.2010). WARP used the Microsoft Basic Render Driver (10.0.26100.9818). ```powershell cmake --build --preset dev --target offscreen_check $env:XBOX2WINDOWS_ADAPTER = '7900 XTX' ctest --preset dev --no-tests=error -R '^compute_store_aot_(lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V ``` 7 passed, 0 failed, 0 skipped. The five synthetic kernels each issue two returning updates. The first destination aliases the data VGPR and the second aliases the address VGPR. Both backends matched the CPU reference across the full UAV for one and three groups. Passing LDS dispatches reported zero debug errors and warnings. All five mutants returning the updated value differed at word 0. All five mutants preserving the return value but dropping the second update differed at word 2. For addition, the first mutant produced `40000011` instead of `fffffff0`, and the second produced `40000011` instead of `c0000014`. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` Passed with LLVM 15.0.7 on WSL Ubuntu 24.04. The gfx1030 Wave32 binaries decoded to the expected DS forms and produced the same HLSL as source assembly through both the direct and CLI paths. The coverage records include all five new forms.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:25:45 +00:00
github manually merged commit daf87ee473 into gh-pr/885/base 2026-11-26 22:25:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.