Tests: check MIMG gather4, image_load_mip, and image_get_lod on the GPU #1562

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

@⁠thiagocalile on GitHub · 2026-11-24 17:41 UTC · original
thiagocalile:tests-recomp-mimg-gather-mip-lod → main · +297 −0 · 1 files · 1 commits · open

Add GPU and translation-refusal tests for MIMG image_gather4 variants, image_load_mip, and image_get_lod. None of these had a GPU test; image_gather4_lz was only checked on the red channel.

What is in it

  • crates/xcl/src/gpu/recomp/tests.rs: mimg_gather_lod_and_mip_refusals checks the translator's refusals for a multi/zero-channel gather4 DMASK, image_get_lod outside PS, image_store_mip, cube image_load_mip, and cube image_gather4_lz_o
  • crates/xcl/src/gpu/recomp/tests.rs: gpu_image_gather4_channels_offsets_and_cmp covers image_gather4_lz on all 4 DMASK channels and with D16, image_gather4 border clamping, image_gather4_lz_o signed 6-bit offsets, image_gather4_c_lz / image_gather4_c_lz_o comparison gathers (on R32_FLOAT; D3D12 has no comparison gather on R32G32B32A32_FLOAT), and EXEC masking, as wave64 and wave32 programs
  • crates/xcl/src/gpu/recomp/tests.rs: gpu_ps_image_load_mip_and_get_lod covers image_load_mip on a 4-mip 2D texture (32-bit and A16 coordinates, mips 0..3, out-of-bounds texels and mip 4 reading 0, DMASK subsets) and image_get_lod in a pixel shader (clamped vs unclamped LOD when magnified and minified, MinLOD/MaxLOD, MipLODBias, DMASK 0x2)

Tested

  • Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, driver 32.0.21045.29003; XCL_ADAPTER=radeon, native wave64 + wave32), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (26200), Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.8.2502.11, debug build
  • XCL_ADAPTER=radeon cargo test -p xcl --lib mimg_gather_lod_and_mip_refusals: 1 passed, 0 failed
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_image_gather4_channels_offsets_and_cmp: 1 passed, 0 failed
  • XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_ps_image_load_mip_and_get_lod: 1 passed, 0 failed
  • XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4 on this branch (rebased on main 9e3831e): 776 passed, 3 failed, 41 ignored. The 3 failures are pre-existing on main on this RX 6600 (placed_title_textures_share_vram_and_preserve_pixels and 2 mutex-poison cascades; #1028 fixes them). 1 GPU test skipped inside the passing count: heap_window_out_of_memory_falls_back_to_the_switch_form (no heap windows)

Not tested

  • NVIDIA / Intel / WARP adapters, D3D12 debug layer, Linux / Wine.

AI use

  • Antigravity with Gemini 4 Neon wrote the tests and ran them on my RX 6600; Antigravity with Claude Opus 5.5 rebased the branch onto current main, re-ran the suite and drafted this description. I reviewed the diff and the test output.
**@⁠thiagocalile** on GitHub · 2026-11-24 17:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1562) `thiagocalile:tests-recomp-mimg-gather-mip-lod` → `main` · +297 −0 · 1 files · 1 commits · open Add GPU and translation-refusal tests for MIMG `image_gather4` variants, `image_load_mip`, and `image_get_lod`. None of these had a GPU test; `image_gather4_lz` was only checked on the red channel. **What is in it** - `crates/xcl/src/gpu/recomp/tests.rs`: `mimg_gather_lod_and_mip_refusals` checks the translator's refusals for a multi/zero-channel `gather4` DMASK, `image_get_lod` outside PS, `image_store_mip`, cube `image_load_mip`, and cube `image_gather4_lz_o` - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_image_gather4_channels_offsets_and_cmp` covers `image_gather4_lz` on all 4 `DMASK` channels and with `D16`, `image_gather4` border clamping, `image_gather4_lz_o` signed 6-bit offsets, `image_gather4_c_lz` / `image_gather4_c_lz_o` comparison gathers (on `R32_FLOAT`; D3D12 has no comparison gather on `R32G32B32A32_FLOAT`), and EXEC masking, as wave64 and wave32 programs - `crates/xcl/src/gpu/recomp/tests.rs`: `gpu_ps_image_load_mip_and_get_lod` covers `image_load_mip` on a 4-mip 2D texture (32-bit and `A16` coordinates, mips 0..3, out-of-bounds texels and mip 4 reading 0, `DMASK` subsets) and `image_get_lod` in a pixel shader (clamped vs unclamped LOD when magnified and minified, `MinLOD`/`MaxLOD`, `MipLODBias`, `DMASK` 0x2) **Tested** - Hardware: AMD Radeon RX 6600 (8146 MiB VRAM, driver 32.0.21045.29003; `XCL_ADAPTER=radeon`, native wave64 + wave32), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (26200), Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.8.2502.11, debug build - `XCL_ADAPTER=radeon cargo test -p xcl --lib mimg_gather_lod_and_mip_refusals`: 1 passed, 0 failed - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_image_gather4_channels_offsets_and_cmp`: 1 passed, 0 failed - `XCL_ADAPTER=radeon cargo test -p xcl --lib gpu_ps_image_load_mip_and_get_lod`: 1 passed, 0 failed - `XCL_ADAPTER=radeon cargo test --workspace --no-fail-fast -- --test-threads=4` on this branch (rebased on `main` `9e3831e`): 776 passed, 3 failed, 41 ignored. The 3 failures are pre-existing on `main` on this RX 6600 (`placed_title_textures_share_vram_and_preserve_pixels` and 2 mutex-poison cascades; #1028 fixes them). 1 GPU test skipped inside the passing count: `heap_window_out_of_memory_falls_back_to_the_switch_form` (`no heap windows`) **Not tested** - NVIDIA / Intel / WARP adapters, D3D12 debug layer, Linux / Wine. **AI use** - Antigravity with Gemini 4 Neon wrote the tests and ran them on my RX 6600; Antigravity with Claude Opus 5.5 rebased the branch onto current `main`, re-ran the suite and drafted this description. I reviewed the diff and the test output.
Add GPU and translation-refusal tests for MIMG image_gather4 variants,
image_load_mip, and image_get_lod in crates/xcl/src/gpu/recomp/tests.rs:

- mimg_gather_lod_and_mip_refusals: verifies explicit rejections for
  multi/zero-channel gather4 DMASK, image_get_lod outside PS,
  image_store_mip, cube image_load_mip, and cube image_gather4_lz_o.
- gpu_image_gather4_channels_offsets_and_cmp: tests image_gather4_lz
  across all 4 DMASK channels and D16 packing, image_gather4 border
  clamping, image_gather4_lz_o signed 6-bit offsets, image_gather4_c_lz
  and image_gather4_c_lz_o comparison gathers on R32_FLOAT, and EXEC
  masking across wave64 and wave32.
- gpu_ps_image_load_mip_and_get_lod: tests 4-mip 2D image_load_mip
  (32-bit and A16 coordinates, in-bounds mips 0..3, OOB texels and OOB
  mip 4 returning 0, DMASK subsets) and image_get_lod (clamped vs
  unclamped LOD under magnification/minification, MinLOD/MaxLOD,
  MipLODBias, and DMASK 0x2) in PS.

Measured on AMD Radeon RX 6600 (driver 32.0.21045.29003, DXC 1.8.2502.11,
Rust 1.100.0) on main 9e3831e: all 3 new tests pass; full workspace run
reports 776 passed, 3 failed (pre-existing main RX 6600 failures covered by
#1028), 41 ignored.

Assisted-by: Antigravity (Gemini 4 Neon, Claude Opus 5.5)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:57:35 +00:00
Author
Owner

@⁠coenflict on GitHub · 2026-11-24 17:56 UTC · original

Tested

  • Head 6995bcbb82f8ab2dff64ffc82d1e2cb01201bdf0, Windows 11 build 26340, Ryzen 7 9800X3D, RTX 5090 driver 32.0.16.2140, Rust 1.97.1 MSVC, DXC and DXIL 1.9.2602.17, debug build. Set XCL_ADAPTER=nvidia.
  • cargo test -p xcl --lib -- --nocapture mimg_gather_lod_and_mip_refusals gpu_image_gather4_channels_offsets_and_cmp gpu_ps_image_load_mip_and_get_lod reported 3 passed, 0 failed, 0 ignored, 0 skips. Both GPU tests executed.

Not tested

  • Whole workspace at this PR head, retail titles, and the D3D12 debug layer.

AI use

  • Codex (gpt-6.2-sol) ran the tests and wrote this report.
**@⁠coenflict** on GitHub · 2026-11-24 17:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/1562#issuecomment-7139933770) **Tested** - Head `6995bcbb82f8ab2dff64ffc82d1e2cb01201bdf0`, Windows 11 build 26340, Ryzen 7 9800X3D, RTX 5090 driver `32.0.16.2140`, Rust 1.97.1 MSVC, DXC and DXIL 1.9.2602.17, debug build. Set `XCL_ADAPTER=nvidia`. - `cargo test -p xcl --lib -- --nocapture mimg_gather_lod_and_mip_refusals gpu_image_gather4_channels_offsets_and_cmp gpu_ps_image_load_mip_and_get_lod` reported 3 passed, 0 failed, 0 ignored, 0 skips. Both GPU tests executed. **Not tested** - Whole workspace at this PR head, retail titles, and the D3D12 debug layer. **AI use** - Codex (`gpt-6.2-sol`) ran the tests and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-24 19:32 UTC · original

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

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 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 19:32 UTC · [original](https://github.com/xcl-dev/xcl/pull/1562#issuecomment-7142246674) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: all passed, 0 failed, ~22 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:41 UTC · original

Tested

Independent native Windows run at clean detached PR #1562 head 6995bcbb82f8ab2dff64ffc82d1e2cb01201bdf0. STOR-WINLAB, Windows 11 Enterprise Evaluation x64 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5. Unoptimized test profile, incremental compilation and debug info disabled.

cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json exited 0 outside the Arc mutex. Used XCL_ADAPTER=A770, XCL_DIRECT_DXIL=0 and XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64. Under the shared Invoke-ArcTest.ps1 lock:

$exe = 'L:/XclTooling/verify-pr1523-1362129-t3-cf2e05e7/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe'
& $exe --exact gpu::recomp::tests::gpu_image_gather4_channels_offsets_and_cmp --nocapture --test-threads=1
& $exe --exact gpu::recomp::tests::gpu_ps_image_load_mip_and_get_lod --nocapture --test-threads=1

2 passed, 0 failed, 0 ignored, 0 GPU skips. Each exact invocation filtered out 750 other tests and exited 0 (0.54 s and 0.53 s). The mutex wrapper exited 0. The executable digest matched before waiting, after lock acquisition, and after both fixtures.

The HLSL/DXC gather fixture checked wave32 channel selection, D16, signed offsets, comparison gather, and EXEC masking. The pixel fixture checked 2D mip loads (including A16 coordinates and out-of-bounds results) and clamped/unclamped LOD readback. On the A770 the stock gather loop omits native wave64.

Not tested

Native wave64 or split-wave64 gather, standalone translation-refusal fixture, direct DXIL, other GPUs, the full workspace suite, and title smoke runs.

AI use

T3 Code / Codex (gpt-6.2-sol) verified the revision, ran the checked-in tests, and wrote this report.

**@⁠JJAutoCompare** on GitHub · 2026-11-25 07:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/1562#issuecomment-7156138241) **Tested** Independent native Windows run at clean detached PR #1562 head `6995bcbb82f8ab2dff64ffc82d1e2cb01201bdf0`. STOR-WINLAB, Windows 11 Enterprise Evaluation x64 26200.9974, Ryzen 7 3800X, Intel Arc A770 driver 32.0.101.9175, Rust/Cargo 1.100.0 x86_64-pc-windows-msvc, DXC/DXIL 1.9.2609.5. Unoptimized test profile, incremental compilation and debug info disabled. `cargo test --locked -p xcl --lib --no-run -j 2 --message-format=json` exited 0 outside the Arc mutex. Used `XCL_ADAPTER=A770`, `XCL_DIRECT_DXIL=0` and `XCL_DXC_DIR=%LOCALAPPDATA%/XclTooling/dxc-1.9.2609/bin/x64`. Under the shared `Invoke-ArcTest.ps1` lock: ```powershell $exe = 'L:/XclTooling/verify-pr1523-1362129-t3-cf2e05e7/target/debug/build/xcl/77aca8ccb20e299f/out/xcl-77aca8ccb20e299f.exe' & $exe --exact gpu::recomp::tests::gpu_image_gather4_channels_offsets_and_cmp --nocapture --test-threads=1 & $exe --exact gpu::recomp::tests::gpu_ps_image_load_mip_and_get_lod --nocapture --test-threads=1 ``` **2 passed, 0 failed, 0 ignored, 0 GPU skips**. Each exact invocation filtered out 750 other tests and exited 0 (0.54 s and 0.53 s). The mutex wrapper exited 0. The executable digest matched before waiting, after lock acquisition, and after both fixtures. The HLSL/DXC gather fixture checked wave32 channel selection, D16, signed offsets, comparison gather, and EXEC masking. The pixel fixture checked 2D mip loads (including A16 coordinates and out-of-bounds results) and clamped/unclamped LOD readback. On the A770 the stock gather loop omits native wave64. **Not tested** Native wave64 or split-wave64 gather, standalone translation-refusal fixture, direct DXIL, other GPUs, the full workspace suite, and title smoke runs. **AI use** T3 Code / Codex (gpt-6.2-sol) verified the revision, ran the checked-in tests, and wrote 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/1562/head:github-bot/gh-1562'
git switch 'github-bot/gh-1562'

Merge

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