shader: lower gfx1030 non-returning image exchanges #1515

Merged
stan495 merged 1 commit from upstream-pr/1522 into main 2026-11-24 13:49:01 +00:00
stan495 commented 2026-11-24 13:33:27 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-24T13:33:27Z.


Summary

Builds on the merged integer min/max support from #1504. Only the two exchange instructions and their fixtures are in the diff. Replaces stan495/Xbox2Windows#14.

Lower non-returning gfx1030 image_atomic_swap and image_atomic_cmpswap for a scalar R32_UINT 2D UAV at mip zero. Swap discards the original value. Compare-store takes a two-word dmask:0x3 tuple: it compares against VDATA+1 and writes VDATA only on equality. The capability gate is local to the exchange suite. Returning atomics, counters and float atomics remain outside this patch.

Verification

Tested clean head e221849f831e5112d8472c721da979cc74ff0fab on upstream base cd186e9e6483c605f803b2b0fdfb594dfe285f6b.

. .\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/atomic-exchange-e221849f.xml"
python -B tools/form_coverage.py out/atomic-exchange-e221849f.xml --records out/build/dev/form_coverage --json out/atomic-exchange-e221849f.coverage.json
python -B tests/form_coverage_check.py
python -B tests/docs_links_check.py
python -B tests/bidi_controls_check.py

CTest: 25 passed, 0 failed, 0 skipped. Each adapter ran both forms at one and two group counts, comparing all 336 words from three mip levels, including untouched and compare-miss texels. Reversing compare and replacement first differs at mip 0, word 32: a5a51f3f expected, fffffff0 actual. Negative inputs include wrong two-word data tuples and masks, undefined operands, unverified descriptors, and unsupported flags. Both passing exchange fixture records contain exactly the two new forms. The compute run covers 23/111 gfx1030 MIMG mnemonics.

Windows 11 build 26300.9974; Intel Arc B390 32.0.101.8509; Microsoft WARP 10.0.26100.9818. Debug layer unavailable on both backends.

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

LLVM 15 assembly, disassembly and synthetic-container CLI round trips passed. git diff --check origin/main...HEAD passed. git merge-tree --write-tree refs/remotes/origin/main HEAD passed against 6fe5def5e6ed3d46a6b6dcb92189073c15bfbb63, including a separate simulation applying #1507 and #1513 first. The simulations did not execute tests.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6582960430 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1522). Originally posted by [stan495](https://github.com/stan495) on 2026-11-24T13:33:27Z. --- ## Summary Builds on the merged integer min/max support from #1504. Only the two exchange instructions and their fixtures are in the diff. Replaces stan495/Xbox2Windows#14. Lower non-returning gfx1030 `image_atomic_swap` and `image_atomic_cmpswap` for a scalar `R32_UINT` 2D UAV at mip zero. Swap discards the original value. Compare-store takes a two-word `dmask:0x3` tuple: it compares against `VDATA+1` and writes `VDATA` only on equality. The capability gate is local to the exchange suite. Returning atomics, counters and float atomics remain outside this patch. ## Verification Tested clean head `e221849f831e5112d8472c721da979cc74ff0fab` on upstream base `cd186e9e6483c605f803b2b0fdfb594dfe285f6b`. ```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/atomic-exchange-e221849f.xml" python -B tools/form_coverage.py out/atomic-exchange-e221849f.xml --records out/build/dev/form_coverage --json out/atomic-exchange-e221849f.coverage.json python -B tests/form_coverage_check.py python -B tests/docs_links_check.py python -B tests/bidi_controls_check.py ``` CTest: 25 passed, 0 failed, 0 skipped. Each adapter ran both forms at one and two group counts, comparing all 336 words from three mip levels, including untouched and compare-miss texels. Reversing compare and replacement first differs at mip 0, word 32: `a5a51f3f` expected, `fffffff0` actual. Negative inputs include wrong two-word data tuples and masks, undefined operands, unverified descriptors, and unsupported flags. Both passing exchange fixture records contain exactly the two new forms. The compute run covers 23/111 gfx1030 MIMG mnemonics. Windows 11 build `26300.9974`; Intel Arc B390 `32.0.101.8509`; Microsoft WARP `10.0.26100.9818`. Debug layer unavailable on both backends. ```sh python3 -B tests/compute_store_check.py binary llvm-mc-15 llvm-objcopy-15 libLLVM-15.so.1 ``` LLVM 15 assembly, disassembly and synthetic-container CLI round trips passed. `git diff --check origin/main...HEAD` passed. `git merge-tree --write-tree refs/remotes/origin/main HEAD` passed against `6fe5def5e6ed3d46a6b6dcb92189073c15bfbb63`, including a separate simulation applying #1507 and #1513 first. The simulations did not execute tests.
upstream-sync closed this pull request 2026-11-24 14:03:08 +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!1515
No description provided.