vk_image_fuzz: enable shaderDrawParameters for the translated vertex shader #1417
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!1417
Loading…
Reference in a new issue
No description provided.
Delete branch "vk-image-fuzz-drawparams"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147754867
What
Every translated vertex shader declares the SPIR-V
DrawParameterscapability (BaseVertex/BaseInstance for the zero-based v0/v3 inputs), butvk_image_fuzznever enabledVkPhysicalDeviceVulkan11Features::shaderDrawParameters. UnderLEONIDA_VK_VALIDATION=1,vkCreateShaderModulefails withVUID-VkShaderModuleCreateInfo-pCode-08740on every case, on both vendors — silently zeroing entireimage_fuzzcampaigns (found when a fuzz sweep's AMD image_fuzz run produced all-fail results that turned out to be this harness bug, not translator bugs). Without validation, drivers tolerate the missing feature.Fix (+9 lines, one file): query
VkPhysicalDeviceVulkan11Featureswith a separatevkGetPhysicalDeviceFeatures2call and setenable11.shaderDrawParametersin the device-creation chain (Features2 → Vulkan12Features → Vulkan11Features), matching the shape used byvk_bindless_test/vk_sampler_test.Tested
e0b08c77d):image_fuzz --seed 1first case fails on both GPUs with VUID-08740.LEONIDA_VK_VALIDATION=1+LEONIDA_PC_TAIL_UBO=1:--programs 60→ 60/60 match; seed 2--programs 30→ 30/30; 0 VUIDs.vk_bindless_testandvk_sampler_testctest entries also pass with validation on both GPUs (same chain shape already worked there).AI-assisted (Devin).
Tested
ff3dbee82on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), againstmain364ab4eab:runtime/test/vk_image_fuzz.cppfrom this head (cmake +-DVulkan_INCLUDE_DIR=/opt/homebrew/include; no other changes needed).LEONIDA_VK_VALIDATION=1,LEONIDA_PC_TAIL_UBO=1, Khronos validation 1.4.363,--seed 1 --programs 1):main's binary reports 5 validation errors, includingvkCreateShaderModule(): SPIR-V Capability DrawParameters was declared, but … shaderDrawParameters …(VUID-VkShaderModuleCreateInfo-pCode-08740, vertex module). With this head: 4 errors, and the DrawParameters one is gone.DenormPreservefor f16 (VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296plus the matching capability VUID-08740) on both the vertex and fragment modules. They appear withmain's binary too, so they are pre-existing on MoltenVK (shaderDenormPreserveFloat16is false there), not caused by this PR.--seed 1 --programs 20matches 20/20 on both themainbinary and this head — no functional change on MoltenVK.AI-assisted; synthetic fixtures only, no game data.
Rebased cleanly onto current main (
db1a22d29) as285801f0ato refresh the stale CI baseline; no conflicts. The branch remains the vk_image_fuzz shaderDrawParameters enablement. AI-assisted with Devin.Independent NVIDIA Linux verification under LunarG Vulkan SDK
1.4.363(VK_LAYER_KHRONOS_validationwith GPU-AV + SyncVal,LEONIDA_VK_VALIDATION=1) onmainec91d695c(both machines are Google Colab Linux runtimes, driver580.82.07):mainec91d695c(NVIDIA L4, Ada):tools/image_fuzz.py --programs 30 --seed 20261126fails on the first program (0/1,R8G8B8A8_UNORM 64x64 dmask:0xf) with:VUID-VkShaderModuleCreateInfo-pCode-08740:SPIR-V Capability DrawParameters was declared, but one of the following requirements must be met (VkPhysicalDeviceVulkan11Features::shaderDrawParameters ...).VkPhysicalDeviceVulkan11Features::shaderDrawParameters = VK_TRUEchained intovk_image_fuzz.cppon top ofmainec91d695c(Tesla T4, Turing — equivalent to this PR's enablement; did not check out the PR branch directly):tools/image_fuzz.py --programs 30 --seed 20261126passes30/30(rc=0, 0 validation errors, 0 sync errors).No game files used. AI-assisted.
Verified by OreoFR
c1ecf04ed+ PR head285801f0a; green run in a merge package of 12 PRs, no new ctest failure vs mainLEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --build <build> --programs 4AI-assisted (Claude Code, Claude Opus 5.5).
Independent Windows 11 + NVIDIA GeForce RTX 3090 Verification (
285801f0acmerged ontomain5825b02ff8)Environment: Windows 11 (
10.0.26200), MSVC19.44.35228, Python3.12.10(-I),llvm-mc(gfx1030),VK_LAYER_KHRONOS_validation1.4.363.1(LEONIDA_VK_VALIDATION=1), physical NVIDIA GeForce RTX 3090 (Ampere, driver610.88, Vulkan1.4). Syntheticimage_fuzz.pyfixtures only; no game files.Results — PASS (
0validation errors)main(5825b02ff8):LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 1 --seed 1 --build <build>fails on program 1 (rc=2,translator: 0/0 programs that ran match; 1 harness error) with:VUID-VkShaderModuleCreateInfo-pCode-08740:vkCreateShaderModule(): SPIR-V Capability DrawParameters was declared, but one of the following requirements must be met (VkPhysicalDeviceVulkan11Features::shaderDrawParameters ...).main+285801f0ac:LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 20 --seed 1 --build <build>:20/20programs match (rc=0,0validation errors).LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 10 --seed 2 --build <build>:10/10programs match (rc=0,0validation errors).(Minor optional note:
vk_image_fuzz.cppcould also passneed(have11.shaderDrawParameters, "shaderDrawParameters")alongside the existingVulkan12Featureschecks so a hypothetical Vulkan 1.2 device withoutshaderDrawParametersexits77with a named missing feature rather than failing under validation.)AI-assisted.
Ready for testing: merges cleanly with
main3535eb5c4. Not inmainyet:git cherryfinds 1 commit(s) not there, and 0 of the 8 lines it adds are already present. No duplicate found: its claimVUID-08740appears in no other open pull request and in nomaincommit.AI-assisted (Claude Code).
Merged. Tested by @OreoFR on head 285801f0a (RTX 4070 Laptop 8 GB, Windows 11): red: VUID-VkShaderModuleCreateInfo-pCode-08740, 0/0 programs, exit 2; green 4/4 programs match, exit 0. Correction: I had not shown that every failed or cancelled CI job on this head was also red on main. Not shown: check (cancelled), windows (failure), macos (failure), linux-gpu-tools (failure). My earlier sentence was too broad. Thanks @whoalin1!
AI-assisted: yes