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

Merged
stan495 merged 7 commits from upstream-pr/929 into main 2026-11-23 18:56:31 +00:00
stan495 commented 2026-11-23 17:38:37 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T17:38:37Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6565186099 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/929). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T17:38:37Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 06:45:27 +00:00
R0Y00 commented 2026-11-24 06:49:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:19:56Z.


#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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7110005476 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/929#issuecomment-7110005476). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T18:19:56Z. --- #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 commented 2026-11-24 06:49:29 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T18:41:10Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7110510147 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/929#issuecomment-7110510147). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T18:41:10Z. --- 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.
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!922
No description provided.