shader: lower private LDS packed and thread-ID accesses #929

Manually merged
github merged 7 commits from gh-pr/929/head into gh-pr/929/base 2026-11-26 22:29:06 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-23 17:38 UTC · original
stan495:codex/gfx1030-ds-write-b8-d16-hi → main · +152 −16 · 4 files · 7 commits · merged 2026-11-23 18:56 UTC

Scope

Lower five additional accesses to the private 32-bit LDS word. The two D16 high writes select their source from the upper half of the VGPR. The signed D16 high read replaces the upper half of the destination. The explicit and implicit address forms name the same word in a full wave32 when M0 and the instruction offset are zero.

Verification

Tested 56cad54 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_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V

7 passed, 0 failed, 0 skipped. Both backends matched the CPU reference across 320 UAV words for one and three groups. Using the low half for the high halfword write first differed at word 0 (9180cdef expected, abcdcdef observed). Substituting the first read for the second thread-ID fixture read first differed at word 1 (89abcdef expected, 12345670 observed).

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

LLVM 15.0.7 assembly and decoding reproduced the same HLSL as text translation. Coverage records include all five new forms.

**@⁠stan495** on GitHub · 2026-11-23 17:38 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/929) `stan495:codex/gfx1030-ds-write-b8-d16-hi` → `main` · +152 −16 · 4 files · 7 commits · merged 2026-11-23 18:56 UTC ## Scope Lower five additional accesses to the private 32-bit LDS word. The two D16 high writes select their source from the upper half of the VGPR. The signed D16 high read replaces the upper half of the destination. The explicit and implicit address forms name the same word in a full wave32 when M0 and the instruction offset are zero. ## Verification Tested `56cad54` 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_private|ds_route|guard_read)_(warp|hardware)$|^compute_store_aot_warp$' -V ``` 7 passed, 0 failed, 0 skipped. Both backends matched the CPU reference across 320 UAV words for one and three groups. Using the low half for the high halfword write first differed at word 0 (`9180cdef` expected, `abcdcdef` observed). Substituting the first read for the second thread-ID fixture read first differed at word 1 (`89abcdef` expected, `12345670` observed). ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` LLVM 15.0.7 assembly and decoding reproduced the same HLSL as text translation. Coverage records include all five new forms.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 22:29:05 +00:00
github manually merged commit e69db648aa into gh-pr/929/base 2026-11-26 22:29:06 +00:00
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-23 18:19 UTC · original

#925 has landed. I integrated the two access families and added both orderings of the mixed-stride control. The implicit ADDTID address is a four-byte stride and can overlap another lane in the wide layout, so the combined lowerer refuses mixing the two. The private LDS draws passed with WARP and the RTX 4060 Laptop, and LLVM 15 passed the round-trip. #936 is next on the same files after the updated head has passed CI.

**@⁠R0Y00** on GitHub · 2026-11-23 18:19 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/929#issuecomment-7110005476) #925 has landed. I integrated the two access families and added both orderings of the mixed-stride control. The implicit ADDTID address is a four-byte stride and can overlap another lane in the wide layout, so the combined lowerer refuses mixing the two. The private LDS draws passed with WARP and the RTX 4060 Laptop, and LLVM 15 passed the round-trip. #936 is next on the same files after the updated head has passed CI.
Author
Owner

@⁠R0Y00 on GitHub · 2026-11-23 18:41 UTC · original

The combined private LDS CTest reached its 45-second limit twice on the RTX 4060 Laptop (32.0.16.1656, debug layer enabled). The completed readbacks had zero mismatches. On top of your updated head I split the draws into private reads/writes, packed and thread-ID accesses, arithmetic, and replacement/counters, keeping the 45-second limit, per-case readbacks, mutations, and binary coverage. All eight WARP and hardware CTests passed. The longest hardware group was arithmetic at 32.45 s. This new head needs fresh CI before #936 lands.

**@⁠R0Y00** on GitHub · 2026-11-23 18:41 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/929#issuecomment-7110510147) The combined private LDS CTest reached its 45-second limit twice on the RTX 4060 Laptop (32.0.16.1656, debug layer enabled). The completed readbacks had zero mismatches. On top of your updated head I split the draws into private reads/writes, packed and thread-ID accesses, arithmetic, and replacement/counters, keeping the 45-second limit, per-case readbacks, mutations, and binary coverage. All eight WARP and hardware CTests passed. The longest hardware group was arithmetic at 32.45 s. This new head needs fresh CI before #936 lands.
This discussion has been locked. Commenting is limited to contributors.
No description provided.