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

Merged
shayderrr merged 5 commits into
ItsNotRexed:mainfrom
sovljanskii:gpu-tools-int64-device
Nov 23, 2026
Merged

shayderrr merged 5 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
Contributor

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.

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 c21d6db to 2911f68 Compare November 22, 2026 22:12
@sovljanskii

Copy link
Copy Markdown
Contributor Author

@tylerstraub thanks, that covers the runner change on a device that has the features.

If you have a minute, 71067997 adds one path the M4 can't reach: a module that declares Int64Atomics now gets shaderBufferInt64Atomics enabled when the device has it. The RTX 5090 should. A Vulkan 1.2 module with a 64-bit OpAtomicIAdd on a Workgroup u64 (OpCapability Shader/Int64/Int64Atomics, LocalSize 1 1 1, the variable in the entry point's interface) run through vk_compute_test <spv> 1 dump should create the pipeline and exit 0. Before 71067997 it ran without the feature enabled, which validation reports. No problem if not. AI-assisted.

@tylerstraub

Copy link
Copy Markdown
Contributor

Replying to @sovljanskii.

At 71067997, the proposed Workgroup add exercises shaderSharedInt64Atomics. The harness also enables shaderBufferInt64Atomics, but an atomic through a storage-buffer pointer would exercise that flag directly. For the buffer check, the synthetic exchange fixture already has a two-word readback and a flag-off control on the RTX 5070 run of #4984. Pairing its flagged module with this head's compute harness and validation enabled would cover the feature-enable change here. Our RTX 5090 report above covers the preceding head 0e80e37a.

AI-assisted.

@sovljanskii

Copy link
Copy Markdown
Contributor Author

@tylerstraub right, thanks: a Workgroup add is the shared flag. The buffer path is #4984's flagged exchange module run through this head's vk_compute_test with validation on, as you describe. On a device that has shaderBufferInt64Atomics it should create the pipeline with no validation error and read back the two exchanged words. Without the feature it should exit 77; the M4 run above covers that half. AI-assisted.

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

Independently checked exact harness head 710679979d891a14c4c88d6eba6e3e3a15c5a5b9 on two devices that support shaderBufferInt64Atomics, using identical default/opt-in modules produced by #4984 at 5880302948f4bacae9564df926bb7b050591d239.

Windows 11, MSVC 19.44.35228, Vulkan SDK 1.4.363.0; RTX 4080 (610.62 / 32.0.16.1062) and Radeon(TM) Graphics (32.0.21043.5001). All four supported-device runs pass their dword-set and predecessor-chain oracles with zero validation errors/VUIDs. The opt-in global-atomic contention module returns zero torn pairs on both. The same exact module produces VUID 08740 with the unmodified #4984 harness, isolating this feature enablement. spirv_capability CTest also passes.

Full source identities, counts, controls, and limitations. Synthetic fixture/checker from #4964, unchanged source worktrees, no game files. This adds supported-device coverage; no unsupported physical device was tested here.

AI-assisted: yes.

@sovljanskii

Copy link
Copy Markdown
Contributor Author

@Hiiva thank you, that closes the gap. With your two devices that have shaderBufferInt64Atomics (zero VUIDs, and 08740 for the same module on the unmodified harness) and the M4 without it (exit 77 instead of -3), both halves of 71067997 are covered on hardware. AI-assisted.

@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 71067997 (merge base 3faac557) on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56. Result: pass.

  • Runtime built from this head: MSVC 19.44 (BuildTools 2022), Ninja, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no Vulkan SDK; the loader comes from the NVIDIA driver). glslangValidator and llvm-mc 21 came from WSL Ubuntu. Build exit 0.
  • ctest -j 3: 178/178 passed.
  • scripts/run_gpu_tests.py --build <this build>: 170/217 passed, 47 skipped, 0 failed.
  • New here: spirv_capability PASS. The RTX 5070 Ti supports shaderInt64, so this run checks that nothing changes on a device that has it, not the path for one without it.
  • Every other test gives the same result as on main 3faac557 (ctest 177/177, GPU 170/217).
  • As on main, run_gpu_tests.py records cs_fmt_d16_xyz twice and skips cs_tbuffer_store. That's main's runner bug (fixed by run_gpu_tests: record cs_tbuffer_store's result; fail a run that records a test twice #4784), not this PR.

Not run: other GPUs/vendors, Linux, the Vulkan validation layer (not installed). No game files.

AI-assisted (Claude Code).

…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,
which builds without Vulkan headers), 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.
…e device lacks

vk_compute_test exits 77 with an "unsupported: ..." line when the module
declares Int64 and the device has no shaderInt64 (this branch), uses Float64
without shaderFloat64, or needs OpFmaKHR. run_gpu_tests.py only read that 77
under --require-wave64, so every other compute dump reported it as a FAIL, and
under --require-wave64 it was labelled "no 64-wide compute subgroup" whatever
the cause (TinkerBell-90's review on an RTX 3070 with shaderInt64 hidden).

check.compute_unsupported turns such an exit into a Skip that quotes the
line. check.py's dump_test and compute_test use it, and so do all of
run_gpu_tests.py's vk_compute_test call sites:
- wavemask_check (judge_cs_dump has quoted the reason in every mode since
  main's 87da932, in its own words: "SKIP (<reason>)");
- the rows that judge their own output: cs_workgroup_yz, cs_lds, cs_exec64,
  cs_bvh, the cs_bounds group, cs_heap_init and cs_user_sgprs;
- cs_cvt_f32_sat, which stops at the first refused input;
- cs_f64_add, which quotes Float64 or Int64, whichever it names.
The cs_fmt_* rows record check.py's result as their detail, so the tally
counts a Skip detail as a skip. A 77 without a reason stays a failure, and
the wave64 refusal keeps its own wording.

Apple M4, MoltenVK 1.4.2, the full suite before and after (on 3faac55):
- on the device itself: 152/217 passed, 58 skipped, every test unchanged;
- with vk_compute_test refusing each module that declares Int64, as on a
  device without shaderInt64: 91 passed, 57 skipped before, and 91 passed,
  120 skipped after. 62 tests go from FAIL to SKIP and none get worse. The 6
  still failing (ps_ssharp, ps_vcmp*) fail on the real device too.
tests/test_run_gpu_tests.py: 50 OK. Without the change, 9 of the new checks
fail.
…omics

The translator's 64-bit atomics are buffer atomics (ItsNotRexed#4984's --int64-atomics:
*_atomic_swap_x2 on PhysicalStorageBuffer memory). vk_compute_test enabled
shaderInt64 for them (Int64Atomics implies Int64) but never asked for
shaderBufferInt64Atomics. A device without it (MoltenVK) failed the pipeline
with -3 instead of reporting 77, and a device with it ran the module without
the feature enabled.

Now the feature is read from the Vulkan 1.2 features. When the module
declares Int64Atomics, vk_compute_test exits 77 with "unsupported: ...
declares Int64Atomics and the device has no shaderBufferInt64Atomics" if the
device lacks it, and enables it otherwise. shaderSharedInt64Atomics is also
enabled where the device has it, for shared-memory atomics. run_gpu_tests.py
and check.py already turn such a line into a SKIP.

Apple M4, MoltenVK 1.4.2:
- a spirv-val-clean Vulkan 1.2 module with a 64-bit OpAtomicIAdd: before,
  exit 1 ("MSL currently does not support 64-bit atomics", -3); after, exit
  77 with the line above;
- full GPU suite: 152/217 passed, 58 skipped, every test unchanged (no
  fixture declares Int64Atomics yet).
spirv_capability_test passes. The enabled path, on a device that has
shaderBufferInt64Atomics, is not tested here.

Found by the M4 run of ItsNotRexed#4984.
@sovljanskii
sovljanskii force-pushed the gpu-tools-int64-device branch from 7106799 to b824c20 Compare November 23, 2026 11:52
@sovljanskii

Copy link
Copy Markdown
Contributor Author

Rebased onto main 561b65a8 (head b824c205, still five commits). The merge round left three files conflicting. In each one I kept main's code and put the PR's change next to it:

  • vk_store_test.cpp: main now reads the dynamic-indexing capabilities and checks StorageImageReadWithoutFormat with spirv_declares_capability. The PR's Int64 gate sits just before those checks. The PR's copy of the old hand-written capability loop is dropped, because main replaced it.
  • vk_texture_test.cpp: the MinLod check is now main's (spirv_declares_capability on fragment_code). The Int64 gate reads the VS and reuses main's fragment_code instead of reading the FS a second time. spirv_capability_min_lod lost its last user, so it is gone from spirv_capability.h and its unit test.
  • run_gpu_tests.py:
    • helper_result (vk_store_test's 77 → SKIP) now builds on main's new verdict_line, so a non-zero exit other than 77 keeps main's exit N: prefix.
    • cs_lds, cs_exec64 and cs_bvh use compute_result(..., verdict_line(rc, msg)).
    • In judge_cs_dump, main's 87da932 already quotes an unsupported: reason in every mode, in its own words (SKIP (<reason>)). So the PR's call there is dropped and its test expects main's wording. The other call sites keep SKIP (unsupported: ...).
    • The messages of commits 1 and 4 say so.

No duplicate definitions, no second shaderInt64 assignment and no second device filter are left (checked with grep). Commit 1 builds on its own.

Apple M4, macOS, MoltenVK 1.4.2, AppleClang, against a pure-main build of 561b65a8:

  • ctest: main 62/62, PR 63/63. The extra test is spirv_capability.
  • run_gpu_tests.py: 165/232 passed, 59 skipped on both. All 232 rows have the same status. The only detail that changes is cs_f64_add's skip, which now quotes vk_compute_test's Float64 line instead of the fixed text. The 8 FAILs are main's own (cs_fma_fused, cs_w32_permlane_fi, ps_ssharp, ps_vcmp*).
  • tests/test_run_gpu_tests.py: 56 OK on Python 3.15.2 and 3.12.16. With main's scripts/, 14 fail. test_docs_* and git diff --check are clean.
  • The PR's claims, checked with hand-assembled compute modules (the M4 has shaderInt64 but not shaderBufferInt64Atomics):
    • A module declaring Int64Atomics runs on main (exit 0, with the feature never enabled). With the PR, vk_compute_test exits 77 with declares Int64Atomics and the device has no shaderBufferInt64Atomics.
    • The plain and the Int64 module run on both.
    • With LEONIDA_VK_DEVICE=no-such-gpu, main's vk_bindless_test ignores the filter, takes the M4 and fails later in vkCreateGraphicsPipelines. With the PR it stops at once with no Vulkan physical device matches.
    • No validation layer is installed here, so "shaderInt64 only when declared" rests on spirv_capability and the unchanged suite.

@tunczzz's Windows 11 / RTX 5070 Ti pass was of the pre-rebase head 71067997 on 3faac557. Since then:

  • The resolved hunks change only where the PR's Int64 gate sits next to main's newer checks, and the detail text of a skip or a failure. On a device that has shaderInt64, as that one does, the PR enables the same features as before.
  • The rest of the PR is unchanged.
  • I'd expect the pass to carry over, but it was run on a main some 1,800 commits older, so only a rerun on b824c205 would confirm it.

AI-assisted.

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested b824c20 on Intel UHD Graphics 630 (CFL GT2), Mesa ANV: run_gpu_tests.py with LEONIDA_VK_DEVICE=Intel gives 167/232 passed, 63 skipped, with FAIL cs_fmt_int_narrow ("word 34: expected 0xffffffff, got 0x00000000") and FAIL cs_signed_zero_nan. cs_imgstore, cs_imgload and cs_imgload_d16 pass ("device: Intel(R) UHD Graphics 630 (CFL GT2)"), and the bindless rows pass ("ps_imgatomic: 0 of 256 texels wrong", "bindless: 16 draws read back, 0 bad pixels, largest error 0"). With LEONIDA_VK_DEVICE=NoSuchDevice, --filter cs_imgstore fails with "no Vulkan physical device matches". tests/test_run_gpu_tests.py runs 56 tests OK and the spirv_capability ctest passes. This device was not shown to lack shaderInt64, so the exit-77 path for a device without it was not exercised, and I did not run main, so I cannot say whether the two FAILs predate this PR.

AI-assisted.

@sovljanskii

Copy link
Copy Markdown
Contributor Author

Thanks @gertify. Neither failure comes from this PR. Both are already reported on Mesa ANV without it:

This PR doesn't change either test. Its run_gpu_tests.py changes are the exit-77 skip for a missing device feature and helper_result/compute_result around main's verdict_line. A test that fails still fails with the same words. Your NoSuchDevice run and the 56 OK cover the other half.

AI-assisted.

@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested b824c205 on a Windows 11 computer with two GPUs: NVIDIA GeForce RTX 4090 (driver 621.01) and AMD Radeon(TM) Graphics (integrated, driver 26.3.1). Result: pass for TEST-469. An AI tool helped me to do these tests. No game files. Build: MSVC 14.51, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363.1, llvm-mc 21.1.8.

The earlier two-GPU Windows reports are for f8345251. This is the same check on the head after the rebase onto 561b65a8.

vk_bindless_test vs_ids.spv ps_imgatomic.spv

LEONIDA_VK_DEVICE main (561b65a8) This head
not set device: NVIDIA GeForce RTX 4090, pass device: NVIDIA GeForce RTX 4090, pass
Radeon device: NVIDIA GeForce RTX 4090, pass device: AMD Radeon(TM) Graphics, pass
4090 device: NVIDIA GeForce RTX 4090, pass device: NVIDIA GeForce RTX 4090, pass
no-such-gpu-leonida device: NVIDIA GeForce RTX 4090, exit 0 LEONIDA_VK_DEVICE=no-such-gpu-leonida: no Vulkan physical device matches, exit 1

"pass" is ps_imgatomic: 0 of 256 texels wrong ...; 0 of 4096 render-target pixels wrong.

Other runs on this head

  • python -I tests/test_run_gpu_tests.py: 56 tests OK (main: 47).
  • The build has no warning in the changed C++ files.
  • scripts/run_gpu_tests.py gives the same counts as main: 183 of 232 passed with LEONIDA_VK_DEVICE=4090 and 209 of 232 passed, 23 skipped, with LEONIDA_VK_DEVICE=Radeon. ms_wave_info_s3 fails on the RTX 4090 on main and on this head. With this head, ps_tex and ps_imgatomic of the Radeon run are on the AMD GPU; on main they are on the RTX 4090.
  • Full ctest on the RTX 4090: 248 tests. d3d12_indirect_dispatch_count, d3d12_present and xbox_present fail on main and on this head. d3d12_bindless_churn_validated failed one time on this head and passed on main; I did not repeat it.

vk_descriptor_bench and vk_sandbox continue to ignore the variable on this head. #5889 corrects them; I tested that also.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds runtime/test/spirv_capability.h, which reads a module's declared capabilities before device creation so the standalone GPU tools enable shaderInt64 only when a stage actually declares Int64 or Int64Atomics. vk_harness, vk_compute_test, vk_texture_test, vk_store_test and vk_bindless_test now use it, returning a reason-bearing exit 77 when the device lacks a required feature. check.py learns to treat that as SKIP rather than failure, vk_bindless_test adopts the shared device filter, and a CPU-only CTest covers capability parsing.

Why merge

Most translated shaders no longer declare Int64, yet the tools blindly requested shaderInt64 and failed on Intel UHD/Arc devices before running anything. Requesting only what the module needs restores portability and turns genuine unsupported cases into explained skips.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

Adds runtime/test/spirv_capability.h, which reads a module's declared capabilities before device creation so the standalone GPU tools enable shaderInt64 only when a stage actually declares Int64 or Int64Atomics. vk_harness, vk_compute_test, vk_texture_test, vk_store_test and vk_bindless_test now use it, returning a reason-bearing exit 77 when the device lacks a required feature. check.py learns to treat that as SKIP rather than failure, vk_bindless_test adopts the shared device filter, and a CPU-only CTest covers capability parsing.

Why merge

Most translated shaders no longer declare Int64, yet the tools blindly requested shaderInt64 and failed on Intel UHD/Arc devices before running anything. Requesting only what the module needs restores portability and turns genuine unsupported cases into explained skips.

Verdict: Approve

@shayderrr
shayderrr merged commit ced4057 into ItsNotRexed:main Nov 23, 2026
0 of 5 checks passed
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.