um: stop the page ping-pong and split the kick (VICTORY_RESIDENCY_STICKY, VICTORY_KICK_SPLIT; both off by default) #596
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!596
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-596"
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?
@t-jonesy on GitHub · 2026-12-05 14:19 UTC · original
t-jonesy:up/residency-sticky→main· +405 −34 · 2 files · 1 commits · openProblem
On the
downtownroute of #554, the slow frames are CPU-late, not GPU-bound. In the slow frames the gfx ring sits idle for about half the frame, waiting for submissions. The largest single cause we found is page residency:0 down for room.drm_exec_lock_obj). This class covers 25% of the time lost to frames over 50 ms;amdgpu_gem_fault→ttm_bo_vm_reserve). That is 66-76 s of thread time per 275 s window, and 1.4-1.6k faults per run each block for 16-64 ms.How we got these numbers:
Change
Two opt-in switches in
um/residency.rs. With both unset, a pass is prepared, placed and kicked exactly as on main (one chunk, one kick).VICTORY_RESIDENCY_STICKY=1(gate):VICTORY_KICK_SPLIT=<pages>: a pass's moves are prepared, placed underlazy::movingand kicked in chunks of at most so many pages. So no single kick validates more than that while it holds the root reservation (we measured 57-145 µs per page). The thread yields between kicks.page residency:line ends with; sticky …; kick split …:touched/read_through. This matches the always-on counters in #552.Relation to #552
#552 (
VICTORY_RESIDENCY_HYSTERESIS,VICTORY_RESIDENCY_BUDGET_MS) targets the same churn. We ported its residency half and ran it on the same bench, interleaved with controls, 2 runs per arm:RESIDENCY_HYSTERESIS=1HYSTERESIS=1+RESIDENCY_BUDGET_MS=2Both are neutral within the bench's spread. Our reading of why, from the trace and from Kal0s's review on #552:
RESIDENCY_BUDGET_MScaps the prepare+place loop by time, but everything placed still goes to the card in one kick at the end of the pass. The kick's root-reservation hold, which is what the title's submissions and faults wait for, is not bounded.KICK_SPLITbounds it.The two can coexist; they touch neighbouring lines of
tick(), so whichever merges second needs a small rebase. If #552 lands first,STICKYcould become a stronger mode of its hysteresis rather than a separate switch. Maintainers' preference welcome.Evidence
Setup:
VICTORY_FSR_4K=performance, ray tracing on,VICTORY_FRAME_INTERVAL_MS=33.333.Build. A fork tree that carries this change. The tree is based on an older main, with many other changes. One of them is #392's per-pool locks (
VICTORY_UM_POOL_LOCKS=1), which were on in both test arms but not in the control.Route.
VICTORY_BENCH_ROUTE=downtown(#554, with the fixes in our comment there):Frame times. Frame intervals come from our tracer. The 1% low is the fps of the mean of the worst 1% of intervals.
Run order. Arms were interleaved with 5 control runs. Δ is the run minus the mean of the control runs right before and after it.
Noise. The control's run-to-run spread on the frame 1% low is ±0.2-0.6 fps (5-6 runs, two nights).
KICK_SPLIT=64(3)RESIDENCY_STICKY=1+KICK_SPLIT=64(3)Paired Δ for STICKY + SPLIT against the bracketing controls:
Hands-on. On the same fork build with
STICKY=1+KICK_SPLIT=64, a 15-minute hand-played session (flying low and fast over downtown, 30 fps cap) traced at avg 28.5 fps, frame 1% low 10.0, p99 78 ms, 4.75% of frames over 50 ms; an earlier hand-driven session without these switches had 10.5% over 50 ms (different activity, so not a paired comparison). Subjectively it was by far the smoothest session we have had.Per run, frame 1% low:
The title's present wait for our submission lane fell 9.0 → 6.3 ms per frame. GPU busy per median frame is unchanged, so gating the promotions did not move work onto the GPU's PCIe reads on this card.
What the rows say:
STICKY+SPLITon top of a fork-only pacing combo (pass every 200 ms, at most 48 pages a pass, a bind prefault). That was worse thanSTICKY+SPLITalone (1% low 8.23 against 8.95), though still better than control.Risks
Switches
VICTORY_RESIDENCY_STICKYVICTORY_KICK_SPLITBoth are documented in
docs/SETTINGS.md(paging rows, marked paging-only).Testing
./build.sh check(victory, Windows target) andcargo check --tests -p victory-gpuare clean, apart from main's existingroom_latelywarning.um::residency::tests::kick_split_chunks_runs_up_to_its_pagesandthe_sticky_gate_closes_at_half_and_opens_under_a_quarter. Both pass under Wine (pure tests);um::residency6 passed.STICKY=2in the fork, untested) is dropped.pass_ms→ place all under onelazy::moving→ one kick, as main. Themovedcount in the debug pass line is the same as main's (touch-down extras are not counted there).Open questions
lazy::movingguard on its own (shorter holds than main's one guard per pass, but more of them). We expect the gate's gain to hold without #392, because the gate cuts the moves by 85%, but we have not run it.STICKYbe folded into #552's hysteresis (same counters, faster decay, gate warm promotions), or stay separate?🤖 Generated with Claude Code
https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya
@datWeazel on GitHub · 2026-12-05 16:44 UTC · original
A/B on RX 6950 XT (RDNA 2) + Ryzen 7 5800X3D,
main@8bf4878+ #554 + this PRSetup: Arch, kernel 7.3.5, GE-Proton10-29, RADV from
setup.sh, 32 GB.VICTORY_BENCH=nort VICTORY_BENCH_ROUTE=downtown VICTORY_FRAME_INTERVAL_MS=0(3840x2160, FSR Quality), presethigh(which setsVICTORY_PAGES_SEEN=1). Release build. 300 s per run, interleaved A B A B. B =VICTORY_RESIDENCY_STICKY=1 VICTORY_KICK_SPLIT=64. Counters taken over the route window only.long frame> 200 mss movingKICK_SPLIT=64the longest kick was still 84–86 ms (about 1,260 kicks of 41–43 pages on average). The split bounds the page count, but not the kick's duration here.@ratatrampa007 on GitHub · 2026-12-05 18:08 UTC · original
Real-world 8 GiB VRAM RDNA 2 test data (re: Open Questions #3 and #4 on 8 GiB cards):
Setup:
7.3.6-arch1-1), RADV26.3.1+vkd3d-protonfromsetup.sh, Wine Staging11.23(ntsync), release build based onmain @ b581f7e+#563+VICTORY_PAGE_RESERVE_MB=512(identical in both runs;VICTORY_PAGES_SEENunset).1280x720native (VICTORY_UPSCALER=6,VICTORY_UI_PLANE_720=1),VICTORY_BVH_BUILDER=0,VICTORY_FRAME_INTERVAL_MS=22.222(45 fps cap),VICTORY_PAGE_ADAPTIVE=1,VICTORY_POOL_MOVE=1.long framecounts).8,378busy ticks,n=330gameplay frame-stat samples)VICTORY_RESIDENCY_STICKY=1+VICTORY_KICK_SPLIT=64, 44.4 min (11,641busy ticks,n=483gameplay frame-stat samples, 69% dense exteriors)STICKY=1+KICK_SPLIT=64(B, 44.4 min)long frame>50 ms / minlong frame>100 ms / minlong frame>200 ms / minlong frame(max)long framep95p05/p10fps (>=1000 draws)>=4500 draws) med / p90 fpspreparing_ms/copy_mson_cardmed (end) /freemedmed/max)Residency & sticky telemetry (B, end of 44.4 min run):
2.67 -> 2.14 / tick) and CPU touch-demotions fell -22% (1.95 -> 1.52 / tick).pool 16(general heap,3,977 MiB) stayed gated for587 sat session end:13,348page-passes gated,14,405probes,4,402page-passes cooling,18left on card by the 64/pass cap, and0re-promotions within 2 s (out of4,274re-promotions).kick split 64 pages:4,805kicks averaging8.9pages/kick (max64, longest kick57.8 ms,p90pass time38.9 -> 37.0 ms).0room evictions and744 MiBon-card at minute 44 (756 MiBfree), 16 probes/pass did not starve GPU residency at all — exteriors actually gained+0.50median /+1.62p90 fps while cutting severe >100 ms / >200 ms hitches by 48–80%.Caveats: Hand-played free-roam sessions rather than a deterministic
VICTORY_BENCH_ROUTE=downtownreplay, andVICTORY_PAGES_SEENwas off (warm/watch promotions only), which likely explains why total move volume fell ~20% rather than ~85% while still halving severe hitches. Zero crashes or kernel errors across 44+ min. Definitely a clear smoothness win on 8 GiB RDNA 2!@fsrajner on GitHub · 2026-12-05 19:17 UTC · original
A/B data point on RDNA 4, tested together with #611 in one build (both opt-in, so the arms differ only by env).
Setup: RX 9070 XT 16 GB, Ryzen 7 7800X3D, CachyOS, repo-patched Mesa 26.3.1 RADV + vkd3d-proton, proton-cachyos-slr. Series X profile, 4K output with FSR 4.1.2 Quality, hardware RT, frame generation off, headless gamescope. Base:
main@8bf4878+rt-7-reuse+ #542, then #611 and this PR (e2dc089) merged in. One conflict, in thepage residencyformat string (let mut linekept).Method: the same intro snapshot every run (standing, light streaming), 120 s after the first A press. One warm-up run, then two rounds of base / #611 /
RESIDENCY_STICKY=1 KICK_SPLIT=64/ both, interleaved. "Long frames" are thelong framelog lines (≥ 50 ms).GEOMETRY_ON_CARD=1RESIDENCY_STICKY=1+KICK_SPLIT=64@DrArroway on GitHub · 2026-12-05 21:44 UTC · original
54-minute real-play soak on RDNA 2 (
main+#611+#596, clean voluntary exit,0errors), compared informally against our 37-minute#611-only soak right before it on the same machine (different story segments — picking up Lucia + bar mission + driving — so not a controlled route A/B, just a long-soak data point on RDNA 2).Setup & build
AMD Radeon RX 6900 XT (1002:73bf)(RDNA 2, 16 GB VRAM, PCIe 4.0), Ryzen 9 7900X (12C/24T), 64 GB DDR5-6000 EXPO, CachyOS kernel7.3.7-1-cachyos,GE-Proton11-15-x86_64, repo-patched Mesa (deps/mesa-inst) + vkd3d-proton.main(a5c6484) +#611+#596merged cleanly with 0 conflicts (48.1 sincremental release build; no shader changes).VICTORY_OUTPUT=2560x1440,VICTORY_FSR_4K=quality,VICTORY_FIDELITYFX_FRAMEGEN=1,VICTORY_FIDELITYFX_FRAMEGEN_DIRECT=1,VICTORY_UI_PLANE=3840x2160,VICTORY_GEOMETRY_ON_CARD=1,VICTORY_RESIDENCY_STICKY=1,VICTORY_KICK_SPLIT=64,VICTORY_PLACED_COPIED=1,VICTORY_PARTS_ONE_CALL=1,VICTORY_KEEP_HOST_BUFFERS=1,VICTORY_SKIP_INTRO=1, software RT.Soak results (
53m 53s,0errors /0crashes)#611alone (37m 08s, pre-Lucia)#611+#596(53m 53s, Lucia + bar + driving)156,859(4,224/min)68,274(1,267/min, −70%)152,328(4,102/min)64,853(1,204/min, −71%)44,51614,698(0re-promoted within 2 s after touch-down)178.0 s(4.8 s/min)250.8 s(4.65 s/min)#611regions allocated /refused_room896 MB/56,874(2,026 MB)1,024 MB/928(232 MB, −98%)13.0 / 13.2 GB·11.8 / 13.2 GB14.0 / 14.0 GB·11.5 / 13.5 GBtools/session-fps.sh23.9med /24.5avg (prep 4.5 ms,copy 1.2 ms)23.7med /23.9avg (prep 6.3 ms,copy 2.7 ms,min 11.4)Key observations on RDNA 2
2,715,572page-passes gated (pool 15 gated for487 s),98,520cooling,53,736probes, and0re-promotions within 2 s of a touch-down.#611: because pool 15 stayed gated instead of fillingcard_mb_for_titleearly,#611got its full1,024 MB(8 × 128 MB) andrefused_roomdropped from56,874to928(locked=0,made_again=0,2,224,049copies /53.9 GB).#392):6,709split kicks averaged20.7pages/kick (max64), thoughlongest kickstill hit81.1 msand total moving time/min stayed near4.65 s/min.51,482page-passes were left on the card by the 64/pass touch-demotion cap, andavg_copy_mswas higher in this session (2.7 msvs1.2 ms— likely partly heavier story/bar activity, and possibly partly deferred touch-demotions reading over BAR as noted under "Risks").Verbatim final
page residencyandgeometry on cardlines (at53m 53s)@Milkhaus-tech on GitHub · 2026-12-06 03:53 UTC · original
RDNA 4 A/B for
VICTORY_RESIDENCY_STICKY=1andVICTORY_KICK_SPLIT=64, each tested on its own.Setup: RX 9060 XT 16 GB (RDNA 4, Navi 44), Ryzen 7 5800X, 32 GB RAM, Ubuntu 26.04 (kernel 7.0.0-44), repo Mesa 26.3.1 RADV, GE-Proton11-11, resizable BAR on. Series X profile, potato preset, 1920x1080 output,
VICTORY_FSR_4K=balanced, ML frame generation, ray tracing off.Method:
VICTORY_BENCH_ROUTE=downtown, with the same save restored before each run. I measured route start +30 s to +330 s from thestats: frame5 s windows (about 59 per run). Rendered fps is shown; generated frames are not counted. "p10" is the 10th-percentile 5 s window. One arm per run; the arms were interleaved, not all A then all B. The default arm varied from 31.6 to 33.4 fps over 8 runs, so differences under about 2 fps are noise.Build:
main@8c4e663+ #596 + #637 + #639, other switches off. Default arm on the same build: 31.6, 32.0, 33.4 fps (frames >100 ms/min: 5.1, 3.5, 2.4).Neither switch changed anything we could measure on this card at these settings; both results sit inside the default spread. STICKY's worst 5 s windows were slightly better (17.5 and 18.8 against 14.3 to 17.9), but with 2 runs I wouldn't read anything into it. No visual differences, errors or crashes. Our run has ray tracing off and paging at the defaults (16 GB card, title room about 4 GB), so the ping-pong this PR targets may simply not happen here.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.