Repository navigation
d3d12: opt-in precompile of every known pipeline (-PrecompileAll); never-drawn pipelines stay out of the library - #2986
TheStonedGamer wants to merge 3 commits into
Conversation
The precompile makes only the pipelines earlier runs drew with (warm --used). -PrecompileAll (launcher: "Precompile every pipeline", off by default) makes every pipeline the title has created, as foxhound's launcher does: fewer stalls in places not drawn in yet, at the cost of an hour or more and gigabytes the first time. Kept across the F1 menu's restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With -PrecompileAll every known pipeline is made (some 88,000 against 4,000 drawn with). Those never drawn with now stay in the driver's cache alone and are kept out of the pipeline library: the driver checks an entry of its own cache against the pipeline asked for and compiles again where they differ, while a library entry is taken as it was stored. With them in the library (1.5 GB, 91,525 entries) the device was removed twice during a burst of first loads in a new place (RTX 3060, driver 621.40): no hang, no page fault, the library file whole. With them kept out, a run of the same settings stayed up. The cause inside the driver is not known. The rule is into_library(), with a unit test that fails without it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests: -PrecompileAll is among the switches checked against play-d3d12.ps1, and it is passed only with the precompile on. - README.md, docs/launcher.md, d3d12/README.md: the switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Integration check with #2956. Both public Windows launchers default to the same sequence but implement the opt-in full precompile differently. I ran the unchanged scripts on each head with a synthetic recording executable.
git merge-tree on afe0b79 and 558b798 reports content conflicts in README.md and both scripts (scripts/play-d3d12.ps1 and d3d12/scripts/play-nvidia.ps1). The functional distinction matters when resolving those conflicts: this PR chooses library eligibility inside warm, while #2956 enforces it by splitting the passes. Combining both launcher implementations literally risks repeating a full warm. This check measured routing only, with no title, shader data or driver-cache workload. Codex-assisted for #2570. |
|
The full-precompile choice survives the actual saved F1 arguments. I tested
The combination with #2761 also launched the dynamic preset with |
Claimed in the coordination issue as: D3D12-PRECOMPILE-ALL-PIPELINES (#2570 (comment))
What and why
The precompile before a start (
leonida warm --used) makes only the pipelines earlier runs drew with. A place or effect not drawn in before then compiles its pipelines while the game waits.-PrecompileAll(Launcher.bat: "Precompile every pipeline", off by default) runsleonida warmwithout--used: every pipeline the title has created in any run (known-pipelines.bin, 88,586 here against about 4,000 drawn with) is compiled into the driver's cache. Plumbed throughtools/leonida_launcher.py,scripts/play-d3d12.ps1andd3d12/scripts/play-nvidia.ps1(kept across the F1 menu's restart). It prints that the first run takes an hour or more and that NVIDIA's Shader Cache Size should be Unlimited. Documented inREADME.md,docs/launcher.mdandd3d12/README.md.warm.rs: only pipelines earlier runs drew with go into the pipeline library (into_library()); the rest stay in the driver's cache alone. The driver checks an entry of its own cache against the pipeline asked for and compiles again where they differ, while a library entry is taken as stored. With every known pipeline in the library (1.5 GB, 91,525 entries), the device was removed twice during a burst of first loads in a new place: no hang (no TDR in the event log), no page fault in DRED, the library file whole (0 of 366,955 pages read as zeros). With them kept out, the same settings stayed up. The cause inside the driver is not known. With--used(the default) nothing changes: those keys are already only ones drawn with.Tested
cargo test --locked -p leonida --bin leonida warm::— the newonly_pipelines_drawn_with_go_into_the_libraryfails with theearlycondition removed (the old rule without--used) and passes with it (reverted by hand; MEASURED).python -m unittest tests.test_leonida_launcher tests.test_win_launchers: OK, including the newtest_precompile_all_only_with_the_precompileand-PrecompileAllin the switch check againstplay-d3d12.ps1.python -m unittest discover -s tests -p "test_docs_*.py": OK.python -I scripts/check_no_game_data.pyon the changed files: clean.warm.rschange, two device removals as above.GPUs tested: NVIDIA GeForce RTX 3060 12 GB, driver 621.40, Windows 11 Pro (26300)
AI-assisted: yes (implementation: Claude Opus 5.5 via Claude Code; separate read-only reviewer agents: Claude Opus)
Checklist
mainand merges cleanly.docs/design.md(n/a: no translator change).🤖 Generated with Claude Code