[PR #2062] d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL) #2066

Open
opened 2026-11-26 21:19:55 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2062
Author: @thegalaxydev
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: rt-pipeline-cache-growth-stall


📝 Commits (2)

  • e6f34ed d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL)
  • 869319b docs: rewrap the pipeline cache growth paragraph (RT-PIPELINE-CACHE-GROWTH-STALL)

📊 Changes

5 files changed (+140 additions, -4 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+10 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+37 -0)
📝 runtime/src/pipeline_cache_store.h (+38 -0)
📝 runtime/src/pipeline_profile.h (+13 -3)
📝 runtime/test/pipeline_cache_store_test.cpp (+42 -1)

📄 Description

RT-PIPELINE-CACHE-GROWTH-STALL, claimed in #1608 after the finding just above it.

What

The runtime says once, in the log, when the title's pipeline builds keep compiling but the driver's VkPipelineCache has stopped growing (the numbers below show the format, not a run):

[rt] d3d12: the Vulkan pipeline cache grew 0 bytes (to 1346482377) over 23 pipeline builds that compiled: the driver no longer keeps new pipelines, so the next run compiles them again. A large pipeline_cache.bin or pipeline_cache.session.bin can cause it (docs/d3d12_vulkan.md, pipeline caches)
  • pipeline_profile::DriverCall (it already wraps both title vkCreate*Pipelines calls) always times the call and counts successful builds of at least 200 ms in compiled_builds(). A cache hit takes a few milliseconds, also while the title loads every core. Printing still needs LEONIDA_PSO_PROFILE=1.
  • pipeline_cache_store::GrowthWatch (pure, no Vulkan) compares two cache sizes with the builds that compiled between them: 16 or more compiled and less than 64 KiB of growth reports once.
  • The device takes the size when it creates the cache (after the seed and the session are loaded) and at every session save, checkpoint or teardown, including a save skipped for being over LEONIDA_PIPELINE_CACHE_BYTES. The size query is the one the save already makes.
  • docs/d3d12_vulkan.md records the measurements under "Pipeline caches".

Why

A driver can stop adding to a large cache without an error, and then a session file stops helping without anything saying so. Measured on an RTX 5060 Ti, NVIDIA 610.88, Windows 11 23H2:

cache before one ~2 s compute compile (vk_pipeline_check named gta6rt.exe) file afterwards next process
empty +~210 KiB 0.01 s from the file, also with __GL_SHADER_DISK_CACHE=0
1.23 GB (library and main-set compute) same size to the byte hit only through the driver's own disk cache
1.35 GB (the above plus what the game added) same size to the byte compiled again

In the game (main fe1553456 + #1886): seeded with the 1.23 GB file, 68 of the ~110 builds over 200 ms in one run were over 200 ms again in the next; started with no seed, 5 of 164 were. An older cache of mostly main-set graphics pipelines stopped growing at 4.9 GB, so there is no fixed size to test against, hence a growth check instead of a size limit. #1886 measured a 1,285 MB session on an RTX 5080, still growing.

Tested

  • RTX 5060 Ti 16 GB, NVIDIA 610.88, Windows 11 23H2, MSVC via scripts/build_runtime.ps1.
  • pipeline_cache_store_test gains test_growth (no Vulkan, no GPU): no reference at creation, a growing cache at any size, too few builds, report once, counting from the previous save, a count that went backwards.
  • ctest -R "pipeline_cache|compile_teardown|pipeline_workers|pso_profile|d3d12_pipeline": 10/10 pass.
  • Full ctest -j 8: everything passes except root_sig, d3d12_state_sweep and d3d12_pso_validation, which fail the same way on main fe1553456 without this change on this machine.
  • scripts/check_no_game_data.py on the changed files: clean.

Related: #1886 (raises the save limit, so sessions reach this size), #1756 (checkpoint scheduling; both touch save_session_pipeline_cache, the overlap is one added line).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2062 **Author:** [@thegalaxydev](https://github.com/thegalaxydev) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `rt-pipeline-cache-growth-stall` --- ### 📝 Commits (2) - [`e6f34ed`](https://github.com/ubiquitarianism/leonida/commit/e6f34ed080508b54d93e162e3aa5bdca66980bbd) d3d12: say when the driver's pipeline cache stops keeping new pipelines (RT-PIPELINE-CACHE-GROWTH-STALL) - [`869319b`](https://github.com/ubiquitarianism/leonida/commit/869319b55cf61e2d2727a2c0a8299ae8d8267da3) docs: rewrap the pipeline cache growth paragraph (RT-PIPELINE-CACHE-GROWTH-STALL) ### 📊 Changes **5 files changed** (+140 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+10 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+37 -0) 📝 `runtime/src/pipeline_cache_store.h` (+38 -0) 📝 `runtime/src/pipeline_profile.h` (+13 -3) 📝 `runtime/test/pipeline_cache_store_test.cpp` (+42 -1) </details> ### 📄 Description RT-PIPELINE-CACHE-GROWTH-STALL, claimed in [#1608](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171729880) after the finding [just above it](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7171729435). ## What The runtime says once, in the log, when the title's pipeline builds keep compiling but the driver's `VkPipelineCache` has stopped growing (the numbers below show the format, not a run): ``` [rt] d3d12: the Vulkan pipeline cache grew 0 bytes (to 1346482377) over 23 pipeline builds that compiled: the driver no longer keeps new pipelines, so the next run compiles them again. A large pipeline_cache.bin or pipeline_cache.session.bin can cause it (docs/d3d12_vulkan.md, pipeline caches) ``` - `pipeline_profile::DriverCall` (it already wraps both title `vkCreate*Pipelines` calls) always times the call and counts successful builds of at least 200 ms in `compiled_builds()`. A cache hit takes a few milliseconds, also while the title loads every core. Printing still needs `LEONIDA_PSO_PROFILE=1`. - `pipeline_cache_store::GrowthWatch` (pure, no Vulkan) compares two cache sizes with the builds that compiled between them: 16 or more compiled and less than 64 KiB of growth reports once. - The device takes the size when it creates the cache (after the seed and the session are loaded) and at every session save, checkpoint or teardown, including a save skipped for being over `LEONIDA_PIPELINE_CACHE_BYTES`. The size query is the one the save already makes. - `docs/d3d12_vulkan.md` records the measurements under "Pipeline caches". ## Why A driver can stop adding to a large cache without an error, and then a session file stops helping without anything saying so. Measured on an RTX 5060 Ti, NVIDIA 610.88, Windows 11 23H2: | cache before one ~2 s compute compile (`vk_pipeline_check` named `gta6rt.exe`) | file afterwards | next process | |---|---|---| | empty | +~210 KiB | 0.01 s from the file, also with `__GL_SHADER_DISK_CACHE=0` | | 1.23 GB (library and main-set compute) | same size to the byte | hit only through the driver's own disk cache | | 1.35 GB (the above plus what the game added) | same size to the byte | compiled again | In the game (main fe1553456 + #1886): seeded with the 1.23 GB file, 68 of the ~110 builds over 200 ms in one run were over 200 ms again in the next; started with no seed, 5 of 164 were. An older cache of mostly main-set graphics pipelines stopped growing at 4.9 GB, so there is no fixed size to test against, hence a growth check instead of a size limit. #1886 measured a 1,285 MB session on an RTX 5080, still growing. ## Tested - RTX 5060 Ti 16 GB, NVIDIA 610.88, Windows 11 23H2, MSVC via `scripts/build_runtime.ps1`. - `pipeline_cache_store_test` gains `test_growth` (no Vulkan, no GPU): no reference at creation, a growing cache at any size, too few builds, report once, counting from the previous save, a count that went backwards. - `ctest -R "pipeline_cache|compile_teardown|pipeline_workers|pso_profile|d3d12_pipeline"`: 10/10 pass. - Full `ctest -j 8`: everything passes except `root_sig`, `d3d12_state_sweep` and `d3d12_pso_validation`, which fail the same way on main fe1553456 without this change on this machine. - `scripts/check_no_game_data.py` on the changed files: clean. Related: #1886 (raises the save limit, so sessions reach this size), #1756 (checkpoint scheduling; both touch `save_session_pipeline_cache`, the overlap is one added line). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#2066
No description provided.