Repository navigation
vk_compute_test: run under validation with LEONIDA_VK_VALIDATION, fail on a validation error (TEST-877) - #4005
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>
|
Independent Windows/RTX 5080 check at |
|
Tested
|
|
Compute side is clean on AMD RADV. Built the branch and ran the full GPU suite with The 17 failures in that run are all |
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>
|
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
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. |
|
Tested Setup: the PR diff applied to
No game files. AI-assisted (Claude Code); I ran the commands above and checked the numbers against the logs. |
TEST-877 (found by @zzEmmazz, finding).
vk_compute_testbuilt its instance without layers and ignoredLEONIDA_VK_VALIDATION. A validation message also never changed its exit code. Soscripts/run_gpu_tests.pycould not catch what GPU-assisted validation finds in the compute fixtures. SHADER-708 only showed up withVK_INSTANCE_LAYERSset by hand.What changes:
runtime/test/vk_validation.h(OptInValidation, header only):LEONIDA_VK_VALIDATIONset and not0, it addsVK_LAYER_KHRONOS_validation,VK_EXT_debug_utilsand a messenger to the instance info, keeping whatever the program already enables. The messenger also covers instance creation.vk_bindless_test, so a broken third-party layer can't fail a test.exit_status(rc)turns counted errors into exit 1 (also over 0 and 77) and printsN validation errors.vk_compute_testuses it.mainnow wraps the old body, so every path ends throughexit_status. That includes the errors GPU-AV reports when the queue finishes, after the words were judged.LEONIDA_VK_VALIDATION=1 VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1 python scripts/run_gpu_tests.pynow fails every compute test the layer objects to.device:line gains(validation on)only when it is set. Thesubgroup MIN..MAXregexes incheck.pyandrun_gpu_tests.pystill match.docs/testing.mdsays this. It also stops listingvk_bindless_testandvk_image_fuzzas programs that ignore the variable, because both read it.The other four programs (
vk_harness,vk_store_test,vk_texture_test,vk_sampler_test) get the same helper in a follow-up PR, claimed as a new item.Tested on RTX 3060 Ti, driver 580.173.02, Linux, Khronos validation layer 1.4.357. Base main aa2988c against this branch with #4025 on top (head 6b30161). Controls are
vk_compute_test <spv> 1 dump:LEONIDA_VK_VALIDATION=1+ GPU-AVcs_lds(clean)OpCapability Int16(feature never enabled)out[0..7]is identical in every run of a row, so validation only changes the exit status.LEONIDA_VK_VALIDATION is set but VK_LAYER_KHRONOS_validation is not installed.python -I scripts/run_gpu_tests.py) without the variable: 164/210 passed, 46 skipped, the same as main.vk_texture_test/vk_sampler_test(so they come from vk_harness, vk_store_test, vk_texture_test, vk_sampler_test: run under validation with LEONIDA_VK_VALIDATION (TEST-877 follow-up) #4025), with one VUID: a translated VS declaresDrawParametersand the device never enabledshaderDrawParameters. tests: preserve DrawParameters when enabling Vulkan maintenance8 #3347 (whattheflop) fixesvk_texture_test, and vk_sampler_test: enable shaderDrawParameters for the translated vs_ids (VUID-08740 on ps_ssharp) #4067 fixesvk_sampler_test.cs_w32_lds_wide,cs_w32_lds_subdwordandcs_w32_lds_u8_d16write one LDS dword from every lane by design (their header says so), which is a race under the Vulkan memory model and harmless on hardware.cs_lds_b64_cmpst,cs_w32_misc_extandcs_w32_new_opscut EXEC to lane 0 first. The translated LDS ops sit in%activebranches, so only invocation 0 runs the atomic and the later load, in program order. The layer reports these as "Likely against unknown invocation", so they look like layer false positives, not translator bugs.AI-assisted (Claude Code).
🤖 Generated with Claude Code