shader: lower gfx1030 non-returning image exchanges #1522

Manually merged
github merged 1 commit from gh-pr/1522/head into gh-pr/1522/base 2026-11-26 23:13:52 +00:00
Owner

@⁠stan495 on GitHub · 2026-11-24 13:33 UTC · original
stan495:codex/gfx1030-mimg-atomic-exchange-upstream → main · +140 −56 · 6 files · 1 commits · merged 2026-11-24 13:49 UTC

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.

**@⁠stan495** on GitHub · 2026-11-24 13:33 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1522) `stan495:codex/gfx1030-mimg-atomic-exchange-upstream` → `main` · +140 −56 · 6 files · 1 commits · merged 2026-11-24 13:49 UTC ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:13:50 +00:00
github manually merged commit e221849f83 into gh-pr/1522/base 2026-11-26 23:13:52 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.