Skip to content

vk_harness, vk_store_test, vk_texture_test, vk_sampler_test: run under validation with LEONIDA_VK_VALIDATION (TEST-877 follow-up) - #4025

Open
TreXito wants to merge 2 commits into
ItsNotRexed:mainfrom
TreXito:test/877b-shader-programs-validation
Open

TreXito wants to merge 2 commits into
ItsNotRexed:mainfrom
TreXito:test/877b-shader-programs-validation

Conversation

@TreXito

@TreXito TreXito commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to TEST-877 (claim).

Depends on: #4005. This branch is stacked on it. Only the last commit, 6b301611, is new here.

vk_harness, vk_store_test, vk_texture_test and vk_sampler_test built their instance without layers and ignored LEONIDA_VK_VALIDATION. A validation message also never changed their exit code. Between them they run every pixel, store, texture and sampler case in scripts/run_gpu_tests.py. So even with #4005, a validation run of the suite could still only fail on the compute cases.

What changes:

  • Each of the four takes the instance setup from runtime/test/vk_validation.h (OptInValidation, added in vk_compute_test: run under validation with LEONIDA_VK_VALIDATION, fail on a validation error (TEST-877) #4005):
    • prepare before vkCreateInstance: with the variable set, it adds the layer, VK_EXT_debug_utils and a messenger, or fails with exit 1 if the layer is missing.
    • attach after it.
  • main now wraps the old body and ends through OptInValidation::exit_status. A counted validation error exits 1 with N validation errors.
  • The diff per program is 11 lines: the include, a header comment, int main renamed to static int run, the two calls, and the new main.
  • Without the variable nothing changes. No output line changes, so the device: and subgroup regexes in check.py and run_gpu_tests.py are unaffected.
  • docs/testing.md now lists every shader test program as reading the variable. It drops the by-hand VK_INSTANCE_LAYERS recipe, which existed only because these programs ignored it.

Tested on RTX 3060 Ti, driver 580.173.02, Linux, Khronos validation layer 1.4.357. Base main aa2988c. Whole suite, python -I scripts/run_gpu_tests.py:

build no variable LEONIDA_VK_VALIDATION=1 + VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1
this branch (6b30161) 164/210, = main 147/210 141/210
this branch + #3347 + #4067 164/210 164/210 158/210

Also tested on AMD Radeon RX 7800 XT, driver 26.11.2, Windows 10 19045, validation layer 1.4.363. Base main aa2988c:

build no variable LEONIDA_VK_VALIDATION=1 + GPU-AV
this branch (6b30161) 196/210, = main 179/210 171/210
this branch + #3347 + #4067 196/210 196/210, 0 VUID-08740 188/210
  • The 8 under GPU-AV are NVIDIA's 6 plus cs_w64x_lds_raw and cs_w64x_lds_war (native wave64, lane 0 against lane 32). All are race reports with 0 mismatches.
  • With the variable set and the layer hidden, every test program fails with the "not installed" diagnostic, as intended.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

@tylerstraub

Copy link
Copy Markdown
Contributor

Tested 6b301611300266f1cdd1e6947f787668ec6a75cf on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).

At 6b301611 on Linux, RTX 5090, driver 595.99.02, all four rebuilt programs (vk_harness, vk_store_test, vk_texture_test, and vk_sampler_test) exited 1 and named the missing Khronos validation layer when I requested validation with an empty explicit layer directory.

With that same directory, I drew a translated constant-white pixel shader in vk_harness twice: once with LEONIDA_VK_VALIDATION unset and once with it set to 0. Both runs exited 0, and all 4,096 RGBA32F pixels were exactly (1,1,1,1) on each run. This covers missing-layer handling in all four entry points and the disabled path on hardware. Counting messages from an installed validation layer was outside this check.

AI-assisted verification.

@SebSilent

Copy link
Copy Markdown
Contributor

Tested 6b30161 on RTX 2070 (Turing, subgroup 32..32), NVIDIA 620.73.04, Vulkan 1.4.357, CachyOS Linux (kernel 7.3.5), gcc 16.2.1, llvm-mc 23.1.5. Native Linux build of the test tools, no game files.

  • No variable: python -I scripts/run_gpu_tests.py --build <build> --require-pass gives 214/214 translated + spirv-val, 164/210 passed, 46 skipped, 0 failed (exit 0). Same as main aa2988c, so nothing changes without the variable. The 46 skips are 32 needing a 64-wide subgroup and 14 Windows-only d3d12 tests.
  • LEONIDA_VK_VALIDATION=1 with the layer absent: all four (vk_harness, vk_store_test, vk_texture_test, vk_sampler_test) print "LEONIDA_VK_VALIDATION is set but VK_LAYER_KHRONOS_validation is not installed" and exit 1, the new prepare() guard, instead of running unchecked.
  • LEONIDA_VK_VALIDATION=0: validation off, normal run, the device: line unchanged.

Caveat: this box has no Khronos validation layer installed, so I could not exercise the validation-error-counting path (the 17 VUID-08740 cases you found). The missing-layer guard and the no-variable regression are confirmed on Turing. AI-assisted (Tacit).

@tedin7

tedin7 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 6b30161 (stacked on #4005, merge base main aa2988c) on NVIDIA GeForce RTX 5080, driver 580.65.06, Ubuntu 22.04 (Linux): pass, all three counts match the PR description

Build: cmake -S runtime -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DVulkan_INCLUDE_DIR=<SDK 1.4.363.1>/include, then ninja -C build -j12 (all targets, including the five changed test programs; they compile cleanly). Khronos validation layer from Vulkan SDK 1.4.363.1 via VK_LAYER_PATH. VK_LOADER_LAYERS_DISABLE=~implicit~.

Whole suite, python -I scripts/run_gpu_tests.py --build build:

variables passed skipped failed
none 164/210 46 0 (same as main)
LEONIDA_VK_VALIDATION=1 147/210 46 17
LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 141/210 46 23

Not tested: the stacked runs with #3347 + #4067 (164/210 under validation), the vk_harness control with OpCapability Int16, the 6 GPU-AV compute LDS failures were not looked at one by one, LEONIDA_W64_EMULATE=1 (the PR does not touch the translator), and other GPUs/OSes (NVIDIA 3060 Ti, Windows).

No game data was used.

AI-assisted run.

@YaBulochka

Copy link
Copy Markdown
Contributor

Ran the branch (6b301611) with LEONIDA_VK_VALIDATION=1 on AMD RADV, which is the case this PR needs a second driver for. The suite does not pass clean here, but the failures are in two test programs, not in the shaders:

GPU:    AMD Radeon RX 7600 (gfx1102, RDNA3)
Driver: RADV, Mesa 27.0.0-devel (git-f7dd61f78f), Vulkan 1.4.363
Layer:  Khronos Validation 1.4.363
Result: 179/210 passed, 14 skipped, 17 failed

All 17 failures are the same VUID, VUID-VkShaderModuleCreateInfo-pCode-08740:

validation: vkCreateShaderModule(): SPIR-V Capability DrawParameters was declared, but one of the following
requirements must be met (VkPhysicalDeviceVulkan11Features::shaderDrawParameters OR VK_KHR_shader_draw_parameters).

1. runtime/test/vk_texture_test.cpp:219 breaks its own feature chain.

m8.maintenance8 = VK_TRUE; f12.pNext = &m8;

f12.pNext was &f11 (the VkPhysicalDeviceVulkan11Features holding shaderDrawParameters), so this replaces it and silently drops the feature. RADV supports VK_KHR_maintenance8 (the run prints enabled VK_KHR_maintenance8), so on this driver every draw with vs_ids fails validation. On a device without maintenance8 the assignment never runs, which is likely why it passes elsewhere. The idiom used by vk_harness.cpp:400 keeps the chain: m8.pNext = chain; chain = &m8;, so here m8.pNext = f12.pNext; f12.pNext = &m8; is enough.

This accounts for 16 of the 17: ps_array_resinfo, ps_cube_sample, ps_gather_border, ps_gather_wrap, ps_get_lod, ps_get_lod_array, ps_sample_c_lz, ps_sample_c_lz_a16, ps_texture_bias_a16, ps_texture_grad_a16, ps_texture_grad_cl_a16, ps_texture_mip0, ps_texture_sample, ps_texture_sample_d16, ps_gather_sampler_lod, ps_sample_implicit_sint. Manually re-running vk_texture_test with LEONIDA_VK_VALIDATION=1 reproduces the message for any of them.

2. runtime/test/vk_sampler_test.cpp never enables shaderDrawParameters.

Its device chain is VkPhysicalDeviceVulkan12Features only (enable12 at ~line 149), and its cases draw with vs_ids too, so the same VUID fires for the sampler test (ps_ssharp here). Adding the VkPhysicalDeviceVulkan11Features with shaderDrawParameters = VK_TRUE in front of enable12, as vk_texture_test/vk_harness do, closes it.

Nothing here is a translated-shader or RADV issue: without validation the same 210 tests pass, and all compute tests in this run were clean. I can re-run the full suite on the RX 7600 and on the Ryzen iGPU (gfx1036, RDNA2) once the two chains are fixed, if that helps.

@TreXito

TreXito commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

@YaBulochka thanks, that matches the NVIDIA run exactly (same 17, same VUID). Both chains already have open PRs:

  1. vk_texture_test: tests: preserve DrawParameters when enabling Vulkan maintenance8 #3347 (whattheflop). It keeps f11 in the chain when maintenance8 is enabled.
  2. vk_sampler_test: vk_sampler_test: enable shaderDrawParameters for the translated vs_ids (VUID-08740 on ps_ssharp) #4067 (mine). It queries VkPhysicalDeviceVulkan11Features and enables shaderDrawParameters when the device has it, as vk_harness does.

On the RTX 3060 Ti, this branch with both cherry-picked (git cherry-pick bf059364 4eb8d084 on 6b301611) gives 164/210 under LEONIDA_VK_VALIDATION=1, the same as without the variable. Yes please, that combination on the RX 7600 and the gfx1036 iGPU would be the AMD half of the proof. Expected result: 196/210 (your 179 plus those 17), with no pCode-08740.

AI-assisted (Claude Code).

@YaBulochka

Copy link
Copy Markdown
Contributor

AMD half of the proof, as asked: 6b301611 plus the two cherry-picks bf059364 (#3347) and 4eb8d084 (#4067) applies cleanly.

RX 7600 (gfx1102, RADV Mesa 27.0.0-devel git-f7dd61f78f, Khronos Validation 1.4.363):

  • LEONIDA_VK_VALIDATION=1: 196/210 passed, 14 skipped, 0 failed
  • control, no variable: 196/210 passed, 14 skipped, 0 failed
  • the 14 skips are the d3d12_* fixtures, as usual; there is no pCode-08740 anywhere in the run.

Ryzen 5 9600X iGPU (gfx1036, RDNA2, same driver and layer), MESA_VK_DEVICE_SELECT=1002:13c0!:

  • LEONIDA_VK_VALIDATION=1: 196/210 passed, 14 skipped, 0 failed, also no pCode-08740.

So both chains are needed and sufficient here: with #3347 (vk_texture_test keeps f11 when maintenance8 goes in) and #4067 (vk_sampler_test enables shaderDrawParameters), the validation run matches the plain run exactly on both AMD devices, at the expected 179 + 17 = 196.

Build used: cmake --build runtime/build -j4 on the cherry-picked branch, no other local changes.

@YaBulochka

Copy link
Copy Markdown
Contributor

Still needed on current main 98fa503f: the shader test programs (vk_harness, vk_store_test, vk_texture_test, vk_sampler_test) do not read LEONIDA_VK_VALIDATION yet, so run_gpu_tests.py --require-pass with the environment variable set runs 202/217 without loading the layer at all.

When the layer is forced through the loader instead (VK_LOADER_LAYERS_DISABLE=~implicit~ VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), the full suite is 202/217, 15 skips (the d3d12_*-only fixtures), 0 failures and exactly the 8 pCode-08740 messages from the vk_sampler_test device setup that #4067 fixes. vk_texture_test is clean (bf059364 present). Sync validation adds nothing; GPU-AV reports only the known LDS SharedMemoryDataRace fixtures from #4005/#4025.

So after #4067 this PR should give a clean Linux/RADV full-suite run.

@bobcatchris

Copy link
Copy Markdown
Contributor

Independent Apple Silicon / MoltenVK validation run of this change (hardware reports Apple M2 / Mac14,3, not M1), macOS 26.4, MoltenVK 1.4.2, Vulkan loader 1.4.363 and Khronos validation layer 1.4.363 (both Homebrew bottles), llvm-mc 23.1.6. Both heads built cleanly on AppleClang 17.

Setup note: on macOS the harnesses load MoltenVK directly by default, which bypasses Vulkan layers entirely, so LEONIDA_VK_VALIDATION=1 alone reports VK_LAYER_KHRONOS_validation is not installed. Pointing LEONIDA_VULKAN_LOADER at the loader then fails vkCreateInstance because the stock MoltenVK ICD is marked is_portability_driver and these programs do not request VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR. I worked around that for this run with a temporary ICD manifest without that flag and a layer manifest with an absolute library_path; no repo file was changed.

python -I scripts/run_gpu_tests.py --build runtime/build/vulkan with LEONIDA_VK_VALIDATION=1 and the layer active: 0/217 passed, 54 skipped. The dominant new diagnostics are:

  • VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296 (129 messages): the translated fixtures declare DenormPreserve for 16-bit floats, but vk_compute_test.cpp's device setup (runtime/test/vk_compute_test.cpp:238-244) only enables bufferDeviceAddress in VkPhysicalDeviceVulkan12Features; shaderDenormPreserveFloat16/32 are never queried or enabled. This is a harness gap this PR now makes visible, not a shader bug.
  • VUID-VkDeviceCreateInfo-pProperties-04451 (107): an artefact of my temporary non-portability ICD manifest, which makes the loader think the portability subset must be explicitly enabled. Discount this one.
  • One VUID-vkCreateDescriptorSetLayout-support-09582.

So on this box the validation path is real and does fail bad device setup, but the standalone harnesses need to enable the float-control features (and ideally request portability enumeration on macOS) before a validation run of the suite can be clean. Happy to run again once the device setup is updated. No game data; synthetic fixtures and counts only.

AI-assisted.

@cxchhh

cxchhh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 44444a08 (with #4005 underneath) on Tesla V100-SXM2-32GB (Volta, subgroup 32..32), NVIDIA 580.95.05, Ubuntu 24.04 (kernel 6.14.11), Python 3.12, Khronos validation layer 1.4.357: pass. With #3347 now on main, one validation failure is left, ps_ssharp, which is #4067's.

Setup: the PR diff applied to main 98fa503f (applies cleanly), Linux Vulkan test programs built from that tree (cmake -S runtime -G Ninja), compared against an untouched main 98fa503f built the same way.

No game files. AI-assisted (Claude Code); I ran the commands above and checked the numbers against the logs.

…alidation with LEONIDA_VK_VALIDATION

The four programs that run every pixel, store, texture and sampler case of scripts/run_gpu_tests.py
built their instance without layers and ignored LEONIDA_VK_VALIDATION, and a validation message
never changed their exit code, so a validation run of the suite could not fail on them. Each now
takes the instance setup from runtime/test/vk_validation.h, like vk_compute_test (TEST-877): the
layer, VK_EXT_debug_utils and a messenger when the variable is set, and main ends through
OptInValidation::exit_status, so a counted validation error exits 1 with "N validation errors".
Without the variable nothing changes. docs/testing.md now lists every shader test program as
reading the variable, and drops the by-hand VK_INSTANCE_LAYERS recipe that only covered them.

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

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main 561b65a8 now that #4005 is merged: the branch is one commit, 279898ee, on top of main.

Three conflicts, all from changes that landed on main since: vk_sampler_test gained #include "vk_shader_fma.h" (kept next to vk_validation.h), vk_store_test gained the signed-zero mode (its header line and usage string are kept inside run()), and vk_texture_test gained --self-test-cube-alpha (cube_texel_matches and cube_alpha_self_test kept, the self-test check is the first thing in run(), so it also goes through exit_status). docs/testing.md and vk_harness.cpp merged without conflicts.

Checked on Linux, no GPU here: g++ -std=c++20 -fsyntax-only passes for all four programs against Vulkan-Headers, and git diff --check is clean. Not run on hardware after the rebase.

AI-assisted (Claude Code).

@sovljanskii

Copy link
Copy Markdown
Contributor

Tested 279898e merged onto main 561b65a on Apple M4, macOS 27.2.1, MoltenVK 1.4.2, Python 3.15.2 and 3.12.16: pass

  • The head already contains 561b65a, so the merge was clean. The runtime builds with AppleClang 21 and 0 warnings. git diff --check is clean. compileall, the eleven tests/test_docs_*.py and test_ci_registration.py pass on 3.15 and 3.12.
  • This Mac has no Khronos validation layer: vulkaninfo --summary lists no instance layers and vulkan-validationlayers is not installed. So I tested the paths without the layer and without the variable. The error-counting path and the per-VUID counts were not exercised here.
  • run_gpu_tests.py, this PR's build and a main build, same session:
    • No variable: 165/232 passed and 59 skipped on both, the same per test. The 8 failures also fail on main.
    • LEONIDA_VK_VALIDATION=0: the same per test as no variable.
    • =1: this PR passes 0/232, skips 17 and fails 215, all on the missing layer. The 17 skips are rows run by d3d12_* or w64_graphics.py. Main passes 101/232 with =1. Those 101 rows, plus 11 that skip on main, are exactly the rows the four programs used to run without checks.
  • Each of the four programs by hand:
    • Unset and =0: the same output and exit code as main.
    • =1, and also an empty value: exit 1 with one stderr line, "LEONIDA_VK_VALIDATION is set but VK_LAYER_KHRONOS_validation is not installed", before any device work.
    • vk_texture_test --self-test-cube-alpha (ctest vk_texture_cube_alpha) still exits 0 with =1, since it returns before creating the instance.
  • Mutations:
    • Ignoring prepare()'s result in vk_store_test still exits 1, because attach() finds no vkCreateDebugUtilsMessengerEXT (-7). The guard is effectively doubled.
    • Removing the calls altogether gives main's 101 unchecked passes.
    • Dropping the exit_status wrapper can't be seen without the layer, so it survived here.
  • Code:
    • The messenger is never destroyed, but none of the four calls vkDestroyInstance, so there is no VUID-vkDestroyInstance-instance-00629 at exit.
    • VK_EXT_debug_utils is requested only once the layer is found, and the layer provides it. A missing entry point fails through CHECK with -7, not silently.
    • prepare() copies the existing layers and extensions and leaves ici.flags alone, so it can't drop a portability flag. There is none to keep, though (next point).
  • macOS, not blocking. This comes from vulkan_loader.h and vk_compute_test: run under validation with LEONIDA_VK_VALIDATION, fail on a validation error (TEST-877) #4005's vk_validation.h, not this diff:
    • The default path dlopens libMoltenVK.dylib directly (runtime/test/vulkan_loader.h:34), and that lists no layers. So on a Mac, =1 says "not installed" even when the Homebrew layer is installed.
    • With LEONIDA_VULKAN_LOADER=/opt/homebrew/lib/libvulkan.1.dylib, all four fail vkCreateInstance with -9, on main as well. vk_texture_test returns 77 there, so its rows count as skips. The cause is that no program sets VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR (docs/design.md:100).
    • I tried adding that flag and VK_KHR_portability_enumeration to vk_harness's instance, locally. It then runs through loader 1.4.363 and draws a byte-identical 64x64 frame.
    • MoltenVK also lists VK_KHR_portability_subset, which none of the programs enable. Going by the VUID's text, any validation run here would then also report VUID-VkDeviceCreateInfo-pProperties-04451 per device, whatever the ICD manifest says.
    • Suggested follow-up: on __APPLE__, have the "not installed" message name LEONIDA_VULKAN_LOADER. In validation mode, request portability enumeration when the loader lists it, and enable VK_KHR_portability_subset when the device lists it. Until then, one macOS sentence in the new paragraph at docs/testing.md:148 would do.
  • Nit: under =1, ps_ssharp's one-line summary shows vk_sampler_test's "S# ..." stdout line, not the diagnostic. That line is printed at vk_sampler_test.cpp:80, before load_vulkan(). The diagnostic itself is on stderr.

AI-assisted.

@TheAirborneCoder

Copy link
Copy Markdown
Contributor

Tested 279898ee6 merged onto main 561b65a83 on Apple M2 Ultra, macOS 27.3 (26C5035r), AppleClang 21 (0 warnings), with Homebrew vulkan-loader 1.4.363.0, Khronos vulkan-validationlayers 1.4.363.0, KosmicKrisp (Mesa 26.3.1), and MoltenVK 1.4.2: pass — including the real validation error-counting path across all four programs on Apple Silicon via KosmicKrisp.

  • Unset / =0 & missing-layer guards:
    • Unset and LEONIDA_VK_VALIDATION=0: 165/232 passed, 59 skipped, 8 failed on MoltenVK and 166/232 passed, 62 skipped, 4 failed on KosmicKrisp, matching main 561b65a83 per test.
    • LEONIDA_VK_VALIDATION=1 on default direct libMoltenVK.dylib (no loader) or on KosmicKrisp with an empty VK_LAYER_PATH: all four programs exit 1 with LEONIDA_VK_VALIDATION is set but VK_LAYER_KHRONOS_validation is not installed (0/232 passed, 17 skipped), while vk_texture_test --self-test-cube-alpha still exits 0.
  • MoltenVK 1.4.2 behind libvulkan.1.dylib:
    • With LEONIDA_VULKAN_LOADER=/opt/homebrew/lib/libvulkan.1.dylib, VK_DRIVER_FILES=/opt/homebrew/etc/vulkan/icd.d/MoltenVK_icd.json, and VK_LAYER_PATH set, prepare() finds VK_LAYER_KHRONOS_validation and attaches the pre-instance messenger (which prints the loader's portability diagnostic), and vkCreateInstance returns -9 (VK_ERROR_INCOMPATIBLE_DRIVER: exit 1 in vk_harness/vk_store_test/vk_sampler_test, 77 in vk_texture_test; 0/232 passed, 39 skipped), confirming portability enumeration blocks MoltenVK under the loader as @sovljanskii noted.
  • KosmicKrisp 26.3.1 + active Khronos Validation Layer 1.4.363.0 (LEONIDA_VULKAN_LOADER=/opt/homebrew/lib/libvulkan.1.dylib, VK_DRIVER_FILES=/opt/homebrew/share/vulkan/icd.d/kosmickrisp_mesa_icd.aarch64.json, VK_LAYER_PATH=..., plus DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/lib so dyld resolves Homebrew's bare libVkLayer_khronos_validation.dylib without manifest edits):
    • Clean shaders (--no-float-controls): all four programs (vk_harness, vk_store_test, vk_texture_test, vk_sampler_test) exit 0 with 0 validation errors (confirming #3347 and #4067 on main resolved every DrawParameters pCode-08740), and all 64x64 readbacks (65,536 bytes) are byte-identical to =0.
    • Error-counting controls: fs_passthru with OpCapability Int16 in vk_harness exits 0 on main and 1 here (VUID-VkShaderModuleCreateInfo-pCode-08740, 1 validation errors). Default DenormPreserve 16 modules (shaderDenormPreserveFloat16/32/64 = false on M2 Ultra) exit 0 across all four programs on main and exit 1 across all four here (4, 2, 4, 4 validation errors), while KosmicKrisp's own GENERAL SPIR-V warnings are printed as vulkan (not counted) and not counted.
    • Full suite under LEONIDA_VK_VALIDATION=1 on KosmicKrisp: main silently passed 102/232 (60 skipped, 70 failed) through these four unchecked harnesses; this branch reports 0/232 passed, 59 skipped, 173 failed, with only the expected DenormPreserve pair (122 VUID-VkShaderModuleCreateInfo-pCode-08740 + 122 VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296) and 0 other VUIDs.
  • All 11 tests/test_docs_*.py, test_ci_registration.py, and test_text_write_line_endings.py pass.

Synthetic fixtures only; no game data. AI-assisted.

Conflicts in vk_store_test.cpp and vk_texture_test.cpp: both new includes (vk_validation.h and spirv_capability.h) are kept.

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

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (fc7d1f514), keeping both new includes. Cross-built runtime/ with clang-cl 21 against the xwin SDK: vk_harness, vk_texture_test, vk_sampler_test and vk_store_test compile and link. Under Wine (no GPU), vk_texture_cube_alpha and the loader tests pass, 5/5. AI-assisted (Claude).

@best2135

Copy link
Copy Markdown

Tested fc7d1f5 on NVIDIA GeForce RTX 4070 Ti SUPER, driver 615.78.08, Linux: pass for the validation wiring. Full-suite failures reproduced on origin/main 6b421e6b0.

  • Synthetic validation control: expected PR exit codes 0 and 1 with validation off and on, got 0 and 1. Main got 0 and 0. The PR reported 1 validation error (VUID-VkShaderModuleCreateInfo-pCode-08740). All 4 frames were byte-identical.
  • With the validation layer hidden, all four affected harnesses exited 1 and reported that the layer was missing.
  • Two-step fixture build/check: 268/268 translated and passed spirv-val, 175 passed, 35 skipped. Main: 269/269 translated and passed spirv-val, 176 passed, 35 skipped.
  • Full runner, validation off and core validation on: both runs on the PR had 190 passes, 48 skips, 1 failure. Both runs on main had 191 passes, 48 skips, 1 failure. The shared failure was ms_wave_info_s3 (expected 0 pixel mismatches, first checked pixel mismatched).
  • With GPU-assisted validation: PR 182 passes, 48 skips, 9 failures. Main 183 passes, 48 skips, 9 failures. The failure outputs matched in all 9 cases: ms_wave_info_s3, cs_lds_b64_cmpst, cs_pk_mul_lo_const, cs_w32_fcmpswap, cs_w32_lds_subdword, cs_w32_lds_u8_d16, cs_w32_lds_wide, cs_w32_misc_ext, and cs_w32_new_ops. Expected 0 added failures under GPU-AV, got 8 on each head.

Linux 7.2.15-1-omarchy, subgroup 32..32, Python 3.14.8, llvm-mc 23.1.3, SPIRV-Tools 2026.4, Khronos validation layer 1.4.363. Synthetic fixtures only. AI-assisted.

gh pr checkout 4025 -R ItsNotRexed/Leonida --detach
git rev-parse --short HEAD
d=/tmp/leonida-rtx-check
export LEONIDA_VK_DEVICE='4070 Ti SUPER' VK_ADD_LAYER_PATH=$d/sdk/usr/share/vulkan/explicit_layer.d LD_LIBRARY_PATH=$d/sdk/usr/lib
cmake -S runtime -B runtime/build/gpu4025 -G Ninja -DVulkan_INCLUDE_DIR=/tmp/leonida-rtx-check/sdk/usr/include
cmake --build runtime/build/gpu4025 -j 8 --target vk_harness vk_store_test vk_texture_test vk_sampler_test vk_compute_test vk_bindless_test
python3 -I runtime/test/shaders/build.py "$d/4025-fixtures"
python3 -I runtime/test/shaders/check.py "$d/4025-fixtures" runtime/build/gpu4025
python3 -I scripts/run_gpu_tests.py --build runtime/build/gpu4025
env LEONIDA_VK_VALIDATION=1 python3 -I scripts/run_gpu_tests.py --build runtime/build/gpu4025
env LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python3 -I scripts/run_gpu_tests.py --build runtime/build/gpu4025
spirv-dis "$d/4025-fixtures/spirv/ps_flat.spv" -o "$d/4025-flat.spvasm"
sed -i '/OpCapability Shader/a\               OpCapability Int16' "$d/4025-flat.spvasm"
spirv-as --target-env vulkan1.2 "$d/4025-flat.spvasm" -o "$d/4025-flat.spv"
for build in runtime/build/gpu4025 "$d/main/runtime/build"; do
  for val in 0 1; do
    out="$d/$(basename "$build")-$val"
    LEONIDA_VK_VALIDATION=$val "$build/vk_harness" "$d/4025-fixtures/spirv/vs_ids.spv" "$d/4025-flat.spv" "$out.raw"
  done
done
sha256sum "$d"/{gpu4025,build}-{0,1}.raw
(
  export LEONIDA_VK_VALIDATION=1 VK_LAYER_PATH="$d/no-layers"
  unset VK_ADD_LAYER_PATH
  for f in ps_flat cs_imgatomic ps_texture_sample ps_ssharp; do
    python3 -I scripts/run_gpu_tests.py --build runtime/build/gpu4025 --filter "$f" --require-pass
  done
  runtime/build/gpu4025/vk_sampler_test "$d/4025-fixtures/spirv/vs_ids.spv" "$d/4025-fixtures/spirv/ps_ssharp.spv" "$d/sampler-layerless.raw" 00000092 00f00000 04000000 00000000
)
cd "$d/main"
git rev-parse --short HEAD
python3 -I runtime/test/shaders/build.py "$d/main-fixtures"
python3 -I runtime/test/shaders/check.py "$d/main-fixtures" runtime/build
python3 -I scripts/run_gpu_tests.py --build runtime/build
env LEONIDA_VK_VALIDATION=1 python3 -I scripts/run_gpu_tests.py --build runtime/build
env LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python3 -I scripts/run_gpu_tests.py --build runtime/build

@thiefyzheng

Copy link
Copy Markdown

checked: ctest -R vk_harness at your head fc7d1f514 — No tests were found!!!: that target is absent at this head. Not run; target may land in a later commit. AI-assisted, 7900 XTX rig.

@vakaobr

vakaobr commented Nov 23, 2026

Copy link
Copy Markdown

Note for whoever weighs the earlier Apple results against the current head: fc7d1f514 is a merge of main into the branch, and the PR's own change is unchanged by it. git diff <merge-base> 279898ee6 and git diff <merge-base> fc7d1f514 give the same 5 files with byte-identical added and removed lines. So the three Apple Silicon passes at 279898ee (@bobcatchris on M2, @sovljanskii on M4, @TheAirborneCoder on M2 Ultra) cover this code. GitHub reports the head as mergeable with main. I didn't rerun it myself (code comparison only, no Mac run of the new head).

AI-assisted.

@YaBulochka

Copy link
Copy Markdown
Contributor

checked: #4025 | with: MESA_VK_DEVICE_SELECT=1002:13c0! LEONIDA_VK_VALIDATION=1 python3 -I scripts/run_gpu_tests.py --build runtime/build-linux-clang --work work-clang --require-pass | on: Linux, RADV gfx1036 (Radeon iGPU, RAPHAEL_MENDOCINO, Mesa 27.0.0-devel git-f7dd61f78f, Vulkan 1.4.363, Khronos Validation 1.4.363), clang-cl 23.1.5 xwin cross-build and clang 23.1.5 native, base 8575d36 + PR head fc7d1f5, #3347 bf05936 and #4067 4eb8d08 already in main so no cherry-pick | result: 223/239 passed, 16 skipped, 0 failed, with no VUID printed at all.

No VUID-VkShaderModuleCreateInfo-pCode-08740 anywhere in the log, and the 17 cases the branch failed alone (ps_texture_*, ps_gather_*, ps_sample_*, ps_cube_sample, ps_array_resinfo, ps_get_lod*, ps_ssharp) all pass. With LEONIDA_VK_VALIDATION unset the same suite gives 223/239 passed, 16 skipped, 0 failed, so the variable changes nothing on this driver. The total is 239 rather than 210 because main added 29 cases since 6b301611 (cs_wqm_*, ms_*, ps_persp_bary, ps_sample_c*, ps_vint_*, ps_table_fetch, ps_texture_cl and more), two of which skip (ps_live_width, ps_m2_literal), so 196 + 27 = 223. The clang-cl build gives the same 223/239 under Wine, but Wine exposes zero instance layers, so the counted run is the native clang build, where removing the #4067 hunk puts 1 validation error and exit 1 back and shows the layer was live.

agent: yes

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.