shader: lower gfx1030 bounded image counters #1565

Manually merged
github merged 1 commit from gh-pr/1565/head into gh-pr/1565/base 2026-11-26 23:17:06 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 14:12 UTC · original
stan495:codex/gfx1030-mimg-atomic-counters-upstream → main · +166 −5 · 6 files · 1 commits · merged 2026-11-24 14:30 UTC

Summary

Lower gfx1030 image_atomic_inc and image_atomic_dec for the non-returning R32_UINT 2D UAV profile at mip 0. The sole data VGPR supplies an unsigned limit. Increment wraps to zero when the old value meets or exceeds the limit. Decrement wraps to the limit at zero or above the limit. A typed compare-exchange loop applies the update and retries with the observed value after contention. The fixture requires the typed compare-store or compare-exchange capability bit for R32_UINT.

Refs #1522

Verification

Tested clean head db40f92a1ef8a0599b7e4c1d847238d991d7c982 on a3633d4df879a46bd07d941ce8295e23ec3400a1.

. .\tools\dev.ps1
$root = (Get-Location).Path
cmake --preset dev -DINTAKE_PYTHON=<python.exe>
cmake --build --preset dev --target offscreen_check
$env:TEMP = "$root/out"
$env:TMP = $env:TEMP
ctest --preset dev --no-tests=error -j 1 -R '^(compute_store_aot_mimg_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V --output-junit "$root/out/counter-db40f92a.xml"
python -B tools/form_coverage.py out/counter-db40f92a.xml --records out/build/dev/form_coverage --json out/counter-db40f92a.coverage.json
$Dxc = (Get-Command dxc -ErrorAction Stop).Source
foreach ($suite in @('counter','integer','minmax','exchange')) {
    python -B tests/compute_store_check.py "compile-mimg-atomic-$suite" $Dxc
}
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py

CTest reported 27 passed, 0 failed and 0 skipped. The WARP and hardware counter records each contain both forms. Across one and two dispatch groups, the test compares 336 words over three mips per case against a CPU reference. The controls cover limits 0, 3 and UINT_MAX, including two updates to the same texel. On both adapters the boundary mutations first differed at mip 0, word 32, with expected and actual 00000000 and 00000004 for increment, and 00000002 and 00000003 for decrement. Removing the retry first differed at the same word for both forms with expected 00000001 and actual 00000003. Setting glc was rejected as Unsupported compute instruction.

Windows 11 build 26300.9974, Intel Arc B390 driver 32.0.101.8509, Microsoft WARP 10.0.26100.9818. The debug layer was unavailable. The four DXC compile checks and all three Python checks passed.

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

The LLVM 15 container check passed, including all eight counter variants through assembly, disassembly and the synthetic-container CLI. git diff --check origin/main...HEAD and git merge-tree --write-tree origin/main HEAD passed against e83e225bdc29703497f1e4937c43a7f257bf89d2. A separate simulation with #1562 also merged cleanly.

**@⁠stan495** on GitHub · 2026-11-24 14:12 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1565) `stan495:codex/gfx1030-mimg-atomic-counters-upstream` → `main` · +166 −5 · 6 files · 1 commits · merged 2026-11-24 14:30 UTC ## Summary Lower gfx1030 `image_atomic_inc` and `image_atomic_dec` for the non-returning `R32_UINT` 2D UAV profile at mip 0. The sole data VGPR supplies an unsigned limit. Increment wraps to zero when the old value meets or exceeds the limit. Decrement wraps to the limit at zero or above the limit. A typed compare-exchange loop applies the update and retries with the observed value after contention. The fixture requires the typed compare-store or compare-exchange capability bit for `R32_UINT`. Refs #1522 ## Verification Tested clean head `db40f92a1ef8a0599b7e4c1d847238d991d7c982` on `a3633d4df879a46bd07d941ce8295e23ec3400a1`. ```powershell . .\tools\dev.ps1 $root = (Get-Location).Path cmake --preset dev -DINTAKE_PYTHON=<python.exe> cmake --build --preset dev --target offscreen_check $env:TEMP = "$root/out" $env:TMP = $env:TEMP ctest --preset dev --no-tests=error -j 1 -R '^(compute_store_aot_mimg_|compute_root_|compute_tables_|offscreen_capability_table_self_test$)' -V --output-junit "$root/out/counter-db40f92a.xml" python -B tools/form_coverage.py out/counter-db40f92a.xml --records out/build/dev/form_coverage --json out/counter-db40f92a.coverage.json $Dxc = (Get-Command dxc -ErrorAction Stop).Source foreach ($suite in @('counter','integer','minmax','exchange')) { python -B tests/compute_store_check.py "compile-mimg-atomic-$suite" $Dxc } python -B tests/form_coverage_check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py ``` CTest reported 27 passed, 0 failed and 0 skipped. The WARP and hardware counter records each contain both forms. Across one and two dispatch groups, the test compares 336 words over three mips per case against a CPU reference. The controls cover limits `0`, `3` and `UINT_MAX`, including two updates to the same texel. On both adapters the boundary mutations first differed at mip 0, word 32, with expected and actual `00000000` and `00000004` for increment, and `00000002` and `00000003` for decrement. Removing the retry first differed at the same word for both forms with expected `00000001` and actual `00000003`. Setting `glc` was rejected as `Unsupported compute instruction`. Windows 11 build `26300.9974`, Intel Arc B390 driver `32.0.101.8509`, Microsoft WARP `10.0.26100.9818`. The debug layer was unavailable. The four DXC compile checks and all three Python checks passed. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` The LLVM 15 container check passed, including all eight counter variants through assembly, disassembly and the synthetic-container CLI. `git diff --check origin/main...HEAD` and `git merge-tree --write-tree origin/main HEAD` passed against `e83e225bdc29703497f1e4937c43a7f257bf89d2`. A separate simulation with #1562 also merged cleanly.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:17:02 +00:00
github manually merged commit db40f92a1e into gh-pr/1565/base 2026-11-26 23:17:06 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.