Repository navigation
Size Vulkan pipeline checker descriptor layouts for the selected GPU (BUILD-1402) - #4811
PingasMech wants to merge 3 commits into
Conversation
|
Retested the ordinary-layout case from the tracker report at
At 128 and 4,096 the RTX 3080 Ti, NVIDIA 620.73.04, CachyOS. Khronos Profiles disabled sampled-image update-after-bind and varied the ordinary sampled-image limit, keeping the per-stage sampler and storage-image limits at 32 and 128. Synthetic fixtures, pipeline creation only. AI-assisted. |
|
Windows RTX 4080 coverage for
Each run built four compute, three pixel and one vertex pipeline. The UBO index contained 16-byte tail blocks in one compute and three pixel shaders. Both indexes passed AI-assisted (Codex). |
|
Tested
No game data. AI-assisted (Gemini, Antigravity). |
|
Tested cb8132b on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
Flyander
left a comment
There was a problem hiding this comment.
Request changes: the checker omits multisample bindings that the shader declares, so pipeline creation runs with an incomplete descriptor-set layout and triggers Vulkan validation. This is reproducible with a synthetic SPIR-V module; details are on the inline comment.
| std::uint32_t count = 0; | ||
| for (std::uint32_t b = 0; b < binding_count; ++b) { | ||
| if (!binding_enabled(b, features)) continue; | ||
| if (!binding_enabled(b, features) || !(binding_mask & (1u << b))) continue; |
There was a problem hiding this comment.
Source trace: PipelineCheckDescriptors leaves features.ms_samples at SAMPLE_COUNT_1; the parsed mask and fits() retain b20, but binding_enabled(20) is false, so this condition omits it. I reproduced the Vulkan validation result with a synthetic compute SPIR-V module that uses an SSBO at set 0/binding 2 and a multisampled image at set 0/binding 20 via OpImageFetch with the Sample operand: a manually created layout containing only b2 triggers VUID-VkComputePipelineCreateInfo-layout-07988; adding b20 as VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE removes the diagnostic. I could not build or run this PR's vk_pipeline_check executable on this host, so please exercise that exact path in a regression test.
There was a problem hiding this comment.
@Flyander, thanks for the precise test case. Fixed in d77112cd. When a shader declares a multisample binding, the checker now builds a per-shader layout that includes that binding even when the runtime defaults to one sample.
I reproduced VUID-VkComputePipelineCreateInfo-layout-07988 on the parent commit with my Intel UHD 770 (Windows 11, driver 32.0.101.7088). The driver counted the pipeline as built, so the new vk_pipeline_check_ms_binding regression also checks the validation output. It fetches a sample from binding 20 and writes the result to binding 2.
On the fix, the regression built one pipeline with zero Khronos validation errors in each run, first with native driver features and then with ordinary descriptors forced. The CPU test covers bindings 20–25. The full 220-shader run built 202 pipelines with zero failures and 18 skips, with the same validation diagnostics as the parent.
Could you take another look at d77112cd and confirm it covers the case you reported? AI-assisted.
BUILD-1402. Compile shaders that declare multisample bindings with a per-shader set. Use one descriptor per declared binding and check storage-image counts against the limits of the active descriptor mode. Add a validation-layer GPU regression for a compute shader that fetches a sample at binding 20 and writes to binding 2. Cover all six multisample bindings in the CPU sizing test. AI-assisted. On Intel UHD 770 (32.0.101.7088), the parent reported VUID-VkComputePipelineCreateInfo-layout-07988. The regression now passes with native features and with ordinary descriptors forced. The 220-shader suite built 202 pipelines with zero failures and 18 skips.
|
Tested MSVC 14.44 build of this head (
I ran it twice on each GPU: plain, and with The CTest part also passes on both GPUs ( This run does not cover the case from the review above (a multisample image at binding 20): I disassembled the 242 modules and none of them declares a multisample image type, so Not run: the same index on Tools: llvm-mc 23.1.6 (conda-forge), Vulkan SDK 1.4.363.0, Python 3.11.9, AI-assisted. Synthetic test programs and counts only, no game files. Created with Perplexity |
Flyander
left a comment
There was a problem hiding this comment.
Request changes: the new multisample regression test is skipped by the repository default runtime CI invocation; details are on the inline comment.
| @@ -0,0 +1,25 @@ | |||
| # The driver may build the pipeline even when binding 20 is missing. Check the validation output too. | |||
| if(NOT "$ENV{LEONIDA_VK_VALIDATION}" STREQUAL "1") | |||
There was a problem hiding this comment.
Repro using the checked-in workflow: .github/workflows/runtime.yml runs ctest --test-dir runtime/build --output-on-failure without setting LEONIDA_VK_VALIDATION (no workflow sets it). This script returns before compiling the fixture whenever that variable is absent, and the CTest SKIP_REGULAR_EXPRESSION turns the return into a skipped/passing test. Therefore the exact b20 regression case is not exercised in CI; the reviewer report above also notes that the 242-module run had no multisample shader. Please arrange for this test to run in CI with Khronos Validation available, or add a dedicated validation step.
pwu2775-dev
left a comment
There was a problem hiding this comment.
Tested cb8132b on Windows 11 (26300), MSVC 19.44 (VS 2022), scripts/build_runtime.ps1 (Ninja), RelWithDebInfo, NVIDIA GeForce RTX 4070 (driver 617.42): pass. ctest 173/173 (GameInput disabled, no SDL3), including bindless_sizing_test. I have no Intel UHD 770, so the 95 → 202 pipelines figures are not reproduced here.
Read-only observations on pipeline_check_descriptors.h, not blocking:
compact = !features.update_after_bind && !minimum_fits: when the three update-after-bind features are enabled andsize_bindingsstill reportsminimum_fits == false, the shared layout is kept even though it exceeds the limits.- The checker never sets
features.ms_samples, sobinding_enabledleaves bindings 20-25 out ofSetLayout(only the tests set it). That is fine while the translator only emits 0-19, but an index that lists those bindings would get a layout that does not match the shader.
AI-assisted: the review was done by Codex (gpt-6.1-terra); both points were checked against the code.
|
On the current head, b20 is covered by the new path: The remaining issue is test execution: the standard |
|
I reproduced the binding-20 diagnostic on
The parent returned 0 and counted the pipeline as built in both modes, so the validation output caught the failure. I forced ordinary descriptors in local test builds by masking sampled-image update-after-bind after feature discovery, then restored both builds. On the unmodified fix, AI-assisted (Codex). |
BUILD-1402. Install Khronos validation and glslang in the Linux GPU job. Build the pipeline checker immediately after configuration and require its named multisample CTest to pass with validation active. Keep the remaining runtime tests in the existing suite. AI-assisted. On Ubuntu 24.04 with Mesa llvmpipe and Khronos validation 1.3.275, the dedicated step passed. It failed for a skipped test, a missing test, an unavailable validation layer, and the pre-fix checker reporting VUID-VkComputePipelineCreateInfo-layout-07988.
Flyander
left a comment
There was a problem hiding this comment.
Both findings I raised are addressed on 16e6025: declared multisample bindings are retained in the per-shader layout, and the binding-20 regression now has a dedicated validation-enabled Linux CI step that explicitly requires Passed. The commit reports that the llvmpipe step passed locally. GitHub reports the hosted workflows as action_required, so I could not independently confirm those hosted checks; they should be authorized and run before merge.
|
On the CI skip Finder raised: the script's early return and the CTest
Not claiming this; it is your change to land, and the fix belongs in the same PR so the regression is exercised from the run that introduces it. AI-assisted. |
|
Tested 16e6025 on Intel UHD Graphics 770 (driver 32.0.101.7088), Windows 11, MSVC 19.44, Vulkan SDK 1.4.357.0: pass for the checks below.
The 220-module index from the PR body was not available here, so the 202/95 pipeline counts are not reproduced. AI-assisted. |
|
Tested 16e6025 merged onto main 3faac55 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:
AI-assisted (Claude Code). |
|
Verified against main 3faac55: clean merge, compileall and the docs guards (CLI flags, repo paths, env vars) pass. Reviewer-side static check: the compact per-shader set-0 layout matches the docs text (default mask bits 0..19, MS binding 20 kept when declared, one descriptor per binding only when the ordinary minimum does not fit), and the CI step greps for Passed so a SKIP cannot pass the binding-20 gate — good design. The ctest targets need a Vulkan/validation-layer build and were not run here, and the branch reports no CI checks at all — please trigger a run before merge. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only review). |
|
Tested
Heads-up for the merge order. This PR and my #2124 ( I built that merge on the M4:
So your per-shader layouts work for the Counts only. AI-assisted. |
|
A31 follow-up on exact Keeping the shader, logical device recipe, push range, 65,536 image slots, 3,936 samplers and update-after-bind flags fixed, the probe also hits with this PR's seed if the six MS bindings are omitted. In the fully controlled comparison, seed and read match with 20 bindings; adding only the runtime's three MS binding pairs to the read changes it to a miss; a seed made with 26 bindings hits with 26. No Vulkan validation diagnostics in the probe. These are application-cache feedback bits from the driver, synthetic only. A31 measurements This confirms the branch fixes the ordinary layout mismatch on this device and isolates the remaining MS-pair cache difference. AI-assisted. |
Claimed in the coordination issue as BUILD-1402. Claim · Original Intel measurements
What and why
The checker gave every device the same ordinary set-0 layout. On Intel UHD 770, that layout requested 4,352 storage-image descriptors per stage against a limit of 16. Khronos validation also reported 5,632 sampled images against a limit of 200. Valid compute and graphics pipelines then failed to build.
The checker now uses the runtime’s
bindless::SetLayoutandsize_bindingswith the enabled device features. It keeps the shared layout when reduced counts fit. On devices where even the smallest ordinary shared layout exceeds the limits, it compiles with one descriptor per binding declared by the shader. Indexes without binding metadata use the existing 0–19 binding set. The checker keeps descriptor set layouts alive until pipeline creation has finished.Tested
Windows 11, MSVC 19.44, Intel UHD Graphics 770, driver
32.0.101.7088, Khronos validation 1.4.363. All inputs were repository-owned synthetic shaders.98fa503fAll descriptor-limit validation errors cleared. Validation still reports existing shader-capability and instruction diagnostics on the full index. In the compute-only run, the only such diagnostic was the lack of FP64 on the one skipped fixture.
--pc-tail-ubobuilt in both modes with zero validation errors. Older indexes with absent or nullbindingsalso passed the four-fixture check.gta6rt,vk_pipeline_check,vk_bindless_test, andbindless_sizing_testbuilt. The checker CLI and sizing CTests, seven index tests, and six documentation link tests passed.AI-assisted (Codex).