Skip to content

TEST-468/469: GPU test tools request shaderInt64 only when a module declares Int64; vk_bindless_test honours LEONIDA_VK_DEVICE - #2647

Open
sovljanskii wants to merge 3 commits into
ItsNotRexed:mainfrom
sovljanskii:gpu-tools-int64-device
Open

sovljanskii wants to merge 3 commits into
ItsNotRexed:mainfrom
sovljanskii:gpu-tools-int64-device

Conversation

@sovljanskii

@sovljanskii sovljanskii commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

TEST-468 and TEST-469 (claim), from @richardsenra's finding. Works on main alone. With #2463 (SHADER-423) it lets the Int64-free modules run on devices without shaderInt64.

What

TEST-468: request shaderInt64 only for modules that declare it.

  • vk_compute_test and vk_texture_test asked for the feature unconditionally.
  • vk_store_test, vk_harness (with VKH_HEAP / VKH_MESH_COMPUTE) and vk_bindless_test exited 77 without it before running anything.
  • All five now read the modules' leading OpCapability run before creating the device.
    • They enable shaderInt64 only when a stage declares Int64 or Int64Atomics (which implicitly declares it).
    • They exit 77 with the reason when that stage meets a device without the feature.
  • The scan is a new header, runtime/test/spirv_capability.h. vk_texture_test's MinLod check moved onto it.
  • spirv_capability_test (ctest spirv_capability, CPU only) checks it with hand-built word lists:
    • address pairs alone need nothing;
    • Int64 and Int64Atomics need the feature;
    • a capability-looking word after OpMemoryModel is ignored;
    • empty or truncated modules declare nothing;
    • the byte form handles a trailing partial word.

TEST-469: device selection and unsupported reporting.

  • vk_bindless_test ranked every Vulkan 1.2 device and ignored LEONIDA_VK_DEVICE. It now chooses through pick_device, as the other tools do, and a filter that matches nothing exits 1 with report_no_device's message (the approach from Tests: shaderInt64 only for modules that declare Int64; LEONIDA_VK_DEVICE in vk_bindless_test #2657).
  • run_gpu_tests.py reported vk_store_test's 77 for cs_imgstore, cs_imgload and cs_imgload_d16 as FAIL, with the last output line. It now reports SKIP and quotes the unsupported: line (helper_result). tests/test_run_gpu_tests.py gets two cases: the 77 is a SKIP with its reason for all three shaders, and other exit codes still fail.

docs/testing.md (GPUs without mesh shaders) now says the device needs shaderInt64 only for a module that declares Int64, and how the tools decide.

Tested

On an Apple M4 (MoltenVK 1.4.2, macOS, one GPU, with shaderInt64), Ninja RelWithDebInfo build, no warnings:

Run Passed Skipped Failed
run_gpu_tests.py, tools from main 4947579 113/185 71 1
run_gpu_tests.py, this branch 113/185 71 1
run_gpu_tests.py, this branch merged with #2463 113/185 71 1

Not tested here:

  • a device without shaderInt64, which is the point of TEST-468;
  • a machine with two GPUs, which TEST-469's selector needs.

@richardsenra's Intel UHD + RTX 3050 laptop has both. A run of scripts/run_gpu_tests.py with #2463 merged and LEONIDA_VK_DEVICE set to the Intel GPU would confirm it.

No game files. AI-assisted.

@duudiis

duudiis commented Nov 22, 2026

Copy link
Copy Markdown

Independent Windows 11 / RTX 5070 check at e56f1e7 (driver 621.24). I used a temporary instrumented build of all five tools that can mask only the queried shaderInt64 result and logs the feature bit passed to vkCreateDevice. Device creation and GPU work still ran through the NVIDIA driver.

Module / reported device All five tools
No Int64 / advertised Render or dispatch passed, requested bit 0
No Int64 / masked off Render or dispatch passed, requested bit 0
Int64 / advertised Render or dispatch passed, requested bit 1
Int64 / masked off Exit 77 with a shaderInt64 reason, before device creation

The fixtures exercised LDS compute, heap-backed fragment reads, sampled textures, typed image load/store, and bindless lookup. The address-pair translations came from #2463 (c550d53). The typed image workload itself uses no 64-bit address arithmetic, so for that negative control I added an Int64 declaration to its otherwise identical module. All fixtures validated for Vulkan 1.2.

vk_bindless_test accepted the RTX 5070 filter and returned 77 with the expected diagnostic for a deliberately unmatched name. Both CTest cases and all 32 runner unit tests passed. The masked check exercises the missing-feature branch on a real driver, with one physical adapter available.

@Marukooh

Copy link
Copy Markdown
Contributor

Tested e56f1e7 on NVIDIA GeForce RTX 5070 Ti (Blackwell), NVIDIA 620.73.04, CachyOS Linux, GCC 16.2.1. Built the runtime and ran the complete synthetic Vulkan suite with LEONIDA_VK_DEVICE=5070 Ti.

Mode Passed Skipped Failed
Without wave64 emulation 139 46 0
With wave64 emulation 170 15 0

All 190 translated modules passed spirv-val in each run. The spirv_capability CTest passed, and all 32 test_run_gpu_tests.py tests passed. This GPU reports shaderInt64=true, so the no-Int64 device path is outside the hardware coverage of this run. AI-assisted.

@carlcdx

carlcdx commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested f8345251 on a dual-GPU Windows 11 system (26300, MSVC 19.44, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, RelWithDebInfo, VK_LOADER_LAYERS_DISABLE=~implicit~): pass on both AMD GPUs (confirming TEST-469's multi-GPU selector and f8345251's exit-1 unmatched filter in vk_bindless_test).

GPUs:

  • AMD Radeon RX 9070 XT (RDNA 4, Adrenalin 26.10.44 LLPC, Vulkan 1.4.349)
  • AMD Radeon(TM) Graphics (Ryzen 7 9800X3D RDNA 2 iGPU, AMD 24.30.18 SC, Vulkan 1.3.302)

Build & CPU checks:

  • Built spirv_capability_test, vk_device_pick_test, vk_compute_test, vk_texture_test, vk_store_test, vk_harness, and vk_bindless_test with 0 warnings.
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^(spirv_capability|vk_device_pick)$": 2/2 passed (vk_device_pick, spirv_capability).
  • python -m unittest tests/test_run_gpu_tests.py -v: 32/32 OK.

Direct vk_bindless_test multi-GPU selection (vs_tri.spv + ps_tex.spv):

  • LEONIDA_VK_DEVICE unset → picked AMD Radeon RX 9070 XT, 24 draws read back, 0 bad pixels, exit 0.
  • LEONIDA_VK_DEVICE="9070 XT" → picked AMD Radeon RX 9070 XT, 24 draws read back, 0 bad pixels, exit 0.
  • LEONIDA_VK_DEVICE="Radeon(TM) Graphics" → picked AMD Radeon(TM) Graphics, 24 draws read back, 0 bad pixels, exit 0.
  • LEONIDA_VK_DEVICE="NoSuchGPU_Test469" → LEONIDA_VK_DEVICE=nosuchgpu_test469: no Vulkan physical device matches, exit 1.

scripts/run_gpu_tests.py across all five tools (run on both 9070 XT and Radeon(TM) Graphics):

  • --filter ps_tex: 9/9 passed on both GPUs (ps_tex, ps_texoff, ps_texoff_implicit, ps_texture_bias_a16, ps_texture_grad_a16, ps_texture_grad_cl_a16, ps_texture_mip0, ps_texture_sample, ps_texture_sample_d16).
  • --filter ps_imgatomic: 1/1 passed on both (0/256 texels wrong, 0/4096 RT pixels wrong).
  • --filter cs_img: 5/5 passed on both (cs_imgatomic, cs_imgatomic3d, cs_imgload, cs_imgload_d16, cs_imgstore, each reporting the selected device).
  • --filter cs_bounds, --filter ps_flat, --filter ps_gather_wrap: 1/1 passed each on both GPUs.

Not tested here: a device lacking shaderInt64 (both AMD adapters advertise shaderInt64), or merged with #2463.

Synthetic tests only; no game files. AI-assisted.

@comp

comp commented Nov 22, 2026

Copy link
Copy Markdown

Independent Windows dual-GPU validation for TEST-469 (AI-assisted). I built vk_bindless_test from base 49475796c226 and PR head f8345251ca6b, and ran both with the same freshly built synthetic vs_ids / ps_tex fixtures. GPUs: AMD Radeon(TM) Graphics (26.11.2) and NVIDIA GeForce RTX 4070 Ti SUPER (621.24).

LEONIDA_VK_DEVICE Base PR head
AMD Radeon Selected NVIDIA Selected AMD; 24 draws, 0 bad pixels
RTX 4070 Selected NVIDIA Selected NVIDIA; 24 draws, 0 bad pixels
TEST469-MISSING-DEVICE Silently selected NVIDIA; exit 0 Exit 1; no Vulkan physical device matches

python -m pytest -q tests/test_run_gpu_tests.py on the PR head: 32 passed, including the exit-77-to-SKIP and reason propagation cases. That part was verified by unit tests, not by forcing an unsupported GPU run. This validates TEST-469, not TEST-468 on a device without shaderInt64. No game files or generated shaders attached.

@c4k3ss

c4k3ss commented Nov 22, 2026

Copy link
Copy Markdown

Tested f8345251 on Windows 11 Pro 10.0.26200, MSVC 14.44, Vulkan SDK 1.4.363.0, llvm-mc 23.1.6: pass on both GPUs here.

  • run_gpu_tests.py --build <this head> on NVIDIA GeForce RTX 5070 Ti (621.24, subgroup 32..32): 190 shaders pass spirv-val, 139/185 passed, 46 skipped, 0 failed (same counts as main).
  • The same with LEONIDA_VK_DEVICE="AMD Radeon" on the RDNA2 gfx1036 iGPU (AMD 25.10.34, subgroup 32..64): 170/185 passed, 15 skipped, 0 failed; ps_tex, ps_imgatomic and cs_imgstore print device: AMD Radeon(TM) Graphics under the filter (TEST-469), and LEONIDA_VK_DEVICE=nomatch exits 1 with no Vulkan physical device matches.
  • ctest d3d12_translated_draw and d3d12_m3_frame: pass. spirv_capability I could not run: my antivirus removed the freshly linked spirv_capability_test.exe before ctest got to it (a local problem, the other reports above cover it).
  • Read the diff: same gate as Tests: shaderInt64 only for modules that declare Int64; LEONIDA_VK_DEVICE in vk_bindless_test #2657 plus Int64Atomics and the memcpy read; nothing to add. Both GPUs here have shaderInt64, so the missing-feature branch is covered by @duudiis's masked run, not by mine.

No game files. AI-assisted.

@TurboSosiska304

Copy link
Copy Markdown

Verified f834525 on CachyOS Linux, Python 3.14.10, gcc 16.2.1, CMake 4.5.1.

  • python3 -I tests/test_run_gpu_tests.py: 32 tests OK.
  • No system Vulkan headers, so configured runtime with -DLEONIDA_VULKAN_HEADERS_FETCH=ON (Vulkan-Headers 1.4.363). spirv_capability_test and the five changed tools (vk_harness, vk_compute_test, vk_texture_test, vk_store_test, vk_bindless_test) compile cleanly.
  • ctest -R spirv_capability: Passed.

Not run: any GPU execution (another worker owns the GPU), so the exit-77 paths and the LEONIDA_VK_DEVICE choice are unverified at runtime.

Note: spirv_capability_test is registered only inside if(TARGET Vulkan::Headers), so this CPU-only test needs Vulkan headers found at configure time even though it includes none. The leading-run capability scan matches real modules: tools/rdna2spirv.py emits every OpCapability before OpExtension.

No issues found.

@sovljanskii

Copy link
Copy Markdown
Contributor Author

Rebased on ec8ec4c9 (head 8a833a66). The only conflict was the run_cmd signature in scripts/run_gpu_tests.py; this keeps main's cwd keyword, and helper_result is unchanged.

Retested on Apple M4 (MoltenVK 1.4.2):

  • ctest spirv_capability and vk_device_pick: pass.
  • tests/test_run_gpu_tests.py: OK.
  • run_gpu_tests.py against ec8ec4c9, each with its own build: 116/189 passed and 72 skipped on both, no test differs. The one failure on both is ps_ssharp (SHADER-268, Apple).

AI-assisted.

sovljanskii added a commit to sovljanskii/Leonida that referenced this pull request Nov 22, 2026
It includes no Vulkan header, but it was registered inside if(TARGET Vulkan::Headers), so a build without
Vulkan headers skipped a CPU-only test. Noted by TurboSosiska304 on ItsNotRexed#2647. Checked with the Vulkan package
disabled: the test builds and passes, while vk_device_pick is not configured.

AI-assisted.
@sovljanskii

sovljanskii commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@TurboSosiska304 thanks, good catch on the CMake block. Fixed in a8438876: spirv_capability_test now sits outside if(TARGET Vulkan::Headers).

  • Vulkan disabled (-DCMAKE_DISABLE_FIND_PACKAGE_Vulkan=ON, no include dir): it builds and ctest -R spirv_capability passes, while vk_device_pick is, correctly, not configured.
  • Normal Mac build: both tests pass.

AI-assisted.

@matheuskshn

Copy link
Copy Markdown
Contributor

Windows 11 integration check with a8438876 and #2395 (33456ca4), resolving the two overlapping hunks locally and using this PR’s shared capability scanner for both Int64 and Float64. The standalone spirv_capability_test passed. On Edge’s SwiftShader (Subzero), the FP64 fixture exited 77 naming shaderFloat64 and two Int64 compute fixtures exited 77 naming shaderInt64, without attempting unsupported device creation.

On RTX 4070 Ti / 621.24 with Vulkan validation active, the FP64 fixture returned 0x00000000 0x40040000 and a hand-written Int64-free buffer-address-pair fixture returned 12345. The latter reached pipeline/dispatch setup on SwiftShader and hit the separate existing 144-versus-128-byte push-constant limit covered by #2048. No game inputs. AI-assisted.

@sovljanskii

Copy link
Copy Markdown
Contributor Author

@matheuskshn thanks for the integration run with #2395, and for checking the 77 paths on SwiftShader.

Both orders work:

AI-assisted.

@crastinator

Copy link
Copy Markdown
Contributor

Tested a843887 merged into main 16282101 (clean merge) on AMD Radeon RX 6700 XT (Navi 22, gfx1031, subgroup 32..64), RADV Mesa 26.3.1, CachyOS, Linux 7.3.5, GCC 16.2.1, llvm-mc 23.1.5: pass.

  • Whole run_gpu_tests.py: 175/189 native, 175/189 with LEONIDA_W64_EMULATE=1 (the skips are the D3D12-only fixtures and ps_w64x_readlane, as on main). ctest 38/38.
  • tests/test_run_gpu_tests.py: 36 passed, 39 subtests passed.

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

sovljanskii added a commit to sovljanskii/Leonida that referenced this pull request Nov 22, 2026
It includes no Vulkan header, but it was registered inside if(TARGET Vulkan::Headers), so a build without
Vulkan headers skipped a CPU-only test. Noted by TurboSosiska304 on ItsNotRexed#2647. Checked with the Vulkan package
disabled: the test builds and passes, while vk_device_pick is not configured.

AI-assisted.
@sovljanskii
sovljanskii force-pushed the gpu-tools-int64-device branch from a843887 to c21d6db Compare November 22, 2026 21:29
@sovljanskii

Copy link
Copy Markdown
Contributor Author

Rebased onto f847748c (now c21d6db3). #2395 landed in the merge round, so its Float64 check now goes through this PR's scanner, as I said above.

vk_compute_test:

  • needs_float64 uses declares_capability(..., spirv_capability_float64) from runtime/test/spirv_capability.h; the header gains spirv_capability_float64 = 10.
  • shaderInt64 comes from needs_shader_int64, as before.
  • Both features are enabled only when the module declares them, with the same 77 messages.

Other files:

  • spirv_capability_test adds two cases: Float64 is detected, and Float64 alone needs no shaderInt64.
  • The five tool files now include both vk_pc_tail.h (from main) and spirv_capability.h.
  • vk_bindless_test keeps main's have11 chain for shaderDrawParameters.

Re-tested on Apple M4 / MoltenVK 1.4.2:

  • spirv_capability_test passes all checks; ctest spirv_capability and vk_device_pick pass 2/2.
  • tests/test_run_gpu_tests.py is OK, and the CI stdlib loop gives 249 files, 0 failed.
  • Whole run_gpu_tests.py, main f847748c vs this branch: 120/199 passed and 74 skipped on both, with 0 tests differing.
  • cs_f64_add is skipped by the runner on both sides (the M4 has no shaderFloat64). Running vk_compute_test cs_f64_add.spv 1 0x00000000 directly exits 77 with uses Float64 and the device has no shaderFloat64, so the shared scanner's Float64 path works.

@crastinator thanks for the RX 6700 XT run on a8438876. The rebase only adds the Float64 routing above, and nothing changes for the Int64 paths you tested.

No game data. AI-assisted.

…IDA_VK_DEVICE in vk_bindless_test

TEST-468: vk_compute_test and vk_texture_test asked for shaderInt64
unconditionally, and vk_store_test, vk_harness (VKH_HEAP, mesh compute)
and vk_bindless_test required it before running anything. With SHADER-423
most memory shaders no longer declare Int64, but the tools still could not
run them on a device without the feature (Intel UHD/Arc). They now read the
modules' leading OpCapability run first (runtime/test/spirv_capability.h,
shared with vk_texture_test's MinLod check), enable shaderInt64 only when a
stage declares Int64 or Int64Atomics, and exit 77 with the reason when the
device lacks it. spirv_capability_test covers the scan without a GPU.

TEST-469: vk_bindless_test ranked every Vulkan 1.2 device and ignored
LEONIDA_VK_DEVICE, so a run meant for one GPU took another; it now skips
devices the filter excludes, as pick_device does, and says when the filter
matched nothing. run_gpu_tests.py reported vk_store_test's 77 for
cs_imgstore, cs_imgload and cs_imgload_d16 as FAIL with the last output
line; it is now a SKIP quoting the "unsupported:" line.

Found by richardsenra.

AI-assisted.
… filter fails

As the other tools do (vk_compute_test, vk_store_test, vk_harness): collect
the Vulkan 1.2 devices and let pick_device apply the rank and
LEONIDA_VK_DEVICE. A filter that matches nothing now exits 1 with
report_no_device's message instead of 77, so a mistyped GPU name can't
pass as a skipped test. Without a filter, no Vulkan 1.2 device is still
77. The approach is c4k3ss's, from ItsNotRexed#2657.

AI-assisted.
It includes no Vulkan header, but it was registered inside if(TARGET Vulkan::Headers), so a build without
Vulkan headers skipped a CPU-only test. Noted by TurboSosiska304 on ItsNotRexed#2647. Checked with the Vulkan package
disabled: the test builds and passes, while vk_device_pick is not configured.

AI-assisted.
@sovljanskii

Copy link
Copy Markdown
Contributor Author

Rebased again, onto 4c52ce27 (now 2911f688). The one conflict was in vk_harness.cpp, where main now asks for shaderInt64 when need_heap || mesh_compute.

How it's resolved: this PR's version stays: the modules decide. Its loop already reads every module the harness loads in that mode:

  • argv[1], which is the GLCompute mesh module under VKH_MESH_COMPUTE;
  • the generated vertex shader at VKH_MESH_COMPUTE;
  • VKH_GS and the PS.

Main's other need_heap || mesh_compute condition, for bufferDeviceAddress, isn't touched. The includes keep main's descriptor_table.h/gfx10_descriptors.h next to spirv_capability.h.

Re-tested on Apple M4 / MoltenVK 1.4.2. Whole run_gpu_tests.py, main 4c52ce27 against this branch:

mode main this branch tests differing
default 127/210 passed, 76 skipped 127/210 passed, 76 skipped 0
LEONIDA_MESH_COMPUTE=1 132/210 passed, 71 skipped 132/210 passed, 71 skipped 0

With LEONIDA_MESH_COMPUTE=1, 5 ms_* fixtures pass through VKH_MESH_COMPUTE on both sides (one skips), so the mesh-compute path gets the features it needs from its modules.

Also run: ctest spirv_capability and vk_device_pick 2/2, tests/test_run_gpu_tests.py OK, and the CI stdlib loop at 298 files, 0 failed.

No game data. AI-assisted.

@throny

throny commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 2911f68 on NVIDIA RTX 4080, driver 610.88, Windows 11: pass

This is the head rebased on 4c52ce27. Ran (MSVC 19.44 / VS 2022 BuildTools, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363.0, native llvm-mc 23.1.6; test programs built from this branch):

  • Full ctest: 154/154 passed, including the new spirv_capability.
  • python -I scripts/run_gpu_tests.py --build <build>: 164/210 passed, 46 skipped, 0 failed. cs_imgstore, cs_imgload and cs_imgload_d16 (through vk_store_test) pass.
  • python -I tests/test_run_gpu_tests.py: OK.

This card has shaderInt64, so the new exit-77 paths (a module that declares Int64 on a device without the feature) aren't exercised here. What this run shows is that the capability scan still enables the feature where the modules need it, with no regressions in the suite.

Note: #4262 also edits vk_harness.cpp, vk_texture_test.cpp and vk_bindless_test.cpp near the same device-creation code (its OpFmaKHR stage checks), so whichever lands second will need a small rebase.

AI-assisted.

@TreXito

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 2911f688 (the head alone) on Linux (kernel 6.18) with two Vulkan devices: NVIDIA GeForce RTX 3060 Ti (driver 580.173.02) and lavapipe (llvmpipe (LLVM 21.1.8, 256 bits), Mesa's software ICD loaded through VK_DRIVER_FILES). TEST-469 passes: a hardware and a software device of different vendors.

vk_bindless_test with vs_tri+ps_tex and vs_ids+ps_imgatomic, this PR against a main build from tonight. Each cell is the device chosen and the exit code, identical for both shader pairs:

ICDs LEONIDA_VK_DEVICE this PR main
NVIDIA + lavapipe (unset) 3060 Ti, 0 3060 Ti, 0
NVIDIA + lavapipe 3060 3060 Ti, 0 3060 Ti, 0
NVIDIA + lavapipe llvmpipe llvmpipe, 0 3060 Ti, 0 (filter ignored)
NVIDIA + lavapipe nomatch exit 1, no Vulkan physical device matches 3060 Ti, 0
NVIDIA only llvmpipe exit 1, same message 3060 Ti, 0
NVIDIA only nomatch exit 1, same message 3060 Ti, 0

With both ICDs and LEONIDA_VK_DEVICE=llvmpipe, run_gpu_tests.py --filter ps_tex on this build: 10/10 passed, ps_tex bindless: 24 draws read back, 0 bad pixels on lavapipe. GitHub reports a conflict with today's main (7b7d73f); these results are from before that.

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

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.