shader: lower private LDS word updates in compute #871

Merged
stan495 merged 1 commit from upstream-pr/878 into main 2026-11-23 15:38:31 +00:00
stan495 commented 2026-11-23 15:19:26 +00:00 (Migrated from github.com)

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


Scope

Extend the thread-private gfx1030 LDS profile from #865 with the no-return forms ds_add_u32, ds_sub_u32, ds_and_b32, ds_or_b32 and ds_xor_b32. They update the same initialized word at offset 0, with addition and subtraction wrapping at 32 bits. Subtraction takes the old word minus the source VGPR. The existing Wave32 group, private address, allocation, EXEC and immediate wait checks apply.

The five fixtures use the same compute test file as #866. The branch merge check passed against its head e8f31c2.

Reproduction

Tested e74f6bd on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used the 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. Each backend ran all five update variants with one and three groups, comparing every UAV word against the CPU reference. The expected result was zero differences and the observed result matched. The passing LDS dispatches logged zero debug errors and warnings. Every full-write mutant differed at word 1, with 40000021 observed instead of the operation's expected result. For example, add expected 40000011 and subtract expected bfffffcf.

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

Passed with LLVM 15.0.7 in WSL Ubuntu 24.04. The assembled gfx1030 Wave32 fixtures decoded to the expected DS forms, and both decoded and CLI translation reproduced the HLSL from source. The D3D12 readback exercised that translated HLSL. The coverage records included all five new forms.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6562525934 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/878). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T15:19:26Z. --- ## Scope Extend the thread-private gfx1030 LDS profile from #865 with the no-return forms `ds_add_u32`, `ds_sub_u32`, `ds_and_b32`, `ds_or_b32` and `ds_xor_b32`. They update the same initialized word at offset 0, with addition and subtraction wrapping at 32 bits. Subtraction takes the old word minus the source VGPR. The existing Wave32 group, private address, allocation, EXEC and immediate wait checks apply. The five fixtures use the same compute test file as #866. The branch merge check passed against its head `e8f31c2`. ## Reproduction Tested `e74f6bd` on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used the 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. Each backend ran all five update variants with one and three groups, comparing every UAV word against the CPU reference. The expected result was zero differences and the observed result matched. The passing LDS dispatches logged zero debug errors and warnings. Every full-write mutant differed at word 1, with `40000021` observed instead of the operation's expected result. For example, add expected `40000011` and subtract expected `bfffffcf`. ```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 in WSL Ubuntu 24.04. The assembled gfx1030 Wave32 fixtures decoded to the expected DS forms, and both decoded and CLI translation reproduced the HLSL from source. The D3D12 readback exercised that translated HLSL. The coverage records included all five new forms.
upstream-sync closed this pull request 2026-11-24 06:45:12 +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!871
No description provided.