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

Merged
stan495 merged 1 commit from upstream-pr/898 into main 2026-11-23 16:45:37 +00:00
stan495 commented 2026-11-23 16:26:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T16:26:32Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6563820665 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/898). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T16:26:32Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:45:18 +00:00
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
R0Y00/Xbox2Windows!891
No description provided.