Host texture sweep: keep copies the title wants back soon after a host-pressure let-go (#3512) #3681

Closed
github-bot wants to merge 4 commits from github-bot/gh-3681 into main AGit
Owner

@⁠Smoodie7 on GitHub · 2026-11-30 03:42 UTC · original
Smoodie7:rayane/host-sweep-backoff → main · +114 −13 · 2 files · 4 commits · closed without merging

Fixes #3512

What it changes

Under host memory pressure, let_go_idle lets go host copies of placed textures whose title memory is unmapped after 1 s (below 8 GiB of headroom, which on a 32 GB PC is every time the PC is pressured) or 5 s. In the minigame the title still reads many of those textures, so the same copies are let go and made again every second, and every look of the sweep gets slower as the table grows.

What the logs show:

  • saltdam36 (RX 7800 XT, in #3512): about 37 GB of texture uploads in ten minutes and one frame of about 650 ms every second, with the card under its budget. VICTORY_HOST_TEXTURE_SWEEP=0 removed the stall (seconds with a frame over 150 ms: 40–54 of every 58 → 0–2), but it turns the host rule off entirely.
  • My session (RTX 4070 Ti SUPER, 32 GB, release build, log in #3512): the "host copies of the levels viewed" counter stayed flat at about 124,000 in the world, then went from 142,000 to 265,000 in the 20 minutes of the minigame (about 100 copies made a second). The "looks for textures to let go" average went from 13 ms to 38 ms, so each look in the minigame took about 85 ms on the submitting thread (longest 132 ms). In the same seconds, "the heaps' records and what is swept" took 140–170 ms per second, against under 40 ms in the world.

Two commits:

  1. Keep copies that come back. When the host-pressure sweep lets a copy go, it stamps the time (host_evicted). If that copy is made again within 10 s (HOST_BACK_MS), the title is still reading it: the host-pressure sweep passes it over for 2 minutes (HOST_PROTECT_MS). The card's own rule and a flush still apply. Copies that do not come back are still freed. Same pattern as the slot eviction protection (slot_evicted / slot_returned). VICTORY_HOST_SWEEP_PROTECT=0 turns it off.
  2. Cap how long a look holds the texture table. Under host pressure, the host-pressure part and the streamed-out part of a look stop after VICTORY_SWEEP_BUDGET_MS (default 4 ms; 0: no limit) and go on from the same place a second later (the FROM cursors were already there). That bounds the cost on the submitting thread whatever the table size. Reclaiming under pressure is spread over more seconds instead. This is the same idea as #3578 (VICTORY_SWEEP_SLICE_US), which I found after writing it. I kept it here so this branch can be tested as a whole fix; if #3578 lands first, I will drop this commit and keep only the first one, which #3578 does not cover (slices make each look cheaper, but the copies are still let go and remade every second).

The diagnostics line "host memory reclamation since the start" now also says how many let-go copies were made again, how many within 10 s, how often a protected one was passed over, and how many looks were cut short, so the effect can be read from a log.

#3475 adds a back-off to the card's rule. That does not apply here: in #3512 the card was under budget and the unmapped-only host rule was the one churning. The two change different branches of let_go_idle.

How it was tested

  • GPU and profile: RTX 4070 Ti SUPER 16 GB, Ryzen 7 7700, 32 GB RAM, Series X, 1080p → 1440p, DLSS Quality, frame generation 4x, ray tracing off. Same minigame as in #3512.
  • Before: one frame of about 640 ms every second in the minigame, 8–9 fps (numbers above).
  • After: not measured in game yet. A build of this branch is ready and I will add the before/after numbers here.
  • cargo test -p victory-gpu --lib: 921 passed. The 2 failures (a_change_is_saved_at_once_however_the_game_was_started, every_switch_of_the_translator_is_in_the_key) fail the same way on main. New unit test a_copy_back_soon_after_a_host_pressure_let_go_is_kept_for_a_while. Clippy shows nothing on the changed lines, with and without --features diagnostics.
  • The red CI check is function unwind_copy is never used in crates/victory-loader/src/crash.rs. That is not touched here and fails the same way on main (41adb55).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3475 (back-off on the card's rule), #3272 (unmapped_only check in let_go_idle), #3502 (sweep stutter), #3578 (the look in slices, same idea as the second commit).
**@⁠Smoodie7** on GitHub · 2026-11-30 03:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681) `Smoodie7:rayane/host-sweep-backoff` → `main` · +114 −13 · 2 files · 4 commits · closed without merging Fixes #3512 ## What it changes Under host memory pressure, `let_go_idle` lets go host copies of placed textures whose title memory is unmapped after 1 s (below 8 GiB of headroom, which on a 32 GB PC is every time the PC is pressured) or 5 s. In the minigame the title still reads many of those textures, so the same copies are let go and made again every second, and every look of the sweep gets slower as the table grows. What the logs show: - saltdam36 (RX 7800 XT, in #3512): about 37 GB of texture uploads in ten minutes and one frame of about 650 ms every second, with the card under its budget. `VICTORY_HOST_TEXTURE_SWEEP=0` removed the stall (seconds with a frame over 150 ms: 40–54 of every 58 → 0–2), but it turns the host rule off entirely. - My session (RTX 4070 Ti SUPER, 32 GB, release build, log in #3512): the "host copies of the levels viewed" counter stayed flat at about 124,000 in the world, then went from 142,000 to 265,000 in the 20 minutes of the minigame (about 100 copies made a second). The "looks for textures to let go" average went from 13 ms to 38 ms, so each look in the minigame took about 85 ms on the submitting thread (longest 132 ms). In the same seconds, "the heaps' records and what is swept" took 140–170 ms per second, against under 40 ms in the world. Two commits: 1. **Keep copies that come back.** When the host-pressure sweep lets a copy go, it stamps the time (`host_evicted`). If that copy is made again within 10 s (`HOST_BACK_MS`), the title is still reading it: the host-pressure sweep passes it over for 2 minutes (`HOST_PROTECT_MS`). The card's own rule and a flush still apply. Copies that do not come back are still freed. Same pattern as the slot eviction protection (`slot_evicted` / `slot_returned`). `VICTORY_HOST_SWEEP_PROTECT=0` turns it off. 2. **Cap how long a look holds the texture table.** Under host pressure, the host-pressure part and the streamed-out part of a look stop after `VICTORY_SWEEP_BUDGET_MS` (default 4 ms; 0: no limit) and go on from the same place a second later (the `FROM` cursors were already there). That bounds the cost on the submitting thread whatever the table size. Reclaiming under pressure is spread over more seconds instead. This is the same idea as #3578 (`VICTORY_SWEEP_SLICE_US`), which I found after writing it. I kept it here so this branch can be tested as a whole fix; if #3578 lands first, I will drop this commit and keep only the first one, which #3578 does not cover (slices make each look cheaper, but the copies are still let go and remade every second). The diagnostics line "host memory reclamation since the start" now also says how many let-go copies were made again, how many within 10 s, how often a protected one was passed over, and how many looks were cut short, so the effect can be read from a log. #3475 adds a back-off to the card's rule. That does not apply here: in #3512 the card was under budget and the unmapped-only host rule was the one churning. The two change different branches of `let_go_idle`. ## How it was tested - GPU and profile: RTX 4070 Ti SUPER 16 GB, Ryzen 7 7700, 32 GB RAM, Series X, 1080p → 1440p, DLSS Quality, frame generation 4x, ray tracing off. Same minigame as in #3512. - Before: one frame of about 640 ms every second in the minigame, 8–9 fps (numbers above). - After: not measured in game yet. A build of this branch is ready and I will add the before/after numbers here. - `cargo test -p victory-gpu --lib`: 921 passed. The 2 failures (`a_change_is_saved_at_once_however_the_game_was_started`, `every_switch_of_the_translator_is_in_the_key`) fail the same way on main. New unit test `a_copy_back_soon_after_a_host_pressure_let_go_is_kept_for_a_while`. Clippy shows nothing on the changed lines, with and without `--features diagnostics`. - The red CI check is `function unwind_copy is never used` in `crates/victory-loader/src/crash.rs`. That is not touched here and fails the same way on main (41adb55). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3475 (back-off on the card's rule), #3272 (`unmapped_only` check in `let_go_idle`), #3502 (sweep stutter), #3578 (the look in slices, same idea as the second commit).
Under host memory pressure the sweep lets go unmapped host texture copies
after 1 s (5 s). In the minigame the title still reads many of them, so they
were made and uploaded again every second (37 GB in ten minutes on an
RX 7800 XT) and one frame a second took about 650 ms.

A copy made again within 10 s of such a let-go is now kept from the
host-pressure sweep for 2 min. The card's own rule and a flush still apply.
VICTORY_HOST_SWEEP_PROTECT=0 restores the old behaviour. The diagnostics
line counts copies made again and those kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 03:48:53 +00:00
In the #3512 minigame log (RTX 4070 Ti SUPER, 32 GB), the host copies made
went from 124,000 to 265,000 in 20 minutes (about 100 a second, flat before
the minigame), and each once-a-second look of let_go_idle took about 85 ms
on the submitting thread (longest 132 ms), on the frame that was then 640 ms
long.

Under host memory pressure, the host-pressure part and the streamed-out part
of a look now stop after VICTORY_SWEEP_BUDGET_MS (default 4 ms, 0: no limit)
and go on from there a second later. The diagnostics line counts the looks
cut short.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Playing with the first two commits, the minigame went from 8-9 fps to two
to three times that, then stuttered again after about 15 minutes: the card
went from 11.7 to 13.3 GB of its 15.3 GB budget, the card's rule took over
from the host-pressure rule, and looks took 60 ms on average (238 ms at
most) again.

With the card's rule in charge and the PC's memory tight, the free loop
still required the copy's title memory to be wholly unmapped (it tested
host_idle instead of unmapped_only), so it asked about every candidate,
freed almost none and walked the whole list each second (as #3272 found).
It now tests unmapped_only, and the look budget also applies to the card's
rule while the PC's memory is tight.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠saltdam36 on GitHub · 2026-11-30 05:28 UTC · original

Tested on the RX 7800 XT from #3512 (Ryzen 7 7800X3D, 32 GB, Series S, FSR upscaler, no frame generation). Build: 41adb551 + #1236 + #2764 + this PR at 90998501, rule on (VICTORY_HOST_TEXTURE_SWEEP unset), dense urban area, host memory pressure on from world entry.

The stall is still here with this PR:

rule off (41adb551, earlier session) rule on + this PR
seconds with a frame over 150 ms 0–2 of 58, some minutes up to 14 34–52 of 57
longest frame in a typical second 70–95 ms 260–300 ms
rendered fps 19–25 16–24
texture uploads 50–106 MB/s 50–80 MB/s

The two runs are different areas of the map, so the frame lengths aren't a like-for-like comparison, but the once-a-second pattern is unmistakable and uploads did not drop. The card was under its budget throughout (11.8 GB of 13.3 GB).

This was not a diagnostics build, so I don't have the "copies made again" count. I can rerun with the diagnostics feature at the same spot if that would show why the protection isn't catching them here.

One correction to the description: the ~650 ms figure is from the 4070 Ti SUPER log; on this card the stalled frame was about 200 ms.

**@⁠saltdam36** on GitHub · 2026-11-30 05:28 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7269701622) Tested on the RX 7800 XT from #3512 (Ryzen 7 7800X3D, 32 GB, Series S, FSR upscaler, no frame generation). Build: `41adb551` + #1236 + #2764 + this PR at `90998501`, rule on (`VICTORY_HOST_TEXTURE_SWEEP` unset), dense urban area, host memory pressure on from world entry. The stall is still here with this PR: | | rule off (`41adb551`, earlier session) | rule on + this PR | |---|---|---| | seconds with a frame over 150 ms | 0–2 of 58, some minutes up to 14 | 34–52 of 57 | | longest frame in a typical second | 70–95 ms | 260–300 ms | | rendered fps | 19–25 | 16–24 | | texture uploads | 50–106 MB/s | 50–80 MB/s | The two runs are different areas of the map, so the frame lengths aren't a like-for-like comparison, but the once-a-second pattern is unmistakable and uploads did not drop. The card was under its budget throughout (11.8 GB of 13.3 GB). This was not a diagnostics build, so I don't have the "copies made again" count. I can rerun with the diagnostics feature at the same spot if that would show why the protection isn't catching them here. One correction to the description: the ~650 ms figure is from the 4070 Ti SUPER log; on this card the stalled frame was about 200 ms.
Author
Owner

@⁠Smoodie7 on GitHub · 2026-11-30 05:32 UTC · original · edited 2026-11-30 05:37 UTC

Thanks @⁠saltdam36, and noted on the ~200 ms figure for your card.

One important point first: this PR targets the minigame of #3512, the mission where you start the game console and play on it, not the open world. Your run was in a dense urban area, so it does not cover the case this fixes. In the minigame the change is large: up to two to three times the frame rate, and the once-a-second stall gone (table below). Could you rerun at 66fe197 inside that minigame?

About the open world: your run is at 90998501, before the third commit, and I think it shows the same thing I saw: with the card at 11.8 of 13.3 GB, the card's rule is the one deciding (vram_keep_below near its line), not the host-pressure rule. The first two commits only act on the host-pressure rule. The card's rule still hit the host_idle/unmapped_only gate (#3272), so every look walked the whole list and freed almost nothing. dea4b48 fixes that gate and applies the look budget to the card's rule as well.

My runs, same minigame as in #3512

RTX 4070 Ti SUPER, Ryzen 7 7700, 32 GB, Series X 1440p, DLSS Quality, frame generation 4x, ray tracing off, release builds. One log line per second:

Before (main) Commits 1–2, first 13 min Commits 1–2, after the card filled up
Rendered fps (average) 12.1 24.4 17.8
Seconds with a frame over 300 ms 57 % 2 % 18 %
Seconds with a frame over 150 ms 93 % 59 % 85 %
Longest frame 1,154 ms 620 ms 1,196 ms

The relapse came when the card went from 11.7 to 13.3 GB of its 15.3 GB budget. At that point looks took 60–75 ms again, which matches your 90998501 run. With all three commits, I played the minigame again on my second PC and checked the logs: the stall did not come back, including past the point where it used to.

Before (main), in the minigame:

23:53:26 INFO victory_gpu::frame_times: frame times: 9 frames, median 45.1 ms, p95 638.8, p99 638.8, longest 638.8; 2 over 50 ms, 1 over 100 ms
23:53:27 INFO victory_gpu::frame_times: frame times: 9 frames, median 44.5 ms, p95 652.8, p99 652.8, longest 652.8; 1 over 50 ms, 1 over 100 ms
23:53:28 INFO victory_gpu::frame_times: frame times: 10 frames, median 45.4 ms, p95 627.0, p99 627.0, longest 627.0; 2 over 50 ms, 1 over 100 ms

With this PR (commits 1–2), in the minigame:

05:06:10 INFO victory_gpu::frame_times: frame times: 22 frames, median 37.9 ms, p95 51.3, p99 166.3, longest 166.3; 2 over 50 ms, 1 over 100 ms
05:06:11 INFO victory_gpu::frame_times: frame times: 26 frames, median 37.6 ms, p95 46.0, p99 48.3, longest 48.3; 0 over 50 ms, 0 over 100 ms
05:06:12 INFO victory_gpu::frame_times: frame times: 23 frames, median 37.6 ms, p95 49.2, p99 153.1, longest 153.1; 1 over 50 ms, 1 over 100 ms

For the rerun in the minigame, a diagnostics build would be ideal: the "host memory reclamation" line now gives copies made again, copies protected and looks cut short, so we would see which rule is acting on your card.

**@⁠Smoodie7** on GitHub · 2026-11-30 05:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7269762487) · edited 2026-11-30 05:37 UTC Thanks @⁠saltdam36, and noted on the ~200 ms figure for your card. **One important point first: this PR targets the minigame of #3512, the mission where you start the game console and play on it, not the open world.** Your run was in a dense urban area, so it does not cover the case this fixes. In the minigame the change is large: up to two to three times the frame rate, and the once-a-second stall gone (table below). Could you rerun at 66fe197 inside that minigame? About the open world: your run is at 90998501, before the third commit, and I think it shows the same thing I saw: with the card at 11.8 of 13.3 GB, the card's rule is the one deciding (`vram_keep_below` near its line), not the host-pressure rule. The first two commits only act on the host-pressure rule. The card's rule still hit the `host_idle`/`unmapped_only` gate (#3272), so every look walked the whole list and freed almost nothing. dea4b48 fixes that gate and applies the look budget to the card's rule as well. ## My runs, same minigame as in #3512 RTX 4070 Ti SUPER, Ryzen 7 7700, 32 GB, Series X 1440p, DLSS Quality, frame generation 4x, ray tracing off, release builds. One log line per second: | | Before (main) | Commits 1–2, first 13 min | Commits 1–2, after the card filled up | |---|---:|---:|---:| | Rendered fps (average) | 12.1 | **24.4** | 17.8 | | Seconds with a frame over 300 ms | 57 % | **2 %** | 18 % | | Seconds with a frame over 150 ms | 93 % | 59 % | 85 % | | Longest frame | 1,154 ms | 620 ms | 1,196 ms | The relapse came when the card went from 11.7 to 13.3 GB of its 15.3 GB budget. At that point looks took 60–75 ms again, which matches your 90998501 run. **With all three commits, I played the minigame again on my second PC and checked the logs: the stall did not come back, including past the point where it used to.** Before (main), in the minigame: ```text 23:53:26 INFO victory_gpu::frame_times: frame times: 9 frames, median 45.1 ms, p95 638.8, p99 638.8, longest 638.8; 2 over 50 ms, 1 over 100 ms 23:53:27 INFO victory_gpu::frame_times: frame times: 9 frames, median 44.5 ms, p95 652.8, p99 652.8, longest 652.8; 1 over 50 ms, 1 over 100 ms 23:53:28 INFO victory_gpu::frame_times: frame times: 10 frames, median 45.4 ms, p95 627.0, p99 627.0, longest 627.0; 2 over 50 ms, 1 over 100 ms ``` With this PR (commits 1–2), in the minigame: ```text 05:06:10 INFO victory_gpu::frame_times: frame times: 22 frames, median 37.9 ms, p95 51.3, p99 166.3, longest 166.3; 2 over 50 ms, 1 over 100 ms 05:06:11 INFO victory_gpu::frame_times: frame times: 26 frames, median 37.6 ms, p95 46.0, p99 48.3, longest 48.3; 0 over 50 ms, 0 over 100 ms 05:06:12 INFO victory_gpu::frame_times: frame times: 23 frames, median 37.6 ms, p95 49.2, p99 153.1, longest 153.1; 1 over 50 ms, 1 over 100 ms ``` For the rerun in the minigame, a diagnostics build would be ideal: the "host memory reclamation" line now gives copies made again, copies protected and looks cut short, so we would see which rule is acting on your card.
Author
Owner

@⁠dyshay on GitHub · 2026-11-30 05:50 UTC · original

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.

**@⁠dyshay** on GitHub · 2026-11-30 05:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7270048896) Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. A run on an RTX 4090 is queued (Series S with ray tracing, DLSS Quality). Frame times will follow here.
Author
Owner

@⁠mia03ther on GitHub · 2026-11-30 11:10 UTC · original

Adding a v2026.11.29.05 16 GB RAM data point (#3909) showing why texture/memory-pressure PRs like this matter even when VRAM stays under budget:

  • Hardware / Settings: Ryzen 9 8940HX, RTX 5070 Ti Laptop (12 GB), 16 GB RAM (36–48 GB pagefile), Win11 26300, Series S 540p, DLSS Performance, FG off, VICTORY_TEXTURE_ROOM_PERCENT=78, VICTORY_SLOT_EVICT_PERCENT=80, VICTORY_SLOT_EVICT_LOW_PERCENT=70.
  • Observed: VRAM stayed under budget (8,650–8,856 / 10,818 MB) with 0 pipeline failures or crashes across 10,933 frames, yet private commit hit 20.6–21.0 GB with only 5,494–5,863 MB resident (487–790 MB free RAM). Even after preload (early=3676), 694/10,933 frames exceeded 100 ms (longest 4,295.9 ms) and VICTORY_THIN / land guards swung between 259 ms and 617.8 ms under memory pressure. Hoping to see #3681 land in .06!
**@⁠mia03ther** on GitHub · 2026-11-30 11:10 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7276653251) Adding a `v2026.11.29.05` 16 GB RAM data point (#3909) showing why texture/memory-pressure PRs like this matter even when VRAM stays under budget: - **Hardware / Settings:** Ryzen 9 8940HX, RTX 5070 Ti Laptop (12 GB), 16 GB RAM (`36–48 GB` pagefile), Win11 26300, Series S 540p, DLSS Performance, FG off, `VICTORY_TEXTURE_ROOM_PERCENT=78`, `VICTORY_SLOT_EVICT_PERCENT=80`, `VICTORY_SLOT_EVICT_LOW_PERCENT=70`. - **Observed:** VRAM stayed under budget (`8,650–8,856 / 10,818 MB`) with `0` pipeline failures or crashes across 10,933 frames, **yet** private commit hit `20.6–21.0 GB` with only `5,494–5,863 MB` resident (`487–790 MB` free RAM). Even after preload (`early=3676`), 694/10,933 frames exceeded 100 ms (`longest 4,295.9 ms`) and `VICTORY_THIN` / `land` guards swung between `259 ms` and `617.8 ms` under memory pressure. Hoping to see #3681 land in `.06`!
Author
Owner

@⁠saltdam36 on GitHub · 2026-11-30 19:43 UTC · original

Reran at 66fe197 on the RX 7800 XT 16 GB (Ryzen 7 7800X3D, 32 GB, Series S, AMD FSR upscaler 720p→1080p, no frame generation): the port's main at 84bd61e2 with #1236, #2764 and this PR merged, VICTORY_HOST_TEXTURE_SWEEP=1, defaults otherwise. Host memory pressure was reported from the first minute in the world.

seconds median fps longest frame in a typical second seconds with a frame over 300 ms
console minigame, first game 174 35 55 ms 4.6 %
console minigame, second game 115 30 64 ms 13.9 %
open world, city 489 26 71 ms 5.5 %

The once-a-second stall is gone in all three. At 90998501 the open world had a ~280 ms frame in 34–52 of every 57 seconds; here the remaining long frames coincide with new shaders being translated (the cache was a few minutes old, this base translates differently) and thin out as it fills.

Two limits: this is not a diagnostics build, so I have no "host memory reclamation" counts. And I have no valid before-run in the minigame: a second session with VICTORY_HOST_SWEEP_PROTECT=0 was just as smooth, but host memory pressure was never reported in it, so the rule did not act.

**@⁠saltdam36** on GitHub · 2026-11-30 19:43 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7289836432) Reran at 66fe197 on the RX 7800 XT 16 GB (Ryzen 7 7800X3D, 32 GB, Series S, AMD FSR upscaler 720p→1080p, no frame generation): the port's main at 84bd61e2 with #1236, #2764 and this PR merged, `VICTORY_HOST_TEXTURE_SWEEP=1`, defaults otherwise. Host memory pressure was reported from the first minute in the world. | | seconds | median fps | longest frame in a typical second | seconds with a frame over 300 ms | |---|---|---|---|---| | console minigame, first game | 174 | 35 | 55 ms | 4.6 % | | console minigame, second game | 115 | 30 | 64 ms | 13.9 % | | open world, city | 489 | 26 | 71 ms | 5.5 % | The once-a-second stall is gone in all three. At 90998501 the open world had a ~280 ms frame in 34–52 of every 57 seconds; here the remaining long frames coincide with new shaders being translated (the cache was a few minutes old, this base translates differently) and thin out as it fills. Two limits: this is not a diagnostics build, so I have no "host memory reclamation" counts. And I have no valid before-run in the minigame: a second session with `VICTORY_HOST_SWEEP_PROTECT=0` was just as smooth, but host memory pressure was never reported in it, so the rule did not act.
Author
Owner

@⁠SmartIngenieriayDesarrollo on GitHub · 2026-12-01 02:22 UTC · original

An AMD measurement of this idea, ported to our tree as an opt-in switch.

Setup

  • Hardware: Ryzen 7 5700X3D at 3.0 GHz, single-channel DDR4-3200, RX 7800 XT, Windows 11, Series S 1.0.2.1.
  • Scene: the prologue's prison cell. About 3 GB of RAM is free, so the host sweep is active.
  • What we had before: the idle sweep walked the whole table once a second, about 20 ms per pass. That showed up as a spike every second.

Port. VICTORY_SWEEP_BUDGET=1 puts a time budget on each sweep pass (VICTORY_SWEEP_BUDGET_MS, default 4 ms). VICTORY_HOST_SWEEP_PROTECT=1 keeps the copies the title wants back soon, as this PR does.

In-run A/B. The switches are toggled every 4 s inside one run, in the same scene. 49 phases were used:

mean ms/frame median worst phase p90
SWEEP_BUDGET off 49.50 48.53 65.00
SWEEP_BUDGET on 48.58 48.52 62.53
diff −0.92 (−1.9 %) −0.02 −2.47

The median does not move, but the mean and the p90 do: the budget removes the once-a-second spike, which is what the PR targets.

HOST_SWEEP_PROTECT on its own was neutral in the cell (−0.24 ms). I expect it to matter more in the city, which I have not measured yet.

Thanks for the PR. It was the first one where we could see the sweep cost clearly.

— El_Santo

AI-assisted: yes

**@⁠SmartIngenieriayDesarrollo** on GitHub · 2026-12-01 02:22 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7298535985) An AMD measurement of this idea, ported to our tree as an opt-in switch. **Setup** - **Hardware:** Ryzen 7 5700X3D at 3.0 GHz, single-channel DDR4-3200, RX 7800 XT, Windows 11, Series S 1.0.2.1. - **Scene:** the prologue's prison cell. About 3 GB of RAM is free, so the host sweep is active. - **What we had before:** the idle sweep walked the whole table once a second, about 20 ms per pass. That showed up as a spike every second. **Port.** `VICTORY_SWEEP_BUDGET=1` puts a time budget on each sweep pass (`VICTORY_SWEEP_BUDGET_MS`, default 4 ms). `VICTORY_HOST_SWEEP_PROTECT=1` keeps the copies the title wants back soon, as this PR does. **In-run A/B.** The switches are toggled every 4 s inside one run, in the same scene. 49 phases were used: | | mean ms/frame | median | worst phase p90 | |---|---|---|---| | `SWEEP_BUDGET` off | 49.50 | 48.53 | 65.00 | | `SWEEP_BUDGET` on | 48.58 | 48.52 | 62.53 | | diff | **−0.92 (−1.9 %)** | −0.02 | **−2.47** | The median does not move, but the mean and the p90 do: the budget removes the once-a-second spike, which is what the PR targets. `HOST_SWEEP_PROTECT` on its own was neutral in the cell (−0.24 ms). I expect it to matter more in the city, which I have not measured yet. Thanks for the PR. It was the first one where we could see the sweep cost clearly. — El_Santo AI-assisted: yes
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:49 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3681#issuecomment-7321633150) 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.
github-bot closed this pull request 2026-12-01 18:58:03 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3681
No description provided.