vk_pipeline_check: skip a module's missing features before vkCreateShaderModule #102

Closed
leonida/mandy
Andretuta wants to merge 0 commits from old-pr/9834 into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

Andretuta commented 2026-11-24 02:18:13 +00:00

Carried over from old PR 9834 by Killurassoul in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9834, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
Killurassoul: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Claimed in the coordination issue: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115409238

What and why

vk_pipeline_check checks a shader's needs in two places: check_missing_module_feature before vkCreateShaderModule ("These capability requirements apply as soon as the module is passed to Vulkan") and check_missing_feature after it. The meta.features list (Float64, Int64, FragmentBarycentricKHR, MinLod, mesh, geometry, shader clock, draw parameters, ...) and the maintenance8 image Offset were in the second one. Each of them is a SPIR-V capability, extension or operand that the Khronos layer checks when the module is created, so on a device without the feature the checker printed SKIPPED for a module the layer had already rejected:

  • VUID-VkShaderModuleCreateInfo-pCode-08740 (capability declared, feature missing): Float64, FragmentBarycentricKHR, MinLod
  • VUID-VkShaderModuleCreateInfo-pCode-08742 (extension declared): SPV_KHR_fragment_shader_barycentric
  • VUID-RuntimeSpirv-Offset-10213 (Offset outside a gather without maintenance8)

Those checks now run in check_missing_module_feature. Pipeline counts are unchanged. A skip reason can change on a device that lacks both a feature and a float control the same shader needs, because the module-level check now runs first: on MoltenVK (no shaderFloat64, no shaderSignedZeroInfNanPreserveFloat64) the four f64 fixtures report no shaderFloat64 instead of no shaderSignedZeroInfNanPreserveFloat64 (measured by @us3r40456 below). A skipped shader no longer counts as a created module, as the existing comment at the early skip says ("No module was attempted, so only the pipeline skip is counted"). Float-control and push-constant checks stay after module creation; I did not see them reported by the layer on these GPUs.

Tested

Windows 11 (10.0.26300), MSVC 19.44 (VS 2022 Build Tools), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, llvm-mc 23.1.6 (conda-forge). Input: the 270 synthetic fixtures from runtime/test/shaders/build.py (270/270 pass spirv-val). No game files.

vk_pipeline_check <spirv> --jobs 1 --isolate with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:

GPU, driver validation errors cs pipelines ps pipelines vs gs
Intel Graphics (Meteor Lake, Xe-LPG), 101.8860 main 6312c057f 38 111 ok / 0 failed / 2 skipped 122 / 0 / 14 18 / 0 / 0 3 / 0 / 0
this PR 0 111 / 0 / 2 122 / 0 / 14 18 / 0 / 0 3 / 0 / 0
NVIDIA RTX 2000 Ada Laptop, 621.14 this PR 0 113 / 0 / 0 136 / 0 / 0 18 / 0 / 0 3 / 0 / 0

ctest -R "pipeline_check|pipeline_summary|large_module|bindless": 7/7 passed.

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

🤖 Generated with Claude Code

> Carried over from **old PR 9834** by `Killurassoul` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9834`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `Killurassoul`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Claimed in the coordination issue: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7115409238 ### What and why `vk_pipeline_check` checks a shader's needs in two places: `check_missing_module_feature` before `vkCreateShaderModule` ("These capability requirements apply as soon as the module is passed to Vulkan") and `check_missing_feature` after it. The `meta.features` list (Float64, Int64, FragmentBarycentricKHR, MinLod, mesh, geometry, shader clock, draw parameters, ...) and the maintenance8 image `Offset` were in the second one. Each of them is a SPIR-V capability, extension or operand that the Khronos layer checks when the module is created, so on a device without the feature the checker printed `SKIPPED` for a module the layer had already rejected: - `VUID-VkShaderModuleCreateInfo-pCode-08740` (capability declared, feature missing): Float64, FragmentBarycentricKHR, MinLod - `VUID-VkShaderModuleCreateInfo-pCode-08742` (extension declared): `SPV_KHR_fragment_shader_barycentric` - `VUID-RuntimeSpirv-Offset-10213` (Offset outside a gather without maintenance8) Those checks now run in `check_missing_module_feature`. Pipeline counts are unchanged. A skip reason can change on a device that lacks both a feature and a float control the same shader needs, because the module-level check now runs first: on MoltenVK (no `shaderFloat64`, no `shaderSignedZeroInfNanPreserveFloat64`) the four f64 fixtures report `no shaderFloat64` instead of `no shaderSignedZeroInfNanPreserveFloat64` (measured by `@us3r40456` below). A skipped shader no longer counts as a created module, as the existing comment at the early skip says ("No module was attempted, so only the pipeline skip is counted"). Float-control and push-constant checks stay after module creation; I did not see them reported by the layer on these GPUs. ### Tested Windows 11 (10.0.26300), MSVC 19.44 (VS 2022 Build Tools), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, llvm-mc 23.1.6 (conda-forge). Input: the 270 synthetic fixtures from `runtime/test/shaders/build.py` (270/270 pass spirv-val). No game files. `vk_pipeline_check <spirv> --jobs 1 --isolate` with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`: | GPU, driver | | validation errors | cs pipelines | ps pipelines | vs | gs | |---|---|---|---|---|---|---| | Intel Graphics (Meteor Lake, Xe-LPG), 101.8860 | main 6312c057f | 38 | 111 ok / 0 failed / 2 skipped | 122 / 0 / 14 | 18 / 0 / 0 | 3 / 0 / 0 | | | this PR | **0** | 111 / 0 / 2 | 122 / 0 / 14 | 18 / 0 / 0 | 3 / 0 / 0 | | NVIDIA RTX 2000 Ada Laptop, 621.14 | this PR | 0 | 113 / 0 / 0 | 136 / 0 / 0 | 18 / 0 / 0 | 3 / 0 / 0 | `ctest -R "pipeline_check|pipeline_summary|large_module|bindless"`: 7/7 passed. AI-assisted (Claude Code, Claude Opus 5.5). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MoonEyes commented 2026-11-30 18:41:32 +00:00

Reviewed against current main. This is not merge-ready: the PR is still a draft, conflicts with main, all reported checks are cancelled, and I found no current claim for #102 in coordination issue #2570.\n\nThe intent is still relevant rather than obsolete: main currently preflights array-indexing, image-int64-atomic, and Fma requirements in check_missing_module_feature before vkCreateShaderModule (see the call around line 1697), but several feature checks and maintenance8 are still performed by check_missing_feature after module creation (around lines 1736/1778).\n\nPlease claim the work in #2570, update/rebase this patch on current main while preserving the existing early checks, resolve the conflict, and rerun the required CI before requesting merge. No merge until those criteria are satisfied.

Reviewed against current main. This is not merge-ready: the PR is still a draft, conflicts with main, all reported checks are cancelled, and I found no current claim for #102 in coordination issue #2570.\n\nThe intent is still relevant rather than obsolete: main currently preflights array-indexing, image-int64-atomic, and Fma requirements in check_missing_module_feature before vkCreateShaderModule (see the call around line 1697), but several feature checks and maintenance8 are still performed by check_missing_feature after module creation (around lines 1736/1778).\n\nPlease claim the work in #2570, update/rebase this patch on current main while preserving the existing early checks, resolve the conflict, and rerun the required CI before requesting merge. No merge until those criteria are satisfied.
aslan2142 commented 2026-12-01 12:07:41 +00:00

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review.

(AI-assisted triage.)

Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. *(AI-assisted triage.)*
aslan2142 commented 2026-12-01 16:21:10 +00:00

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
Sign in to join this conversation.
No description provided.