shader: lower gfx1030 conditional atomic subtract with discarded result #1564

Manually merged
github merged 1 commit from gh-pr/1564/head into gh-pr/1564/base 2026-11-26 23:16:59 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 14:11 UTC · original
stan495:codex/gfx1030-mubuf-atomic-csub-upstream → main · +74 −8 · 5 files · 1 commits · merged 2026-11-24 14:40 UTC

Summary

Lower fixed-address unsigned buffer_atomic_csub with glc when the returned value is discarded. Preserve the upstream raw-UAV binding restrictions and reject a use of the pending or unmodelled return. The wrapping-subtract control should first differ at DWORD index 2, expected 00000000, actual c5c5c5c5.

Refs #1354. The atomic counters from #1458 are already on main.

Local check

The LLVM 15 assembly, disassembly and compute-container CLI regression passed at b61eeb75fa83a7699e2dd41e17641621b284ec37.

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

Windows GPU validation

Tested commit b61eeb75fa83a7699e2dd41e17641621b284ec37 on Windows 11 x64 (25H2, build 26200.9974) with MSVC 19.44.35228.0 and DXC from Windows SDK 10.0.26100.0.

Backend Adapter Driver D3D12 debug layer Passed Failed Skipped
Hardware AMD Radeon RX 7900 XTX 32.0.32029.2010 Enabled 25 0 0
WARP Microsoft Basic Render Driver 10.0.26100.9818 Enabled 25 0 0

On both backends, buffer_atomic_csub matched the CPU reference across all 320 DWORDs for both the one-group and two-group dispatches. The one-group case left a positive counter and the two-group case reached zero. The D3D12 debug layer reported zero errors and warnings for both dispatches on each backend. The wrapping-subtract negative control first differed at zero-based DWORD index 2 on both backends (00000000 expected, c5c5c5c5 actual). The gfx1030 form coverage report includes buffer_atomic_csub from both fixtures.

Reproduce on Windows

From the repository root, with the development Python environment at out/pe-env:

. .\tools\dev.ps1
cmake --preset dev
cmake --build --preset dev --target offscreen_check
$env:CTEST_PARALLEL_LEVEL = '1'
$junit = Join-Path $PWD 'out/mubuf-csub.xml'
ctest --preset dev --no-tests=error -R '^compute_store_aot_(mubuf_|mimg_)' -V --output-junit $junit
.\out\pe-env\Scripts\python.exe -B tools/form_coverage.py $junit --records out/build/dev/form_coverage --gaps gfx1030 --json out/mubuf-csub-coverage.json
**@⁠stan495** on GitHub · 2026-11-24 14:11 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1564) `stan495:codex/gfx1030-mubuf-atomic-csub-upstream` → `main` · +74 −8 · 5 files · 1 commits · merged 2026-11-24 14:40 UTC ## Summary Lower fixed-address unsigned `buffer_atomic_csub` with `glc` when the returned value is discarded. Preserve the upstream raw-UAV binding restrictions and reject a use of the pending or unmodelled return. The wrapping-subtract control should first differ at DWORD index 2, expected `00000000`, actual `c5c5c5c5`. Refs #1354. The atomic counters from #1458 are already on `main`. ## Local check The LLVM 15 assembly, disassembly and compute-container CLI regression passed at `b61eeb75fa83a7699e2dd41e17641621b284ec37`. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` ## Windows GPU validation Tested commit `b61eeb75fa83a7699e2dd41e17641621b284ec37` on Windows 11 x64 (25H2, build `26200.9974`) with MSVC `19.44.35228.0` and DXC from Windows SDK `10.0.26100.0`. | Backend | Adapter | Driver | D3D12 debug layer | Passed | Failed | Skipped | | --- | --- | --- | --- | ---: | ---: | ---: | | Hardware | AMD Radeon RX 7900 XTX | `32.0.32029.2010` | Enabled | 25 | 0 | 0 | | WARP | Microsoft Basic Render Driver | `10.0.26100.9818` | Enabled | 25 | 0 | 0 | On both backends, `buffer_atomic_csub` matched the CPU reference across all 320 DWORDs for both the one-group and two-group dispatches. The one-group case left a positive counter and the two-group case reached zero. The D3D12 debug layer reported zero errors and warnings for both dispatches on each backend. The wrapping-subtract negative control first differed at zero-based DWORD index 2 on both backends (`00000000` expected, `c5c5c5c5` actual). The gfx1030 form coverage report includes `buffer_atomic_csub` from both fixtures. ### Reproduce on Windows From the repository root, with the development Python environment at `out/pe-env`: ```powershell . .\tools\dev.ps1 cmake --preset dev cmake --build --preset dev --target offscreen_check $env:CTEST_PARALLEL_LEVEL = '1' $junit = Join-Path $PWD 'out/mubuf-csub.xml' ctest --preset dev --no-tests=error -R '^compute_store_aot_(mubuf_|mimg_)' -V --output-junit $junit .\out\pe-env\Scripts\python.exe -B tools/form_coverage.py $junit --records out/build/dev/form_coverage --gaps gfx1030 --json out/mubuf-csub-coverage.json ```
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:16:58 +00:00
github manually merged commit b61eeb75fa into gh-pr/1564/base 2026-11-26 23:16:59 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.