Refreshes: a range with no journal writes whose pages are all taken skips the stale-page walk again (lost in v2026.11.30.01's rewrite) #4294
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4294"
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 Lyrnc on 2026-11-30T18:18:28Z.
Problem
Reported on palmlight (RTX 5080, HW RT roaming, 6-minute runs, not measured by us yet): v2026.11.30.01 runs at 18-21 fps against 25-29 on a v2026.11.29.01 build with our changes. Most of the gap is the submitting thread, +7 ms a frame: refreshes +4.1 ms (16.4 against 12.3 ms) at about the same count (6.5k against 6.8k a frame), so about 2.5 us a refresh instead of 1.8; copies in the card's memory +1.8 ms.
What this changes
Shadow::copy_stalewas rewritten for v2026.11.30.01 (lock-free stamps published after the bytes land, the tworangedslots under a sequence lock, the per-range memo). An early exit that palmlight carried on the old code (5c36db66: skip the page walk when the journal has no writes for the range and every page is taken) did not come along. This puts it back on the new code:writtenempty, and either the two slots holding a range that holds this one (ranged_slots != 0) or every page's stamp nonzero, no page can be copied, stamped or counted by the memo, so the walk is left out. The range is noted as of this asking as before (note_ranged, split out of the end ofcopy_stale; it writes the two slots and the memo's slot, as that code did).MEMO_SAVEDcounts, so that diagnostic stays exact.Confirmed / not confirmed
copy_stalewith nothing written, and no before/after has been run yet. Counter numbers (the frame line's "refreshes X in N flushes of M" on v2026.11.30.02 against this) are pending.write_watched_submission_throughputwith clustered changes would show it.VICTORY_CARD_ALL=1gives every copy a card side, so every refresh's bytes also go up (that fits the +1.8 ms for copies in the card's memory). A run withVICTORY_CARD_ALL=0separates the default's share from the code's.Verification
Windows 11, rustc 1.98.1 (the pinned toolchain), RTX 5080 + Ryzen 7 9800X3D, own target directory, on
e03424b3(main84bd61e2+ this commit):cargo check -p victory-gpu --tests --locked -j 4: passes. Its one warning (Shadow::rangednever used) is main's:copy_stalecallsranged_partssince the rewrite.cargo test -p victory-gpu --lib --locked -j 4 -- shadow:: host::refresh_tests: 92 passed, 0 failed, 10 ignored (benchmarks). Among them the randomizedrefreshed_ranges_hold_title_memory(600 rounds of writes, overlapping copies and 1-3 flushes: every refreshed range holds title memory) and the test kept from the original,shadow::empty_journal_refresh_requires_every_page_to_have_a_copy(every stamp pattern of eight pages, with and without a range taken whole, with and without a write).cargo clippy -p victory-gpu --lib --tests --locked -j 4: two warnings, neither on a line this adds (main'sShadow::ranged;seed % 3in a test inhost.rs).NOT tested
84bd61e2) is queued; its numbers will be added here.copy_staleon the new code.Overlap
copy_stalewalk forranged > 0(only the written pages are visited). Same function, other case; this one is the empty-journal case. They compose; a rebase of either touches the same lines.Shadow::ranged, the warning above; no shared lines.AI use
Claude Code (Claude Opus 5.5) ported the earlier commit onto the rewritten code, compared the refresh path of v2026.11.29.01 and v2026.11.30.01, ran the checks above and wrote this text.
🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nicolasabosch on 2026-11-30T21:25:31Z.
Tested: no measurable fps difference here (2 runs).
Tested on main
e1251c31with this PR (e03424b3) merged on top and nothing else changed. Release build, same profile as main.Setup
victory play --series-s --dlss performance --framegen 2, with no fps cap and the window minimized.host:reports, about 200 s. These are real frames, not generated ones.Both runs are inside main's own spread. On this laptop, identical main runs differ by up to about 2.5 fps, so only an effect of roughly 2–3 fps or more would be visible in this scene. The walk this PR shortens may well be faster. It just doesn't move the frame here.
Not tested: driving, camera turns, interiors, an image comparison, other GPUs.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-12-01T01:41:57Z.
Bench result: the camera-spin A/B from "NOT tested", run overnight. RTX 5080 16 GB, Ryzen 7 9800X3D, 32 GB RAM, Windows 11. Release builds, one shared shader cache (warmed first): main =
84bd61e2, R = this PR ate03424b3. Series X, 1440p, DLSS Quality, frame generation off, ray tracing off, same save. Standing from world+30 to 150 s, right stick held from 150 to 270 s, 360 s runs, two runs each, alternating with other arms in between. Ranges are the two runs.No device removed, DRED or "did not close" line in any run. The "texture picked by index changed after its upload with nothing to tell of it" warning came 5-7 times per R run and 4-34 per main run.
What this shows
copy_stalewith nothing written, so the early exit itself is not visible here.What it does not show
84bd61e2, so it says nothing about how much of that +4.1 ms the early exit wins back.VICTORY_CARD_ALL=0arm (the description's second suspect).AI use: Claude Code (Claude Opus 5.5) ran these on our bench queue, parsed the run logs with its own scripts, and wrote this comment.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-12-01T01:49:39Z.
I checked the early return against the walk it skips, on
e03424b. It is exactly equivalent:writtenempty, every page'swriteis 0, so the walk copies a page only whentaken = max(cur, ranged) == 0.ranged_slots != 0(soranged != 0) or everycur != 0. Either waytaken != 0for every page: the walk would copy nothing, stamp nothing, and still end innote_ranged, which the early path also calls.MEMO_SAVED: the walk counts a page only whenwithout = max(cur, ranged_slots) == 0, which can't happen under either condition. The count stays exact, as the description says.written, even one outside the range. That is conservative.page - baseoverfrom/PAGE..=last), so it adds no new panic.On the failed
check: its Clippy warnings are the twomainalready has (Shadow::rangednever used,seed % 3in host.rs). I see the same pair on7d93ee07without this change, so it isn't this PR. #3530 fixes them.Code read only, no game run. The A/Bs above already cover that.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KruIN689 on 2026-12-01T02:56:53Z.
The HW RT roaming case from "not tested", on the PC that first reported the gap. RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X3D, 47 GB, Windows 11. Series X, native 1440p, DLSS and FG off,
VICTORY_HW_RT=1.Method:
e03424b3alone cherry-picked onto our fork's main (upstream84bd61e2+ the spread sweep, #3272, #3063/#3067, #4233). Release builds, auto-driven roaming (walk and drive), 2+2 alternating runs of 6 min in one session, stats over the last 4 min:So: neutral to slightly positive with HW RT while moving, and no harm. Since it restores exactness-preserving behaviour (davemathews12's check above), I see no reason against it.
(Measured and written with Claude Code, for KruIN689.)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-12-01T04:11:48Z.
Thanks @nicolasabosch and @davemathews12, and @KruIN689 for the HW RT case.
MEMO_SAVEDstays exact, and the slice adds no new panic. So it restores what the rewrite lost, at no cost, without promising speed.72b3a244) notes its coverage record only where a page is taken again, so this PR's early return no longer needs to touch it. My earlier overlap note there no longer applies. Only the textual conflict nearlet lastremains, for whichever lands second.AI use: Claude Code (Claude Opus 5.5) read the reports and wrote this.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by albertik322-sudo on 2026-12-01T17:00:22Z.
Positive on a laptop, in the batch with #4340, #4493, #4876, #4206. PC: RTX 3070 Laptop 8 GB, i7-11800H, 32 GB RAM, Windows 11. Series S, 1080p output, DLSS Performance, FG x4.
Can't isolate cleanly, but the batch's fixed-cost drop (47 to 25.5 ms a frame) is consistent with the empty-journal skip doing real work: before the batch, refresh checks dominated the frame; after it, the per-frame copy refresh count is ~18,500 but the empty ones cost much less. No correctness issues observed — no stale geometry, no missing updates in hours of play.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:44:33Z.
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