Refreshes: no-op spans dropped before they are queued, clean spans sifted before the per-span lock (VICTORY_FLUSH_FAST_NOOP, _V2) #4774
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4774"
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 henriazz10 on 2026-12-01T07:23:57Z.
What it changes
Refreshes are the largest part of the submit thread: about 28–32 ms of a 60 ms preparation per frame in our logs, and about 92 % of the spans they walk change nothing (no-op). Each no-op still paid for an ahead snapshot, an
OWNEDread lock and atell_watchper span.VICTORY_FLUSH_FAST_NOOP=1: caches the ahead snapshot once per submission and drops no-op spans early inBatch::add, before they are queued.VICTORY_FLUSH_FAST_NOOP_V2=1: inflush_all, sifts the clean spans first (owned_snap,ahead_containsfirst,last_clean), so the per-spanOWNEDlock andtell_watchare skipped for them. It also fixes the merge of disjoint intervals inBatch::add, which could join two ranges that do not touch.play.rs. A span that does change takes the same path as before.How it was tested
victory.logafter a 20 s warm-up and compared at matched scene load (42–56k thin calls per frame), with the same build switching only these settings:FLUSH_FAST_NOOP=1: submit-thread preparation −7.3 % at matched load (−8.7 % inside the load band), 2 alternated runs per config.FLUSH_FAST_NOOP_V2=1on top: a further −4.8 % (1 run), and −13 % together with another switch that turned out to do nothing in that run, which makes it effectively V2 alone. In fps, about 13.1 → 15.3 at matched load.v2026.11.30.03, same route: frame time at matched load 75.3 → 70.6 ms; submit-thread preparation 70.7 → 65.4 ms (−7.5 %).ci.yml:cargo build --releasepasses.cargo clippy --workspace --all-targets --locked -- -D warningsgives no new finding (it already fails onmain, in the same 3 files).cargo test --workspace --locked: 2488 pass;modules::xmem::tests::a_read_by_range_waits_only_for_a_remapping_that_meets_itfails on every branch of this set and on none of the files they touch, andconsole_insn::tests::clzero_on_a_guarded_line_goes_through_the_guardonce in the full parallel run, and each passes when run alone (--exact);mainitself failshost::refresh_tests::chunked_nothing_new_with_matches_individualin the same run.cargo fmt --checkalready reports hundreds of hunks per file onmain; the new code follows the style of the code around it.Checked for overlap
AI-assisted. Neon (Gemini) wrote the change; Claude Code reviewed it, rebased it on
main, built it, ran the checks and measured it.🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-12-01T10:51:04Z.
A measurement of this PR on an 8-core CPU, in case it helps.
Setup
5fabb46ewith this PR and #4757 merged. The only conflict was theplay.rsdefaults block, where both sets were kept.--set, so the arms differ only by them:0;VICTORY_FLUSH_FAST_NOOP=1andVICTORY_FLUSH_FAST_NOOP_V2=1, #4757's two at0.Submitting thread, per frame (the "preparing per frame, the submitting thread" line, mean of each run's 150 s):
Picture: 800 frames per arm; we looked at every frame a frame-to-frame check flagged.
Not tested: movement (idle camera only), Series S, frame generation on, other cards.
AI Assisted
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tillo88 on 2026-12-01T12:07:05Z.
I queued this PR on my replay bench, but it does not merge on top of v2026.11.30.03, the latest release (merge conflict), so there are no numbers from it yet. I'll try again on the next release.
Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Razen114514 on 2026-12-01T14:40:05Z.
A third host with the same shape of numbers, from a much smaller card, and one detail
about where the no-op cost is paid here.
Host: RTX 5060 8 GB, i5-13490F, 32 GB, Windows 11 build 26200, driver 621.1.0.
Series S, 960x540 scene through the title's FidelityFX path to 1920x1080, DLSS
performance, DLSS frame generation 2x, at
v2026.11.30.03. Log line, per frame:So 90.2 % of the refreshes here are already known to copy nothing (
9560 / 10593),which matches your 92 % on quite different hardware -- the ratio looks structural, not
config-dependent.
What that is worth here, scaled down. The same switch set measured -13 % of the
submit thread's preparation on your RTX 5080, where refreshes are about half of it
(28-32 ms of 60). Here the whole preparation is 47 ms and refreshes are 16.6 ms of it,
about 35 %, so the same -13 % of the refresh part would be roughly -9 % (about 4 ms a
frame), not -13 % of everything. I have not built this branch, so that is arithmetic
from the two logs, not a measurement of your change on this card.
The detail worth having: the log says known to copy nothing, so the runtime
already decides this before queuing -- but the span still goes into
Batchand 1,942 ofthe calls land on several threads in that window. That is the step
VICTORY_FLUSH_FAST_NOOPdrops before it is queued, which is why I think the small-cardcase may gain a little more than the ratio suggests: on this machine the per-span work
that remains is dispatch, not copying.
No review of the diff -- this is two hosts' logs side by side. If it helps, I can run the
switch here once you say the branch builds on
mainand post the before/after from thiscard, which is the one configuration none of the PRs in this set has measured.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:32:32Z.
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