Sweeps behind flights every 15 s while memory is not pressed (a 36-100 ms frame every 1.5 s) #340
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/340"
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 bentsignal on 2026-11-27T21:13:00Z.
What this fixes
A regular stutter: about one frame in every 1.5 s took 36-100 ms instead of ~31, even standing still.
With the present sent ahead (
late_free_present),submitmakes a moment with nothing in the air for the sweep every 1.5 s. It does that by settling every flight first, so that frame waits for the card to drain. A 45-frame timeline (VICTORY_TIMELINE) of the prologue's cell put the two longest frames on it:With
VICTORY_SWEEP=0there was no frame over 50 ms at all. The sweep can't simply go, though: it is what lets idle host copies, staging buffers and textures go.The change
Host::sweep_every_mssets how often a sweep is made behind flights:VICTORY_SWEEP_EVERY_MS, 15,000 by default; 1,500 restores the old cadence) while memory is not pressed;residency::pressured(), or the card's use, less the texture pool's free part, at or overresource::room_line(the line textures are made up to). From that line on, textures are held back for room, and the sweep is what frees idle ones. The first version used 97 % of the budget instead, which left textures waiting between ~93 % and 97 %.It is looked at twice a second, and the log says when it switches (
sweeps behind flights pressed=... every_ms=...). Sweeps that need no settle (nothing in the air anyway) are unchanged.Measured
RTX 5070 Ti 16 GB, Ryzen 9 9900X, 61.6 GB RAM, Windows 11. Series X profile, 2560x1440, DLSS Quality, release, pipelines warmed. Prologue cell, 40 s steady state, frame times from the present intervals:
VICTORY_SWEEP=0)The first two columns are without frame generation; the third is from five runs with it.
The last column also needs memory not to be pressed. On this PC that needed a separate fix to how commit is counted (a separate PR, "Residency: count what the pagefiles can still grow by as commit left"). Without it, the residency pressure stays on and the sweep keeps its 1.5 s pace, which is the same as today.
Tests
cargo test -p victory-gpu --lib: same results asmain(indirect::tests::host_list_budget_starts_empty_at_each_submissionandwarp_batch_charges_every_executionfail onmaintoo).watch::tests::what_is_put_in_beside_the_guards_is_told_at_every_viewfailed once in a full run and passed alone, on this branch and onmain.cargo clippy -p victory-gpu --all-targets: no new warnings.Setup
Own dump of the title. No game files are attached or quoted.
This change and its testing were done with an AI assistant (Claude Code), and the results were checked on my machine.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T03:49:40Z.
Testing feedback on AMD Ryzen 7 5700X (8C/16T), NVIDIA RTX 5080 16 GB, 32 GB RAM, Windows 11, Series X 1440p + DLSS Quality + DLSS MFG 4× (
4 MiBdefault windows,VICTORY_GPU_BCPACK=0,VICTORY_WAIT_RESIDENT=0,VICTORY_TEXTURE_ROOM_PERCENT=70,VICTORY_LAND_SKIP=1, defaultVICTORY_SWEEP_EVERY_MS=15000).Full disclosure: tested on a fork branch based on
v2026.11.27.7(with local GPU patches,x86-64-v3/ThinLTO, and PR #516).Result — 12-minute (720 s) 3D run (
3.2k–5.3k draws/frame)DeviceRemoved, 0 guest exceptions, 198/198 Responding,SharedMax = 6,879 MB,loose_mb = 2,808 MB,MinFreeC = 12.86 GB.sweeps behind flights pressed=false every_ms=15000(initial)sweeps behind flights pressed=true every_ms=1500(during heavy streaming load)sweeps behind flights pressed=false every_ms=15000(steady 3D)1500 mssweeps once memory pressure subsided.360..760 sstretch (n=56samples,4k–5.3k draws/frame): 16.6–17.6 FPS p50 (56.7–60.2 ms),max = 68.8 ms,0frames>=250 ms,0GPU stalls>=50 ms(66–79 FPSwith MFG 4×).0..360 sstretch vs identical build without PR #340:14.5 FPSp50 (69.2 ms,max 118.4 ms,0frames>=250 ms) vs14.2 FPS(70.2 ms,max 400.2 ms,1frame>=250 ms).Clean frame-pacing win with safe automatic fallback to
1500 msunder memory/VRAM pressure.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by bentsignal on 2026-11-28T13:13:23Z.
One more commit here, since it corrects this PR's own "pressed" rule: the card now counts as pressed when the texture pass finds no room (
resource::room, which also counts what is kept for render targets and buffer copies), not by the card's use against the line alone.Why: in a cutscene on an RTX 5070 Ti (16 GB, Windows giving the process ~10.9 GB, frame generation 3x), the use-only test said "not pressed" for seconds at a time while every texture pass held new textures back: ~9,800 slots a second held for room, served a median 0.9 s and up to 32 s after their write, while sweeps ran every 15 s. Measured together with #1095 (texture pass held-slot cap) and a launcher texture line of 93 %: 23.3 -> 29.7 fps, frames over 50 ms 4.6 -> 2.2 a second, held slots 9,800 -> 1,200 a second, served median 919 -> ~220 ms. This commit's own share was not measured apart.
VICTORY_SWEEP_PRESS_BY_ROOM=0restores the use-only test.🤖 Generated with Claude Code