vk_image_fuzz: enable shaderDrawParameters for the translated vertex shader #1417

Merged
whoalin1 merged 1 commit from upstream-pr/1417 into main 2026-11-29 15:41:49 +00:00
whoalin1 commented 2026-11-24 23:45:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-24T23:45:54Z.


Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147754867

What

Every translated vertex shader declares the SPIR-V DrawParameters capability (BaseVertex/BaseInstance for the zero-based v0/v3 inputs), but vk_image_fuzz never enabled VkPhysicalDeviceVulkan11Features::shaderDrawParameters. Under LEONIDA_VK_VALIDATION=1, vkCreateShaderModule fails with VUID-VkShaderModuleCreateInfo-pCode-08740 on every case, on both vendors — silently zeroing entire image_fuzz campaigns (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 VkPhysicalDeviceVulkan11Features with a separate vkGetPhysicalDeviceFeatures2 call and set enable11.shaderDrawParameters in the device-creation chain (Features2 → Vulkan12Features → Vulkan11Features), matching the shape used by vk_bindless_test/vk_sampler_test.

Tested

  • Before fix (e0b08c77d): image_fuzz --seed 1 first case fails on both GPUs with VUID-08740.
  • After fix, LEONIDA_VK_VALIDATION=1 + LEONIDA_PC_TAIL_UBO=1:
    • AMD Radeon iGPU (gfx1035, driver 24.10.24): seed 1 --programs 60 → 60/60 match; seed 2 --programs 30 → 30/30; 0 VUIDs.
    • NVIDIA RTX 4070 SUPER: seed 1 → 60/60; seed 2 → 30/30; 0 VUIDs.
  • vk_bindless_test and vk_sampler_test ctest entries also pass with validation on both GPUs (same chain shape already worked there).

AI-assisted (Devin).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482292668 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1417). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-24T23:45:54Z. --- Claimed in the coordination issue: https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7147754867 ## What Every translated vertex shader declares the SPIR-V `DrawParameters` capability (BaseVertex/BaseInstance for the zero-based v0/v3 inputs), but `vk_image_fuzz` never enabled `VkPhysicalDeviceVulkan11Features::shaderDrawParameters`. Under `LEONIDA_VK_VALIDATION=1`, `vkCreateShaderModule` fails with `VUID-VkShaderModuleCreateInfo-pCode-08740` on **every case, on both vendors** — silently zeroing entire `image_fuzz` campaigns (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 `VkPhysicalDeviceVulkan11Features` with a separate `vkGetPhysicalDeviceFeatures2` call and set `enable11.shaderDrawParameters` in the device-creation chain (`Features2 → Vulkan12Features → Vulkan11Features`), matching the shape used by `vk_bindless_test`/`vk_sampler_test`. ## Tested - Before fix (`e0b08c77d`): `image_fuzz --seed 1` first case fails on both GPUs with VUID-08740. - After fix, `LEONIDA_VK_VALIDATION=1` + `LEONIDA_PC_TAIL_UBO=1`: - AMD Radeon iGPU (gfx1035, driver 24.10.24): seed 1 `--programs 60` → **60/60 match**; seed 2 `--programs 30` → **30/30**; 0 VUIDs. - NVIDIA RTX 4070 SUPER: seed 1 → 60/60; seed 2 → 30/30; 0 VUIDs. - `vk_bindless_test` and `vk_sampler_test` ctest entries also pass with validation on both GPUs (same chain shape already worked there). AI-assisted (Devin).
GeorgiyDemo commented 2026-11-24 23:55:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by GeorgiyDemo on 2026-11-24T23:55:59Z.


Tested ff3dbee82 on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against main 364ab4eab:

  • Rebuilt runtime/test/vk_image_fuzz.cpp from this head (cmake + -DVulkan_INCLUDE_DIR=/opt/homebrew/include; no other changes needed).
  • Validation on (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, including vkCreateShaderModule(): 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.
  • The 4 remaining VUIDs are DenormPreserve for f16 (VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296 plus the matching capability VUID-08740) on both the vertex and fragment modules. They appear with main's binary too, so they are pre-existing on MoltenVK (shaderDenormPreserveFloat16 is false there), not caused by this PR.
  • Without validation: --seed 1 --programs 20 matches 20/20 on both the main binary and this head — no functional change on MoltenVK.

AI-assisted; synthetic fixtures only, no game data.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7147953445 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1417#issuecomment-7147953445). Originally posted by [GeorgiyDemo](https://github.com/GeorgiyDemo) on 2026-11-24T23:55:59Z. --- Tested `ff3dbee82` on Apple M5 Pro (16-core GPU), macOS 26.7.3 (25G342), against `main` `364ab4eab`: - Rebuilt `runtime/test/vk_image_fuzz.cpp` from this head (cmake + `-DVulkan_INCLUDE_DIR=/opt/homebrew/include`; no other changes needed). - **Validation on** (`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, including `vkCreateShaderModule(): 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. - The 4 remaining VUIDs are `DenormPreserve` for f16 (`VUID-RuntimeSpirv-shaderDenormPreserveFloat16-06296` plus the matching capability VUID-08740) on both the vertex and fragment modules. They appear with `main`'s binary too, so they are pre-existing on MoltenVK (`shaderDenormPreserveFloat16` is false there), not caused by this PR. - **Without validation**: `--seed 1 --programs 20` matches 20/20 on both the `main` binary and this head — no functional change on MoltenVK. AI-assisted; synthetic fixtures only, no game data.
whoalin1 commented 2026-11-25 20:07:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by whoalin1 on 2026-11-25T20:07:38Z.


Rebased cleanly onto current main (db1a22d29) as 285801f0a to refresh the stale CI baseline; no conflicts. The branch remains the vk_image_fuzz shaderDrawParameters enablement. AI-assisted with Devin.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7173226573 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1417#issuecomment-7173226573). Originally posted by [whoalin1](https://github.com/whoalin1) on 2026-11-25T20:07:38Z. --- Rebased cleanly onto current main (`db1a22d29`) as `285801f0a` to refresh the stale CI baseline; no conflicts. The branch remains the vk_image_fuzz shaderDrawParameters enablement. AI-assisted with Devin.
kevincommits commented 2026-11-27 14:43:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by kevincommits on 2026-11-27T14:43:36Z.


Independent NVIDIA Linux verification under LunarG Vulkan SDK 1.4.363 (VK_LAYER_KHRONOS_validation with GPU-AV + SyncVal, LEONIDA_VK_VALIDATION=1) on main ec91d695c (both machines are Google Colab Linux runtimes, driver 580.82.07):

  • Unmodified main ec91d695c (NVIDIA L4, Ada): tools/image_fuzz.py --programs 30 --seed 20261126 fails 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 ...).
  • With VkPhysicalDeviceVulkan11Features::shaderDrawParameters = VK_TRUE chained into vk_image_fuzz.cpp on top of main ec91d695c (Tesla T4, Turing — equivalent to this PR's enablement; did not check out the PR branch directly): tools/image_fuzz.py --programs 30 --seed 20261126 passes 30/30 (rc=0, 0 validation errors, 0 sync errors).

No game files used. AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7221148833 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1417#issuecomment-7221148833). Originally posted by [kevincommits](https://github.com/kevincommits) on 2026-11-27T14:43:36Z. --- Independent NVIDIA Linux verification under LunarG Vulkan SDK `1.4.363` (`VK_LAYER_KHRONOS_validation` with GPU-AV + SyncVal, `LEONIDA_VK_VALIDATION=1`) on `main` `ec91d695c` (both machines are Google Colab Linux runtimes, driver `580.82.07`): - **Unmodified `main` `ec91d695c` (NVIDIA L4, Ada):** `tools/image_fuzz.py --programs 30 --seed 20261126` fails 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 ...)`. - **With `VkPhysicalDeviceVulkan11Features::shaderDrawParameters = VK_TRUE` chained into `vk_image_fuzz.cpp` on top of `main` `ec91d695c` (Tesla T4, Turing — equivalent to this PR's enablement; did not check out the PR branch directly):** `tools/image_fuzz.py --programs 30 --seed 20261126` passes **`30/30`** (`rc=0`, 0 validation errors, 0 sync errors). No game files used. AI-assisted.
OreoFR commented 2026-11-28 21:50:07 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:50:07Z.


Verified by OreoFR

  • Base: main c1ecf04ed + PR head 285801f0a; green run in a merge package of 12 PRs, no new ctest failure vs main
  • Test: LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --build <build> --programs 4
  • Red on main: validation error VUID-VkShaderModuleCreateInfo-pCode-08740, 0/0 programs, 1 harness error (exit code 2)
  • Green with the PR: 4/4 programs identical, exit code 0
  • Verdict: READY
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246308132 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1417#issuecomment-7246308132). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:50:07Z. --- **Verified by OreoFR** - Base: main `c1ecf04ed` + PR head `285801f0a`; green run in a merge package of 12 PRs, no new ctest failure vs main - Test: `LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --build <build> --programs 4` - Red on main: validation error VUID-VkShaderModuleCreateInfo-pCode-08740, 0/0 programs, 1 harness error (exit code 2) - Green with the PR: 4/4 programs identical, exit code 0 - Verdict: READY - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 01:34:56 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T01:34:56Z.


Independent Windows 11 + NVIDIA GeForce RTX 3090 Verification (285801f0ac merged onto main 5825b02ff8)

Environment: Windows 11 (10.0.26200), MSVC 19.44.35228, Python 3.12.10 (-I), llvm-mc (gfx1030), VK_LAYER_KHRONOS_validation 1.4.363.1 (LEONIDA_VK_VALIDATION=1), physical NVIDIA GeForce RTX 3090 (Ampere, driver 610.88, Vulkan 1.4). Synthetic image_fuzz.py fixtures only; no game files.

Results — PASS (0 validation errors)

  • Red on 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 ...).
  • Green on main + 285801f0ac:
    • LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 20 --seed 1 --build <build>: 20/20 programs match (rc=0, 0 validation errors).
    • LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 10 --seed 2 --build <build>: 10/10 programs match (rc=0, 0 validation errors).

(Minor optional note: vk_image_fuzz.cpp could also pass need(have11.shaderDrawParameters, "shaderDrawParameters") alongside the existing Vulkan12Features checks so a hypothetical Vulkan 1.2 device without shaderDrawParameters exits 77 with a named missing feature rather than failing under validation.)

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248877811 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1417#issuecomment-7248877811). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T01:34:56Z. --- ### Independent Windows 11 + NVIDIA GeForce RTX 3090 Verification (`285801f0ac` merged onto `main` `5825b02ff8`) **Environment**: Windows 11 (`10.0.26200`), MSVC `19.44.35228`, Python `3.12.10` (`-I`), `llvm-mc` (`gfx1030`), `VK_LAYER_KHRONOS_validation` `1.4.363.1` (`LEONIDA_VK_VALIDATION=1`), physical **NVIDIA GeForce RTX 3090** (Ampere, driver `610.88`, Vulkan `1.4`). Synthetic `image_fuzz.py` fixtures only; no game files. #### Results — **PASS (`0` validation errors)** - **Red on `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 ...)`. - **Green on `main` + `285801f0ac`**: - `LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 20 --seed 1 --build <build>`: **`20/20` programs match (`rc=0`, `0` validation errors)**. - `LEONIDA_VK_VALIDATION=1 python -I tools/image_fuzz.py --programs 10 --seed 2 --build <build>`: **`10/10` programs match (`rc=0`, `0` validation errors)**. *(Minor optional note: `vk_image_fuzz.cpp` could also pass `need(have11.shaderDrawParameters, "shaderDrawParameters")` alongside the existing `Vulkan12Features` checks so a hypothetical Vulkan 1.2 device without `shaderDrawParameters` exits `77` with a named missing feature rather than failing under validation.)* AI-assisted.
TheGeogeo commented 2026-11-29 14:18:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:18:50Z.


Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 1 commit(s) not there, and 0 of the 8 lines it adds are already present. No duplicate found: its claim VUID-08740 appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257205768 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1417#issuecomment-7257205768). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:18:50Z. --- Ready for testing: merges cleanly with `main` `3535eb5c4`. Not in `main` yet: `git cherry` finds 1 commit(s) not there, and 0 of the 8 lines it adds are already present. No duplicate found: its claim `VUID-08740` appears in no other open pull request and in no `main` commit. AI-assisted (Claude Code).
MoonEyes commented 2026-11-29 15:41:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T15:41:52Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258294430 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1417#issuecomment-7258294430). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T15:41:52Z. --- 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
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1417
No description provided.