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

Closed
leonida/mandy
Tauwni wants to merge 0 commits from fix/bindless-atomic-skips-tex-checks into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Tauwni commented 2026-11-26 06:19:58 +00:00

vk_bindless_test runs two shaders: ps_tex and ps_imgatomic. Commit 9f98dcc61 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.

`vk_bindless_test` runs two shaders: `ps_tex` and `ps_imgatomic`. Commit 9f98dcc61 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): ```text 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](https://claude.com/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](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239890652)) | | `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](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7238921436)) | | `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](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7239812627)) | | `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.
real-rusher commented 2026-11-26 10:06:43 +00:00

Verified on main a73a57e1 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)

Verified on main a73a57e1 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 commented 2026-11-29 19:20:28 +00:00

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.

**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 commented 2026-11-30 06:21:58 +00:00

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.

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.
aslan2142 commented 2026-12-01 12:26:09 +00:00

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:43:03 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.