Skip to content

GPU test: cs_imgload_mip_3d, the 3D explicit-mip loads row on Intel(R) UHD Graphics 630 - #5292

Open
gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-3d-explicit-mip-loads
Open

gertify wants to merge 1 commit into
ItsNotRexed:mainfrom
gertify:fix-contract-3d-explicit-mip-loads

Conversation

@gertify

@gertify gertify commented Nov 23, 2026

Copy link
Copy Markdown

The 3D explicit-mip loads row of the translator contract table had no GPU check: the translated form of image_load_mip on a 3D image was only checked on the CPU, plus native gfx1036 measurements at mip zero.

This adds runtime/test/shaders/cs_imgload_mip_3d.asm, a hand-written compute fixture in the shape of the other vk_store_test image fixtures, and the 3D sampled images it needs at binding 6: a 4x4x4 image with three levels, bound once per numeric class (rgba8 unorm, r32 uint, r32 sint) and filled so every fetched word names the level and the texel it came from. The fixture loads at mip 0, 1 and 2 through all three T# FORMAT classes and through the d16 forms, and stores each result into its own texel of the 2D sint image, where check.py compares all 64 words of the three images.

It passes on Intel(R) UHD Graphics 630 (CFL GT2), Mesa 25.2.8, and the row records that check. AI-assisted.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

AI-assisted. The new 3D mip fixture passes on the RTX 4090 and AMD Radeon iGPU on Windows 11 at df3423c. The checker matches all 64 words in each of the three images. All 79 tests in tests/test_shader_checks.py pass.

The existing cs_imgstore case now allocates and maps nine upload buffers that it never submits. I measured the following Vulkan calls on the RTX 4090 with the same cs_imgstore.spv on both revisions:

Revision vkAllocateMemory vkCreateBuffer vkMapMemory vkCmdCopyBufferToImage
3faac55 9 4 4 0
df3423c 21 13 13 0

To reproduce, build vk_store_test on both revisions. Generate the fixture with py -3.14 -I runtime/test/shaders/build.py <output> cs_imgstore. Set VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_api_dump. Run each vk_store_test.exe <output>/spirv/cs_imgstore.spv without a mode argument. Both runs report zero bad texels.

The nine buffers are the three mip uploads for each of the three images. Only words mode records the upload commands. Move the staging-buffer creation and fill loop inside a words_mode check so other modes avoid all nine allocations and mappings.

@CharlyRien

Copy link
Copy Markdown

Tested df3423c (merged on main 3faac55) on RTX 3090 (NVIDIA 616.56, Windows 11 23H2): pass. AI-assisted.

  • run_gpu_tests: PASS cs_imgload_mip_3d: all 64 words of the uint image, the sint image and the volume exact. 171/218 passed, 47 skipped; the only difference from main is this new case.
  • Full ctest: same results as main on this host.

@Kev-Ball

Copy link
Copy Markdown

Checked that the fixture detects a lost depth coordinate on CachyOS, RTX 3080 Ti, NVIDIA 620.73.04. At df3423c2, run_gpu_tests.py --filter cs_imgload_mip_3d --require-pass passed all three 64-word comparisons.

For a negative control I kept the exact same translated SPIR-V and changed only the test harness’s integer volume fill: I omitted the 16 * z term while preserving the mip, x and y terms. The runner exited 1 with five incorrect words in the sint readback. The first was 0x09 instead of 0x39, the missing contribution from slice 3. This checks depth sensitivity independently of mip selection.

AI-assisted. Synthetic fixture.

@Dom-in

Dom-in commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Tested df3423c on AMD Radeon RX 9070 (RDNA4), AMD driver 26.11.2, Windows 11 Pro 26300, with vk_store_test rebuilt from this PR (MSVC Release): pass.

  • run_gpu_tests.py --filter cs_imgload: 3/3, natively and with LEONIDA_W64_EMULATE=1.
  • cs_imgload_mip_3d: "all 64 words of the uint image, the sint image and the volume exact".
  • With an older vk_store_test of mine, built before this PR, the new case failed. I did not separately rebuild main's harness to confirm that this PR's harness change is what's required.

Correction to my notes on #5295, #5299, #5225 and #4280: the four main failures there (cs_bvh, cs_bvh32, ps_sample_c, ps_sample_c_b) came from my stale tool build. With tools freshly built from main 3faac55, the suite passes 202/217 with 15 skipped and none failing.

AI-assisted (Claude Code).

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head df3423c2e on 3faac55. Windows 11, MSVC 19.44.35228, Vulkan 1.4.363, RTX 5070 Ti.

  • Built vk_store_test vk_compute_test vk_harness in build-review-5292.
  • $env:LLVM_MC='wsl -d Ubuntu -e /usr/lib/llvm-21/bin/llvm-mc'; $env:LEONIDA_VK_DEVICE='RTX 5070 Ti'; python -I scripts/run_gpu_tests.py --build C:\Users\kam\AppData\Local\Temp\opencode\build-review-5292 --filter cs_imgload_mip_3d -> 1/1 PASS, "all 64 words of the uint image, the sint image and the volume exact".
  • Neighbours, to check the new binding-6 descriptor: cs_imgatomic + cs_imgatomic3d 2/2, cs_resinfo 1/1, cs_imgstore 1/1, all PASS.
  • Intel(R) UHD Graphics 630 / Mesa 25.2.8 claim is unverified here: only an RTX 5070 Ti is available.
  • git diff --check origin/main...HEAD clean.

Doc nit: the "Typed image loads" row still ends "The translated d16 loads on 1D, 2D-array and 3D images still lack GPU checks". If that sentence includes image_load_mip, it is now stale for 3D; please narrow it or say it means non-mip loads. Approve.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants