shader: lower private LDS word accesses in compute #851

Merged
stan495 merged 2 commits from upstream-pr/857 into main 2026-11-23 14:27:25 +00:00
stan495 commented 2026-11-23 13:51:24 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-23T13:51:24Z.


Change

Lower ds_write_b32, ds_read_b32 and ds_read_u16 for a proven private LDS word per thread in a 32×1×1 gfx1030 compute group. An explicit allocation, aligned local address and immediate wait let the translator preserve the written value and extract either unsigned halfword.

Verification

Tested c139447 based on d4620fd. On WARP and hardware, each dispatch compared all 320 UAV words against the CPU reference, including the untouched tail. The fixtures exercised one and three groups. All four CTest entries passed with zero skips. Windows 11 25H2 build 26200.9974, DXC 1.8.2502.11, Radeon RX 7900 XTX driver 32.0.32029.2010, WARP 10.0.26100.9818. The D3D12 debug layer reported zero errors and warnings.

The fixture overwrites the source VGPR after the write. Selecting the opposite halfword mismatches at word 2, expected 0x000089ab and observed 0x0000fff0. Controls reject an uninitialized read, unknown address, insufficient allocation, masked EXEC, invalid offset and missing waits.

LLVM 15.0.7 assembled the original gfx1030 wave32 fixtures, decoded the exact DS instructions and reproduced the HLSL through the compute CLI. The existing gfx1013 compute binary fixtures and the LLVM-enabled RDNA2 disassembler suite also passed. The coverage records include each new DS mnemonic.

.\tools\dev.ps1
$env:XBOX2WINDOWS_ADAPTER = '7900 XTX'
cmake --preset dev
cmake --build --preset dev --target offscreen_check
ctest --preset dev --no-tests=error -R '^compute_store_aot(_lds_private)?_(warp|hardware)$' --output-junit "$PWD/out/results.xml" -V
python -B tools/form_coverage.py out/results.xml --gaps gfx1030
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py
git diff --check origin/main...HEAD
python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1

This change overlaps the gfx1030 compute decoder entry, coverage fixture registration and documentation with #856. Please review that PR first. This branch can be rebased after it lands.

AI-assisted (Codex and DeepSeek Harness).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6560809998 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/857). Originally posted by [stan495](https://github.com/stan495) on 2026-11-23T13:51:24Z. --- ## Change Lower `ds_write_b32`, `ds_read_b32` and `ds_read_u16` for a proven private LDS word per thread in a 32×1×1 gfx1030 compute group. An explicit allocation, aligned local address and immediate wait let the translator preserve the written value and extract either unsigned halfword. ## Verification Tested `c139447` based on `d4620fd`. On WARP and hardware, each dispatch compared all 320 UAV words against the CPU reference, including the untouched tail. The fixtures exercised one and three groups. All four CTest entries passed with zero skips. Windows 11 25H2 build 26200.9974, DXC 1.8.2502.11, Radeon RX 7900 XTX driver 32.0.32029.2010, WARP 10.0.26100.9818. The D3D12 debug layer reported zero errors and warnings. The fixture overwrites the source VGPR after the write. Selecting the opposite halfword mismatches at word 2, expected `0x000089ab` and observed `0x0000fff0`. Controls reject an uninitialized read, unknown address, insufficient allocation, masked EXEC, invalid offset and missing waits. LLVM 15.0.7 assembled the original gfx1030 wave32 fixtures, decoded the exact DS instructions and reproduced the HLSL through the compute CLI. The existing gfx1013 compute binary fixtures and the LLVM-enabled RDNA2 disassembler suite also passed. The coverage records include each new DS mnemonic. ```powershell .\tools\dev.ps1 $env:XBOX2WINDOWS_ADAPTER = '7900 XTX' cmake --preset dev cmake --build --preset dev --target offscreen_check ctest --preset dev --no-tests=error -R '^compute_store_aot(_lds_private)?_(warp|hardware)$' --output-junit "$PWD/out/results.xml" -V python -B tools/form_coverage.py out/results.xml --gaps gfx1030 python -B tests/form_coverage_check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py git diff --check origin/main...HEAD ``` ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` This change overlaps the gfx1030 compute decoder entry, coverage fixture registration and documentation with #856. Please review that PR first. This branch can be rebased after it lands. AI-assisted (Codex and DeepSeek Harness).
upstream-sync closed this pull request 2026-11-24 06:45:07 +00:00
R0Y00 commented 2026-11-24 06:49:11 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T14:17:04Z.


I merged current main into this branch after #856. Both DS fixtures keep their readback and mutation checks. WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) each matched all 320 words for one and three groups. The private-LDS high-half mutation failed at word 2 (0x89ab versus 0xfff0), and both reversed lane-routing mutations still failed at word 0. LLVM 15 and the docs check passed. Windows CI will rerun on the updated head. The earlier Windows failure was in the BVH WARP test.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7103763117 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/857#issuecomment-7103763117). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-23T14:17:04Z. --- I merged current main into this branch after #856. Both DS fixtures keep their readback and mutation checks. WARP 10.0.26100.9818 and RTX 4060 Laptop (32.0.16.1656) each matched all 320 words for one and three groups. The private-LDS high-half mutation failed at word 2 (0x89ab versus 0xfff0), and both reversed lane-routing mutations still failed at word 0. LLVM 15 and the docs check passed. Windows CI will rerun on the updated head. The earlier Windows failure was in the BVH WARP test.
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!851
No description provided.