Tests: check all 16 32-bit MIMG image_atomic_* ops on the GPU #1712

Open
github-bot wants to merge 1 commit from github-bot/gh-1712 into main AGit
Owner

@⁠thiagocalile on GitHub · 2026-11-24 19:35 UTC · original
thiagocalile:tests-recomp-mimg-image-atomics → main · +276 −0 · 1 files · 1 commits · open

Adds GPU execution tests for all 16 32-bit MIMG IMAGE_ATOMIC_* operations across wave64 and wave32, covering integer ALU ops, signed/unsigned min/max, GLC=0 vs GLC=1 return-value behaviour, CAS-loop inc/dec/cmpswap/fcmpswap, float fmin/fmax, multi-lane contention on a single texel, and EXEC masking. No runtime or recompiler source files are changed.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs:
    • gpu_image_atomics_32bit_int_and_glc: tests IMAGE_ATOMIC_ADD, SUB (including 32-bit wrap-around), AND, OR, XOR, SWAP (GLC=1 returning the prior texel value and GLC=0 updating memory while keeping VDATA unchanged), UMIN, UMAX, SMIN, SMAX (signed negative extremes on DXGI_FORMAT_R32_SINT), multi-lane contention on 1×1 UAVs, and EXEC-masked writes on both wave64 and wave32.
    • gpu_image_atomics_32bit_cas_and_float: tests IMAGE_ATOMIC_INC, DEC (including limit wrap-around), CMPSWAP, FCMPSWAP (bitwise -0.0 vs +0.0 discrimination), FMIN, FMAX (per-lane and multi-lane contention across negative and positive floats), GLC=1 return values, and EXEC masking on both wave64 and wave32.

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64, driver 32.0.21045.29003; XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11.
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_image_atomics_32bit_ -- --nocapture: 2 passed, 0 failed, 0 ignored (0.30s; both wave64 and wave32 executed on hardware).
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4: 857 passed, 3 failed, 42 ignored (xcl --lib: 808 passed, 3 failed, 22 ignored; integration tests: 49 passed, 0 failed, 20 ignored).
    • The 3 failures are pre-existing on main (c160d86) on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels: 3D mip subresource mismatch, plus 2 mutex-poison cascades transitions_apply_when_their_list_is_submitted and d32s8_targets_take_their_own_size_of_video_memory; tracked by #1028).
    • SKIPPED (not counted as coverage): heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows (plus D3D12 debug-layer tests skip because d3d12SDKLayers.dll is not installed).

Not tested

  • NVIDIA / Intel GPUs, D3D12 debug layer, 64-bit DMASK 0x3/0xF image atomics, retail title smoke run (test-only PR; no runtime code changed).

AI use

  • Antigravity (Gemini 4 Neon) wrote the two GPU tests in crates/xcl/src/gpu/recomp/tests.rs, ran the targeted and full workspace test suites on my RX 6600, and drafted this PR description; I reviewed the diff and test output before opening the PR.
**@⁠thiagocalile** on GitHub · 2026-11-24 19:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712) `thiagocalile:tests-recomp-mimg-image-atomics` → `main` · +276 −0 · 1 files · 1 commits · open Adds GPU execution tests for all 16 32-bit MIMG `IMAGE_ATOMIC_*` operations across wave64 and wave32, covering integer ALU ops, signed/unsigned min/max, `GLC=0` vs `GLC=1` return-value behaviour, CAS-loop `inc`/`dec`/`cmpswap`/`fcmpswap`, float `fmin`/`fmax`, multi-lane contention on a single texel, and `EXEC` masking. No runtime or recompiler source files are changed. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: - `gpu_image_atomics_32bit_int_and_glc`: tests `IMAGE_ATOMIC_ADD`, `SUB` (including 32-bit wrap-around), `AND`, `OR`, `XOR`, `SWAP` (`GLC=1` returning the prior texel value and `GLC=0` updating memory while keeping `VDATA` unchanged), `UMIN`, `UMAX`, `SMIN`, `SMAX` (signed negative extremes on `DXGI_FORMAT_R32_SINT`), multi-lane contention on 1×1 UAVs, and `EXEC`-masked writes on both wave64 and wave32. - `gpu_image_atomics_32bit_cas_and_float`: tests `IMAGE_ATOMIC_INC`, `DEC` (including limit wrap-around), `CMPSWAP`, `FCMPSWAP` (bitwise `-0.0` vs `+0.0` discrimination), `FMIN`, `FMAX` (per-lane and multi-lane contention across negative and positive floats), `GLC=1` return values, and `EXEC` masking on both wave64 and wave32. **Tested** - **Hardware**: AMD Radeon RX 6600 (8146 MiB VRAM, RDNA2, native wave64, driver `32.0.21045.29003`; `XCL_ADAPTER=radeon`), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (`10.0.26200.0`), Rust `1.100.0` (`stable-x86_64-pc-windows-msvc`), DXC `1.8.2502.11`. - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_image_atomics_32bit_ -- --nocapture`: **2 passed, 0 failed, 0 ignored** (`0.30s`; both wave64 and wave32 executed on hardware). - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4`: **857 passed, 3 failed, 42 ignored** (`xcl --lib`: 808 passed, 3 failed, 22 ignored; integration tests: 49 passed, 0 failed, 20 ignored). - The 3 failures are pre-existing on `main` (`c160d86`) on this RX 6600 (`placed_title_textures_share_vram_and_preserve_pixels`: 3D mip subresource mismatch, plus 2 mutex-poison cascades `transitions_apply_when_their_list_is_submitted` and `d32s8_targets_take_their_own_size_of_video_memory`; tracked by #1028). - `SKIPPED` (not counted as coverage): `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows` (plus D3D12 debug-layer tests skip because `d3d12SDKLayers.dll` is not installed). **Not tested** - NVIDIA / Intel GPUs, D3D12 debug layer, 64-bit `DMASK 0x3`/`0xF` image atomics, retail title smoke run (test-only PR; no runtime code changed). **AI use** - Antigravity (Gemini 4 Neon) wrote the two GPU tests in `crates/xcl/src/gpu/recomp/tests.rs`, ran the targeted and full workspace test suites on my RX 6600, and drafted this PR description; I reviewed the diff and test output before opening the PR.
Add two GPU tests in crates/xcl/src/gpu/recomp/tests.rs covering all 16
32-bit MIMG IMAGE_ATOMIC_* instructions on both wave64 and wave32:

- gpu_image_atomics_32bit_int_and_glc: per-lane and multi-lane contention
  checks for add, sub (including 32-bit wrap-around), and, or, xor, swap
  (GLC=0 preserving vdata vs GLC=1 returning the prior texel value),
  umin/umax, smin/smax (signed negative extremes), and EXEC masking.
- gpu_image_atomics_32bit_cas_and_float: CAS-loop and float ops — inc/dec
  (including wrap at limit), cmpswap, fcmpswap (bitwise -0.0 vs +0.0),
  per-lane and contention fmin/fmax (negative and positive ordering),
  GLC=1 return values, and EXEC masking.

Assisted-by: Antigravity (Gemini 4 Neon)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:02:22 +00:00
Author
Owner

@⁠upipibi on GitHub · 2026-11-24 20:10 UTC · original

NVIDIA run, since the PR lists it as not tested: RTX 3070 (Ampere, 32-lane waves only, so the wave64 case goes through the split form), driver 616.56, Windows 11, DXC 1.8.2502.11, bfdefbe.

  • gpu_image_atomics_32bit_int_and_glc and gpu_image_atomics_32bit_cas_and_float pass in 3 of 3 runs under XCL_REQUIRE_GPU=wave64, so neither case is skipped.

Test-only PR, synthetic tests, no game files. AI-assisted (Claude Code).

**@⁠upipibi** on GitHub · 2026-11-24 20:10 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712#issuecomment-7143135662) NVIDIA run, since the PR lists it as not tested: RTX 3070 (Ampere, 32-lane waves only, so the wave64 case goes through the split form), driver 616.56, Windows 11, DXC 1.8.2502.11, `bfdefbe`. - `gpu_image_atomics_32bit_int_and_glc` and `gpu_image_atomics_32bit_cas_and_float` pass in 3 of 3 runs under `XCL_REQUIRE_GPU=wave64`, so neither case is skipped. Test-only PR, synthetic tests, no game files. AI-assisted (Claude Code).
Author
Owner

@⁠mantavisual on GitHub · 2026-11-24 20:28 UTC · original

Test report for bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3. It adds the whole suite on NVIDIA to the run above, and a check of what the tests notice.

Tested

  • RTX 4060 8 GB (driver 616.92, wave32), i5-13600K, 32 GB, Windows 11 Pro 22631, Rust 1.100.0 MSVC, DXC 1.9.2602.17 (SDK 10.0.26100), debug.
  • cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 860 passed, 0 failed, 42 ignored. Both new tests ran.
  • Merged locally with main b9b6ea6: 891 passed, 0 failed, 42 ignored.
  • SKIPPED at the head: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows).

Do the tests notice a broken translator?

  • Gap: with GLC=0 ignored on the CAS-loop image atomics (sub, inc, dec, cmpswap, fmin, fmax), so that the old value is always written back, both tests still pass. VDATA after a GLC=0 operation is only checked for IMAGE_ATOMIC_SWAP. These two lines pass normally and fail with that break: assert_eq!(v[22], lu + 1) in the first test, assert_eq!([v[18], v[19]], [st.vgpr[l][18], st.vgpr[l][19]]) in the second.
  • 6 other breaks were caught.

Not tested: AMD, native wave64, retail title.

AI use: Claude Code (Claude Opus 5.5) ran this on my machine, wrote the report and posted it for me.

**@⁠mantavisual** on GitHub · 2026-11-24 20:28 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712#issuecomment-7143599310) Test report for `bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3`. It adds the whole suite on NVIDIA to the run above, and a check of what the tests notice. **Tested** - RTX 4060 8 GB (driver 616.92, wave32), i5-13600K, 32 GB, Windows 11 Pro 22631, Rust 1.100.0 MSVC, DXC 1.9.2602.17 (SDK 10.0.26100), debug. - `cargo test --workspace --locked --no-fail-fast -- --test-threads=4`: 860 passed, 0 failed, 42 ignored. Both new tests ran. - Merged locally with main `b9b6ea6`: 891 passed, 0 failed, 42 ignored. - SKIPPED at the head: `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware` (no wave64), `heap_window_out_of_memory_falls_back_to_the_switch_form` (no heap windows). **Do the tests notice a broken translator?** - Gap: with GLC=0 ignored on the CAS-loop image atomics (sub, inc, dec, cmpswap, fmin, fmax), so that the old value is always written back, both tests still pass. VDATA after a GLC=0 operation is only checked for `IMAGE_ATOMIC_SWAP`. These two lines pass normally and fail with that break: `assert_eq!(v[22], lu + 1)` in the first test, `assert_eq!([v[18], v[19]], [st.vgpr[l][18], st.vgpr[l][19]])` in the second. - 6 other breaks were caught. **Not tested:** AMD, native wave64, retail title. **AI use:** Claude Code (Claude Opus 5.5) ran this on my machine, wrote the report and posted it for me.
Author
Owner

@⁠LocranKing on GitHub · 2026-11-24 20:37 UTC · original

Independent Windows release GPU test run on NVIDIA Ampere (RTX 3060 Ti, wave32) at bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3: both new 32-bit MIMG image_atomic_* GPU tests pass.

Setup

  • GPU: NVIDIA GeForce RTX 3060 Ti (8024 MiB VRAM, Ampere, wave32), driver 32.0.16.2101
  • CPU / RAM: AMD Ryzen 5 5500 (6C/12T), 31.8 GB RAM
  • OS: Windows 11 Home Single Language, build 26200
  • Toolchain: rustc 1.100.0, DXC 1.9.2602.17, --release

Results (cargo test --workspace --release --no-fail-fast -- --test-threads=4)

  • Exit 0: 860 passed, 0 failed, 42 ignored across 20 result blocks (SKIPPED: 2 no wave64, 2 no D3D12 debug layer, heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows).
  • New tests verified on GPU:
    • gpu::recomp::tests::gpu_image_atomics_32bit_int_and_glc — ok
    • gpu::recomp::tests::gpu_image_atomics_32bit_cas_and_float — ok

Not tested: Debug build, AMD / native wave64 hardware.

AI use: Antigravity (Gemini 4 Neon) built and ran the workspace test suite on this hardware and drafted this report from the captured output; reviewed before posting. No game files attached.

**@⁠LocranKing** on GitHub · 2026-11-24 20:37 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712#issuecomment-7143833092) Independent Windows release GPU test run on NVIDIA Ampere (`RTX 3060 Ti`, wave32) at `bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3`: both new 32-bit MIMG `image_atomic_*` GPU tests pass. **Setup** - GPU: NVIDIA GeForce RTX 3060 Ti (`8024 MiB VRAM`, Ampere, wave32), driver `32.0.16.2101` - CPU / RAM: AMD Ryzen 5 5500 (6C/12T), `31.8 GB` RAM - OS: Windows 11 Home Single Language, build `26200` - Toolchain: `rustc 1.100.0`, DXC `1.9.2602.17`, `--release` **Results (`cargo test --workspace --release --no-fail-fast -- --test-threads=4`)** - Exit `0`: **860 passed, 0 failed, 42 ignored** across 20 result blocks (`SKIPPED`: 2 `no wave64`, 2 `no D3D12 debug layer`, `heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows`). - New tests verified on GPU: - `gpu::recomp::tests::gpu_image_atomics_32bit_int_and_glc` — ok - `gpu::recomp::tests::gpu_image_atomics_32bit_cas_and_float` — ok **Not tested:** Debug build, AMD / native wave64 hardware. **AI use:** Antigravity (`Gemini 4 Neon`) built and ran the workspace test suite on this hardware and drafted this report from the captured output; reviewed before posting. No game files attached.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 22:18 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

**@⁠DavidM1911** on GitHub · 2026-11-24 22:18 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712#issuecomment-7146078530) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~23 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified `main`.) Thanks!
Author
Owner

@⁠JJAutoCompare on GitHub · 2026-11-25 07:12 UTC · original

Tested

Independent Intel Arc A770 run of the two checked-in synthetic fixtures at bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3, from a clean detached checkout. Arc A770 driver 32.0.101.9175, Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build 26200.9974, Rust/Cargo 1.100.0 MSVC, DXC 1.9.2609.5 (01b62ad47). Unoptimized test profile.

cargo test --locked -p xcl --lib --no-run --message-format=json
& $exe --exact gpu::recomp::tests::gpu_image_atomics_32bit_int_and_glc --nocapture --test-threads=1
& $exe --exact gpu::recomp::tests::gpu_image_atomics_32bit_cas_and_float --nocapture --test-threads=1

The two invocations used the pinned Cargo-emitted test executable and XCL_ADAPTER=A770 under the lab's Arc mutex. 2 passed, 0 failed, 0 ignored, 0 explicit skips. D3D12 reported 8–32 lanes per wave, so the stock fixtures ran native wave32 through HLSL/DXC. Each checked returned old values and final UAV texels across all 32 lanes. The contention cases checked final shared texels. Swap was the explicit GLC=0 VDATA preservation check.

Not tested

Native or split wave64, direct DXIL, release, other adapters, the full workspace suite, retail smoke, and negative controls.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the fixtures, checked their assertion scope, and drafted this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 07:12 UTC · [original](https://github.com/xcl-dev/xcl/pull/1712#issuecomment-7155607093) **Tested** Independent Intel Arc A770 run of the two checked-in synthetic fixtures at `bfdefbea1fcb89edf0e4e7cb5d679c19ca2687c3`, from a clean detached checkout. Arc A770 driver `32.0.101.9175`, Ryzen 7 3800X, Windows 11 Enterprise Evaluation 25H2 build `26200.9974`, Rust/Cargo `1.100.0` MSVC, DXC `1.9.2609.5` (`01b62ad47`). Unoptimized test profile. ```powershell cargo test --locked -p xcl --lib --no-run --message-format=json & $exe --exact gpu::recomp::tests::gpu_image_atomics_32bit_int_and_glc --nocapture --test-threads=1 & $exe --exact gpu::recomp::tests::gpu_image_atomics_32bit_cas_and_float --nocapture --test-threads=1 ``` The two invocations used the pinned Cargo-emitted test executable and `XCL_ADAPTER=A770` under the lab's Arc mutex. **2 passed, 0 failed, 0 ignored, 0 explicit skips.** D3D12 reported 8–32 lanes per wave, so the stock fixtures ran native wave32 through HLSL/DXC. Each checked returned old values and final UAV texels across all 32 lanes. The contention cases checked final shared texels. Swap was the explicit `GLC=0` VDATA preservation check. **Not tested** Native or split wave64, direct DXIL, release, other adapters, the full workspace suite, retail smoke, and negative controls. **AI use** T3 Code / Codex (gpt-6.2-sol) ran the fixtures, checked their assertion scope, and drafted this report.
This pull request has changes conflicting with the target branch.
  • crates/xcl/src/gpu/recomp/tests.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1712/head:github-bot/gh-1712'
git switch 'github-bot/gh-1712'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1712'
git switch 'github-bot/gh-1712'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1712'
git switch 'github-bot/gh-1712'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1712'
git switch 'main'
git merge --squash 'github-bot/gh-1712'
git switch 'main'
git merge --ff-only 'github-bot/gh-1712'
git switch 'main'
git merge 'github-bot/gh-1712'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.