Repository navigation
perf(agc): keep up to 1024 cached pipelines - #2175
Merged
oneandonlydean merged 1 commit intoOct 9, 2026
Merged
Conversation
CachedPipeline keeps at most 256 pipelines. A level with a larger working set thrashes the LRU: every miss creates a new VkPipeline (modules, layout, render pass and a driver compile from the pipeline cache). The bound is now 1024. A cached pipeline is a pure function of its key, so the bound changes only memory and time.
Contributor
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CachedPipeline's LRU bound goes from 256 to 1024 pipelines. A cached pipeline is a pure function of its key, so only memory and time change.Why
A level whose draws use more than 256 pipelines thrashes the LRU, and every miss creates a new
VkPipeline(modules, layout, render pass and a driver compile). Since #639 shaders are compiled at registration, but pipelines are still created on demand here.Tested
Linux (CachyOS, GCC 16.2, RTX 4090, NVIDIA 610.57), on
maina8b032b: ctest 495/495.tools/check_conventions.pypasses.No new test: the bound is a constant, and counting cache misses needs a device and a scene with more than 256 pipelines.
A heavier title, one level, frames per second over level start +30 to +150 s, warm caches, two runs with the change and four of the base. It does not reach the level on
mainalone, so this was measured with the fixes needed for the title to reach the level:main4b6ab6b plus the boot fixes, feat(agc): depth planes sampled as 2D arrays, cubes and integer views #425 (with a depth-plane read fix), fix(recompiler): split image reads whose descriptor is a web of SRT Phis #1274, Fix/agc hold flip behind worker #1745, perf(agc): size the storage and sampled texture caches to the device #1059 and an import budget like feat(agc): host import windows, least-recent eviction under the budget #290's. The base is that build:[pipecache]shows 1,488 misses and 1,488 evictions per 10 s; the level's working set is 538 pipelines. At 1024: 0-4 misses per 10 s, nothing evicted.Graphics::Drawper draw packetA lighter title that runs at 60 fps: unchanged, 60.0 fps menu, 59.9 fps gameplay, no skipped draws, all screen checks pass.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)