Skip to content

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

Open
thiagocalile wants to merge 1 commit into
xcl-dev:mainfrom
thiagocalile:tests-recomp-mimg-gather-mip-lod
Open

thiagocalile wants to merge 1 commit into
xcl-dev:mainfrom
thiagocalile:tests-recomp-mimg-gather-mip-lod

Conversation

@thiagocalile

Copy link
Copy Markdown

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; D3D12.X: map and unmap 3D texture mips separately #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
xcl-dev#1028), 41 ignored.

Assisted-by: Antigravity (Gemini 4 Neon, Claude Opus 5.5)
@coenflict

Copy link
Copy Markdown

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.

@DavidM1911

Copy link
Copy Markdown
Contributor

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!

@JJAutoCompare

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

@github-actions github-actions Bot added the stale No activity for 3 days; closed 4 days later unless something happens label Nov 28, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Triage (#1607) – head 6995bcb

No open PR adds the same tests. #1861 tests image_get_lod only through static samplers, #1812 / #3240 change gather4 code, and #1712 covers image_atomic_*.
The refusal strings asserted in mimg_gather_lod_and_mip_refusals all exist in main's emit.rs. The gather footprints (D3D order (x0,y1) (x1,y1) (x1,y0) (x0,y0)), the offset / border clamping and the LESS comparisons are correct for the 4x4 textures used. No problems found in the diff.
The branch conflicts with main (tests.rs tail) and needs a rebase.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants