mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:45:54 +01:00
[PR #1886] [MERGED] d3d12: the session pipeline cache is saved up to 4 GiB, checkpoints included (RT-SESSION-CACHE-LIMIT) #1896
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1896
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1886
Author: @DadaCap
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142
Base:
main← Head:session-cache-limit📝 Commits (3)
a031392d3d12: the session pipeline cache is saved up to 4 GiB, checkpoints included (RT-SESSION-CACHE-LIMIT)10b01d2Merge remote-tracking branch 'origin/main' into session-cache-limit66e96ccd3d12: the session cache limit counts what a session adds to an offline seed; exit wait sized from measurements📊 Changes
4 files changed (+38 additions, -15 deletions)
View changed files
📝
docs/d3d12_vulkan.md(+3 -2)📝
runtime/shims/d3d12_vulkan_device.cpp(+15 -8)📝
runtime/src/pipeline_cache_store.h(+12 -5)📝
runtime/test/pipeline_cache_store_test.cpp(+8 -0)📄 Description
RT-SESSION-CACHE-LIMIT, claimed and found in #1608.
What
The session pipeline cache's default save limit (
LEONIDA_PIPELINE_CACHE_BYTES) goes from 256 MiB to 4 GiB, and a checkpoint uses the same limit instead of its own 512 MiB.Why
Past the limit nothing is written, so every later build is lost and the next run repeats it. The world phase exceeds it on NVIDIA:
main+ #1756 + #1849 + #1827,LEONIDA_DEVICE_TYPE=6, the two later runs withLEONIDA_SERIAL_BIG_COMPILES=0pipeline cache is 350948938 bytes, over the 268435456-byte write limitThe effect on the next run: 353 of 362 builds that were slow (2 s or more) in one run came from the cache in the following one (5 rebuilt, probably in flight when the run was stopped; 4 not reached when I counted). The later run passed in about 80 s what had taken the earlier one its whole 30 minutes. Those two runs got to the fifth world frame, a point my runs never reached before.
Cost, measured on the same machine: loading 867 MB takes 0.35 s (
driver_us), a checkpoint 0.35 s at 681 MB and 0.50 s at 1,102 MB, on the compile worker. Whether that disturbs a frame is not measured yet.What the limit is for: the comment says it keeps a cache seeded from a multi-GB offline corpus from being rewritten at every exit. With 4 GiB a corpus file below that is rewritten, at teardown and with
LEONIDA_STARTUP_CACHE_CHECKPOINTS=1at each checkpoint. If that is a concern, a lower default (above about 1.5 GB) plus an exemption for a seeded cache would be an alternative; tell me and I'll change it.Tests
pipeline_cache_store,d3d12_compile_teardown,d3d12_pipeline_workersand its eager variant pass onmain98c2f7777, RTX 5080, Windows 11, VS 18 RelWithDebInfo. No new test: the parsing is covered bypipeline_cache_store_test, and this changes a constant and removes a second cap. Textual overlap with #1756 insave_session_pipeline_cache(both touch the same function); I'll mergemainwhen that lands. Not run: the wholectestset, other GPUs.AI-assisted (Claude Code).
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.