vk_pipeline_check: choose robustBufferAccess and VK_EXT_robustness2 as the runtime does (RT-PIPELINE-CHECK-ROBUSTNESS) #1833

Closed
adrianmjim wants to merge 3 commits from upstream-pr/1833 into main
adrianmjim commented 2026-11-25 12:48:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-25T12:48:59Z.


Claimed in the coordination issue as: RT-PIPELINE-CHECK-ROBUSTNESS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162894648)

Depends on: none. main is merged in (cf1c34128).

What and why

pipeline_cache_seed fails on main on an AMD Radeon RX 7900 XT:

FAIL: vk_pipeline_check cache does not hit on the runtime's device (AMD Radeon RX 7900 XT), which does hit a cache it wrote itself: vk_pipeline_check's device differs from the runtime's in something the driver makes part of a pipeline's cache key

#1723 (ba626820e) made the runtime's device enable, where supported:

  • robustBufferAccess together with VK_EXT_robustness2's robustBufferAccess2, for bounded indexed indirect draws (leonida::can_enable_robust_index_view, with maintenance5);
  • nullDescriptor, wherever it is offered.

vk_pipeline_check still forced robustBufferAccess off and never enabled VK_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.

  • It queries VK_EXT_robustness2 (and maintenance5) and decides nullDescriptor and the robust index view as create_vulkan_device_standalone does.
  • The update-after-bind input is the runtime's VulkanDeviceInfo::bindless. 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. Otherwise robustBufferAccess could meet a buffer update-after-bind feature without robustBufferAccessUpdateAfterBind (VUID-VkDeviceCreateInfo-robustBufferAccess-10247).
  • It chains VK_EXT_robustness2 (and maintenance5) only when one of them is used.
  • After the general feature query it keeps only those choices: robustBufferAccess and robustBufferAccess2 follow the robust index view, nullDescriptor is as decided, and robustImageAccess2 is 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.

  • On the merge with main (7aa549e07, main cf1c34128):
    • pipeline_cache_seed passes 3 of 3, also under LEONIDA_VK_VALIDATION=1 with no VUIDs.
    • With only vk_pipeline_check.cpp put back to main'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_stack and pipeline_cache_snapshot pass.
  • On 0d80bc5df + both commits: pipeline_cache_seed 3 of 3, also under validation; the checker tests pass.
  • What matters: in a local experiment on the first revision, mirroring nullDescriptor alone still missed. Adding robustBufferAccess and robustBufferAccess2 hit, with or without maintenance5. Turning off the uniform and texel buffer update-after-bind bits did not change the hit.
  • Whole ctest -j 6 (first revision, on 0d80bc5df): 437 of 439 pass or skip. The two failures, d3d12_texture_tiles (#964) and d3d12_clear, fail on main there 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_seed passes).

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

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (No translator change.)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5491639739 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-25T12:48:59Z. --- Claimed in the coordination issue as: RT-PIPELINE-CHECK-ROBUSTNESS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162894648) Depends on: none. `main` is merged in (`cf1c34128`). ### What and why `pipeline_cache_seed` fails on `main` on an AMD Radeon RX 7900 XT: ``` FAIL: vk_pipeline_check cache does not hit on the runtime's device (AMD Radeon RX 7900 XT), which does hit a cache it wrote itself: vk_pipeline_check's device differs from the runtime's in something the driver makes part of a pipeline's cache key ``` #1723 (`ba626820e`) made the runtime's device enable, where supported: - `robustBufferAccess` together with `VK_EXT_robustness2`'s `robustBufferAccess2`, for bounded indexed indirect draws (`leonida::can_enable_robust_index_view`, with `maintenance5`); - `nullDescriptor`, wherever it is offered. `vk_pipeline_check` still forced `robustBufferAccess` off and never enabled `VK_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. - It queries `VK_EXT_robustness2` (and `maintenance5`) and decides `nullDescriptor` and the robust index view as `create_vulkan_device_standalone` does. - The update-after-bind input is the runtime's `VulkanDeviceInfo::bindless`. 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. Otherwise `robustBufferAccess` could meet a buffer update-after-bind feature without `robustBufferAccessUpdateAfterBind` (VUID-VkDeviceCreateInfo-robustBufferAccess-10247). - It chains `VK_EXT_robustness2` (and `maintenance5`) only when one of them is used. - After the general feature query it keeps only those choices: `robustBufferAccess` and `robustBufferAccess2` follow the robust index view, `nullDescriptor` is as decided, and `robustImageAccess2` is 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. - **On the merge with `main` (`7aa549e07`, `main` `cf1c34128`):** - `pipeline_cache_seed` passes 3 of 3, also under `LEONIDA_VK_VALIDATION=1` with no VUIDs. - With only `vk_pipeline_check.cpp` put back to `main`'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_stack` and `pipeline_cache_snapshot` pass. - **On `0d80bc5df` + both commits:** `pipeline_cache_seed` 3 of 3, also under validation; the checker tests pass. - **What matters:** in a local experiment on the first revision, mirroring `nullDescriptor` alone still missed. Adding `robustBufferAccess` and `robustBufferAccess2` hit, with or without `maintenance5`. Turning off the uniform and texel buffer update-after-bind bits did not change the hit. - **Whole `ctest -j 6` (first revision, on `0d80bc5df`):** 437 of 439 pass or skip. The two failures, `d3d12_texture_tiles` (#964) and `d3d12_clear`, fail on `main` there 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_seed` passes). 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 - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (No translator change.)
copilot-pull-request-reviewer[bot] commented 2026-11-25 13:06:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T13:06:38Z.

Review: COMMENTED


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

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6058155565 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#pullrequestreview-6058155565). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T13:06:38Z. **Review:** COMMENTED --- > [!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](https://gh.io/AA11tgch) for more details. <!-- ccr-overview-v2 --> ## Copilot review overview <details open> <summary><strong>2 open issues</strong></summary> - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> [This is intended to mirror the runtime’s input to `can_enable_robust_index_view`, but it currently…](https://github.com/ubiquitarianism/leonida/pull/1833#discussion_r4695324747) · New - <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture> [The inline comment is hard to parse and includes an incomplete VUID reference (`VUID-...`). Please…](https://github.com/ubiquitarianism/leonida/pull/1833#discussion_r4695324836) · New </details> <details> <summary><strong>What changed in this PR</strong></summary> 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. | </details> <sub>Review effort: Lite</sub>
Copilot commented 2026-11-25 13:06:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Copilot on 2026-11-25T13:06:38Z.

Code review location: runtime/test/vk_pipeline_check.cpp; line 1178

@@ -1144,6 +1145,48 @@ int main(int argc, char** argv) {
     link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true);
     link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true);
     const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true);
+    // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone):
+    // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed
+    // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part
+    // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same.
+    // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.)
+    VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT};
+    bool null_descriptor = false, robust_index_view = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+    VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR};
+#endif
+    if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) {
+        VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
+        robustness2.pNext = &q12;
+        bool sized_indirect = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5;
+#endif
+        VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2};
+        vkGetPhysicalDeviceFeatures2(pd, &query);
+        null_descriptor = robustness2.nullDescriptor == VK_TRUE;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        // The runtime only decides this where the SDK has maintenance5, as here.
+        sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5;
+        robust_index_view = leonida::can_enable_robust_index_view(
+            pd, vkGetPhysicalDeviceProperties2, sized_indirect,
+            query.features.robustBufferAccess && robustness2.robustBufferAccess2,
+            // 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);

This is intended to mirror the runtime’s input to can_enable_robust_index_view, but it currently passes uniform || storage || texel update-after-bind support. The PR description/comment says the runtime passes the storage-buffer update-after-bind choice; using an OR here can yield a different robust_index_view decision than the runtime (and therefore reintroduce a pipeline cache key mismatch). Pass the same single boolean that the runtime uses (storage-buffer UAB), or plumb the checker’s actual chosen bindless/UAB enable decision rather than OR’ing multiple supported bits.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4695324747 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#discussion_r4695324747). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T13:06:38Z. **Code review location:** `runtime/test/vk_pipeline_check.cpp`; line 1178 ~~~~diff @@ -1144,6 +1145,48 @@ int main(int argc, char** argv) { link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true); link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true); const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true); + // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone): + // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed + // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part + // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same. + // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.) + VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT}; + bool null_descriptor = false, robust_index_view = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR}; +#endif + if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) { + VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES}; + robustness2.pNext = &q12; + bool sized_indirect = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5; +#endif + VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2}; + vkGetPhysicalDeviceFeatures2(pd, &query); + null_descriptor = robustness2.nullDescriptor == VK_TRUE; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + // The runtime only decides this where the SDK has maintenance5, as here. + sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5; + robust_index_view = leonida::can_enable_robust_index_view( + pd, vkGetPhysicalDeviceProperties2, sized_indirect, + query.features.robustBufferAccess && robustness2.robustBufferAccess2, + // 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); ~~~~ --- This is intended to mirror the runtime’s input to `can_enable_robust_index_view`, but it currently passes `uniform || storage || texel` update-after-bind support. The PR description/comment says the runtime passes the *storage-buffer update-after-bind* choice; using an OR here can yield a different `robust_index_view` decision than the runtime (and therefore reintroduce a pipeline cache key mismatch). Pass the same single boolean that the runtime uses (storage-buffer UAB), or plumb the checker’s actual chosen bindless/UAB enable decision rather than OR’ing multiple supported bits.
Copilot commented 2026-11-25 13:06:38 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Copilot on 2026-11-25T13:06:38Z.

Code review location: runtime/test/vk_pipeline_check.cpp; line 1175

@@ -1144,6 +1145,48 @@ int main(int argc, char** argv) {
     link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true);
     link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true);
     const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true);
+    // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone):
+    // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed
+    // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part
+    // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same.
+    // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.)
+    VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT};
+    bool null_descriptor = false, robust_index_view = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+    VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR};
+#endif
+    if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) {
+        VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
+        robustness2.pNext = &q12;
+        bool sized_indirect = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5;
+#endif
+        VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2};
+        vkGetPhysicalDeviceFeatures2(pd, &query);
+        null_descriptor = robustness2.nullDescriptor == VK_TRUE;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        // The runtime only decides this where the SDK has maintenance5, as here.
+        sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5;
+        robust_index_view = leonida::can_enable_robust_index_view(
+            pd, vkGetPhysicalDeviceProperties2, sized_indirect,
+            query.features.robustBufferAccess && robustness2.robustBufferAccess2,
+            // 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).

The inline comment is hard to parse and includes an incomplete VUID reference (VUID-...). Please tighten the wording (the current sentence fragment reads ungrammatically) and either cite the full VUID ID or remove it, so future readers can understand the exact validation concern and why this boolean is computed this way.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4695324836 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#discussion_r4695324836). Originally posted by [Copilot](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-25T13:06:38Z. **Code review location:** `runtime/test/vk_pipeline_check.cpp`; line 1175 ~~~~diff @@ -1144,6 +1145,48 @@ int main(int argc, char** argv) { link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true); link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true); const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true); + // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone): + // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed + // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part + // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same. + // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.) + VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT}; + bool null_descriptor = false, robust_index_view = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR}; +#endif + if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) { + VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES}; + robustness2.pNext = &q12; + bool sized_indirect = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5; +#endif + VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2}; + vkGetPhysicalDeviceFeatures2(pd, &query); + null_descriptor = robustness2.nullDescriptor == VK_TRUE; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + // The runtime only decides this where the SDK has maintenance5, as here. + sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5; + robust_index_view = leonida::can_enable_robust_index_view( + pd, vkGetPhysicalDeviceProperties2, sized_indirect, + query.features.robustBufferAccess && robustness2.robustBufferAccess2, + // 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). ~~~~ --- The inline comment is hard to parse and includes an incomplete VUID reference (`VUID-...`). Please tighten the wording (the current sentence fragment reads ungrammatically) and either cite the full VUID ID or remove it, so future readers can understand the exact validation concern and why this boolean is computed this way.
Mby159 commented 2026-11-25 13:14:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Mby159 on 2026-11-25T13:14:33Z.


AMD Radeon 780M (RDNA3): main's checker diverges from the runtime's robustness choice, with a cache-key measurement

I could not run pipeline_cache_seed on this machine (no MSVC or Windows SDK here - the test links gta6rt_d3d12_com), so this is a device-feature measurement plus a cache-key measurement with vk_pipeline_check, not a run of the test itself. The device is an AMD Radeon 780M Graphics (RDNA3, PCI\VEN_1002&DEV_1900), Windows driver 32.0.32015.12012, Vulkan apiVersion 1.4.359, props.driverVersion 2.0.416.

The runtime's device enables robustness here, so main (0d80bc5df) still differs from the runtime on this GPU. Querying the features the way create_vulkan_device_standalone queries them: VK_EXT_robustness2 and VK_KHR_maintenance5 are advertised (the maintenance5 feature is on), core robustBufferAccess and drawIndirectFirstInstance are on, robustBufferAccess2 and nullDescriptor are on, runtimeDescriptorArray, shaderSampledImageArrayDynamicIndexing, shaderStorageImageArrayDynamicIndexing and the sampled-image/storage-image/storage-buffer update-after-bind features are on (so the runtime's info.bindless is on), and robustBufferAccessUpdateAfterBind (Vulkan 1.2 property) is on. leonida::can_enable_robust_index_view(...) with the runtime's inputs therefore returns true here, so the runtime's device enables robustBufferAccess together with robustBufferAccess2, plus nullDescriptor where it is offered. With this PR's change the checker makes the same robustness choice on this device; on main the checker still forces robustBufferAccess off and never enables VK_EXT_robustness2.

Cache-key measurement. Four builds of runtime/test/vk_pipeline_check.cpp, one synthetic minimal compute SPIR-V and index.json (the same pair runtime/test/check_pipeline_cache_seed.cmake feeds the checker), and --jobs 1 --cache-feedback:

  • main (0d80bc5df): robustness off (core robustBufferAccess forced off, no VK_EXT_robustness2).
  • main + core robustBufferAccess on only, no VK_EXT_robustness2 (a local one-line patch of main).
  • this PR's head (97fb9ee3) with the robust index view forced off: VK_EXT_robustness2 with nullDescriptor on, both robustBufferAccess bits off (a local patch of this PR).
  • this PR's head as it stands: core robustBufferAccess + robustBufferAccess2 + nullDescriptor, and VK_KHR_maintenance5 with the robust index view.

Each build was run as the same file name (pipeline_cache_seed_test.exe) in the same directory; one run writes the cache, the next is given that cache file and reports the VkPipelineCreationFeedback hits:

cache written by read by main (robustness off) read by main + core robustBufferAccess on read by robustness2 + nullDescriptor only read by this PR's configuration
main (robustness off) 1 hit 0 hits 0 hits 0 hits
main + core robustBufferAccess on 0 hits 1 hit 0 hits 0 hits
robustness2 + nullDescriptor only 0 hits 0 hits 1 hit 0 hits
this PR's configuration 0 hits 0 hits 0 hits 1 hit

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 robustBufferAccess on and nothing else changes the key, and enabling VK_EXT_robustness2 with nullDescriptor (both robustBufferAccess bits still off) changes it as well.

One difference in the inputs, from reading the code rather than measuring it: the runtime passes its info.bindless as the update-after-bind input to can_enable_robust_index_view, while this PR's checker passes "any of the four update-after-bind features is supported". On this device both are true, so it did not affect the measurement above. On a device where info.bindless is false while one of those four is supported and robustBufferAccessUpdateAfterBind is false, and where the sized-indirect and robust-access gates pass, the helper returns true for the runtime and false for the checker, and the two would still disagree.

Not covered here: pipeline_cache_seed itself, the validation layer, and anything but one AMD GPU and one driver version. The RX 7900 XT result in the PR description is the author's own run of pipeline_cache_seed; I did not reproduce that test here.

AI-assisted (MiniMax Code). No game files.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7163492778 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#issuecomment-7163492778). Originally posted by [Mby159](https://github.com/Mby159) on 2026-11-25T13:14:33Z. --- **AMD Radeon 780M (RDNA3): `main`'s checker diverges from the runtime's robustness choice, with a cache-key measurement** I could not run `pipeline_cache_seed` on this machine (no MSVC or Windows SDK here - the test links `gta6rt_d3d12_com`), so this is a device-feature measurement plus a cache-key measurement with `vk_pipeline_check`, not a run of the test itself. The device is an AMD Radeon 780M Graphics (RDNA3, `PCI\VEN_1002&DEV_1900`), Windows driver 32.0.32015.12012, Vulkan apiVersion 1.4.359, `props.driverVersion` 2.0.416. **The runtime's device enables robustness here, so `main` (`0d80bc5df`) still differs from the runtime on this GPU.** Querying the features the way `create_vulkan_device_standalone` queries them: `VK_EXT_robustness2` and `VK_KHR_maintenance5` are advertised (the maintenance5 feature is on), core `robustBufferAccess` and `drawIndirectFirstInstance` are on, `robustBufferAccess2` and `nullDescriptor` are on, `runtimeDescriptorArray`, `shaderSampledImageArrayDynamicIndexing`, `shaderStorageImageArrayDynamicIndexing` and the sampled-image/storage-image/storage-buffer update-after-bind features are on (so the runtime's `info.bindless` is on), and `robustBufferAccessUpdateAfterBind` (Vulkan 1.2 property) is on. `leonida::can_enable_robust_index_view(...)` with the runtime's inputs therefore returns true here, so the runtime's device enables `robustBufferAccess` together with `robustBufferAccess2`, plus `nullDescriptor` where it is offered. With this PR's change the checker makes the same robustness choice on this device; on `main` the checker still forces `robustBufferAccess` off and never enables `VK_EXT_robustness2`. **Cache-key measurement.** Four builds of `runtime/test/vk_pipeline_check.cpp`, one synthetic minimal compute SPIR-V and `index.json` (the same pair `runtime/test/check_pipeline_cache_seed.cmake` feeds the checker), and `--jobs 1 --cache-feedback`: - `main` (`0d80bc5df`): robustness off (core `robustBufferAccess` forced off, no `VK_EXT_robustness2`). - `main` + core `robustBufferAccess` on only, no `VK_EXT_robustness2` (a local one-line patch of main). - this PR's head (`97fb9ee3`) with the robust index view forced off: `VK_EXT_robustness2` with `nullDescriptor` on, both `robustBufferAccess` bits off (a local patch of this PR). - this PR's head as it stands: core `robustBufferAccess` + `robustBufferAccess2` + `nullDescriptor`, and `VK_KHR_maintenance5` with the robust index view. Each build was run as the same file name (`pipeline_cache_seed_test.exe`) in the same directory; one run writes the cache, the next is given that cache file and reports the `VkPipelineCreationFeedback` hits: | cache written by | read by main (robustness off) | read by main + core robustBufferAccess on | read by robustness2 + nullDescriptor only | read by this PR's configuration | |---|---|---|---|---| | main (robustness off) | 1 hit | 0 hits | 0 hits | 0 hits | | main + core robustBufferAccess on | 0 hits | 1 hit | 0 hits | 0 hits | | robustness2 + nullDescriptor only | 0 hits | 0 hits | 1 hit | 0 hits | | this PR's configuration | 0 hits | 0 hits | 0 hits | 1 hit | 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 `robustBufferAccess` on and nothing else changes the key, and enabling `VK_EXT_robustness2` with `nullDescriptor` (both `robustBufferAccess` bits still off) changes it as well. **One difference in the inputs, from reading the code rather than measuring it:** the runtime passes its `info.bindless` as the update-after-bind input to `can_enable_robust_index_view`, while this PR's checker passes "any of the four update-after-bind features is supported". On this device both are true, so it did not affect the measurement above. On a device where `info.bindless` is false while one of those four is supported and `robustBufferAccessUpdateAfterBind` is false, and where the sized-indirect and robust-access gates pass, the helper returns true for the runtime and false for the checker, and the two would still disagree. Not covered here: `pipeline_cache_seed` itself, the validation layer, and anything but one AMD GPU and one driver version. The RX 7900 XT result in the PR description is the author's own run of `pipeline_cache_seed`; I did not reproduce that test here. AI-assisted (MiniMax Code). No game files.
potatoe0100 commented 2026-11-25 13:50:36 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by potatoe0100 on 2026-11-25T13:50:36Z.


NVIDIA data point: 97fb9ee3d merged onto main 98c2f7777 (clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja.

  • pipeline_cache_seed passes with this PR, as it does on main here, so the robustness choice keeps the cache hitting on NVIDIA.
  • Full ctest -j 6: all pass apart from xmem_no_write_watch, which failed while another build was running on this PC; xmem failed the same way in the main run under that load. run_gpu_tests.py: 209/263, identical to main.

AI-assisted (Claude)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7164370550 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#issuecomment-7164370550). Originally posted by [potatoe0100](https://github.com/potatoe0100) on 2026-11-25T13:50:36Z. --- NVIDIA data point: `97fb9ee3d` merged onto `main` `98c2f7777` (clean), native Windows 11 Pro 26H2 (build 26300), NVIDIA GeForce RTX 4060, driver 621.14, VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja. - `pipeline_cache_seed` passes with this PR, as it does on `main` here, so the robustness choice keeps the cache hitting on NVIDIA. - Full `ctest -j 6`: all pass apart from `xmem_no_write_watch`, which failed while another build was running on this PC; `xmem` failed the same way in the `main` run under that load. `run_gpu_tests.py`: 209/263, identical to `main`. AI-assisted (Claude)
BubsMcgee commented 2026-11-25 14:18:47 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T14:18:47Z.


Potential high-severity gap in the robustness input, as Copilot flagged: the checker does not pass the same bindless choice the runtime passes.

The runtime (runtime/shims/d3d12_vulkan_device.cpp, create_vulkan_device_standalone) passes info.bindless, which is an AND:

runtimeDescriptorArray && shaderSampledImageArrayDynamicIndexing && shaderStorageImageArrayDynamicIndexing &&
descriptorBindingSampledImageUpdateAfterBind && descriptorBindingStorageImageUpdateAfterBind &&
descriptorBindingStorageBufferUpdateAfterBind

This checker passes an OR of descriptorBindingUniformBufferUpdateAfterBind, descriptorBindingStorageBufferUpdateAfterBind, descriptorBindingUniformTexelBufferUpdateAfterBind, descriptorBindingStorageTexelBufferUpdateAfterBind.

The OR can be true where info.bindless is false, e.g. a device that supports uniform/texel-buffer update-after-bind but not the sampled/storage-image UAB, or lacks runtimeDescriptorArray / dynamic indexing. The helper's last parameter is storage_update_after_bind, and when it is true the helper requires robustBufferAccessUpdateAfterBind. So on such a device, if that property is false, the checker chooses robust_index_view = false (robustBufferAccess off) while the runtime chooses true — the same class of cache-key mismatch this PR fixes.

The shared test device helper already does it correctly: runtime/test/vk_test_device.h:434 computes bindless with the same six-feature AND and passes that to can_enable_robust_index_view. The checker should do the same: compute that predicate from its queried features and pass it, rather than the OR. (The checker also enables every supported UAB feature, whereas the runtime enables only what info.bindless needs; for the device itself to match, it probably needs to mirror the runtime's UAB enable set too.)

On the 7900 XT both are true and robustBufferAccessUpdateAfterBind is true, so pipeline_cache_seed passes; the divergence is latent on devices where they differ. Worth correcting before treating #1833 as fully solving the AMD parity.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7165083599 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#issuecomment-7165083599). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T14:18:47Z. --- Potential high-severity gap in the robustness input, as Copilot flagged: the checker does not pass the same `bindless` choice the runtime passes. The runtime (`runtime/shims/d3d12_vulkan_device.cpp`, `create_vulkan_device_standalone`) passes `info.bindless`, which is an **AND**: ``` runtimeDescriptorArray && shaderSampledImageArrayDynamicIndexing && shaderStorageImageArrayDynamicIndexing && descriptorBindingSampledImageUpdateAfterBind && descriptorBindingStorageImageUpdateAfterBind && descriptorBindingStorageBufferUpdateAfterBind ``` This checker passes an **OR** of `descriptorBindingUniformBufferUpdateAfterBind`, `descriptorBindingStorageBufferUpdateAfterBind`, `descriptorBindingUniformTexelBufferUpdateAfterBind`, `descriptorBindingStorageTexelBufferUpdateAfterBind`. The OR can be true where `info.bindless` is false, e.g. a device that supports uniform/texel-buffer update-after-bind but not the sampled/storage-image UAB, or lacks `runtimeDescriptorArray` / dynamic indexing. The helper's last parameter is `storage_update_after_bind`, and when it is true the helper requires `robustBufferAccessUpdateAfterBind`. So on such a device, if that property is false, the checker chooses `robust_index_view = false` (robustBufferAccess off) while the runtime chooses true — the same class of cache-key mismatch this PR fixes. The shared test device helper already does it correctly: `runtime/test/vk_test_device.h:434` computes `bindless` with the same six-feature AND and passes that to `can_enable_robust_index_view`. The checker should do the same: compute that predicate from its queried features and pass it, rather than the OR. (The checker also enables every supported UAB feature, whereas the runtime enables only what `info.bindless` needs; for the device itself to match, it probably needs to mirror the runtime's UAB enable set too.) On the 7900 XT both are true and `robustBufferAccessUpdateAfterBind` is true, so `pipeline_cache_seed` passes; the divergence is latent on devices where they differ. Worth correcting before treating #1833 as fully solving the AMD parity. AI-assisted.
BubsMcgee commented 2026-11-25 15:35:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by BubsMcgee on 2026-11-25T15:35:50Z.


Concrete patch for the OR-vs-AND gap, on top of your branch so it is easy to take:

Branch: BubsMcgee/leonida:fix-1833-bindless (head 3e45ed067, based on main b0f3d3998 + your 5894f9324). The only change is the last argument to can_enable_robust_index_view in runtime/test/vk_pipeline_check.cpp: replace the OR of the four update-after-bind flags with the same predicate the runtime passes (VulkanDeviceInfo::bindless in create_vulkan_device_standalone, and already in runtime/test/vk_test_device.h:434):

q12.runtimeDescriptorArray && query.features.shaderSampledImageArrayDynamicIndexing &&
    query.features.shaderStorageImageArrayDynamicIndexing &&
    q12.descriptorBindingSampledImageUpdateAfterBind &&
    q12.descriptorBindingStorageImageUpdateAfterBind &&
    q12.descriptorBindingStorageBufferUpdateAfterBind

Why: 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 runtimeDescriptorArray), where the runtime's bindless is false. The helper's last parameter is storage_update_after_bind; with the OR true and robustBufferAccessUpdateAfterBind false, the checker would disable robust_index_view while the runtime enables it, changing robustBufferAccess and the cache key again.

Tested on Windows 11 / RTX 3080 Ti (driver 616.64): pipeline_cache_seed, pipeline_cache_file, pipeline_cache_store, vk_pipeline_check_cli, vk_pipeline_check_stack, pipeline_cache_snapshot — 6/6 pass. On this GPU the OR and the AND agree (both true), so this is a no-regression check; the divergence needs a device where they differ.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7167087436 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1833#issuecomment-7167087436). Originally posted by [BubsMcgee](https://github.com/BubsMcgee) on 2026-11-25T15:35:50Z. --- Concrete patch for the OR-vs-AND gap, on top of your branch so it is easy to take: Branch: `BubsMcgee/leonida:fix-1833-bindless` (head `3e45ed067`, based on `main` `b0f3d3998` + your `5894f9324`). The only change is the last argument to `can_enable_robust_index_view` in `runtime/test/vk_pipeline_check.cpp`: replace the OR of the four update-after-bind flags with the same predicate the runtime passes (`VulkanDeviceInfo::bindless` in `create_vulkan_device_standalone`, and already in `runtime/test/vk_test_device.h:434`): ```cpp q12.runtimeDescriptorArray && query.features.shaderSampledImageArrayDynamicIndexing && query.features.shaderStorageImageArrayDynamicIndexing && q12.descriptorBindingSampledImageUpdateAfterBind && q12.descriptorBindingStorageImageUpdateAfterBind && q12.descriptorBindingStorageBufferUpdateAfterBind ``` Why: 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 `runtimeDescriptorArray`), where the runtime's `bindless` is false. The helper's last parameter is `storage_update_after_bind`; with the OR true and `robustBufferAccessUpdateAfterBind` false, the checker would disable `robust_index_view` while the runtime enables it, changing `robustBufferAccess` and the cache key again. Tested on Windows 11 / RTX 3080 Ti (driver 616.64): `pipeline_cache_seed`, `pipeline_cache_file`, `pipeline_cache_store`, `vk_pipeline_check_cli`, `vk_pipeline_check_stack`, `pipeline_cache_snapshot` — 6/6 pass. On this GPU the OR and the AND agree (both true), so this is a no-regression check; the divergence needs a device where they differ. AI-assisted.
adrianmjim commented 2026-11-27 20:26:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-27T20:26:31Z.

Code review location: runtime/test/vk_pipeline_check.cpp; line 1178

@@ -1144,6 +1145,48 @@ int main(int argc, char** argv) {
     link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true);
     link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true);
     const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true);
+    // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone):
+    // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed
+    // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part
+    // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same.
+    // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.)
+    VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT};
+    bool null_descriptor = false, robust_index_view = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+    VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR};
+#endif
+    if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) {
+        VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
+        robustness2.pNext = &q12;
+        bool sized_indirect = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5;
+#endif
+        VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2};
+        vkGetPhysicalDeviceFeatures2(pd, &query);
+        null_descriptor = robustness2.nullDescriptor == VK_TRUE;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        // The runtime only decides this where the SDK has maintenance5, as here.
+        sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5;
+        robust_index_view = leonida::can_enable_robust_index_view(
+            pd, vkGetPhysicalDeviceProperties2, sized_indirect,
+            query.features.robustBufferAccess && robustness2.robustBufferAccess2,
+            // 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);

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4723403035 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#discussion_r4723403035). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-27T20:26:31Z. **Code review location:** `runtime/test/vk_pipeline_check.cpp`; line 1178 ~~~~diff @@ -1144,6 +1145,48 @@ int main(int argc, char** argv) { link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true); link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true); const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true); + // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone): + // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed + // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part + // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same. + // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.) + VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT}; + bool null_descriptor = false, robust_index_view = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR}; +#endif + if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) { + VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES}; + robustness2.pNext = &q12; + bool sized_indirect = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5; +#endif + VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2}; + vkGetPhysicalDeviceFeatures2(pd, &query); + null_descriptor = robustness2.nullDescriptor == VK_TRUE; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + // The runtime only decides this where the SDK has maintenance5, as here. + sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5; + robust_index_view = leonida::can_enable_robust_index_view( + pd, vkGetPhysicalDeviceProperties2, sized_indirect, + query.features.robustBufferAccess && robustness2.robustBufferAccess2, + // 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); ~~~~ --- 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.
adrianmjim commented 2026-11-27 20:26:33 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-27T20:26:33Z.

Code review location: runtime/test/vk_pipeline_check.cpp; line 1175

@@ -1144,6 +1145,48 @@ int main(int argc, char** argv) {
     link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true);
     link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true);
     const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true);
+    // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone):
+    // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed
+    // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part
+    // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same.
+    // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.)
+    VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT};
+    bool null_descriptor = false, robust_index_view = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+    VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR};
+#endif
+    if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) {
+        VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
+        robustness2.pNext = &q12;
+        bool sized_indirect = false;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5;
+#endif
+        VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2};
+        vkGetPhysicalDeviceFeatures2(pd, &query);
+        null_descriptor = robustness2.nullDescriptor == VK_TRUE;
+#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME
+        // The runtime only decides this where the SDK has maintenance5, as here.
+        sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5;
+        robust_index_view = leonida::can_enable_robust_index_view(
+            pd, vkGetPhysicalDeviceProperties2, sized_indirect,
+            query.features.robustBufferAccess && robustness2.robustBufferAccess2,
+            // 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).

Reworded in ba6720e9a, and it now cites the full VUID-VkDeviceCreateInfo-robustBufferAccess-10247.

<!-- greyfinch-sync:ubiquitarianism/leonida:review-comment:4723403243 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#discussion_r4723403243). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-27T20:26:33Z. **Code review location:** `runtime/test/vk_pipeline_check.cpp`; line 1175 ~~~~diff @@ -1144,6 +1145,48 @@ int main(int argc, char** argv) { link(&f12, reinterpret_cast<VkBaseOutStructure*>(&f12), nullptr, true); link(&f13, reinterpret_cast<VkBaseOutStructure*>(&f13), nullptr, true); const bool ext_mesh = link(&mesh, reinterpret_cast<VkBaseOutStructure*>(&mesh), VK_EXT_MESH_SHADER_EXTENSION_NAME, true); + // VK_EXT_robustness2 and robustBufferAccess as the runtime's device chooses them (create_vulkan_device_standalone): + // nullDescriptor wherever it is offered, and robustBufferAccess with robustBufferAccess2 for bounded indexed + // indirect draws (leonida::can_enable_robust_index_view, with maintenance5). A driver makes robust buffer access part + // of a pipeline's cache key (AMD does), so the cache only hits in gta6rt when this device chooses the same. + // (The runtime also enables maintenance5 for A8 render targets alone; that is not mirrored, as before.) + VkPhysicalDeviceRobustness2FeaturesEXT robustness2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT}; + bool null_descriptor = false, robust_index_view = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + VkPhysicalDeviceMaintenance5FeaturesKHR maintenance5{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES_KHR}; +#endif + if (has(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME)) { + VkPhysicalDeviceVulkan12Features q12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES}; + robustness2.pNext = &q12; + bool sized_indirect = false; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + if (has(VK_KHR_MAINTENANCE_5_EXTENSION_NAME)) q12.pNext = &maintenance5; +#endif + VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &robustness2}; + vkGetPhysicalDeviceFeatures2(pd, &query); + null_descriptor = robustness2.nullDescriptor == VK_TRUE; +#ifdef VK_KHR_MAINTENANCE_5_EXTENSION_NAME + // The runtime only decides this where the SDK has maintenance5, as here. + sized_indirect = query.features.drawIndirectFirstInstance && maintenance5.maintenance5; + robust_index_view = leonida::can_enable_robust_index_view( + pd, vkGetPhysicalDeviceProperties2, sized_indirect, + query.features.robustBufferAccess && robustness2.robustBufferAccess2, + // 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). ~~~~ --- Reworded in `ba6720e9a`, and it now cites the full `VUID-VkDeviceCreateInfo-robustBufferAccess-10247`.
adrianmjim commented 2026-11-27 20:26:35 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-27T20:26:35Z.


Updated: ba6720e9a fixes the bindless input, and 7aa549e07 merges current main (cf1c34128). The only conflict was the transform-feedback line from D3D-302, and both are kept.

Thanks @BubsMcgee, Copilot, @Mby159 and @potatoe0100.

The bindless input. The OR was wrong, as you said. The checker now passes the runtime's VulkanDeviceInfo::bindless, the same six-feature AND as vk_test_device.h:434.

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 bindless holds. Take a device where bindless is false, the storage-buffer update-after-bind feature is supported and robustBufferAccessUpdateAfterBind is false. There the helper returns true, so the checker would enable robustBufferAccess together with a buffer update-after-bind feature, which VUID-VkDeviceCreateInfo-robustBufferAccess-10247 forbids. That was the reason for the OR in the first place. So the checker now 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 bits.

Set 0 only has sampled images, samplers, storage images and one storage buffer (vulkan_bindless.h), so its update-after-bind layout still has the features it needs. The comment now cites the full VUID, and docs/pipeline_check.md says the same.

Tested on an AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, no Resizable BAR, Windows 11 26300, VS 2022 RelWithDebInfo:

  • On 0d80bc5df + ba6720e9a: pipeline_cache_seed passes 3 of 3, and under LEONIDA_VK_VALIDATION=1 with VK_LAYER_KHRONOS_validation loaded it reports no VUIDs. vk_pipeline_check_cli, vk_pipeline_check_stack and pipeline_cache_snapshot pass.
  • On the merge with main (7aa549e07):
    • pipeline_cache_seed passes 3 of 3, also under validation with no VUIDs.
    • With only vk_pipeline_check.cpp put back to main's, it fails 3 of 3 with the same "does not hit" message as in the description.
    • pipeline_cache_file, pipeline_cache_store, heavy_pipeline_cache, pipeline_cache_journal, vk_pipeline_check_cli, vk_pipeline_check_stack and pipeline_cache_snapshot pass.

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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7227510887 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#issuecomment-7227510887). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-27T20:26:35Z. --- Updated: `ba6720e9a` fixes the bindless input, and `7aa549e07` merges current `main` (`cf1c34128`). The only conflict was the transform-feedback line from D3D-302, and both are kept. Thanks @BubsMcgee, Copilot, @Mby159 and @potatoe0100. **The bindless input.** The OR was wrong, as you said. The checker now passes the runtime's `VulkanDeviceInfo::bindless`, the same six-feature AND as `vk_test_device.h:434`. 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 `bindless` holds. Take a device where `bindless` is false, the storage-buffer update-after-bind feature is supported and `robustBufferAccessUpdateAfterBind` is false. There the helper returns true, so the checker would enable `robustBufferAccess` together with a buffer update-after-bind feature, which VUID-VkDeviceCreateInfo-robustBufferAccess-10247 forbids. That was the reason for the OR in the first place. So the checker now 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 bits. Set 0 only has sampled images, samplers, storage images and one storage buffer (`vulkan_bindless.h`), so its update-after-bind layout still has the features it needs. The comment now cites the full VUID, and `docs/pipeline_check.md` says the same. **Tested** on an AMD Radeon RX 7900 XT (RDNA3), AMD 32.0.32029.2010, no Resizable BAR, Windows 11 26300, VS 2022 RelWithDebInfo: - On `0d80bc5df` + `ba6720e9a`: `pipeline_cache_seed` passes 3 of 3, and under `LEONIDA_VK_VALIDATION=1` with `VK_LAYER_KHRONOS_validation` loaded it reports no VUIDs. `vk_pipeline_check_cli`, `vk_pipeline_check_stack` and `pipeline_cache_snapshot` pass. - On the merge with `main` (`7aa549e07`): - `pipeline_cache_seed` passes 3 of 3, also under validation with no VUIDs. - With only `vk_pipeline_check.cpp` put back to `main`'s, it fails 3 of 3 with the same "does not hit" message as in the description. - `pipeline_cache_file`, `pipeline_cache_store`, `heavy_pipeline_cache`, `pipeline_cache_journal`, `vk_pipeline_check_cli`, `vk_pipeline_check_stack` and `pipeline_cache_snapshot` pass. 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.
adrianmjim commented 2026-11-28 09:48:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by adrianmjim on 2026-11-28T09:48:52Z.


Closing to make room: this account can only have one pull request open here, and the 13 leak fixes claimed in #1608 go into one pull request first. The change still applies to current main and merges cleanly; the branch stays at 7aa549e07, and I'll reopen it when a slot frees. Thanks again @BubsMcgee, @Mby159 and @potatoe0100.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7237483569 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#issuecomment-7237483569). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-28T09:48:52Z. --- Closing to make room: this account can only have one pull request open here, and the 13 leak fixes claimed in #1608 go into one pull request first. The change still applies to current `main` and merges cleanly; the branch stays at `7aa549e07`, and I'll reopen it when a slot frees. Thanks again @BubsMcgee, @Mby159 and @potatoe0100.
Tauwni commented 2026-11-29 08:05:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Tauwni on 2026-11-29T08:05:37Z.


For whoever picks this up again: the closed head 7aa549e07 still merges cleanly into main b6bf3aa0b and fixes pipeline_cache_seed on AMD RDNA4.

Radeon RX 9060 XT, driver 32.0.23033.1002 (Vulkan 26.3.1), Windows 10 Pro 22H2 19045.7846, MSVC 14.44 RelWithDebInfo. MEASURED, 3 runs each, ctest -R "^pipeline_cache_seed$":

  • main: fails 3/3, "vk_pipeline_check cache does not hit on the runtime's device (AMD Radeon RX 9060 XT)".
  • main + 7aa549e07: passes 3/3.

An independent A/B on main's checker, before I found this PR, points at the same cause on RDNA4. Local debug toggles, not pushed; MEASURED, 3 runs each:

  • adding VK_EXT_robustness2 with nullDescriptor alone: still misses;
  • robustBufferAccess + robustBufferAccess2 without nullDescriptor: still misses;
  • all three, as the runtime enables them: hits.

So on this driver all three are part of the cache key. docs/pipeline_check.md still says nothing else changed the key on RX 9070 XT; that measurement predates #1723.

Not checked by a second agent or human yet. AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7252881571 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1833#issuecomment-7252881571). Originally posted by [Tauwni](https://github.com/Tauwni) on 2026-11-29T08:05:37Z. --- For whoever picks this up again: the closed head `7aa549e07` still merges cleanly into `main` `b6bf3aa0b` and fixes `pipeline_cache_seed` on AMD RDNA4. Radeon RX 9060 XT, driver 32.0.23033.1002 (Vulkan 26.3.1), Windows 10 Pro 22H2 19045.7846, MSVC 14.44 RelWithDebInfo. MEASURED, 3 runs each, `ctest -R "^pipeline_cache_seed$"`: - `main`: fails 3/3, "vk_pipeline_check cache does not hit on the runtime's device (AMD Radeon RX 9060 XT)". - `main` + `7aa549e07`: passes 3/3. An independent A/B on `main`'s checker, before I found this PR, points at the same cause on RDNA4. Local debug toggles, not pushed; MEASURED, 3 runs each: - adding `VK_EXT_robustness2` with `nullDescriptor` alone: still misses; - `robustBufferAccess` + `robustBufferAccess2` without `nullDescriptor`: still misses; - all three, as the runtime enables them: hits. So on this driver all three are part of the cache key. `docs/pipeline_check.md` still says nothing else changed the key on RX 9070 XT; that measurement predates #1723. Not checked by a second agent or human yet. AI-assisted: yes (Claude Code).

Pull request closed

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!1833
No description provided.