Pauses, hitches and flicker measured at every present: a smoothness: line, VICTORY_FLICKER_DETECT=1, and both in bench.ps1's summary #4376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4376"
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 IRennie74 on 2026-11-30T19:26:29Z.
What it changes
The complaint was that the game flickers and pauses between frames, while
scripts\bench.ps1measured only frame-time averages and percentiles. A run with a good median and a good p99 can still stop for 300 ms twice a minute (the p99 of 10,000 frames hides 20 of them), and a frame that shows the wrong thing is on time. This adds two measurements and puts both in the bench summary. Nothing changes what is rendered or presented.host/smooth.rs, thesmoothness:line. Every present we issue is stamped, and a line about once a second gives presents, title frames, repeated and generated presents, the median and longest gap, hitches (a gap over 50 ms and over twice the running median of the last 120 gaps), pauses (any gap over 150 ms), frame-to-frame variability (the mean of |gap - previous gap|), and from DXGI'sGetFrameStatisticsthe refreshes on which nothing new was ready, presents replaced before they were shown, and the longest time between two new images on the screen. It is on by default in diagnostics builds (VICTORY_SMOOTHNESS=0turns it off) and only asked for in release builds (VICTORY_SMOOTHNESS=1). With the present handed to another queue or thread (VICTORY_PRESENT_QUEUE=1,VICTORY_PRESENT_ASIDE=1, both already on main) the stamp is the hand-off, and the module docs say so.host/flicker.rs,VICTORY_FLICKER_DETECT=1(diagnostics builds only). Each presented frame is shrunk on the card to 192x108 luminance pixels. This happens after the planes are composed and before our panel, notice, advisor and menu are drawn. The result goes into a ring of six read-backs that are read a few presents later, so nothing waits. Avictory-flickerworker checks 16x9 tiles for A-B-A flicker, black flashes and frozen frames (byte-identical while the title's frame number advanced), then writes aflicker:line a second. The thresholds areVICTORY_FLICKER_{DELTA,REVERT,TILES,BLACK,BLACK_TILES,STILL}. The frames of the first 40 events, then of every 25th, are written as 576x108 PGMs toVICTORY_FLICKER_DIR, else toflickerbesideVICTORY_LOG_FILE. These are the game's pixels, so a folder inside the source tree is refused (the same rule asvictory_core::ensure_outside_repo, whichvictory-gpudoes not depend on: adding it would changeCargo.lockand so every shader cache). Only with the switch does the swap chain ask forDXGI_USAGE_SHADER_INPUT. Without it, the swap chain is made exactly as before.scripts\bench.ps1. There is a new-Flickerswitch.summary.md/summary.jsonnow give pauses, hitches, flicker, black flashes and frozen frames per minute, plus the longest gap, the variability, and the ten worst gaps and events (in seconds into the run, to line up with the log).scripts\bench.ps1readsvictory.logwithFileShare.ReadWrite | Delete. A title that had not exited within 30 s of being stopped still held its log open.ReadLinesthen threw and the run had no summary (2 of 18 walking runs on 2026-11-30). This is the same fix as part of open #3925. It is a commit of its own here, so it can be dropped if #3925 lands first.How it was tested
docs/findings.md, "Pauses while walking", 2026-11-30):sweep()inHost::submitcost 56-67 ms while walking (up to 242 ms). A pause followed within 3 frames after 40-78 % of sweeps: 14-26 of the 63 a minute.smoothness:line was not measured in game. Its doc's estimate of some 5-20 us per present comes from the DXGI queries' documentation, not from a run. The flicker pass's cost (a compute pass of some 20,000 threads) was not measured in game either.host.rs: main'sVICTORY_PRESENT_QUEUE/VICTORY_PRESENT_ASIDEpresent branches, with the stamp taken before them. The resolved code was built withcargo build --locked --profile diag -p victory --features diagnostics.scripts\bench.ps1parses cleanly with PowerShell's parser. A bench run on this exact port was not done.cargo testpassed for the crates it touches: yes for this PR's tests.cargo test -p victory-gpu --lib -- host::smooth host::flickergives 25 passed, including the flicker pass shrinking a picture on WARP. The wholevictory-gpulib run gives 1153 passed and 5 failed, and all 5 failures are in files this PR does not touch:descriptor,host::card_steps,list::thin,pipeline::make,shader_cache.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--features diagnostics: nothing in the files this PR touches. The remaining errors are pre-existing on main in other files:shadow.rsrangedunused,copystat.rsmbunused (diagnostics), andhost.rs:5092is_multiple_ofin a test from an earlier commit.cargo xtask policy --staged: ok.Checked for overlap
smoothness,flicker,hitch,bench.ps1,pacingandstutter. Related:victory.loginbench.ps1. It is kept as a separate commit here so either can go first.host/pacing.rs) reports frame deadlines and DXGIPresentoutcomes. This PR adds gap-based pauses and hitches andGetFrameStatisticsdisplay counts, which that one does not have.VICTORY_FSR_PRESENT_STATS=1. It is narrower and independent.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by M4gnif1cus on 2026-11-30T22:16:06Z.
Hi @IRennie74, this fits well with the second F3 panel in #4541, which shows some of the same things on screen while playing:
Your
smoothness:line measures at the present, which is more precise than the panel's own clock. If both land, the panel could take its hitch and pause figures fromsmooth.rs, so the overlay andbench.ps1agree on one definition. Your thresholds (50 ms and twice the running median; 150 ms for a pause) are close to mine, and I am happy to adopt yours.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by IRennie74 on 2026-11-30T22:20:11Z.
Thanks, that fits well. One definition for the overlay and
bench.ps1sounds right to me.Two thoughts on how to join them:
smooth.rslacks. Today a loading screen or the settling after a load counts as pauses in thesmoothness:line, which inflates a run that crosses a load. If #4541 already knows when it is in a menu, loading or settling,smooth.rscould take that same signal and leave those gaps out, so both count the same frames.smooth::snapshot()(session hitches, pauses, longest gap, the running median and the last N gaps) to this PR, so the panel reads it rather than keeping its own clock. Whichever lands second would then switch to it. Happy to adapt the thresholds too: yours are tuned for what a player sees, mine for what a 60 s bench window can count, and they are close enough to settle on one pair.Let me know which order you would prefer, and I will follow it.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by IRennie74 on 2026-12-01T00:01:41Z.
Pushed one more commit: an A-B-A tile now has to come back pixel by pixel, not only in its mean (
VICTORY_FLICKER_MATCH, 8 levels by default; tiles turned away this way are counted asmoving=on the line).Looking at the 166 A-B-A frames kept from today's walking runs (Series S, DLSS Performance, 15-20 fps), 154 were the camera turning between slow frames, where a tile's mean came back by chance while its pixels did not. With the new rule 12 of the 166 still count, and those are real one-frame events: a dark wedge over the cell window, lights appearing for one frame, a wrong frame of the opening logo. So the earlier "51-84 a minute" walking figure in the description overstates flicker by about an order of magnitude; the pause and hitch counts are unaffected.
@M4gnif1cus, this matters for the shared definition too: anything reading flicker counts from this should take the matched count.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by M4gnif1cus on 2026-12-01T00:02:01Z.
Thanks! I went with the load signal first: #4541 now has
victory_gpu::in_play(), so the two pull requests stay independent and either can land first.Some(true)in play,Some(false)paused, in a menu, on the map, in the settings overlay or before a player exists,Nonewhen the title's flags cannot be read (another build).smooth.rscould leave out the gaps wherein_play() == Some(false), so a pause or a menu does not count as a hitch or a pause in thesmoothness:line. A sharedsmooth::snapshot()for the panel's figures can follow once both are in, and the thresholds are open as I said.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by IRennie74 on 2026-12-01T00:30:57Z.
That works well, thanks. Keeping the two independent is the right call.
Once #4541 is in, I'll make
smooth.rsleave out gaps that begin or end whilein_play() == Some(false), and count them separately on the line (asout of play) so a run still shows how much it spent in menus or paused.Nonewill keep today's behaviour, so other builds are unaffected. The settling after a load I'll leave to the frame-time side too, as you suggest; for the bench it mostly falls in the warm-up window anyway.Then the snapshot can follow as you say.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:42:11Z.
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