Compile memory admission by the process: on in warm, preload and shaders, off in a run (VICTORY_COMPILE_MEMORY=1/0 for every process) #3347
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3347
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3347"
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?
@Lyrnc on GitHub · 2026-11-29 22:09 UTC · original
Lyrnc:perf/regression-compilemem→main· +85 −9 · 5 files · 1 commits · openFixes #2385 and #2308. Part of #2319 (the 0.1 fps stall, not its slower warm frame); the same stall is reported on v2026.11.29.03 in #2942. Reworked on v2026.11.30.02 (
84bd61e2) for #4017: see "What changed in this revision".What changed in this revision (2026-11-30)
Before: the admission was off in every process unless
VICTORY_COMPILE_MEMORY=1. v2026.11.30.01 shipped the same thing as a play default (VICTORY_COMPILE_MEMORY=0).Why that was wrong. v2026.11.30.02 took that default out again (
78978f86, the note inplay.rs):victory warm,victory preloadandvictory shaderstake play's defaults too.So the admission is on in play again, and the cold-start stall measured below comes back with it.
Now: the admission goes by the process.
=1=0victory warm(and its child processes),victory preload,victory shadersvictory play,victory run)main.rstells victory-gpu that the process is one of the tools (victory_hle::compiles_beside_other_processes()), right after it applies play's defaults and before anything compiles.compilemem::on()decides once, fromon_for(VICTORY_COMPILE_MEMORY, beside_others), a pure function.compile memory:line now also saysbeside_other_processes.victory warm --theseprocesses, which go through the samemain.rsbranch.Why these two defaults:
WAIT_OTHER). Its draw or dispatch is then dropped until the pipeline is made again 1 s later, and a dispatch the title runs once is lost.A looser rule in play instead of off. Considered, not taken. For example: always let one compile start, never hold or put off a compile on a title thread, and gate only the pipeline workers.
ptxasfailure on a PC whose page file can grow.VICTORY_COMPILE_MEMORY=1turns the full admission on for that PC, and a per-worker cap could follow with that report's numbers.Unit test:
the_admission_is_on_beside_other_processes_and_off_in_a_runcovers unset,1,1,0, another value and empty, in a run and in a tool process. The othercompilememtests are unchanged.begin_lets_one_compile_run_and_frees_the_gate_when_it_endsholds either way.What it changes (the original measurement, still the reason for "off in a run")
What was wrong. v2026.11.29.01 turned on the compile memory admission from #1625 (
60a08ef2).VICTORY_COMMIT_FLOOR_MB). Free physical memory sits under its 1024 MB soft floor (VICTORY_MEMORY_FLOOR_MB).829188e9: 1,337 compiles were put off after waiting, only 108 were started in 300 s, and 1,272 pipelines were recorded as failed with0x8007000E. Frames took 5 or 10 s (0.1-0.2 fps), and the loading screen never left: no frame reached 2,500 draws.The commit figure is not where allocations fail: Windows grows a system-managed page file when commit nears its limit.
0x8007000Eat all.0x8007000E.Why not count page file growth instead (#2392, #2717). Both keep the admission on and count what the page files can still grow by as commit left, as residency does since #339.
0x8007000E. That is 0.2 fps, the same as without them.Trade-off. The admission was written for
ptxas fatal: Memory allocation failure, with a dozen workers compiling at once (#1625, RTX 5070).VICTORY_COMPILE_MEMORY=1is the way back there.How it was tested
VICTORY_BVH_BUILDER=0).pipelinesfolder) is deleted before the run. Warm: the second run on that build's own cache.0x8007000E829188e9(v2026.11.29.01)829188e9+ this change (first revision: off everywhere)829188e9+ #2392829188e9+ #271784bd61e2.84bd61e2(rustc 1.98.1, its own target directory):cargo test -p victory-gpu --lib --locked -- compilemem memguard: 20 passed, 0 failed (the new one included).cargo clippy -p victory -p victory-hle -p victory-gpu --all-targets --locked: no warning in a touched file (3 elsewhere, all on main's lines:host.rs:5092,shadow.rs:7197,xmem.rs:1933).Checked for overlap
AI use
Claude Code (Claude Opus 5.5) wrote the change and this revision, ran the A/B runs above (the run script and the log parsing are its own), read the cause out of the compile memory and memory guard log lines, and wrote this description. #1625's admission is mizzied's work and stays in the tree unchanged: on in the tools, and behind
VICTORY_COMPILE_MEMORY=1in a run.🤖 Generated with Claude Code
@Lyrnc on GitHub · 2026-11-29 23:20 UTC · original
More A/B runs, adding the two newer guard PRs. Same setup as the table above: RTX 5080 + 9800X3D, Series S, DLSS Quality, FG and RT off, standing still, 300 s per run. "Cold" means the driver pipeline cache was deleted before the run. The columns are fps, compiles put off, and pipelines failed with
0x8007000E.829188e9)829188e9#2886 and #2392 together leave the cold stall as well as this PR does, and they keep the admission on, so they also keep #1625's protection where the page file can't grow. If the maintainers prefer to keep the guard, merging those two together is the alternative to this PR. Neither one alone is enough on a 32 GB PC. #2886 + #2717 conflict in
memguard.rsandcompilemem.rsand were not tested.AI use: Claude Code (Claude Opus 5.5) ran these runs and wrote this comment.
@Lyrnc on GitHub · 2026-11-29 23:26 UTC · original
A note on the method above: the builds shared one cargo target dir, and that turned out to leave out a branch's victory-shader changes when the checkout's files were older than the last build. Every change that matters here (
memguard.rs,compilemem.rs) is in victory-gpu and was compiled into these builds, so the guard numbers stand. #2886's own victory-shader commits were not in its build. They don't affect the compile admission.Compile memory admission off by default (VICTORY_COMPILE_MEMORY=1 turns it on)to Compile memory admission by the process: on in warm, preload and shaders, off in a run (VICTORY_COMPILE_MEMORY=1/0 for every process)8bc02d8d25to08f337860408f3378604to1205383319@Lyrnc on GitHub · 2026-11-30 19:05 UTC · original
Rebased onto main
e1251c31(v2026.11.30.03), now12053833. The only conflict was inapps/victory/src/main.rs, where #4177'sclear_stale_shaderscall and this PR'scompiles_beside_other_processes()both land afterplay::apply_defaults()for shaders/warm/preload; both are kept, in that order.cargo check -p victorypasses;cargo test -p victory-gpu --lib -- compilemem memguard: 20 passed. (The one check warning,Shadow::rangedunused, is main's.)AI use: Claude Code (Claude Opus 5.5) did the rebase and ran the checks.
1205383319to821f4a833eView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.