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

Manually merged
github merged 1 commit from gh-pr/1372/head into gh-pr/1372/base 2026-11-26 23:01:57 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 09:37 UTC · original
stan495:codex/gfx1030-mubuf-atomic-x2-upstream → main · +112 −34 · 6 files · 1 commits · merged 2026-11-24 09:58 UTC

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.

**@⁠stan495** on GitHub · 2026-11-24 09:37 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1372) `stan495:codex/gfx1030-mubuf-atomic-x2-upstream` → `main` · +112 −34 · 6 files · 1 commits · merged 2026-11-24 09:58 UTC 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`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:01:55 +00:00
github manually merged commit 98d2c3e895 into gh-pr/1372/base 2026-11-26 23:01:57 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 09:55 UTC · original · reviewed

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.
**@⁠tedin7** on GitHub · 2026-11-24 09:55 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1372#pullrequestreview-6037080960) · **reviewed** 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.