um: stop the page ping-pong and split the kick (VICTORY_RESIDENCY_STICKY, VICTORY_KICK_SPLIT; both off by default) #596

Open
github-bot wants to merge 1 commit from github-bot/gh-596 into main AGit
Owner

@⁠t-jonesy on GitHub · 2026-12-05 14:19 UTC · original
t-jonesy:up/residency-sticky → main · +405 −34 · 2 files · 1 commits · open

Problem

On the downtown route 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:

  • Ping-pong, not room. About 121k pages go up to the card per run, and about 100k of them (82%) come back down because the processor touched them. 27% of those come back within 2 s. None go down for room: VRAM is full, but the kernel evicts nothing, and the page residency line shows 0 down for room.
  • Strikes don't catch it. Nearly all promotions are pages that "went up never touched by the processor", in the general heap pool. The per-page strikes and probation only begin after a first bounce, so they never stop the first round trip.
  • The kick holds a lock the title needs. Each pass's moves reach the card in one kick. That kick holds the VM's root reservation for 24 ms on average and up to 76 ms (≥1 ms instances: about 400 per run). Two things wait behind it:
    • the title's gfx submission (drm_exec_lock_obj). This class covers 25% of the time lost to frames over 50 ms;
    • every CPU fault on a mapping of the card's (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:

  • frame classification from a trace of 14,177 frames, two control runs;
  • per-thread off-CPU and fault stacks from a BPF tracer;
  • the page residency line's own counters.

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):
    • Counting. Per pool, recent promotions and touch-backs are counted. A touch-back is the first touch of a promoted page on the card, by the title or by our own reads. Both counts are halved every 2 s.
    • The gate. A pool that is not write-combined, with ≥64 recent promotions of which half or more came back, is gated. Only its 16 hottest candidates go up a pass, as probes, so its share stays known. The gate opens again when the share falls under a quarter. Warm promotions are gated as well as seen ones.
    • Cool-down. A page that a touch brought down waits 10 s of wall time before it can go up again.
    • Touch-demotion cap. At most 64 pages go down for a touch per pass (512 on main). The rest stay marked, and on the card, for the next pass.
  • VICTORY_KICK_SPLIT=<pages>: a pass's moves are prepared, placed under lazy::moving and 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.
  • Counters. While either switch is on, the 5 s page residency: line ends with ; sticky …; kick split …:
    • touch-backs, re-promotions after a touch-down (and those within 2 s);
    • pages left on the card by the cap, cooling, gated, probes;
    • the gated pools with their recent counts;
    • kicks, average and most pages per kick, longest kick.
  • Always on. The touch-back and recent-promotion counters, and the per-page "brought down at" time, are kept whatever the switches. They are relaxed atomics on the residency thread and in 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:

arm frame 1% low Δ 0.1% low Δ >50 ms frames Δ page moves per frame
RESIDENCY_HYSTERESIS=1 +0.21 ± 0.20 fps +0.08 −1.3 pts 34.4 (control 34.8)
HYSTERESIS=1 + RESIDENCY_BUDGET_MS=2 +0.16 ± 0.52 −0.10 −1.2 pts 30.1

Both are neutral within the bench's spread. Our reading of why, from the trace and from Kal0s's review on #552:

  • Throttling is too slow. Hysteresis throttles a pool only once it has ≥64 samples, and decays at most every 128 busy ticks (≥25.6 s). In our runs pools 7 and 15 were throttled for 100% of the window. But the throttle stops only speculative (seen) promotions and watch-retires; warm promotions of untouched pages still go up and bounce. This change gates those too, decays every 2 s, and adds the cool-down.
  • The budget doesn't shorten the kick. RESIDENCY_BUDGET_MS caps 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_SPLIT bounds it.

The two can coexist; they touch neighbouring lines of tick(), so whichever merges second needs a small rebase. If #552 lands first, STICKY could become a stronger mode of its hysteresis rather than a separate switch. Maintainers' preference welcome.

Evidence

Setup:

  • Hardware: RX 9070 XT 16 GB, Ryzen 9 7950X3D, game 1.0.2.1.
  • Picture: Series X profile, 3840x2160 output with VICTORY_FSR_4K=performance, ray tracing on, VICTORY_FRAME_INTERVAL_MS=33.333.
  • Software: RADV with this repo's patch plus our own Mesa/kernel changes. The kernel is 7.4-rc5 with experimental VA-update patches, so absolute numbers are not main's.

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):

  • noon, clock paused, sunny;
  • 320 s laps;
  • window from route start + 60 s to + 270 s.

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).

arm (n) avg fps frame 1% low 0.1% low frames >50 ms p99 max longest CS ioctl in a frame, p99 page moves/frame gfx busy, median frame
control (5) 25.63 6.77 ± 0.21 4.70 17.0% 119.6 ms 244 ms 42.0 ms 34.3 28.5 ms
KICK_SPLIT=64 (3) 25.72 6.97 ± 0.36 4.87 17.2% 116.0 ms 251 ms 21.2 ms 34.4 28.3 ms
RESIDENCY_STICKY=1 + KICK_SPLIT=64 (3) 27.04 8.95 ± 0.39 6.84 11.6% 95.1 ms 162 ms 16.3 ms 5.1 28.7 ms

Paired Δ for STICKY + SPLIT against the bracketing controls:

  • frame 1% low +2.20 ± 0.43 fps (+32%);
  • 0.1% low +2.11 ± 0.37 (+46%);
  • time spent in frames over 50 ms −11.1 points (32% → 21%);
  • p99 −25 ms;
  • avg +1.44 fps.

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:

  • control: 6.80, 6.65, 7.09, 6.52, 6.80;
  • STICKY + SPLIT: 8.54, 9.00, 9.32.

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:

  • The split alone does nothing for the lows. It halves the longest CS ioctl per frame (p99, 42 → 21 ms) but leaves the frame 1% low and >50 ms frames where they were. The gate does the work.
  • The per-pool locks are not the cause. They were on in both test arms, and the split arm is neutral. A sticky-only run without #392 was not made.
  • Combining with our other pacing hurts. We tried STICKY + SPLIT on top of a fork-only pacing combo (pass every 200 ms, at most 48 pages a pass, a bind prefault). That was worse than STICKY + SPLIT alone (1% low 8.23 against 8.95), though still better than control.

Risks

  • Pages the GPU wants may stay in system memory. A gated pool keeps pages the GPU reads in GTT, up to the probes. On this card and route the GPU busy time did not move. On a card with less PCIe headroom, or a scene where those pages are GPU-hot, it could cost GPU time. The gate opens when the share falls under a quarter, and the 2 s decay lets it reopen in seconds, not minutes.
  • The constants are untuned. 64 floor, half/quarter, 16 probes, 10 s cool-down, 64 touch-demotions, 2 s decay: set once from the trace, not swept. They are constants, not switches, for now.
  • Touch-demotions are deferred. A touched page on the card waits up to a few passes to go down. Meanwhile the CPU's accesses to it go over the BAR. In our runs that did not show (longest CS ioctl per frame, p99, 42 → 16 ms), but the processor reads card memory slowly.
  • The split adds kicks per pass. Each kick is an ioctl that waits for its moves. With 64-page chunks we saw no cost in the passes' total time; smaller chunks were not tried here.
  • Measured on one setup only. One card (16 GB, RDNA 4), one route, a patched kernel. Not measured: 8 GiB cards (where #552 was measured), other generations, Windows (residency does not run there).

Switches

Setting Default Values Effect
VICTORY_RESIDENCY_STICKY unset 0, 1 Gate pools whose promoted pages the CPU touches back; 10 s cool-down after a touch-down; at most 64 touch-demotions a pass
VICTORY_KICK_SPLIT unset pages (e.g. 64) A pass's moves go to the driver in kicks of at most so many 64 KiB pages

Both are documented in docs/SETTINGS.md (paging rows, marked paging-only).

Testing

  • Build checks: ./build.sh check (victory, Windows target) and cargo check --tests -p victory-gpu are clean, apart from main's existing room_lately warning.
  • New unit tests: um::residency::tests::kick_split_chunks_runs_up_to_its_pages and the_sticky_gate_closes_at_half_and_opens_under_a_quarter. Both pass under Wine (pure tests); um::residency 6 passed.
  • Not run in game on this branch. The numbers above are from the fork build that carries the same logic. The port differs from that build only in its surroundings:
    • main has no #552 or #392;
    • the place loop is reshaped into a per-chunk prepare/place/kick;
    • the fork's sub-switches for the constants and its live toggles are dropped;
    • "keep" mode (STICKY=2 in the fork, untested) is dropped.
  • Parity with both switches off: one chunk, so prepare all → pass_ms → place all under one lazy::moving → one kick, as main. The moved count in the debug pass line is the same as main's (touch-down extras are not counted there).

Open questions

  1. Does it need #392? In our tree the per-pool locks were on in both measured arms. Without them, every chunk of a split pass takes the global lazy::moving guard 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.
  2. Fold into #552? Should STICKY be folded into #552's hysteresis (same counters, faster decay, gate warm promotions), or stay separate?
  3. Probes: are 16 probes per pass per gated pool enough on 8 GiB cards, where room demotions also compete?
  4. More data wanted. A run of this on an 8 GiB RDNA 3 (the #552 setup) on the same route would tell whether the gate helps where VRAM really is short.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya

**@⁠t-jonesy** on GitHub · 2026-12-05 14:19 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596) `t-jonesy:up/residency-sticky` → `main` · +405 −34 · 2 files · 1 commits · open ## Problem On the `downtown` route 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: - **Ping-pong, not room.** About 121k pages go up to the card per run, and about 100k of them (82%) come back down because the processor touched them. 27% of those come back within 2 s. None go down for room: VRAM is full, but the kernel evicts nothing, and the page residency line shows `0 down for room`. - **Strikes don't catch it.** Nearly all promotions are pages that "went up never touched by the processor", in the general heap pool. The per-page strikes and probation only begin after a first bounce, so they never stop the first round trip. - **The kick holds a lock the title needs.** Each pass's moves reach the card in one kick. That kick holds the VM's root reservation for 24 ms on average and up to 76 ms (≥1 ms instances: about 400 per run). Two things wait behind it: - the title's gfx submission (`drm_exec_lock_obj`). This class covers 25% of the time lost to frames over 50 ms; - every CPU fault on a mapping of the card's (`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: - frame classification from a trace of 14,177 frames, two control runs; - per-thread off-CPU and fault stacks from a BPF tracer; - the page residency line's own counters. ## 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): - **Counting.** Per pool, recent promotions and touch-backs are counted. A touch-back is the first touch of a promoted page on the card, by the title or by our own reads. Both counts are halved every 2 s. - **The gate.** A pool that is not write-combined, with ≥64 recent promotions of which half or more came back, is gated. Only its 16 hottest candidates go up a pass, as probes, so its share stays known. The gate opens again when the share falls under a quarter. Warm promotions are gated as well as seen ones. - **Cool-down.** A page that a touch brought down waits 10 s of wall time before it can go up again. - **Touch-demotion cap.** At most 64 pages go down for a touch per pass (512 on main). The rest stay marked, and on the card, for the next pass. - **`VICTORY_KICK_SPLIT=<pages>`**: a pass's moves are prepared, placed under `lazy::moving` and 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. - **Counters.** While either switch is on, the 5 s `page residency:` line ends with `; sticky …; kick split …`: - touch-backs, re-promotions after a touch-down (and those within 2 s); - pages left on the card by the cap, cooling, gated, probes; - the gated pools with their recent counts; - kicks, average and most pages per kick, longest kick. - **Always on.** The touch-back and recent-promotion counters, and the per-page "brought down at" time, are kept whatever the switches. They are relaxed atomics on the residency thread and in `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: | arm | frame 1% low Δ | 0.1% low Δ | >50 ms frames Δ | page moves per frame | |---|---|---|---|---| | `RESIDENCY_HYSTERESIS=1` | +0.21 ± 0.20 fps | +0.08 | −1.3 pts | 34.4 (control 34.8) | | `HYSTERESIS=1` + `RESIDENCY_BUDGET_MS=2` | +0.16 ± 0.52 | −0.10 | −1.2 pts | 30.1 | Both are neutral within the bench's spread. Our reading of why, from the trace and from Kal0s's review on #552: - **Throttling is too slow.** Hysteresis throttles a pool only once it has ≥64 samples, and decays at most every 128 busy ticks (≥25.6 s). In our runs pools 7 and 15 were throttled for 100% of the window. But the throttle stops only speculative (seen) promotions and watch-retires; warm promotions of untouched pages still go up and bounce. This change gates those too, decays every 2 s, and adds the cool-down. - **The budget doesn't shorten the kick.** `RESIDENCY_BUDGET_MS` caps 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_SPLIT` bounds it. The two can coexist; they touch neighbouring lines of `tick()`, so whichever merges second needs a small rebase. If #552 lands first, `STICKY` could become a stronger mode of its hysteresis rather than a separate switch. Maintainers' preference welcome. ## Evidence **Setup:** - **Hardware:** RX 9070 XT 16 GB, Ryzen 9 7950X3D, game 1.0.2.1. - **Picture:** Series X profile, 3840x2160 output with `VICTORY_FSR_4K=performance`, ray tracing on, `VICTORY_FRAME_INTERVAL_MS=33.333`. - **Software:** RADV with this repo's patch plus our own Mesa/kernel changes. The kernel is 7.4-rc5 with experimental VA-update patches, so absolute numbers are not main's. **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): - noon, clock paused, sunny; - 320 s laps; - window from route start + 60 s to + 270 s. **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). | arm (n) | avg fps | frame 1% low | 0.1% low | frames >50 ms | p99 | max | longest CS ioctl in a frame, p99 | page moves/frame | gfx busy, median frame | |---|---|---|---|---|---|---|---|---|---| | control (5) | 25.63 | 6.77 ± 0.21 | 4.70 | 17.0% | 119.6 ms | 244 ms | 42.0 ms | 34.3 | 28.5 ms | | `KICK_SPLIT=64` (3) | 25.72 | 6.97 ± 0.36 | 4.87 | 17.2% | 116.0 ms | 251 ms | 21.2 ms | 34.4 | 28.3 ms | | **`RESIDENCY_STICKY=1` + `KICK_SPLIT=64` (3)** | **27.04** | **8.95 ± 0.39** | **6.84** | **11.6%** | **95.1 ms** | **162 ms** | **16.3 ms** | **5.1** | 28.7 ms | Paired Δ for STICKY + SPLIT against the bracketing controls: - frame 1% low **+2.20 ± 0.43 fps (+32%)**; - 0.1% low +2.11 ± 0.37 (+46%); - time spent in frames over 50 ms −11.1 points (32% → 21%); - p99 −25 ms; - avg +1.44 fps. **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: - control: 6.80, 6.65, 7.09, 6.52, 6.80; - STICKY + SPLIT: 8.54, 9.00, 9.32. 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: - **The split alone does nothing for the lows.** It halves the longest CS ioctl per frame (p99, 42 → 21 ms) but leaves the frame 1% low and >50 ms frames where they were. The gate does the work. - **The per-pool locks are not the cause.** They were on in both test arms, and the split arm is neutral. A sticky-only run without #392 was not made. - **Combining with our other pacing hurts.** We tried `STICKY` + `SPLIT` on top of a fork-only pacing combo (pass every 200 ms, at most 48 pages a pass, a bind prefault). That was worse than `STICKY` + `SPLIT` alone (1% low 8.23 against 8.95), though still better than control. ## Risks - **Pages the GPU wants may stay in system memory.** A gated pool keeps pages the GPU reads in GTT, up to the probes. On this card and route the GPU busy time did not move. On a card with less PCIe headroom, or a scene where those pages are GPU-hot, it could cost GPU time. The gate opens when the share falls under a quarter, and the 2 s decay lets it reopen in seconds, not minutes. - **The constants are untuned.** 64 floor, half/quarter, 16 probes, 10 s cool-down, 64 touch-demotions, 2 s decay: set once from the trace, not swept. They are constants, not switches, for now. - **Touch-demotions are deferred.** A touched page on the card waits up to a few passes to go down. Meanwhile the CPU's accesses to it go over the BAR. In our runs that did not show (longest CS ioctl per frame, p99, 42 → 16 ms), but the processor reads card memory slowly. - **The split adds kicks per pass.** Each kick is an ioctl that waits for its moves. With 64-page chunks we saw no cost in the passes' total time; smaller chunks were not tried here. - **Measured on one setup only.** One card (16 GB, RDNA 4), one route, a patched kernel. Not measured: 8 GiB cards (where #552 was measured), other generations, Windows (residency does not run there). ## Switches | Setting | Default | Values | Effect | |---|---|---|---| | `VICTORY_RESIDENCY_STICKY` | unset | 0, 1 | Gate pools whose promoted pages the CPU touches back; 10 s cool-down after a touch-down; at most 64 touch-demotions a pass | | `VICTORY_KICK_SPLIT` | unset | pages (e.g. 64) | A pass's moves go to the driver in kicks of at most so many 64 KiB pages | Both are documented in `docs/SETTINGS.md` (paging rows, marked paging-only). ## Testing - **Build checks:** `./build.sh check` (victory, Windows target) and `cargo check --tests -p victory-gpu` are clean, apart from main's existing `room_lately` warning. - **New unit tests:** `um::residency::tests::kick_split_chunks_runs_up_to_its_pages` and `the_sticky_gate_closes_at_half_and_opens_under_a_quarter`. Both pass under Wine (pure tests); `um::residency` 6 passed. - **Not run in game on this branch.** The numbers above are from the fork build that carries the same logic. The port differs from that build only in its surroundings: - main has no #552 or #392; - the place loop is reshaped into a per-chunk prepare/place/kick; - the fork's sub-switches for the constants and its live toggles are dropped; - "keep" mode (`STICKY=2` in the fork, untested) is dropped. - **Parity with both switches off:** one chunk, so prepare all → `pass_ms` → place all under one `lazy::moving` → one kick, as main. The `moved` count in the debug pass line is the same as main's (touch-down extras are not counted there). ## Open questions 1. **Does it need #392?** In our tree the per-pool locks were on in both measured arms. Without them, every chunk of a split pass takes the global `lazy::moving` guard 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. 2. **Fold into #552?** Should `STICKY` be folded into #552's hysteresis (same counters, faster decay, gate warm promotions), or stay separate? 3. **Probes:** are 16 probes per pass per gated pool enough on 8 GiB cards, where room demotions also compete? 4. **More data wanted.** A run of this on an 8 GiB RDNA 3 (the #552 setup) on the same route would tell whether the gate helps where VRAM really is short. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya
On the downtown route of #554 (RX 9070 XT, 30 fps cap, traced), the slow
frames are CPU-late, and the largest family is page residency: 121k pages
went up a run and 100k (82%) came back down because the processor touched
them, 27% of those within two seconds, none for room. Nearly all went up
never touched by the processor (the general heap), so the strikes and
probation, which only begin after a first bounce, never stop the first
round trip. Each pass's moves reach the card in one kick that holds the
VM's root reservation for 24 ms on average (76 ms at most), and the
title's submissions and every CPU fault on a mapping of the card's wait
behind it.

- VICTORY_RESIDENCY_STICKY=1: per pool, recent promotions and touch-backs
  are counted and halved every 2 s. A pool that is not write-combined,
  with 64 or more recent promotions of which half or more came back, is
  gated: only its 16 hottest candidates go up a pass (warm and seen
  alike), until its share falls under a quarter. A page a touch brought
  down waits 10 s of wall time before it goes up again, and at most 64
  pages go down for a touch a pass (512 before); the rest stay marked
  for the next.
- VICTORY_KICK_SPLIT=<pages>: a pass's moves are prepared, placed under
  `lazy::moving` and kicked in chunks of at most so many pages, so no kick
  validates more than that under the root reservation.

With both unset a pass is prepared, placed and kicked as before (one
chunk); only the counters (touch-backs, recent promotions, the time a
touch brought a page down) are kept regardless. While either is on, the
page residency line ends with "; sticky ...; kick split ...".

Measured downstream (a fork tree carrying this change, on a patched
kernel and Mesa), downtown route, start+60 to +270 s, 3 runs per arm
interleaved with 5 controls; both arms also had #392's per-pool locks on
(VICTORY_UM_POOL_LOCKS=1 there), the control did not:
- KICK_SPLIT=64: frame 1% low 6.77 -> 6.97 fps (noise), worst kick CS
  42 -> 21 ms;
- RESIDENCY_STICKY=1 + KICK_SPLIT=64: 1% low 6.77 -> 8.95 fps (+32%),
  0.1% low 4.70 -> 6.84, frames over 50 ms 17% -> 11.6%, p99 120 -> 95 ms,
  average 25.6 -> 27.0 fps, page moves 34 -> 5 a frame, GPU busy per
  frame unchanged.

Tests, under Wine: um::residency 6 passed, the new
kick_split_chunks_runs_up_to_its_pages and
the_sticky_gate_closes_at_half_and_opens_under_a_quarter among them;
`cargo check` of victory and of victory-gpu's tests clean apart from the
existing room_lately warning. Not run in game on this tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ETU6PfySRvsjk18uHFtWya
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 14:21:28 +00:00
Author
Owner

@⁠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 PR

Setup: 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), preset high (which sets VICTORY_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.

A (n=2) B (n=2)
avg fps 13.7 / 12.7 13.6 / 13.7
1% low 3.6 / 3.3 4.5 / 4.2
long frame > 200 ms 162 / 169 66 / 100
> 100 ms 770 / 808 771 / 753
> 50 ms 2197 / 2311 2645 / 2526
pages moved up 68k / 74k 10k / 12k
down on CPU touch (within 2 s) 77k (19k) / 82k (21k) 16k (279) / 20k (225)
s moving 46 / 49 29 / 30
  • The ping-pong is essentially gone on this card too, and the worst stalls halve (1% low +26 %), while frames of 50–100 ms rise by about 15 %. Average fps is unchanged.
  • With KICK_SPLIT=64 the 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.
  • Caveats: two runs per arm, and the save was autosaved during one route run, so A2 started from a different spot.
**@⁠datWeazel** on GitHub · 2026-12-05 16:44 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596#issuecomment-7441551644) **A/B on RX 6950 XT (RDNA 2) + Ryzen 7 5800X3D, `main` @ 8bf4878 + #554 + this PR** Setup: 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), preset `high` (which sets `VICTORY_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. | | A (n=2) | B (n=2) | |---|---|---| | avg fps | 13.7 / 12.7 | 13.6 / 13.7 | | 1% low | 3.6 / 3.3 | 4.5 / 4.2 | | `long frame` > 200 ms | 162 / 169 | 66 / 100 | | > 100 ms | 770 / 808 | 771 / 753 | | > 50 ms | 2197 / 2311 | 2645 / 2526 | | pages moved up | 68k / 74k | 10k / 12k | | down on CPU touch (within 2 s) | 77k (19k) / 82k (21k) | 16k (279) / 20k (225) | | `s moving` | 46 / 49 | 29 / 30 | - The ping-pong is essentially gone on this card too, and the worst stalls halve (1% low +26 %), while frames of 50–100 ms rise by about 15 %. Average fps is unchanged. - With `KICK_SPLIT=64` the 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. - Caveats: two runs per arm, and the save was autosaved during one route run, so A2 started from a different spot.
Author
Owner

@⁠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:

  • Hardware: AMD Radeon RX 6600 (8 GiB VRAM, ReBAR 8 GiB enabled), Intel Core i5-14400F, 32 GiB RAM.
  • Software: Arch Linux (kernel 7.3.6-arch1-1), RADV 26.3.1 + vkd3d-proton from setup.sh, Wine Staging 11.23 (ntsync), release build based on main @ b581f7e + #563 + VICTORY_PAGE_RESERVE_MB=512 (identical in both runs; VICTORY_PAGES_SEEN unset).
  • Config: Series S profile, 1280x720 native (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.
  • Activity: Continuous hand-played gameplay (interiors + dense exterior driving/roaming, skipping the initial 30 s world load for long frame counts).
    • Control (A): 32.6 min (8,378 busy ticks, n=330 gameplay frame-stat samples)
    • PR #596 (B): VICTORY_RESIDENCY_STICKY=1 + VICTORY_KICK_SPLIT=64, 44.4 min (11,641 busy ticks, n=483 gameplay frame-stat samples, 69% dense exteriors)
Metric Control (A, 32.6 min) STICKY=1 + KICK_SPLIT=64 (B, 44.4 min) Delta
long frame >50 ms / min 182.5 / min 151.9 / min -16.8%
long frame >100 ms / min 10.0 / min (264) 5.2 / min (165) -48.0%
long frame >200 ms / min 0.45 / min (12) 0.09 / min (3) -80.0%
Worst gameplay long frame (max) 397.7 ms 241.6 ms -39.3% (-156 ms)
long frame p95 102.3 ms 93.5 ms -8.8 ms
Global p05 / p10 fps (>=1000 draws) 16.82 / 18.62 17.73 / 19.22 +5.4% / +3.2%
Exteriors (>=4500 draws) med / p90 fps 21.68 / 24.63 22.18 / 26.25 +0.50 / +1.62 fps
Exteriors >50 ms share 25.5% 20.2% -5.3 pts
Median preparing_ms / copy_ms 6.86 / 3.80 ms 5.54 / 2.69 ms -19.2% / -29.2%
VRAM on_card med (end) / free med 707 (670) / 878 MiB 710 (744) / 1,029 MiB Healthy headroom
Pages waiting for room (med / max) 0 / 0 0 / 0 No room starvation

Residency & sticky telemetry (B, end of 44.4 min run):

  • Normalized per busy tick: promotions fell -20% (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 for 587 s at session end: 13,348 page-passes gated, 14,405 probes, 4,402 page-passes cooling, 18 left on card by the 64/pass cap, and 0 re-promotions within 2 s (out of 4,274 re-promotions).
  • kick split 64 pages: 4,805 kicks averaging 8.9 pages/kick (max 64, longest kick 57.8 ms, p90 pass time 38.9 -> 37.0 ms).
  • 8 GiB VRAM & probes observation: With 0 room evictions and 744 MiB on-card at minute 44 (756 MiB free), 16 probes/pass did not starve GPU residency at all — exteriors actually gained +0.50 median / +1.62 p90 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=downtown replay, and VICTORY_PAGES_SEEN was 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!

**@⁠ratatrampa007** on GitHub · 2026-12-05 18:08 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596#issuecomment-7442862837) Real-world 8 GiB VRAM RDNA 2 test data (re: Open Questions #3 and #4 on 8 GiB cards): **Setup:** - **Hardware:** AMD Radeon RX 6600 (8 GiB VRAM, ReBAR 8 GiB enabled), Intel Core i5-14400F, 32 GiB RAM. - **Software:** Arch Linux (kernel `7.3.6-arch1-1`), RADV `26.3.1` + `vkd3d-proton` from `setup.sh`, Wine Staging `11.23` (`ntsync`), release build based on `main @ b581f7e` + `#563` + `VICTORY_PAGE_RESERVE_MB=512` (identical in both runs; `VICTORY_PAGES_SEEN` unset). - **Config:** Series S profile, `1280x720` native (`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`. - **Activity:** Continuous hand-played gameplay (interiors + dense exterior driving/roaming, skipping the initial 30 s world load for `long frame` counts). - **Control (A):** 32.6 min (`8,378` busy ticks, `n=330` gameplay frame-stat samples) - **PR #596 (B):** `VICTORY_RESIDENCY_STICKY=1` + `VICTORY_KICK_SPLIT=64`, 44.4 min (`11,641` busy ticks, `n=483` gameplay frame-stat samples, 69% dense exteriors) | Metric | Control (A, 32.6 min) | `STICKY=1` + `KICK_SPLIT=64` (B, 44.4 min) | Delta | |---|---:|---:|---:| | `long frame` >50 ms / min | 182.5 / min | **151.9 / min** | **-16.8%** | | `long frame` >100 ms / min | 10.0 / min (264) | **5.2 / min** (165) | **-48.0%** | | `long frame` >200 ms / min | 0.45 / min (12) | **0.09 / min** (3) | **-80.0%** | | Worst gameplay `long frame` (max) | 397.7 ms | **241.6 ms** | **-39.3%** (-156 ms) | | `long frame` p95 | 102.3 ms | **93.5 ms** | **-8.8 ms** | | Global `p05` / `p10` fps (`>=1000 draws`) | 16.82 / 18.62 | **17.73 / 19.22** | **+5.4% / +3.2%** | | Exteriors (`>=4500 draws`) med / p90 fps | 21.68 / 24.63 | **22.18 / 26.25** | **+0.50 / +1.62 fps** | | Exteriors >50 ms share | 25.5% | **20.2%** | **-5.3 pts** | | Median `preparing_ms` / `copy_ms` | 6.86 / 3.80 ms | **5.54 / 2.69 ms** | **-19.2% / -29.2%** | | VRAM `on_card` med (end) / `free` med | 707 (670) / 878 MiB | **710 (744) / 1,029 MiB** | Healthy headroom | | Pages waiting for room (`med` / `max`) | 0 / 0 | **0 / 0** | No room starvation | **Residency & sticky telemetry (B, end of 44.4 min run):** - Normalized per busy tick: promotions fell **-20%** (`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 for `587 s` at session end: `13,348` page-passes gated, `14,405` probes, `4,402` page-passes cooling, `18` left on card by the 64/pass cap, and **`0` re-promotions within 2 s** (out of `4,274` re-promotions). - `kick split 64 pages`: `4,805` kicks averaging **`8.9` pages/kick** (max `64`, longest kick `57.8 ms`, `p90` pass time `38.9 -> 37.0 ms`). - **8 GiB VRAM & probes observation:** With `0` room evictions and `744 MiB` on-card at minute 44 (`756 MiB` free), 16 probes/pass did not starve GPU residency at all — exteriors actually gained `+0.50` median / `+1.62` p90 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=downtown` replay, and `VICTORY_PAGES_SEEN` was 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!
Author
Owner

@⁠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 the page residency format string (let mut line kept).

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 the long frame log lines (≥ 50 ms).

arm ms/frame 5 s windows > 40 ms worst window gpu_wait long frames
base 42 / 41 24/36 54.4 / 47.9 ms 16.7 / 16.1 ms 261 / 251
#611 GEOMETRY_ON_CARD=1 40 / 41 22/36 48.3 / 56.9 ms 15.7 / 16.2 ms 226 / 221 (−13 %)
RESIDENCY_STICKY=1 + KICK_SPLIT=64 41 / 41 26/36 48.9 / 49.0 ms 16.1 / 16.8 ms 234 / 239 (−8 %)
both 39 / 40 19/36 49.6 / 58.9 ms 15.9 / 17.0 ms 206 / 203 (−20 %)
  • The gate works as described. Pool 15 is gated, and pages moved up fall from 17.9k to 7.6k per run. Pages brought back down within 2 s of promotion fall from 4,737 to 1,103. Kicks: 322 of 38.5 pages on average, the longest 38 ms.
  • In this scene the mean and the worst window stay within noise. The ≥ 50 ms frame count drops by about 8 % alone and about 20 % with #611. Our scene is a standing intro with light streaming, so the ping-pong is much smaller than on your downtown route. No errors or device loss.
**@⁠fsrajner** on GitHub · 2026-12-05 19:17 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596#issuecomment-7443861854) 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 the `page residency` format string (`let mut line` kept). **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 the `long frame` log lines (≥ 50 ms). | arm | ms/frame | 5 s windows > 40 ms | worst window | gpu_wait | long frames | |---|---|---|---|---|---| | base | 42 / 41 | 24/36 | 54.4 / 47.9 ms | 16.7 / 16.1 ms | 261 / 251 | | #611 `GEOMETRY_ON_CARD=1` | 40 / 41 | 22/36 | 48.3 / 56.9 ms | 15.7 / 16.2 ms | 226 / 221 (−13 %) | | `RESIDENCY_STICKY=1` + `KICK_SPLIT=64` | 41 / 41 | 26/36 | 48.9 / 49.0 ms | 16.1 / 16.8 ms | 234 / 239 (−8 %) | | both | 39 / 40 | 19/36 | 49.6 / 58.9 ms | 15.9 / 17.0 ms | 206 / 203 (−20 %) | - The gate works as described. Pool 15 is gated, and pages moved up fall from 17.9k to 7.6k per run. Pages brought back down within 2 s of promotion fall from 4,737 to 1,103. Kicks: 322 of 38.5 pages on average, the longest 38 ms. - In this scene the mean and the worst window stay within noise. The ≥ 50 ms frame count drops by about 8 % alone and about 20 % with #611. Our scene is a standing intro with light streaming, so the ping-pong is much smaller than on your downtown route. No errors or device loss.
Author
Owner

@⁠DrArroway on GitHub · 2026-12-05 21:44 UTC · original

54-minute real-play soak on RDNA 2 (main + #611 + #596, clean voluntary exit, 0 errors), 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

  • GPU / System: 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 kernel 7.3.7-1-cachyos, GE-Proton11-15-x86_64, repo-patched Mesa (deps/mesa-inst) + vkd3d-proton.
  • Build: main (a5c6484) + #611 + #596 merged cleanly with 0 conflicts (48.1 s incremental release build; no shader changes).
  • Settings: Series X profile, 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, 0 errors / 0 crashes)

Metric #611 alone (37m 08s, pre-Lucia) #611 + #596 (53m 53s, Lucia + bar + driving)
Pages moved up (total / per min) 156,859 (4,224/min) 68,274 (1,267/min, −70%)
Touch-demotions (total / per min) 152,328 (4,102/min) 64,853 (1,204/min, −71%)
Promotions bouncing within 2 s 44,516 14,698 (0 re-promoted within 2 s after touch-down)
Total residency moving time 178.0 s (4.8 s/min) 250.8 s (4.65 s/min)
#611 regions allocated / refused_room 896 MB / 56,874 (2,026 MB) 1,024 MB / 928 (232 MB, −98%)
Card VRAM / Shared (end / peak) 13.0 / 13.2 GB · 11.8 / 13.2 GB 14.0 / 14.0 GB · 11.5 / 13.5 GB
tools/session-fps.sh 23.9 med / 24.5 avg (prep 4.5 ms, copy 1.2 ms) 23.7 med / 23.9 avg (prep 6.3 ms, copy 2.7 ms, min 11.4)

Key observations on RDNA 2

  • Page ping-pong dropped ~70% per minute, with 2,715,572 page-passes gated (pool 15 gated for 487 s), 98,520 cooling, 53,736 probes, and 0 re-promotions within 2 s of a touch-down.
  • Nice interaction with #611: because pool 15 stayed gated instead of filling card_mb_for_title early, #611 got its full 1,024 MB (8 × 128 MB) and refused_room dropped from 56,874 to 928 (locked=0, made_again=0, 2,224,049 copies / 53.9 GB).
  • Worth noting for tuning on RDNA 2 (without #392):
    • 6,709 split kicks averaged 20.7 pages/kick (max 64), though longest kick still hit 81.1 ms and total moving time/min stayed near 4.65 s/min.
    • 51,482 page-passes were left on the card by the 64/pass touch-demotion cap, and avg_copy_ms was higher in this session (2.7 ms vs 1.2 ms — likely partly heavier story/bar activity, and possibly partly deferred touch-demotions reading over BAR as noted under "Risks").

Verbatim final page residency and geometry on card lines (at 53m 53s)

2026-12-05T21:42:08.392838Z  INFO victory_gpu::um: page residency: 2768 MB of 9330 MB of paged title memory on the card, card room for the title 4080 MB, 1205 MB of the card free; since the start 68274 pages moved up (0 of them seen by the card, never touched by the CPU), 5670 down cold, 0 down for room, 64853 down when the processor touched them (14698 within two seconds of promotion), 67691 taken from the processor to watch, 97367 touched while watched or up, 0 not moved by the driver, 250.8 s moving; of the pages that came to the card 46545 were in pools opened there, 51163 went up never touched by the processor, 16574 after the processor's mapping was taken and watched and 537 back up in write-combined pools, and a touch of the processor's or a read of ours brought down 1102, 48796, 14841 and 114 of them; the card's reads marked 11589 pages in the last tick, 14825 a tick over 14706 ticks (14129 of them busy); last pass 0 us; 0 pages wait for room; pools (MB on the card/read by the card lately/touched by the processor/all): 1w:1819/488/68/2199 5w:709/256/0/710 7:42/100/87/185 15:196/174/2955/6236; sticky on: 63751 touches of promoted pages on the card, 25821 promoted again after a touch brought them down (0 of them within two seconds), 51482 page-passes left on the card by the cap of 64 a pass, 98520 page-passes cooling, 2715572 page-passes gated, 53736 probes; gated pools (recent touch-backs/promotions): 15 for 487 s (1/2); kick split 64 pages: 6709 kicks of 20.7 pages on average, most pages in one kick 64, longest kick 81100 us
2026-12-05T21:42:09.405668Z  INFO stats: geometry on card copied=2224049 copied_mb=53908 alive=61023 alive_mb=804 regions_mb=1024 ended=2163026 resting=786 free_mb=184 largest_free_kb=20580 refused_room=928 refused_room_mb=232 refused_size=0 made_again=0 aliased=792 locked=0
**@⁠DrArroway** on GitHub · 2026-12-05 21:44 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596#issuecomment-7445964206) 54-minute real-play soak on RDNA 2 (`main` + `#611` + `#596`, clean voluntary exit, `0` errors), compared informally against our [37-minute `#611`-only soak](https://git.gtahub.st/github/lobomfz--VIctory-xmem/pulls/611) 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 - **GPU / System:** `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 kernel `7.3.7-1-cachyos`, `GE-Proton11-15-x86_64`, repo-patched Mesa (`deps/mesa-inst`) + vkd3d-proton. - **Build:** `main` (`a5c6484`) + `#611` + `#596` merged cleanly with 0 conflicts (`48.1 s` incremental release build; no shader changes). - **Settings:** Series X profile, `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`, `0` errors / `0` crashes) | Metric | `#611` alone (37m 08s, pre-Lucia) | `#611` + **`#596`** (53m 53s, Lucia + bar + driving) | |---|---:|---:| | **Pages moved up (total / per min)** | `156,859` (`4,224/min`) | **`68,274` (`1,267/min`, −70%)** | | **Touch-demotions (total / per min)** | `152,328` (`4,102/min`) | **`64,853` (`1,204/min`, −71%)** | | **Promotions bouncing within 2 s** | `44,516` | **`14,698` (`0` re-promoted within 2 s after touch-down)** | | **Total residency moving time** | `178.0 s` (`4.8 s/min`) | `250.8 s` (`4.65 s/min`) | | **`#611` regions allocated / `refused_room`** | `896 MB` / `56,874` (`2,026 MB`) | **`1,024 MB` / `928` (`232 MB`, −98%)** | | **Card VRAM / Shared (end / peak)** | `13.0 / 13.2 GB` · `11.8 / 13.2 GB` | `14.0 / 14.0 GB` · `11.5 / 13.5 GB` | | **`tools/session-fps.sh`** | `23.9` med / `24.5` avg (`prep 4.5 ms`, `copy 1.2 ms`) | `23.7` med / `23.9` avg (`prep 6.3 ms`, `copy 2.7 ms`, `min 11.4`) | ### Key observations on RDNA 2 - **Page ping-pong dropped ~70% per minute**, with **`2,715,572` page-passes gated** (pool 15 gated for `487 s`), `98,520` cooling, `53,736` probes, and **`0`** re-promotions within 2 s of a touch-down. - **Nice interaction with `#611`:** because pool 15 stayed gated instead of filling `card_mb_for_title` early, `#611` got its full **`1,024 MB`** (`8 × 128 MB`) and `refused_room` dropped from `56,874` to `928` (`locked=0`, `made_again=0`, `2,224,049` copies / `53.9 GB`). - **Worth noting for tuning on RDNA 2 (without `#392`):** - `6,709` split kicks averaged **`20.7` pages/kick** (max `64`), though **`longest kick` still hit `81.1 ms`** and total moving time/min stayed near `4.65 s/min`. - `51,482` page-passes were left on the card by the 64/pass touch-demotion cap, and `avg_copy_ms` was higher in this session (`2.7 ms` vs `1.2 ms` — likely partly heavier story/bar activity, and possibly partly deferred touch-demotions reading over BAR as noted under "Risks"). ### Verbatim final `page residency` and `geometry on card` lines (at `53m 53s`) ```text 2026-12-05T21:42:08.392838Z INFO victory_gpu::um: page residency: 2768 MB of 9330 MB of paged title memory on the card, card room for the title 4080 MB, 1205 MB of the card free; since the start 68274 pages moved up (0 of them seen by the card, never touched by the CPU), 5670 down cold, 0 down for room, 64853 down when the processor touched them (14698 within two seconds of promotion), 67691 taken from the processor to watch, 97367 touched while watched or up, 0 not moved by the driver, 250.8 s moving; of the pages that came to the card 46545 were in pools opened there, 51163 went up never touched by the processor, 16574 after the processor's mapping was taken and watched and 537 back up in write-combined pools, and a touch of the processor's or a read of ours brought down 1102, 48796, 14841 and 114 of them; the card's reads marked 11589 pages in the last tick, 14825 a tick over 14706 ticks (14129 of them busy); last pass 0 us; 0 pages wait for room; pools (MB on the card/read by the card lately/touched by the processor/all): 1w:1819/488/68/2199 5w:709/256/0/710 7:42/100/87/185 15:196/174/2955/6236; sticky on: 63751 touches of promoted pages on the card, 25821 promoted again after a touch brought them down (0 of them within two seconds), 51482 page-passes left on the card by the cap of 64 a pass, 98520 page-passes cooling, 2715572 page-passes gated, 53736 probes; gated pools (recent touch-backs/promotions): 15 for 487 s (1/2); kick split 64 pages: 6709 kicks of 20.7 pages on average, most pages in one kick 64, longest kick 81100 us ``` ```text 2026-12-05T21:42:09.405668Z INFO stats: geometry on card copied=2224049 copied_mb=53908 alive=61023 alive_mb=804 regions_mb=1024 ended=2163026 resting=786 free_mb=184 largest_free_kb=20580 refused_room=928 refused_room_mb=232 refused_size=0 made_again=0 aliased=792 locked=0 ```
Author
Owner

@⁠Milkhaus-tech on GitHub · 2026-12-06 03:53 UTC · original

RDNA 4 A/B for VICTORY_RESIDENCY_STICKY=1 and VICTORY_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 the stats: frame 5 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).

Arm Runs avg fps p10 worst 5 s frames >50 ms /min frames >100 ms /min
RESIDENCY_STICKY=1 2 32.5, 31.8 19.5, 21.6 17.5, 18.8 126, 122 3.1, 3.5
KICK_SPLIT=64 1 31.7 18.0 16.0 142 5.7

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.

**@⁠Milkhaus-tech** on GitHub · 2026-12-06 03:53 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/596#issuecomment-7451070802) RDNA 4 A/B for `VICTORY_RESIDENCY_STICKY=1` and `VICTORY_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 the `stats: frame` 5 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). | Arm | Runs | avg fps | p10 | worst 5 s | frames >50 ms /min | frames >100 ms /min | |---|---|---|---|---|---|---| | RESIDENCY_STICKY=1 | 2 | 32.5, 31.8 | 19.5, 21.6 | 17.5, 18.8 | 126, 122 | 3.1, 3.5 | | KICK_SPLIT=64 | 1 | 31.7 | 18.0 | 16.0 | 142 | 5.7 | 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/596/head:github-bot/gh-596'
git switch 'github-bot/gh-596'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-596'
git switch 'github-bot/gh-596'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-596'
git switch 'github-bot/gh-596'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-596'
git switch 'main'
git merge --squash 'github-bot/gh-596'
git switch 'main'
git merge --ff-only 'github-bot/gh-596'
git switch 'main'
git merge 'github-bot/gh-596'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.