shader: lower gfx1030 fixed-address 64-bit atomic reductions #1365

Merged
stan495 merged 1 commit from upstream-pr/1372 into main 2026-11-24 09:58:05 +00:00
stan495 commented 2026-11-24 09:37:47 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T09:37:47Z.


This follows the 32-bit reduction profile from #1354.

Summary

  • Lower the nine fixed-address, non-returning integer MUBUF _x2 reductions to single SM 6.6 raw UAV interlocked operations. Combine consecutive VGPR words in little-endian order and require eight-byte alignment.
  • Use the signed or unsigned interlocked overload for min/max. Preserve modular arithmetic for add/sub. The fixture uses an SM 6.6 and Int64ShaderOps capability gate.

Validation

Tested commit 98d2c3e895fe7727b8cb9c3b7b338d88d1732227 against parent e1316e1c79ed111390752240c3e0f2b0f95b5bf3.

cmake --build --preset dev --target offscreen_check
$env:CTEST_PARALLEL_LEVEL = '2'
ctest --preset dev --no-tests=error -R '^(compute_store_aot_|offscreen_.*self)' -V --output-junit "$PWD/out/compute-store-junit.xml"
python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py

53 passed, 0 failed, 0 capability skips. Both compute_store_aot_mubuf_reduction_x2_* fixtures record nine passing forms. The selected tests record 54 of 73 gfx1030 MUBUF forms. Windows build 26300.9974, WARP on Microsoft Basic Render Driver (10.0.26100.9818), and hardware on Intel Arc B390 (32.0.101.8509). The debug layer was unavailable on both. The one- and two-group dispatches compare all 320 words of translated DXIL output with a CPU reference. Wrong operations and signedness change one or both target words. Rejection controls cover register pairs, eight-byte alignment and glc.

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

Passed on Ubuntu 22.04.5 with LLVM 15.0.7. The coverage self-check, documentation links and merge-tree checks passed.

The wrong add/sub operation first differs at word 2 on both adapters. See the execution fixture for the per-form expected and actual words. The merge-tree check passed against e1316e1c79ed111390752240c3e0f2b0f95b5bf3.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6578861778 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1372). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T09:37:47Z. --- This follows the 32-bit reduction profile from #1354. ## Summary - Lower the nine fixed-address, non-returning integer MUBUF `_x2` reductions to single SM 6.6 raw UAV interlocked operations. Combine consecutive VGPR words in little-endian order and require eight-byte alignment. - Use the signed or unsigned interlocked overload for min/max. Preserve modular arithmetic for add/sub. The fixture uses an SM 6.6 and `Int64ShaderOps` capability gate. ## Validation Tested commit `98d2c3e895fe7727b8cb9c3b7b338d88d1732227` against parent `e1316e1c79ed111390752240c3e0f2b0f95b5bf3`. ```powershell cmake --build --preset dev --target offscreen_check $env:CTEST_PARALLEL_LEVEL = '2' ctest --preset dev --no-tests=error -R '^(compute_store_aot_|offscreen_.*self)' -V --output-junit "$PWD/out/compute-store-junit.xml" python -B tools/form_coverage.py out/compute-store-junit.xml --records out/build/dev/form_coverage --gaps gfx1030 --json out/compute-store-coverage.json python -B tests/form_coverage_check.py python -B tests/docs_links_check.py ``` 53 passed, 0 failed, 0 capability skips. Both `compute_store_aot_mubuf_reduction_x2_*` fixtures record nine passing forms. The selected tests record 54 of 73 gfx1030 MUBUF forms. Windows build `26300.9974`, WARP on Microsoft Basic Render Driver (`10.0.26100.9818`), and hardware on Intel Arc B390 (`32.0.101.8509`). The debug layer was unavailable on both. The one- and two-group dispatches compare all 320 words of translated DXIL output with a CPU reference. Wrong operations and signedness change one or both target words. Rejection controls cover register pairs, eight-byte alignment and `glc`. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` Passed on Ubuntu 22.04.5 with LLVM 15.0.7. The coverage self-check, documentation links and merge-tree checks passed. The wrong add/sub operation first differs at word 2 on both adapters. See the execution fixture for the per-form expected and actual words. The merge-tree check passed against `e1316e1c79ed111390752240c3e0f2b0f95b5bf3`.
upstream-sync closed this pull request 2026-11-24 10:02:34 +00:00
tedin7 commented 2026-11-24 10:02:35 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:55:41Z.

Review: COMMENTED


Technical peer-review at commit 98d2c3e895fe7727b8cb9c3b7b338d88d1732227:

Verification

  • Linux (LLVM-19):
    • git diff --check origin/main...HEAD: clean.
    • tests/docs_links_check.py: passed (16 Markdown files, 305 links).
    • tests/bidi_controls_check.py: passed (1,149 tracked files).
    • tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so: passed.
    • tests/rdna2_tools_check.py: passed (139 tests, 18 skipped).
    • tests/form_coverage_check.py: passed.
  • Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP):
    • Debug (--preset dev): offscreen_check built in 5.18s; ctest -R '^compute_store_aot_mubuf_reduction': 4/4 passed in 4.70s (compute_store_aot_mubuf_reduction_{warp,hardware}, compute_store_aot_mubuf_reduction_x2_{warp,hardware}).
    • Release /O2 (--preset release): offscreen_check built in 3.42s; 4/4 passed in 4.68s.

Code Review Notes

  • Lowering (tools/compute_store_aot.py): Cleanly extends the 32-bit fixed-address MUBUF atomic reduction path to _x2: enforces 8-byte alignment (offset % 8 == 0), consecutive VGPR pair v[src:src+1] with src + 2 <= 256, combines words in little-endian order (uint64_t(low) | (uint64_t(high) << 32u)), uses int64_t for smin/smax and 0ull - word for sub, and emits Interlocked{Add,And,Or,Xor,Min,Max}64.
  • Capability gate & controls (tests/offscreen_check.cpp, tests/compute_store_check.py): --compute-store-case-atomic64 gates on D3D_SHADER_MODEL_6_6 + Int64ShaderOps; negative controls verify VGPR pair bounds, unknown data words, 4-byte-only offset alignment, and glc rejection, while execution checks compare all 320 readback words across 1- and 2-group dispatches and assert wrong-op/wrong-signedness detection.
<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6037080960 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1372#pullrequestreview-6037080960). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T09:55:41Z. **Review:** COMMENTED --- Technical peer-review at commit `98d2c3e895fe7727b8cb9c3b7b338d88d1732227`: ### Verification - **Linux (LLVM-19)**: - `git diff --check origin/main...HEAD`: clean. - `tests/docs_links_check.py`: passed (16 Markdown files, 305 links). - `tests/bidi_controls_check.py`: passed (1,149 tracked files). - `tests/compute_store_check.py binary llvm-mc-19 llvm-objcopy-19 /usr/lib/llvm-19/lib/libLLVM-19.so`: passed. - `tests/rdna2_tools_check.py`: passed (139 tests, 18 skipped). - `tests/form_coverage_check.py`: passed. - **Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP)**: - **Debug (`--preset dev`)**: `offscreen_check` built in `5.18s`; `ctest -R '^compute_store_aot_mubuf_reduction'`: **4/4 passed** in `4.70s` (`compute_store_aot_mubuf_reduction_{warp,hardware}`, `compute_store_aot_mubuf_reduction_x2_{warp,hardware}`). - **Release `/O2` (`--preset release`)**: `offscreen_check` built in `3.42s`; **4/4 passed** in `4.68s`. ### Code Review Notes - **Lowering (`tools/compute_store_aot.py`)**: Cleanly extends the 32-bit fixed-address MUBUF atomic reduction path to `_x2`: enforces 8-byte alignment (`offset % 8 == 0`), consecutive VGPR pair `v[src:src+1]` with `src + 2 <= 256`, combines words in little-endian order (`uint64_t(low) | (uint64_t(high) << 32u)`), uses `int64_t` for `smin`/`smax` and `0ull - word` for `sub`, and emits `Interlocked{Add,And,Or,Xor,Min,Max}64`. - **Capability gate & controls (`tests/offscreen_check.cpp`, `tests/compute_store_check.py`)**: `--compute-store-case-atomic64` gates on `D3D_SHADER_MODEL_6_6` + `Int64ShaderOps`; negative controls verify VGPR pair bounds, unknown data words, 4-byte-only offset alignment, and `glc` rejection, while execution checks compare all 320 readback words across 1- and 2-group dispatches and assert wrong-op/wrong-signedness detection.
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!1365
No description provided.