Repository navigation
vk_harness, vk_store_test, vk_texture_test, vk_sampler_test: run under validation with LEONIDA_VK_VALIDATION (TEST-877 follow-up) - #4025
Conversation
…l on a validation error (TEST-877) vk_compute_test created its instance without layers and ignored LEONIDA_VK_VALIDATION, and a validation message never changed its exit code, so scripts/run_gpu_tests.py could not catch what GPU-assisted validation finds in the compute fixtures (SHADER-708 only showed up with VK_INSTANCE_LAYERS set by hand). With LEONIDA_VK_VALIDATION=1 it now enables VK_LAYER_KHRONOS_validation and a debug messenger the way vk_bindless_test does, prints each message to stderr and counts validation-type errors. main wraps the old body, so every path (including errors GPU-AV reports when the queue finishes) ends with "N validation errors" and exit 1. Without the variable nothing changes. docs/testing.md says so, and no longer lists vk_bindless_test as a program that ignores the variable (it reads it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…/vk_validation.h OptInValidation reads LEONIDA_VK_VALIDATION, adds VK_LAYER_KHRONOS_validation, VK_EXT_debug_utils and a messenger to the instance (keeping what the program already enables), counts validation-type errors and turns them into the exit status. vk_compute_test uses it instead of its own copy, so the other shader test programs can opt in with a few lines. docs/testing.md also no longer lists vk_image_fuzz as a program that ignores the variable (it reads it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
|
Tested At With that same directory, I drew a translated constant-white pixel shader in AI-assisted verification. |
|
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.
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). |
|
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: Whole suite,
Not tested: the stacked runs with #3347 + #4067 (164/210 under validation), the No game data was used. AI-assisted run. |
|
Ran the branch ( All 17 failures are the same VUID, 1. m8.maintenance8 = VK_TRUE; f12.pNext = &m8;
This accounts for 16 of the 17: 2. Its device chain is 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 ( |
|
@YaBulochka thanks, that matches the NVIDIA run exactly (same 17, same VUID). Both chains already have open PRs:
On the RTX 3060 Ti, this branch with both cherry-picked ( AI-assisted (Claude Code). |
|
AMD half of the proof, as asked: RX 7600 (
Ryzen 5 9600X iGPU (
So both chains are needed and sufficient here: with #3347 ( Build used: |
vk_compute_test.cpp: keep both includes (vk_validation.h from this branch, cs_wave_probe_spv.h from main). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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_testandvk_sampler_testbuilt their instance without layers and ignoredLEONIDA_VK_VALIDATION. A validation message also never changed their exit code. Between them they run every pixel, store, texture and sampler case inscripts/run_gpu_tests.py. So even with #4005, a validation run of the suite could still only fail on the compute cases.What changes:
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):preparebeforevkCreateInstance: with the variable set, it adds the layer,VK_EXT_debug_utilsand a messenger, or fails with exit 1 if the layer is missing.attachafter it.mainnow wraps the old body and ends throughOptInValidation::exit_status. A counted validation error exits 1 withN validation errors.int mainrenamed tostatic int run, the two calls, and the newmain.device:andsubgroupregexes incheck.pyandrun_gpu_tests.pyare unaffected.docs/testing.mdnow lists every shader test program as reading the variable. It drops the by-handVK_INSTANCE_LAYERSrecipe, 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:LEONIDA_VK_VALIDATION=1VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1DrawParameters, and the device never enabledshaderDrawParameters. 16 go throughvk_texture_test, wheref12.pNext = &m8unlinks the Vulkan 1.1 features (tests: preserve DrawParameters when enabling Vulkan maintenance8 #3347, whattheflop). One,ps_ssharp, goes throughvk_sampler_test, which never asked for the feature (vk_sampler_test: enable shaderDrawParameters for the translated vs_ids (VUID-08740 on ps_ssharp) #4067, found here). With both, the suite under validation equals main.--lds-wave-orderdoes not clear these reports either (measured).vk_harnesscontrol:fs_passthruwithOpCapability Int16added. main with the variable set exits 0. This branch exits 0 without the variable and 1 with it (VUID-VkShaderModuleCreateInfo-pCode-08740). The frames are byte-identical with and without validation.g++ -std=c++20 -fsyntax-onlyagainst Vulkan-Headers.Also tested on AMD Radeon RX 7800 XT, driver 26.11.2, Windows 10 19045, validation layer 1.4.363. Base main aa2988c:
LEONIDA_VK_VALIDATION=1cs_w64x_lds_rawandcs_w64x_lds_war(native wave64, lane 0 against lane 32). All are race reports with 0 mismatches.AI-assisted (Claude Code).
🤖 Generated with Claude Code