Skip to content

test: GPU readback for explicit-LOD array and cube gathers - #7370

Open
frnandoooo wants to merge 2 commits into
ItsNotRexed:mainfrom
frnandoooo:test/gather-explicit-lod-dims
Open

frnandoooo wants to merge 2 commits into
ItsNotRexed:mainfrom
frnandoooo:test/gather-explicit-lod-dims

Conversation

@frnandoooo

@frnandoooo frnandoooo commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explicit-LOD array/cube gather paths added by #7097 have translation/validation tests, but the cited GPU gather fixtures exercise 2D images. This adds an opt-in readback test for the new paths using synthetic instruction listings and the existing texture harness.

Depends on: #7097. Rebased onto main f3a7b0f; the dependency patch from fb32681 is carried as 0de6b69, followed by our test commit 993adf5.
This branch is stacked on #7097. The new test-only contribution is commit 993adf5 (four files); until #7097 lands, GitHub also shows its translator/decoder changes in the combined diff. Please merge #7097 first.

Coordination: TEST-GATHER-EXPLICIT-LOD-DIMS, #7231 (comment).

The 192-case matrix covers layer rounding/clamping, faces 0/5 in two cubes, mip 0/1, explicit offsets, f32/a16 addresses and RGB components. Every draw checks all four taps at all 4,096 pixels. An opt-in harness flag supplies two array mips with distinct patterns; existing modes remain unchanged. The runner uses the repository's Python assembler and can optionally invoke spirv-val. It tests the translator's documented contract, not native Xbox equivalence, binary decoding, d16 conversion or cube seams. Related #6264 covers LZ/d16 forms; this does not change its implementation.

Tested on Windows build 26300, MSVC 19.44, NVIDIA RTX 5060 (621.01):

  • Full GPU matrix: 192/192 draws, 786,432 pixels passed.
  • Existing 2D harness mode: 4,096 pixels passed. Existing cube-alpha self-test passed.
  • Negative controls: a changed expected value fails; a no-output fragment shader is rejected even when expected pixels are zero (readback remains the -1 clear).
  • Pre-rdna2spirv: support 2D_ARRAY and CUBE for image_gather4_l[_o] (+ a16/d16) #7097 translator at 1cc6e3c rejects the first case with Unsupported: image_gather4_l form.
  • Eight checker tests passed (known mip/layer values, short/long data, NaN/infinity, last-pixel mismatch, no-draw clear).
  • Diff whitespace and game-data checks passed. After rebasing, documentation checks reproduce the clean main f3a7b0f failures: docs links (1 failed test: missing dev-tools anchor and RX9070GRE result file), CLI docs (2 failed tests: stale flags in unrelated documentation). No new documentation failures identified.

Not run: standalone spirv-val or Khronos validation layers (not installed). Successful GPU execution is not presented as SPIR-V-validation coverage. No shader decoder validation is claimed because the input is a hand-written instruction listing.

AI-assisted: Codex implementation and tests; Claude reviewed the synthetic code. Its no-draw concern was checked against the existing -1 clear and verified with an actual no-output GPU negative control. No game files used or included.

@thehollowedone

Copy link
Copy Markdown

Independent native Windows check of 6d7ece16 on the published #7097 stack. RTX 3080 Ti, NVIDIA 621.35, MSVC 19.44, CPython 3.12.8, Vulkan SDK 1.4.363.0.

The stock check_gather_dims.py matrix passed all 192 draws, split evenly between arrays and cubes. All four taps matched at every pixel across 786,432 pixels. All 193 shader modules passed spirv-val --target-env vulkan1.2. Khronos core and synchronization validation were active for all draws and reported zero diagnostics.

AI-assisted.

@umnitus

umnitus commented Nov 23, 2026

Copy link
Copy Markdown

Independent Windows GPU check at 6d7ece1 on RTX 3060 12 GB / NVIDIA 621.14, same-head vk_texture_test built with clang-cl/xwin. check_gather_dims.py with spirv-val passed all 192 draws and 786,432 pixels. The checker unit tests passed 8/8. This was SPIR-V validation coverage. AI-assisted testing.

@Poussistar

Copy link
Copy Markdown

This does not apply to main (53bc463): the hunk in runtime/test/vk_texture_test.cpp:107 is rejected.

git worktree add --detach /tmp/check origin/main
git apply /pull/7370.diff
error: patch failed: runtime/test/vk_texture_test.cpp:107
error: runtime/test/vk_texture_test.cpp: patch does not apply

A rebase is enough to get it back into the queue. Linux, 4 cores, Python 3.14.7, no game files.

@bunbeans2-arch

Copy link
Copy Markdown

AMD Windows run of 6d7ece16 (on #7097 fb32681d): AMD Radeon RX 9070 XT (RDNA4, gfx1201), AMD driver
32.0.32015.7029, Windows 11 Pro 22631. Test programs built at this head.

  • tests/test_gather_dims_checker.py: 8 tests, OK.
  • scripts/check_gather_dims.py --spirv-val: PASS, 192/192 draws, 786,432 pixels (full matrix), every module
    validated. So the array and cube gathers match the CPU oracle on all four taps under AMD's driver too, including
    the a16 forms, both cube slices and explicit LOD 1.
  • Positive control: a local copy of the checker whose oracle drops mip 1's +7 failed on the first mip-1 case
    (('2D_ARRAY', -1, 1, False, False, 0): read 39/255 where the planted value was 32/255), so the driver returned
    mip 1's texels and the LOD is not being ignored.

This adds the first RDNA4 / AMD Windows result to the NVIDIA runs above. No wave-size claim (vk_texture_test has no
subgroup setting). AI-assisted (Claude Code). Synthetic shaders only, no game files.

@frnandoooo
frnandoooo force-pushed the test/gather-explicit-lod-dims branch from 6d7ece1 to 993adf5 Compare November 23, 2026 17:13
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