shader: lower gfx1030 bounded image counters #1558

Merged
stan495 merged 1 commit from upstream-pr/1565 into main 2026-11-24 14:30:55 +00:00
stan495 commented 2026-11-24 14:12:50 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T14:12:50Z.


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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6583737109 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1565). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T14:12:50Z. --- ## 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.
upstream-sync closed this pull request 2026-11-24 15:02:01 +00:00
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!1558
No description provided.