shader: lower paired LDS exchanges and full-wave counters #945

Merged
stan495 merged 3 commits from upstream-pr/952 into main 2026-11-24 00:21:16 +00:00
stan495 commented 2026-11-23 18:31:46 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T18:31:46Z.


Scope

Lower ds_wrxchg2_rtn_b32 and ds_wrxchg2st64_rtn_b64 for initialized private LDS layouts and ds_append and ds_consume for a single full wave32. The counter is the initialized lane-zero dword, with zero M0 and zero instruction offset. It broadcasts the prior value and updates only that dword, modulo 2^32.

Updated against main after #936 merged.

Verification

Tested 93dca075 on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used AMD Radeon RX 7900 XTX (32.0.32029.2010). WARP used 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_strided|lds_packed|lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V

11 passed, 0 failed, 0 skipped. Both backends compared all 320 UAV words. Reversing exchange offsets first differed at word 0 (76543210 expected, 12345670 observed for dwords and 12345678 expected, 76543210 observed for qwords). Reversing append first differed at word 1 (00000010 expected, ffffffd0 observed). Reversing consume first differed at word 3 (fffffff0 expected, 00000030 observed).

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

LLVM 15.0.7 round trips reproduced the same HLSL as text translation. Coverage records include all four new forms.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6566156133 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/952). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T18:31:46Z. --- ## Scope Lower ds_wrxchg2_rtn_b32 and ds_wrxchg2st64_rtn_b64 for initialized private LDS layouts and ds_append and ds_consume for a single full wave32. The counter is the initialized lane-zero dword, with zero M0 and zero instruction offset. It broadcasts the prior value and updates only that dword, modulo 2^32. Updated against main after #936 merged. ## Verification Tested `93dca075` on Windows 11 25H2 (10.0.26200.9974) with the D3D12 debug layer enabled. Hardware used AMD Radeon RX 7900 XTX (32.0.32029.2010). WARP used 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_strided|lds_packed|lds_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V ``` 11 passed, 0 failed, 0 skipped. Both backends compared all 320 UAV words. Reversing exchange offsets first differed at word 0 (76543210 expected, 12345670 observed for dwords and 12345678 expected, 76543210 observed for qwords). Reversing append first differed at word 1 (00000010 expected, ffffffd0 observed). Reversing consume first differed at word 3 (fffffff0 expected, 00000030 observed). ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` LLVM 15.0.7 round trips reproduced the same HLSL as text translation. Coverage records include all four new forms.
upstream-sync closed this pull request 2026-11-24 06:45:33 +00:00
R0Y00 commented 2026-11-24 06:49:54 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T00:10:12Z.


#949 is on main. I resolved the shared fixture and docs conflicts in 97074f32. The paired exchange and wave32 counter retain their negative controls, and the returning qword and binary64 cases keep the output widths from #949. Windows Release passed eight packed, strided, qword and floating-point tests on RTX 4060 Laptop and WARP. The combined fixture also passed LLVM 15.0.7 assembly and round-trip checks.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7117778711 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/952#issuecomment-7117778711). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T00:10:12Z. --- #949 is on main. I resolved the shared fixture and docs conflicts in 97074f32. The paired exchange and wave32 counter retain their negative controls, and the returning qword and binary64 cases keep the output widths from #949. Windows Release passed eight packed, strided, qword and floating-point tests on RTX 4060 Laptop and WARP. The combined fixture also passed LLVM 15.0.7 assembly and round-trip checks.
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!945
No description provided.