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
|
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: |
|
Still needed on current main When the layer is forced through the loader instead ( So after #4067 this PR should give a clean Linux/RADV full-suite run. |
|
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. |
…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>
|
Rebased onto main Three conflicts, all from changes that landed on main since: Checked on Linux, no GPU here: AI-assisted (Claude Code). |
44444a0 to
279898e
Compare
|
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
AI-assisted. |
|
Tested
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>
|
Merged main ( |
|
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
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 |
|
checked: |
|
Note for whoever weighs the earlier Apple results against the current head: AI-assisted. |
|
checked: #4025 | with: No agent: yes |
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