Skip to content

GPU tests: vk_bindless_test and vk_image_fuzz skip below 144 push constant bytes (TEST-149) - #1113

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:test-149-push-constants
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
etcetera-yt:test-149-push-constants

Conversation

@etcetera-yt

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: TEST-149 (claim). Found by @ItsJaved.

What and why

vk_bindless_test (the ps_tex GPU test) and vk_image_fuzz (the harness behind tools/image_fuzz.py) both create a pipeline layout with a 144-byte push constant range, the translated user-data block. Neither checked maxPushConstantsSize. On a 128-byte device (Intel Arc, some AMD drivers) they hit validation errors and reported a failure, even though every pixel was exact. vk_texture_test has skipped in this case since 0c84bff.

  • runtime/test/vk_bindless_test.cpp, runtime/test/vk_image_fuzz.cpp: right after the device: line, a device below push_bytes = 144 prints unsupported: need 144 push constant bytes, device has N and exits 77 (the harnesses' existing unsupported code) before anything is created. The pipeline layout's range now uses the same constant.
  • tools/image_fuzz.py: it already treated 77 as a skip, but always printed "the device does not support the set". It now quotes the harness's unsupported: line and falls back to the old text when there isn't one. The failure path is unchanged.
  • scripts/run_gpu_tests.py needed no change: its ps_tex branch already reports 77 as SKIP (<unsupported line>).
  • Tests (CPU only):
    • tests/test_run_gpu_tests.py BindlessTestOnASmallPushConstantDevice: ps_tex with a fake run_cmd that answers 77 gives that SKIP reason and 0/1 passed, 1 skipped; exit 1 is still a failure.
    • tests/test_image_fuzz.py: run_case with a stubbed harness covers 77 with a reason line, 77 without one, and a non-77 error, which stays a FAIL.

What's left: nothing for TEST-149. I have no 128-byte device, so the real-hardware run is still open (see below).

Tested

NVIDIA GeForce RTX 5060 Ti, driver 621.14, Windows 10 19045, VS 2022 BuildTools (MSVC), Vulkan SDK 1.4.363.0, Python 3.14; pytest 9.2.0 (as pinned in tests/requirements.txt) for test_image_fuzz.py.

cmake -S runtime -B <build>
cmake --build <build> --config RelWithDebInfo
ctest --test-dir <build> -C RelWithDebInfo
LEONIDA_VK_VALIDATION=1 ctest --test-dir <build> -C RelWithDebInfo
python -I tests/test_run_gpu_tests.py
python -m pytest tests/test_image_fuzz.py -q
python -I tools/image_fuzz.py --self-test
baseline main c63773d (fresh worktree) this branch (clean build)
MSVC warnings 0 0
ctest 54/54 pass (gameinput disabled: no SDL3) 54/54 pass
ctest, LEONIDA_VK_VALIDATION=1 54/54 pass 54/54 pass
test_run_gpu_tests.py OK OK (+2 tests)
test_image_fuzz.py 35 passed 38 passed
  • Negative controls:
    • With tools/image_fuzz.py reverted, test_unsupported_device_skips_with_the_harness_reason fails.
    • With run_gpu_tests.py's ps_tex check changed from rc == 77 to rc == 78, BindlessTestOnASmallPushConstantDevice fails.
    • Both pass again once restored.
  • On the GPU, with the limit faked: this card has 256 bytes. With a local, uncommitted edit that made each harness require push_bytes * 2 (288), both printed unsupported: need 144 push constant bytes, device has 256 and exited 77, with and without LEONIDA_VK_VALIDATION=1. With the real code, both go past the check on this card. The message prints push_bytes, so the faked run still shows 144.

Not tested:

  • A real 128-byte device: none here. A run of ps_tex and image_fuzz.py on Intel Arc or an affected AMD driver would close that.
  • Full ps_tex and image_fuzz.py runs on this GPU: there's no llvm-mc on this machine to assemble the shaders. The device check comes before the harnesses read their SPIR-V, which is why the faked-limit run above reaches it.
  • Linux and Wine.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (Not applicable: no translator change.)

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@kapitche

Copy link
Copy Markdown
Contributor

Tested c549b45 on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): no regression. Neither GPU here can exercise the new skip, though: both report maxPushConstantsSize = 256.

  • ctest: 54/54 on the RTX 4080 SUPER. On the Intel UHD 770, 52/54, where the two failures (d3d12_vulkan_device d3d12_vulkan_device_test: compare OPTIONS1 with the same GPU's host device, not the default adapter #962 and d3d12_descriptor's min-LOD case) also fail on main.
  • run_gpu_tests.py --filter ps_tex (vk_bindless_test):
    • NVIDIA: ps_tex 14 draws, 0 bad pixels.
    • Intel: ps_tex 7 draws, 0 bad pixels. The other ps_tex* cases are unchanged.
  • image_fuzz.py --programs 20: NVIDIA 20/20 match. Intel skips all 20 for shaderStorageImageReadWithoutFormat, as on main.

So the change is neutral on 256-byte devices. The below-144 path still needs someone with a 128-byte device.

@etcetera-yt

Copy link
Copy Markdown
Contributor Author

Thanks @kapitche. Good to see ps_tex and image_fuzz.py unchanged on both of your 256-byte GPUs, including the Intel one. As you say, the below-144 path still needs a 128-byte device.

About the red check job: it fails in tests/test_carve_all_paths.py (the trailing-separator game path case on the Windows runner). That test isn't touched here. Main fails it the same way at c63773d (run 44996147687), and @NathansDomainSolutions has claimed the fix in #1006. It passes locally on this Windows 10 machine. AI-assisted (Claude Code).

@quackottu quackottu 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.

Tested c549b45 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass

  • Build ok. ctest: 100% tests passed, 0 tests failed out of 54 (gameinput disabled, no SDL3).
  • vk_bindless_test and vk_image_fuzz run (the RTX 5070 has more than 144 push-constant bytes, so the new skip path isn't taken here). tests/test_image_fuzz.py + tests/test_run_gpu_tests.py: 64 passed.
  • 49 test programs exit 0 with 0 validation messages.
  • Same on main, not from this PR: d3d12_clear_test (NVIDIA 0.5 tie rounding, #521), vk_binary_occlusion_test (needs an input file), and VUID-vkCreateDevice-ppEnabledExtensionNames-01387 from the standalone device in d3d12_fence_timing_test/d3d12_vulkan_device_test (#1027).

@etcetera-yt

Copy link
Copy Markdown
Contributor Author

Thanks @quackottu. With your RTX 5070 that's three 256-byte GPUs with no regression. The 128-byte path still needs someone with such a device. AI-assisted (Claude Code).

…stant bytes (TEST-149)

Both harnesses create a pipeline layout with the 144-byte translated
user-data block and never checked maxPushConstantsSize, so on a
128-byte device (Intel Arc, some AMD drivers) they failed validation
instead of skipping, although every pixel was exact. Each now prints
"unsupported: need 144 push constant bytes, device has N" and exits
77 before creating anything, as vk_texture_test does since 0c84bff;
the range uses the same constant.

run_gpu_tests.py already reported ps_tex's 77 as SKIP; image_fuzz.py
skipped it with a fixed message and now quotes the harness's
unsupported line. CPU tests cover both runners' 77 path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@etcetera-yt
etcetera-yt force-pushed the test-149-push-constants branch from c549b45 to 71eea4a Compare November 22, 2026 07:56
@etcetera-yt

Copy link
Copy Markdown
Contributor Author

Rebased onto main d3841c0 (head 71eea4a). #1087's integer image loads added a format-feature check at the same spot in vk_image_fuzz.cpp. Both checks are kept: the format check runs first, then the push-constant one. The diff is unchanged otherwise (5 files, +90/-11).

Re-tested, NVIDIA GeForce RTX 5060 Ti, driver 621.14, Windows 10 19045:

  • Clean builds of d3841c0 and of this branch: 0 warnings each. ctest 56/56 on both, and 56/56 with LEONIDA_VK_VALIDATION=1.
  • tests/test_run_gpu_tests.py OK on both. tests/test_image_fuzz.py: 37 passed on main, 40 here. image_fuzz.py --self-test OK (6 formats).
  • With the limit faked locally again (uncommitted), the rebased vk_image_fuzz prints unsupported: need 144 push constant bytes, device has 256 and exits 77, with and without validation. With the real code it gets past the check.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit 452af90 into ItsNotRexed:main Nov 22, 2026
10 of 11 checks passed
ItsNotRexed pushed a commit that referenced this pull request Nov 22, 2026
…han it pushes

vk_harness declared a 144-byte push-constant range (152 with
--mesh-compute) without checking maxPushConstantsSize. On a device with
128 bytes, the Vulkan minimum, that is invalid
(VUID-VkPushConstantRange-size-00298), and on an AMD Radeon 610M on
AMD's Windows driver ms_clip crashed (0xC0000005) and ms_w64x_ballot
under LEONIDA_W64_EMULATE=1 hung until the runner's timeout.

It now checks the limit once, right after it knows whether it runs a
--mesh-compute module, and exits 77 with "unsupported: need N push
constant bytes, device has M", as vk_texture_test (#862) and
vk_bindless_test/vk_image_fuzz (#1113) already do. The range and the
pushes use the same pc_bytes.
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