Repository navigation
d3d12: the session pipeline cache is saved up to 4 GiB, checkpoints included (RT-SESSION-CACHE-LIMIT) - #1886
Conversation
…ncluded (RT-SESSION-CACHE-LIMIT) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Answering the question in the description with one measured size: my offline By reading, what changes for such a setup: today both writes stop at the limit (256 MiB at teardown; Two ways that keep your gain: count only what the session added ( The PR builds and its neighbours pass together with six other world-start pull requests (counts in #1608); it conflicts with #1756. AI-assisted (Claude Code). |
|
Thank you @Snooozs, that is the size I did not have: 2.1 GB is a real seed, so with this change a seeded run writes the whole union at each checkpoint. Extrapolating my own checkpoints (0.35 s at 681 MB, 0.61 s at 1,357 MB: Of your two ways I prefer counting only what the session added against the limit: a seed alone then never triggers a write, and the builds a session adds are still saved. I'd rather not add it to this pull request without a maintainer saying which they want, since it needs the seed's size kept beside the cache. Whoever merges: is the plain limit fine for now, or shall I add that here? AI-assisted (Claude Code). |
|
Test report from a combined build on a second NVIDIA machine. Counts only. Machine: Windows 11, RTX 4070 SUPER, NVIDIA 621.01, 64 GB, own 1.0.2.1 copy. Build: Shaders: translated on Pipeline cache: warm and complete, 26,503 of 26,503 (9.6 GB).
Recipe:
AI-assisted (Claude Code). |
|
Tested together with #1756 and #1950: on my PC the session cache now persists and a second boot reuses it. AI-assisted test. Setup: RTX 2070 SUPER, NVIDIA 616.56, Windows 11.
#1950's exit path wrote too: after the device loss in run 2 (0x80000003), Run 2 then hit a device loss at ~203 s, before the cache was even needed for the big builds. I'm narrowing that down with the crash-diagnostic layer and will report it separately in #1608. |
|
Raising the limit is right, and making checkpoints follow it fixes
Wine suite (lavapipe and RDNA2 iGPU): no regressions from this PR. AI-assisted (Claude Code, Claude Opus 5.5). |
…ne seed; exit wait sized from measurements Review of ProjectLeonida#1886: the seed the driver hands back with the session's builds no longer counts against LEONIDA_PIPELINE_CACHE_BYTES (pipeline_cache_store::over_save_limit, with a unit test), the stale 512 MiB checkpoint sentence is gone from docs/d3d12_vulkan.md, and kExitCacheWriteMs is 6 s with the measured write times (1.87 GB in 1.4 s, 2.9 GB in 1.3-1.6 s; about 2.2 s at the 4 GiB default). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gt9hwRYcpySx4P4ncQ3wD5
|
@aslan2142 thank you, all three are in 66e96cc (with main merged first, no conflict):
Tested: |
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 onmain98c2f77, 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