Even frame delivery: frames arriving unevenly 76 % → 16 %, 1 % low +28 % (10.6 → 13.6 fps), average unchanged (present pace, on by default) #4636
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!4636
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4635"
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?
@thatblend on GitHub · 2026-12-01 00:24 UTC · original
thatblend:perf/present-pace→main· +353 −30 · 3 files · 1 commits · closed without mergingWhat it changes
On main the frames a player sees come in long and short pairs even when the frame rate is steady. Same build, same drive, the switch flipped every 12 s (
VICTORY_AB):The same drive with the camera swung round six times: 74 % → 20 % uneven, 95th percentile 67.0 → 52.9 ms, 1 % low 10.0 → 12.0 fps, mean 39.8 → 40.1 ms.
What was wrong. The title presents on an even beat (its presents were 37.4 ms apart in the mean), but its threads submit the next frame's lists while a present stands, and how much of that work lies ahead of each present in the line of submissions alternates from frame to frame. The host's
Presentis called when the line reaches it, so it comes early after little work and late after much: frames of some 30 and 50 ms on end at a 37 ms mean. The work is done at the same rate either way; the 1 % low is poor for the timing alone. A frame-rate cap does not help, since it paces the title, which is paced already.What this does. A present that is ready early is held until the frames' mean time since the one before it has passed (97 % of it, and never longer than three fifths of a frame), and shown by a small thread of its own (
victory-pace). Only thePresentcall waits: the frame's copy into the back buffer is recorded and sent where it was, and the submitting thread goes on with the next submissions, which is why the mean does not move. At most one present is ever held; the next present shows it first, so the back buffers keep their turn. In the runs four presents in five were held, 11 to 15 ms each.New file
crates/victory-gpu/src/host/pace.rs(the rule is a pure function with three unit tests); inhost.rsthe present call and what follows it becomePresenter::show, so that the same code shows a present now or later.VICTORY_PRESENT_PACE=0shows presents as they come, as before. It is read throughtoggled!, soVICTORY_AB=12,VICTORY_PRESENT_PACEcompares it in one run.Left alone: presents with frame generation (Streamline reads the tagged depth and motion vectors when the present is called, and later submissions would have written them), any present through Streamline's or FidelityFX's swap chain, and presents handed to
present_aside's thread (VICTORY_PRESENT_ASIDE,VICTORY_PRESENT_QUEUE). Those are shown as they come.What it costs. A held frame reaches the screen up to three fifths of a frame later than it could have. Nothing is dropped and no frame is shown out of order.
How it was tested
e1251c31plus this change and nothing else (release,--features ab, warm caches): a scripted drive through traffic from one save, 240 s measured after 80 s of warm-up,VICTORY_AB=12,VICTORY_PRESENT_PACE(eleven phases and some 3,300 frames a side). Frame times are our presents to the host (the frame log).cargo testpassed for the crates it touches: yes. At this branch's head on7d93ee07:cargo test --locked -p victory-gpu --lib: 1136 passed, 0 failed, 66 ignored;cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand the same with--all-features: clean.Checked for overlap
VICTORY_FRAME_PACE, and differs in two ways that are why this is a separate request. It is off by default, so a player gets nothing until they find the switch. And where it waits is on a thread the frame is made by: the title's thread at its present, or withVICTORY_PACE_AT_PRESENT=1the thread that presents, before the swap chain'sPresent; here the submitting thread is never held (only thePresentcall is, on a thread that does nothing else), which is what leaves the mean frame time where it was. Also related, and left alone by this: #1988 and #2201 (VICTORY_PRESENT_QUEUE,VICTORY_PACE: a swap chain on a queue of its own, paced by refresh counts; opt-in).@shurhundo on GitHub · 2026-12-01 02:48 UTC · original
The
presenting.is_none() && !swap_chain_proxied() && !live_swap_chain()exclusion is checked once, at the moment a present becomes "ready," and it can then sit held for up to 0.6x the mean frame time beforeshow()fires, with no recheck at show time. If Streamline frame generation gets toggled on via the live F1 menu item during that hold window, is there anything that flushes/resets a pending held present, or could one that was vetted as "safe to delay" fire late without re-validation?@isgti07-hub on GitHub · 2026-12-01 02:57 UTC · original
Tested on an RTX 5090 32 GB, Ryzen 7 9800X3D, 64 GB RAM, Windows 11; Series X, 3840x2160 output, DLSS Quality, no frame generation, no ray tracing. Release build with
--features ab: this PR's head merged onto main7d93ee07, together with #4640 and some changes of my own (#4603, #4644, #4645 and two that only add counters and a profiler).One run, about 15 minutes of driving through the city,
VICTORY_AB=12,VICTORY_PRESENT_PACE,<one switch of mine>: 68 phases of 12 s with gameplay, 34 with the pace on and 34 off. Per phase, the per-secondframe timeslines (they are measured after the present is shown, so they include the hold), averaged; the effect is from a least-squares fit with the phase's draws a frame as a covariate:The same as your numbers on the RTX 4090: the mean stays where it was and the long and short frames even out. It also feels smoother in play. No crash or device loss in the run.
Not tested: frame generation (the PR leaves it alone), other cards.
🤖 Generated with Claude Code
@Aniseto on GitHub · 2026-12-01 07:44 UTC · original
Ran the
pacetests and thevictory-gpulib suite at0484229con an NVIDIA Blackwell desktop part with 16 GB of VRAM, with the failing test repeated onmain5fabb46ein a separate target directory.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.The three new
pacetests pass here. The one lib failure ishost::packed_present_tests::packed_float_single_planes_are_presented: it panics athost.rs:17778here and athost.rs:17713onmain, so the same pre-existing failure reproduces on this host and is not introduced by this head. The description's 1136/0/66 was on its base7d93ee07; on currentmainthe lib suite selects fewer tests (1161 here against 1202 at the head), and the same test fails there too. The full-tree timing and the in-world pace measurement were not repeated here.Not tested: a title run with
VICTORY_PRESENT_PACE, the 12-second A/B, DLSS/frame generation, WARP, AMD and Intel GPUs, Wine, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@trustno1-coder on GitHub · 2026-12-01 18:36 UTC · original
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed