shader: lower private LDS min, max and reverse subtract updates #898

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

@⁠stan495 on GitHub · 2026-11-23 16:26 UTC · original
stan495:codex/gfx1030-ds-min-i32 → main · +76 −18 · 4 files · 1 commits · merged 2026-11-23 16:45 UTC

Scope

Extend the private gfx1030 LDS profile from #878 and #885 with ds_rsub_u32, ds_min_i32, ds_max_i32, ds_min_u32 and ds_max_u32. Reverse subtraction stores the source minus the old word modulo 2^32. The comparisons select the signed or unsigned minimum or maximum as specified and store its 32-bit pattern. These are the no-return forms at offset 0 and use the existing initialization, private address, EXEC and immediate wait checks.

Verification

Tested commit 80c4d6e 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. Both backends matched the CPU reference over all 320 UAV words after dispatches of one and three groups, with zero debug errors or warnings in the LDS dispatches. Each mutant differed at word 1. The reversed subtraction mutant produced 7ffffff8 instead of 80000008. The four comparison mutants swapped signedness and picked the other operand, 7ffffff0 or fffffff8.

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 forms and produced the same HLSL as the source assembly through the direct and CLI paths. The coverage records include all five new forms.

**@⁠stan495** on GitHub · 2026-11-23 16:26 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/898) `stan495:codex/gfx1030-ds-min-i32` → `main` · +76 −18 · 4 files · 1 commits · merged 2026-11-23 16:45 UTC ## Scope Extend the private gfx1030 LDS profile from #878 and #885 with `ds_rsub_u32`, `ds_min_i32`, `ds_max_i32`, `ds_min_u32` and `ds_max_u32`. Reverse subtraction stores the source minus the old word modulo 2^32. The comparisons select the signed or unsigned minimum or maximum as specified and store its 32-bit pattern. These are the no-return forms at offset 0 and use the existing initialization, private address, EXEC and immediate wait checks. ## Verification Tested commit `80c4d6e` 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. Both backends matched the CPU reference over all 320 UAV words after dispatches of one and three groups, with zero debug errors or warnings in the LDS dispatches. Each mutant differed at word 1. The reversed subtraction mutant produced `7ffffff8` instead of `80000008`. The four comparison mutants swapped signedness and picked the other operand, `7ffffff0` or `fffffff8`. ```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 forms and produced the same HLSL as the source assembly through 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:26:52 +00:00
github manually merged commit 80c4d6e0b3 into gh-pr/898/base 2026-11-26 22:26:53 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.