PR #2607 (RemapQueue::record burst compaction) causes 15–25× regression in opening or noting guards and severe frame-time stutters #3666
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 foxhelperfriend on 2026-11-30T03:25:48Z.
Summary
Commit
2fe2d4cc(merged as PR #2607 /d052b34d, shipped inv2026.11.29.05/main) introduces an O(N² log N) contention pathology under the globalREMAPPEDmutex onceRemapQueuereachesREMAP_LIMIT(32,768).Because
land::Notes::flush()→watch::landed_beside()→descriptor::host::remapped_ranges()acquiresREMAPPED.lock()and callsRemapQueue::record(), all landing threads pile up behind that mutex. On an RTX 4080 SUPER + Ryzen 7 7800X3D (Series S), this regressesopening or noting guardsby 15–25× (0.7–1.2 ms→13.8–22.6 ms), slowsmerging what was fetchedby 3–4.5×, and causes a 3–4× spike in>100 msframe hitches.Root Cause
In
crates/victory-gpu/src/descriptor/host.rs,RemapQueue::record():716a0c99), whenself.ranges.len() == REMAP_LIMIT(32,768),record()did an O(1)pop_front()+push_back().self.ranges.len() == limitandunpub_len > 0,record()allocates a newVec, drains the entire unpublished suffix (up to32,768entries), runsjoin(&mut unpub)(sort_unstable+dedup_by), and pushes the ranges back.needed > limit, it only dropsdrop_n = needed - limitentries — leavingself.ranges.len()still equal tolimitwith zero headroom/hysteresis.record()call re-allocates, drains, sorts, and re-pushes up to32,768entries while holding the globalREMAPPEDmutex, andunpub_lengrows toward32,768on every call.A/B/A Benchmarks
Tested on
716a0c99vs.716a0c99+ cherry-picked2fe2d4cc(andv2026.11.29.05) vs. reverting2fe2d4ccback to716a0c99:opening or noting guardsmerging what was fetchedcopying backp95frame time>100 msresets/min716a0c99(10 runs, 3,100+ s)0.6 – 1.2 ms2.0 – 2.9 ms~11 – 13 ms55 – 68 ms3 – 14 / minv2026.11.29.05(includes PR #2607, 5 runs)10.3 – 19.8 ms6.0 – 8.0 ms~18 – 22 ms60 – 72 ms22 – 44 / min716a0c99+ cherry-pick PR #2607 (6 runs)8.8 – 22.6 ms5.9 – 11.0 ms19.7 – 20.0 ms72 – 97 ms20 – 65 / min716a0c99(verified 10 min in)0.9 ms(0.4–2.4 ms)2.4 ms10.7 ms73.4 ms(7kdraws)System: RTX 4080 SUPER | Ryzen 7 7800X3D | Windows 11 (Build 26200) | Series S
(No crash occurred, so no crash log applies.)
--- 1. Pure
716a0c99(BEFORE PR #2607) ---INFO victory_gpu::frame_times: frame times: 22 frames, median 46.0 ms, p95 56.4, p99 61.1, longest 61.1; 4 over 50 ms, 0 over 100 ms
INFO victory_gpu::land: landing per frame (VICTORY_LAND=1, 3 threads): which pieces to fetch 0.17 ms, then the fetches (the relay's line); looking through copies in the PC's memory 0.00 ms beside them and 0.00 ms more; merging what was fetched 2.47 ms (5.79 ms on all threads, 50 jobs), merging the others 0.00 ms (0.00 on all threads); of the threads' time 1.52 ms waiting for the title's bytes going in, 1.45 ms opening or noting guards; then ranges done with 0.15 ms, read-backs and lists 3.30, the title told 0.02, the rest 4.17
--- 2.
716a0c99+ PR #2607 (2fe2d4cc, identical switches) ---INFO victory_gpu::frame_times: frame times: 16 frames, median 58.2 ms, p95 104.1, p99 108.2, longest 108.2; 10 over 50 ms, 3 over 100 ms
INFO victory_gpu::host: the relay per frame (VICTORY_RELAY=1): 21.1 flights landed in 11.2 landings by the thread that copies back, beside the submitting thread; that thread waited 12.3 ms for the card with nothing to land and 2.4 ms for fetches of card copies' pieces, and was 25.1 ms landing in all
INFO victory_gpu::land: landing per frame (VICTORY_LAND=1, 3 threads): which pieces to fetch 0.18 ms, then the fetches (the relay's line); looking through copies in the PC's memory 0.00 ms beside them and 0.00 ms more; merging what was fetched 10.60 ms (24.97 ms on all threads, 56 jobs), merging the others 0.00 ms (0.00 on all threads); of the threads' time 0.41 ms waiting for the title's bytes going in, 21.70 ms opening or noting guards; then ranges done with 0.13 ms, read-backs and lists 3.82, the title told 0.03, the rest 3.99
--- 3. Reverted PR #2607 back to pure
716a0c99(even after 10M+ queue evictions) ---INFO victory_gpu::land: landing per frame (VICTORY_LAND=1, 3 threads): which pieces to fetch 0.19 ms, then the fetches (the relay's line); looking through copies in the PC's memory 0.00 ms beside them and 0.00 ms more; merging what was fetched 2.77 ms (6.86 ms on all threads, 65 jobs), merging the others 0.00 ms (0.00 on all threads); of the threads' time 1.59 ms waiting for the title's bytes going in, 1.26 ms opening or noting guards; then ranges done with 0.13 ms, read-backs and lists 3.14, the title told 0.03, the rest 4.85
INFO victory_gpu::host: textures picked by index, the queue: ... 12497471 ranges of memory mapped, unmapped or written under texture views (10131754 evicted from history), 430683 slots made due by them
Suggested Fix
*cursor = latest;fix inHostHeap::refresh_remapped()(that part is cheap).RemapQueue::record(), avoid running O(N log N) compaction on every call atlen == limit:limit / 8orlimit / 4new unpublished records since the last compaction attempt), and/orneeded > limit), fall back to O(1)pop_front()until the next publish/threshold rather than leavinglen == limitand re-sorting the whole unpublished tail on the very next call.GPU: RTX 4080 SUPER | CPU: Ryzen 7 7800X3D | OS: Windows 11 (Build 26200)
GPU ver: 610.88
.logs
1-pure-716a0c99-before-pr2607.log
2-with-pr2607-regression.log
3-reverted-to-716a0c99-fixed.log
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-30T03:25:56Z.
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by foxhelperfriend on 2026-11-30T03:34:26Z.
Play log excerpt can be found in original post, as well as system info.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by foxhelperfriend on 2026-11-30T04:26:37Z.
System info can be seen in original post (GPU: RTX 4080 SUPER - Ver 610.88 | CPU: Ryzen 7 7800X3D | OS: Windows 11 (Build 26200)
1-pure-716a0c99-before-pr2607.log
2-with-pr2607-regression.log
3-reverted-to-716a0c99-fixed.log
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by HQasper on 2026-11-30T14:30:42Z.
The same regression, measured on an RTX 5090 + Ryzen 9 9950X3D (driver 621.24, Windows 11 26300), on
41adb551plus local commits. The scene is the opening from one save: Series X profile, 1440p, DLSS Quality, ray tracing off. The figure is frames over 50 ms in the first 60 s after the world appears. Runs are 170 s, interleaved, one number per run.Bisection (builds reverting groups of the commits between
f72cec77and41adb551):2fe2d4ccreverted2fe2d4ccand5c604fecrevertedThe steady frame rate after the way in did not change within the spread. #2607 still does what it set out to do: the "evicted from history" count was 1.56 M with it against 2.65-2.69 M without.
A fix along the lines of #3877. Once a compaction of the full queue frees less than an eighth of it, it is not retried until the next snapshot moves the published mark; records evict in O(1) meanwhile. Four runs each, interleaved:
Patch: HQasper/VIctory-NVIDIA#9 (fork draft, one commit on
41adb551). It overlaps #3877, #3733 and #3730, so I am not opening another PR; these numbers are in support of fixing it.🤖 Generated with Claude Code