Repository navigation
vk_pipeline_check: choose robustBufferAccess and VK_EXT_robustness2 as the runtime does (RT-PIPELINE-CHECK-ROBUSTNESS) - #1833
Conversation
…s the runtime does (RT-PIPELINE-CHECK-ROBUSTNESS) Since ba62682 (ubiquitarianism#1723) the runtime's device enables robustBufferAccess with VK_EXT_robustness2's robustBufferAccess2 for bounded indexed indirect draws (leonida::can_enable_robust_index_view, with maintenance5), and nullDescriptor wherever robustness2 offers it. The checker still forced robustBufferAccess off and never enabled robustness2. AMD makes robust buffer access part of a pipeline's cache key, so the cache the checker saves stopped hitting in gta6rt: pipeline_cache_seed fails on an RX 7900 XT. The checker now makes the same choice with the same helper, chains robustness2 and maintenance5 only when one of them is used, and after the general feature query keeps only those choices. A buffer update-after-bind feature it enables also asks the helper for robustBufferAccessUpdateAfterBind, so its own device stays valid.
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
2 open issues
What changed in this PR
Aligns vk_pipeline_check device feature/extension selection with the runtime to avoid Vulkan pipeline cache key mismatches (notably on AMD where robust buffer access affects the cache key).
Changes:
- Mirrors the runtime’s decisions for
robustBufferAccess,VK_EXT_robustness2(robustBufferAccess2,nullDescriptor), and (conditionally)VK_KHR_maintenance5. - Updates the checker’s post-query feature overrides so only the runtime-matching robustness bits remain enabled.
- Documents the robustness/keying behavior and the runtime parity requirement.
| File | Description |
|---|---|
| runtime/test/vk_pipeline_check.cpp | Adds runtime-parity robustness2/maintenance5 probing and applies matching feature enables to keep pipeline cache keys consistent. |
| docs/pipeline_check.md | Updates documentation to describe the runtime/checker alignment for robustness-related cache key behavior. |
Review effort: Lite
| // The runtime passes its bindless choice (storage-buffer update-after-bind); this device enables every | ||
| // supported update-after-bind feature, so any buffer one asks for the property (VUID-...-robustBufferAccess-10247). | ||
| q12.descriptorBindingUniformBufferUpdateAfterBind || q12.descriptorBindingStorageBufferUpdateAfterBind || | ||
| q12.descriptorBindingUniformTexelBufferUpdateAfterBind || | ||
| q12.descriptorBindingStorageTexelBufferUpdateAfterBind); |
There was a problem hiding this comment.
Fixed in ba6720e9a. The input is now the runtime's VulkanDeviceInfo::bindless (runtime_bindless(), the same six-feature AND). The checker also enables only the runtime's update-after-bind set, so robustBufferAccess never meets a buffer update-after-bind feature without the property.
| // The runtime passes its bindless choice (storage-buffer update-after-bind); this device enables every | ||
| // supported update-after-bind feature, so any buffer one asks for the property (VUID-...-robustBufferAccess-10247). |
There was a problem hiding this comment.
Reworded in ba6720e9a, and it now cites the full VUID-VkDeviceCreateInfo-robustBufferAccess-10247.
|
AMD Radeon 780M (RDNA3): I could not run The runtime's device enables robustness here, so Cache-key measurement. Four builds of
Each build was run as the same file name (
Every build hits its own cache (the diagonal) and misses the others, so the mechanism works on this driver; the off-diagonal entries report "no hit reported". The whole matrix was run twice with the same result. The cache file is accepted in every case: in the main/PR pair it grows from 2412 to 4772 bytes after the cross-configuration read, and each configuration then hits only its own entry - the misses are a cache-key difference, not a rejected cache. So on this driver, turning core One difference in the inputs, from reading the code rather than measuring it: the runtime passes its Not covered here: AI-assisted (MiniMax Code). No game files. |
|
NVIDIA data point:
AI-assisted (Claude) |
|
Potential high-severity gap in the robustness input, as Copilot flagged: the checker does not pass the same The runtime ( This checker passes an OR of The OR can be true where The shared test device helper already does it correctly: On the 7900 XT both are true and AI-assisted. |
|
Concrete patch for the OR-vs-AND gap, on top of your branch so it is easy to take: Branch: q12.runtimeDescriptorArray && query.features.shaderSampledImageArrayDynamicIndexing &&
query.features.shaderStorageImageArrayDynamicIndexing &&
q12.descriptorBindingSampledImageUpdateAfterBind &&
q12.descriptorBindingStorageImageUpdateAfterBind &&
q12.descriptorBindingStorageBufferUpdateAfterBindWhy: the OR is true on a device that supports, say, uniform/texel-buffer update-after-bind but not the sampled/storage-image ones (or lacks Tested on Windows 11 / RTX 3080 Ti (driver 616.64): AI-assisted. |
… set (RT-PIPELINE-CHECK-ROBUSTNESS) can_enable_robust_index_view's last input is now the runtime's VulkanDeviceInfo::bindless (the six-feature AND), not an OR of the four buffer update-after-bind features, so the checker makes the runtime's robust index view choice on every device. The checker also enables update-after-bind as the runtime does: the sampled-image, storage-image and storage-buffer bits only where bindless holds, never the uniform or texel buffer ones. Without that, a device with robustBufferAccess on and no robustBufferAccessUpdateAfterBind would enable a buffer update-after-bind feature (VUID-VkDeviceCreateInfo-robustBufferAccess-10247). Reported by Copilot and BubsMcgee on ProjectLeonida#1833.
…ustness # Conflicts: # runtime/test/vk_pipeline_check.cpp
|
Updated: Thanks @BubsMcgee, Copilot, @Mby159 and @potatoe0100. The bindless input. The OR was wrong, as you said. The checker now passes the runtime's The AND alone was not enough, though. The checker enables every update-after-bind feature the device supports, while the runtime enables only the three its set 0 uses, and only where
Set 0 only has sampled images, samplers, storage images and one storage buffer ( Tested on an AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, no Resizable BAR, Windows 11 26300, VS 2022 RelWithDebInfo:
Turning off the uniform and texel buffer update-after-bind bits did not change the hit on this card, which agrees with the 9070 XT note that the checker's other features are not part of the key. A device where the OR and the AND differ still needs testing; none of the GPUs tested here is one. |


Claimed in the coordination issue as: RT-PIPELINE-CHECK-ROBUSTNESS (#1608 (comment))
Depends on: none.
mainis merged in (cf1c34128).What and why
pipeline_cache_seedfails onmainon an AMD Radeon RX 7900 XT:#1723 (
ba626820e) made the runtime's device enable, where supported:robustBufferAccesstogether withVK_EXT_robustness2'srobustBufferAccess2, for bounded indexed indirect draws (leonida::can_enable_robust_index_view, withmaintenance5);nullDescriptor, wherever it is offered.vk_pipeline_checkstill forcedrobustBufferAccessoff and never enabledVK_EXT_robustness2. AMD makes robust buffer access part of a pipeline's cache key, so the cache the checker saves no longer hits in gta6rt.The change: the checker now makes the same choice the runtime does, with the same helper and the same inputs.
VK_EXT_robustness2(andmaintenance5) and decidesnullDescriptorand the robust index view ascreate_vulkan_device_standalonedoes.VulkanDeviceInfo::bindless. The checker also enables update-after-bind as the runtime does: the sampled-image, storage-image and storage-buffer bits only wherebindlessholds, never the uniform or texel buffer ones. OtherwiserobustBufferAccesscould meet a buffer update-after-bind feature withoutrobustBufferAccessUpdateAfterBind(VUID-VkDeviceCreateInfo-robustBufferAccess-10247).VK_EXT_robustness2(andmaintenance5) only when one of them is used.robustBufferAccessandrobustBufferAccess2follow the robust index view,nullDescriptoris as decided, androbustImageAccess2is off.docs/pipeline_check.md("The cache and the runtime's device") says so.Tested
AMD Radeon RX 7900 XT (RDNA3), AMD driver 32.0.32029.2010 (26.11.2), no Resizable BAR, Windows 11 build 26300, VS 2022 (MSVC 19.44) RelWithDebInfo.
main(7aa549e07,maincf1c34128):pipeline_cache_seedpasses 3 of 3, also underLEONIDA_VK_VALIDATION=1with no VUIDs.vk_pipeline_check.cppput back tomain's, it fails 3 of 3.pipeline_cache_file,pipeline_cache_store,heavy_pipeline_cache,pipeline_cache_journal,vk_pipeline_check_cli,vk_pipeline_check_stackandpipeline_cache_snapshotpass.0d80bc5df+ both commits:pipeline_cache_seed3 of 3, also under validation; the checker tests pass.nullDescriptoralone still missed. AddingrobustBufferAccessandrobustBufferAccess2hit, with or withoutmaintenance5. Turning off the uniform and texel buffer update-after-bind bits did not change the hit.ctest -j 6(first revision, on0d80bc5df): 437 of 439 pass or skip. The two failures,d3d12_texture_tiles(test: texture tiles NOTE only for the measured CopyTiles offset rounding on AMD and Intel (D3D-TILES-AMD-BYTE-OFFSET) #964) andd3d12_clear, fail onmainthere too. It was not re-run on the merge.Others' results in the thread: Radeon 780M (cache-key matrix with
vk_pipeline_check), RTX 4060 and RTX 3080 Ti (pipeline_cache_seedpasses).Not run on NVIDIA or Intel. Where the runtime makes the other choice, the checker now makes it too.
GPUs tested: AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, Windows 11 26300
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)