Skip to content

vk_bindless_test: ps_imgatomic no longer runs (and ignores) the ps_tex mirror and 3D T# checks - #2211

Draft
Tauwni wants to merge 3 commits into
ProjectLeonida:mainfrom
Tauwni:fix/bindless-atomic-skips-tex-checks
Draft

Tauwni wants to merge 3 commits into
ProjectLeonida:mainfrom
Tauwni:fix/bindless-atomic-skips-tex-checks

Conversation

@Tauwni

@Tauwni Tauwni commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

vk_bindless_test runs two shaders: ps_tex and ps_imgatomic. Commit 9f98dcc added two blocks of checks before the if (atomic_mode) block: the mirror/alias draws and the "a 3D T# read by a 2D op" draw. Those checks are written for ps_tex, since they expect its texels (orange, zeros) in the render target.

With ps_imgatomic they still run, using the atomic shader. Every compare() misses, because that target holds 1.0 or the 0.25 clear. The mismatches go to stderr, and the atomic path's return wrong || bad_rt ? 1 : 0; never looks at mismatches. run_gpu_tests.py then shows the first stderr line as the PASS detail. Seen on main a73a57e13 (Apple M3, MoltenVK 1.4.2):

PASS  ps_imgatomic          mirror: a 2D-array T# read by a 2D op pixel (5, 0): got 0.25 0.25 0.25 0.25, want 1 0.501961 0 1

The change:

  • The two blocks run only when !atomic_mode. ps_tex still runs them unchanged.
  • The atomic return also counts mismatches, so a ps_tex check misplaced ahead of it in the future fails instead of passing quietly.

After the change, on an Apple M3 (macOS 26.5.1), through scripts/run_gpu_tests.py --filter ps_tex / --filter ps_imgatomic:

Driver ps_tex ps_imgatomic
MoltenVK 1.4.2 PASS, 15 draws, 0 bad pixels PASS, 0 of 256 texels, 0 of 4096 RT pixels wrong
KosmicKrisp (Mesa 26.3.1) PASS, 38 draws, 0 bad pixels PASS, same
llvmpipe (Mesa 26.3.1) PASS, 38 draws, 0 bad pixels PASS, same

These were not run under the validation layer: on a Mac it needs the loader portability opt-in from #2178. The change is test-only and adds no Vulkan call.

AI-assisted (Claude Code). No game data.

🤖 Generated with Claude Code

Red checks: from main, not this change

The failing jobs (check, macos-python, stdlib-tests-linux, linux-gpu-tools, macos, windows) fail the same way on main d48a957bb (MEASURED on macOS for the Python tests, 1 run, with the same assertion text; GPU tests READ from this PR's CI logs). The open pull requests that fix them:

Failing on main Fixed by
test_docs_cli_flags #2536
test_make_game_preflight, test_progress_dashboard (repository URL) #2550
test_docs_repo_paths #2552 (all 14 paths; it conflicts with main, a merge is on Tauwni:fix/2552-merge-main, correction)
test_tool_stdout_encoding #2531, plus two scripts on Tauwni:fix/stdout-replace-two-new-scripts (no PR, open PR limit)
test_windows_boot_journal_seed #2514
test_docs_python_deps passes with the fixes above merged
test_build_runtime_fallback #2573 (passes with it, macOS, 1 run)
vk_bindless_dimensions (macOS) #2441
test_docs_env_vars DOC-CLWB-SETTING (fix)
test_make_game_pipelines, test_sampler_source_census, test_spirv_metal_set0_cli_errors, test_spirv_metal_set0_extra, tests/semantic/test_valu_cvt_f16_int16_mods.py, ps_exp_f32_denorm_rt (macOS) branches on Tauwni/leonida, no PR (finding)
cs_imgatomic_ext (macOS, linux-gpu-tools) #1518, closed without a comment
vk_xdxr_postbuild_readback (Windows) already passes on main: merge main

Not checked by a second agent or human yet.

…s, and fails on a compare mismatch

9f98dcc put the mirror/alias and 3D-T#-read-by-a-2D-op checks before the
atomic_mode block, so ps_imgatomic drew them with its own shader: every
compare() missed (the target holds 1.0/0.25, not orange or zeros), the
mismatches went to stderr, and the atomic return ignored them. The runner
showed the first mismatch line as a PASS detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@real-rusher

Copy link
Copy Markdown
Contributor

Verified on main a73a57e with Mesa llvmpipe (Mesa 25.2.8, LLVM 20.1.2, 256 bits, Ubuntu 24.04 x86-64, no GPU), GCC 13, Ninja, llvm-mc 21.1.8. Merges cleanly.

  • main: run_gpu_tests.py --filter ps_imgatomic reports PASS, with a mismatch as its detail: "mirror: a 2D-array T# read by a 2D op pixel (5, 0): got 0.25 0.25 0.25 0.25, want 1 0.501961 0 1". This is the false pass the PR describes.
  • With this PR: ps_imgatomic PASS, "0 of 256 texels wrong (2D umax/umin/or 8x8 each, 3D umax 4x4x4); 0 of 4096 render-target pixels wrong (odd columns discarded)".
  • ps_tex is unchanged on both: PASS, 38 draws read back, 0 bad pixels.

AI-assisted: yes (Claude Code)

@lorentsob

Copy link
Copy Markdown

Verified on Apple M5 Max (MoltenVK 1.4.2, macOS 27.2.1)

  • Base: PR head a5f55f1e5 with current main dd87aa405 merged in (clean merge, as the maintainer guide does).
  • main: ps_imgatomic reports PASS but prints mirror: a 2D-array T# read by a 2D op pixel (5, 0): got 0.25 0.25 0.25 0.25, want 1 0.501961 0 1: the ps_tex mirror check runs against the atomics target and its mismatch is ignored.
  • Counter-check: main with only this PR's new return line (|| mismatches) turns that into FAIL ps_imgatomic exit 1, so the counting would have caught it.
  • PR: ps_imgatomic PASS 3 of 3, 0 of 256 texels wrong ... 0 of 4096 render-target pixels wrong, no stray check output. ps_tex (which keeps the mirror and 3D T# checks) PASS 3 of 3, 15 draws read back, 0 bad pixels.
  • Full ctest: 132/132, same as main.

AI-assisted: yes.

@fiestorra

Copy link
Copy Markdown
Contributor

Verified on this machine (Windows 11, RTX 4090), and my first pass at this pull request was a false alarm - the test needs two SPIR-V arguments, which my triage loop did not pass.

1. It applies. merge-tree clean; 04a9f3a59 cherry-picks onto main 0ae217ceb without a conflict. One file, 4 insertions(+), 3 deletions(-) in runtime/test/vk_bindless_test.cpp.

2. Run the way ctest runs it, it passes:

vk_bindless_test generated\bindless_shaders\spirv\vs_ids.spv …\ps_tex.spv
  -> exit 0, "bindless: 38 draws read back, 0 bad pixels, largest error 0"

vk_bindless_test …\vs_ids.spv …\ps_imgatomic.spv
  -> exit 0

Run with no arguments it exits 2 and prints usage: - which is what my loop recorded as a failure. The difference is the harness, not the pull request, and I have corrected the loop to treat exit 2 + usage as "needs arguments".

3. On main, the ps_imgatomic mode also passes:

ps_imgatomic: 0 of 256 texels wrong (2D umax/umin/or 8x8 each, 3D umax 4x4x4); 0 of 4096 render-target pixels

so there is no negative control here: the change is a guard, not a fix - it skips the ps_tex mirror and 3D T# comparisons when the atomic shader cannot satisfy them, which removes spurious failures rather than making a real one pass.

What that means for a reviewer: the change makes the test stop reporting failures it should not report for the atomic shader. On this driver those comparisons were already passing (0 of 4096), so the guard is invisible here; it would matter on a driver or shader path where the mirror compare does not hold. The ps_tex mode still passes with the guard in place, which is the part that could have broken - it does not.

Written with an AI assistant.

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.

4 participants