Warm: pipelines are marked done by what is in them, so a translator setting remakes only the pipelines it changed #2731
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2731"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T16:41:39Z.
Related: #1262, #1483.
What it changes
victory warm, the step ofvictory preloadthat makes every known pipeline ahead of a run, wrote each pipeline down as done under one fingerprint. That fingerprint held the translator and every setting in the shader cache's key (shader_cache::translation). Changing one switch that alters a few programs therefore changed the fingerprint for all of them, and the next preload made every known pipeline again. Here that was 83,564 pipelines and 33.7 min on an RTX 4090, while the translations themselves take about 20 s.The pipeline library already names each pipeline by what its host description holds (
library::name: the translated code, our root signature and the graphics state). The driver's own cache also keys by those bytes. This PR uses the same name for the done marks:library::name_onlyruns code on one thread withlibrary::pipelineloading and making nothing. It records the first name asked for. A guard puts the thread back even after a panic.HostPipeline::name_ofrunsHostPipeline::newinside it, so the name is the one a real make would use. It covers compute, graphics, the rectangle geometry stage, linked mesh shaders, depth bounds and primed static-sampler places. Inside it,newreturns early instead of reporting, refusing or retrying.known::namesnames the warm's pipelines on the warm's threads. The shaders are translated once each (the cache's hits afterpreload's shader step). Only the root signature is asked of the driver. Nothing is compiled.warmmarks a pipeline<marks> <name>.markshashes the driver, the static samplers' order, the program and the card (known::made_forplusmark_fingerprint), but not the translator. When the name is in the marks, the pipeline is not made again. When its translated code or root signature changed, the name changed and the pipeline is made. Two title pipelines with one host description are made once. A pipeline with no name here (no host pipeline) is made as before and never marked.VICTORY_WARM_SHARED,fill_librarymarks by name in the same way.warm-bad.txt) still follows the translator's fingerprint, as before (#779).A stale entry cannot be used. A name is the hash of the exact bytes handed to the driver, so changed code always gives a new name. Marks from before this change are under other fingerprints, so the first warm after it makes everything once. Shader translations are still keyed by the whole translator and its settings, unchanged: they are cheap, and only the compiled pipelines are reused.
Expected effect: a switch that changes N programs still re-translates every shader, about 20 s on all cores (104 to 153 s in the passes below, on 16 low-priority threads). Naming takes 4 to 13 s. After that, only the pipelines that use those N programs are compiled, instead of all of them.
How it was tested
On the card, with the title: the same change on our integration branch, Series S profile with ray tracing, house scene, 300 s after a full preload. Median 47.8 ms, p95 88.4 ms (the same scene on the base before: 50.1 ms, p95 2,217 ms with a cold cache). The ray-tracing structure builder ran, and no pipeline was dropped for want of a host pipeline. The run reused the library written by the preload (12,486 loaded, 170 made at the end of the preload).
RTX 4090 (driver as installed), Windows 11, i9-13900KF. Offline only: no title run.
victory preload --all --jobs 16was run with a renamed copy of the diag build and a cache folder of its own (VICTORY_CACHE_DIR). The cache folder held a copy of the known pipelines from earlier runs (83,564 pipelines, 19,104 shaders). The preload ran on logical CPUs 16-31 at low priority.Passes in order. "Kept" means made before under the same name. "To make" includes pipelines the memory guard put off in an earlier pass, which are never marked.
MED3_CLAMP=1(in the key, same code)MED3_CLAMP=0(rewrite off)MED3_CLAMP=0againMINMAX_NONZERO=0(rewrite off)the commit left would fall under its floor, other runs on the PC) are not marked and are tried again by the next warm, as before this PR.library::tests::naming_only_makes_nothing_and_ends: nothing is loaded or made, the first name comes back, and the thread makes pipelines again afterwards, also after a panic.warm::tests::only_pipelines_whose_contents_changed_are_made_again: unchanged names are reused, a changed name is made, twins are made once, unnamed pipelines are made, and--againremakes.warm::tests::done_marks_are_read_by_name_under_their_fingerprint: older marks and other fingerprints do not count.warm::tests::marks_by_name_follow_program_card_and_driver_only.cargo test --locked -p victory-gpu --lib -- pipeline:: shader_cache: 82 passed.cargo test --locked -p victory --bin victory -- warm::: 11 passed.cargo clippy -p victory-gpu -p victory --all-targetsshows no warning in the lines this PR changes. With-D warnings, clippy already fails onmaininvictory-loader(crash.rs,unwind_copynever used).Checked for overlap
warm.rsnear the same lines, so a small rebase may be needed.VICTORY_WARM_SHARED, which this keeps.Provenance: written for this PR, not ported from another fork.
AI-assisted: written with Claude Code (Claude Opus 5.5). I reviewed the change, and the measurements above were taken on my PC.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PVi6XmTj4ohPL7QwUeFgV4