Default to full D3D12 shader and pipeline precompilation #3172
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3172"
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?
Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T16:17:29Z.
Claimed as D3D12-FULL-PRECOMPILE-DEFAULT.
What and why
Windows Play translates every shader and warms every recorded pipeline by default. This uses the existing full warm-up and its driver cache. A fresh pipeline book contains no entries. The first substantial full warm-up happens on a later launch, after the game records pipelines. A large book can take an hour or more to warm, and parallel compiler processes can use several GB of system RAM.
-PrecompileUsedkeeps shader translation and warms only pipelines used to draw in previous runs.-NoPrecompileskips both stages.-PrecompileAllswitch and its explicit PowerShell false form. Preserve the used-only choice on in-game restart.Tested
warm --used, and the fresh desktop profile reported full warm-up off.git diff --check.GPUs tested: n/a. Windows launcher tests used a synthetic executable.
AI-assisted: yes, OpenAI Codex GPT-6.2 Sol. Independently reviewed by separate read-only GPT-6.2 Sol reviewer runs.
Checklist
main.Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-02T16:30:34Z.
Verified: it applies on the current
main, and its tests pass - 26 intest_leonida_launcher.py(3 new) and 6 intest_win_launchers.py(1 new), all OK.And one measured concern about the new default, from this machine.
What the change does, in its own words: the default becomes
-PrecompileAll- "translate all shaders and warm every pipeline recorded in earlier runs" - and the help text says "an hour or more and use gigabytes of driver cache".The number it does not have is the memory one, and I measured it yesterday for #3041 on this machine (RTX 4090, 64 GB) with
leonida warmon a real book:--jobsAbout 8-11 MB for each pipeline at peak, and the peak follows the count, not the concurrency.
known.rsand a real book both say the title creates about 84,000 pipelines (I have awarmrun that printed83563 pipelines known). The drawn-with subset is some 2,000 - but "every recorded" is the whole book.So the default this sets is a warm-up whose memory grows past what an 8 GB card's machine has before it finishes, on exactly the machines that already arrive in this repository with "out of memory" reports (#3041, the 8 GB threads).
-PrecompileUsed- the drawn-with subset - is the shape that fits there, and it is this same pull request that gives it a name.What I would suggest: keep
PrecompileAllavailable but not default for every card, or gate it on free memory (thewarmmemory figure above is enough to size the gate: free memory minus 2 GB, divided by 10 MB), or at least say the RAM in the help text next to the hour and the gigabytes.What I did not measure: a full warm-up of the whole book - the peaks above are at 140 and 540 pipelines, and extrapolating to 84,000 is arithmetic, not a measurement. I am not claiming 84,000 was run.
AI-assisted: yes - DeepSeek v4.1 (flash).
Written with an AI assistant.
Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T16:32:05Z.
Thanks for testing this and recording the host RAM peaks. I added a system RAM note to the startup output and D3D12 guide in
0413012fa. The startup output points to-PrecompileUsedfor warming a smaller set. All 32 Windows and desktop launcher tests passed after the edit.The two measurements change both the number of pipelines and the number of workers.
warm.rsreplaces compiler children after batches of at most 40, andknown.rsreads the whole book in each child while copying just that batch’s entries. The samples show several GB of RAM use, but they do not establish a per-pipeline memory requirement that we could use to size a gate. The change keeps the requested full default. Worker limits are being handled separately in #3071.Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-02T16:53:50Z.
Review: COMMENTED
Checked out
0413012fa: the launcher (26), Windows launcher (6), switch (20) and menu-choice (16) tests pass; the default is full warm,-PrecompileUsedand-NoPrecompilebehave, the legacy-PrecompileAll:$falsemaps to used-only, and the used-only choice survives an in-game restart. Merge-tree with current main is clean. Both guards are mutation-covered (forcing used-only failstest_d3d12_precompile_modes; flipping the launcher default fails three tests).The concern is operational, not plumbing: this turns a ~2,000-pipeline warm into ~84,000, and the failure path is unguarded.
play-nvidia.ps1:888/933never checks$LASTEXITCODE, andwarm.rsreturnsOk(())even when children die — they go towarm-bad.txtand are never retried, even after memory recovers. On an 8 GB machine that is a realistic OOM, not an edge case.precompile_all=false, silently downgrading the new default to used-only. And the top-level README omits the RAM/time note thatd3d12/README.md:71-74has.Also worth stating in the body: the expensive full warm is normally the second start (fresh install has an empty book and warms 0), and there is no environment-level opt-out — only the two scripts/settings.
Verified with a synthetic runtime only; the 84k-pipeline timing, peak RAM, 4 GB driver-cache behavior and in-game restart still need a real pipeline book and GPU.
Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-12-02T16:57:04Z.
Thanks for verifying the launcher paths and the merge tree. I updated the PR description to say that a fresh pipeline book starts empty, to call out host RAM, and to point to the launcher settings and PowerShell switches.
#3071 and #3027 cover separate mitigations. The worker cap reduces peak concurrency. The exit-code warning can report a failed top-level process, while the supervisor can currently record a failed child and still return success. A fixed free-memory cutoff would need measurements with the same book and worker count on lower-memory hosts.
I reproduced the pause/resume issue, made both launchers retain the selected warm-up mode, and verified it with the launcher tests and a Node smoke test. GitHub rejected the push because #3172 is already in the merge queue. I left it queued so the requested default can land.
Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T17:06:16Z.
Review: COMMENTED
I checked
0413012famerged withmain5b1fff821. All 44 runnable launcher tests passed on Linux, with 5 platform/tool skips. I also round-tripped fresh settings and existing saved full, used-only, and skip selections through the Python launcher. Windows command construction selected the default,-PrecompileUsed, or-NoPrecompileas expected, and the Linux command omitted all three Windows choices. The web preview produced the same Windows arguments in a Node smoke test. This covers saved settings and command routing. I did not measure a full warm-up, GPU behavior, or native PowerShell execution.AI-assisted: OpenAI Codex.