Sweep: the parts after the texture sweep run in turn under a time budget, each part timed #3858

Closed
duckey-dev wants to merge 1 commit from upstream-pr/3858 into main
duckey-dev commented 2026-11-30 09:31:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T09:31:14Z.


What this does

The once-a-second sweep on the submission thread runs four things back to back: the host copies of textures (resource::let_go_idle), the windows and staging buffers, the dead render targets, and slot eviction. When each is costly (while streaming), the frame with the sweep in it pays for all of them.

With this PR:

  • The parts run in turn (VICTORY_SWEEP_SPREAD, on unless 0). The texture sweep runs at every sweep, as main bounds it. The other three run one after the other while VICTORY_SWEEP_BUDGET_MS (3) lasts from the sweep's start, at least one a sweep. A sweep the submission thread asks for and a flush (F7/F8) run all their parts at once. =0 is main's order exactly.
  • A timing line in the frame-rate report: each part's calls, time and longest, and the drain made for a sweep.

What it no longer does (1 Dec)

Earlier versions of this PR also bounded the texture sweep itself, the dead render targets' walk and slot eviction. @paales measured on an RTX 5070 Ti 16 GB (comments below) that the texture sweep's bounding released less per sweep, held about 300 MB more of the card and brought slot eviction forward by ten seconds, with textures gray after cuts; with it off (VICTORY_SWEEP_BOUNDED=0) the run matched the base. Main has since bounded let_go_idle itself and looks for slot-eviction victims on a thread of its own (VICTORY_SLOT_EVICT_ASIDE).

So those parts are removed (a7823981): VICTORY_SWEEP_BOUNDED, VICTORY_SLOT_EVICT_BOUNDED and VICTORY_SLOT_EVICT_BACKOFF_MS are gone, and @tyr0nsur's fix to the bounded slot eviction went with them. Main's let_go_idle, dead render targets and slot eviction are unchanged apart from being timed and callable in turn. One commit, 333 lines added against main.

Measurements

The figures this PR was opened with (frames over 100 ms from about 25 a run to 0-2 on an RX 7900 XTX) were measured with the removed bounding in and do not describe this version. The closest measurement so far is @paales' run of the earlier branch with VICTORY_SWEEP_BOUNDED=0: card use, slot eviction and textures made again all as the base, no gray textures in captures every 250 ms. A measurement of this version itself is to come.

Checks

Both of CI's clippy runs add no warning over main (e1251c31) here. cargo test --workspace: no failure that main does not have on this machine (two, in list::thin and shader_cache, fail on main too).

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5562592645 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T09:31:14Z. --- ## What this does The once-a-second sweep on the submission thread runs four things back to back: the host copies of textures (`resource::let_go_idle`), the windows and staging buffers, the dead render targets, and slot eviction. When each is costly (while streaming), the frame with the sweep in it pays for all of them. With this PR: - **The parts run in turn** (`VICTORY_SWEEP_SPREAD`, on unless `0`). The texture sweep runs at every sweep, as main bounds it. The other three run one after the other while `VICTORY_SWEEP_BUDGET_MS` (3) lasts from the sweep's start, at least one a sweep. A sweep the submission thread asks for and a flush (F7/F8) run all their parts at once. `=0` is main's order exactly. - **A timing line** in the frame-rate report: each part's calls, time and longest, and the drain made for a sweep. ## What it no longer does (1 Dec) Earlier versions of this PR also bounded the texture sweep itself, the dead render targets' walk and slot eviction. @paales measured on an RTX 5070 Ti 16 GB (comments below) that the texture sweep's bounding released less per sweep, held about 300 MB more of the card and brought slot eviction forward by ten seconds, with textures gray after cuts; with it off (`VICTORY_SWEEP_BOUNDED=0`) the run matched the base. Main has since bounded `let_go_idle` itself and looks for slot-eviction victims on a thread of its own (`VICTORY_SLOT_EVICT_ASIDE`). So those parts are removed (a7823981): `VICTORY_SWEEP_BOUNDED`, `VICTORY_SLOT_EVICT_BOUNDED` and `VICTORY_SLOT_EVICT_BACKOFF_MS` are gone, and @tyr0nsur's fix to the bounded slot eviction went with them. Main's `let_go_idle`, dead render targets and slot eviction are unchanged apart from being timed and callable in turn. One commit, 333 lines added against main. ## Measurements The figures this PR was opened with (frames over 100 ms from about 25 a run to 0-2 on an RX 7900 XTX) were measured with the removed bounding in and do not describe this version. The closest measurement so far is @paales' run of the earlier branch with `VICTORY_SWEEP_BOUNDED=0`: card use, slot eviction and textures made again all as the base, no gray textures in captures every 250 ms. A measurement of this version itself is to come. ## Checks Both of CI's clippy runs add no warning over main (e1251c31) here. `cargo test --workspace`: no failure that main does not have on this machine (two, in `list::thin` and `shader_cache`, fail on main too). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
tyr0nsur commented 2026-11-30 09:49:19 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T09:49:19Z.


A deadline cut can look like a complete empty pass and trigger the 30-second rest. The table cursor can wrap before the candidate loop runs. If the first candidate became active again and the deadline cuts the loop before the next one, PASS_WHOLE and went == 0 can still arm backoff. The same mistake occurs if an earlier window was cut and the final window had no candidates.

Follow-up 063d3d9 records a cut across windows and only arms the rest when the attempts finished. The bounded path also counts bytes actually released. It can move past a renewed candidate to the next oldest while there is time, with the existing deadline and cap. The unbounded path still uses the preselected candidate set.

A deterministic regression failed on the old pass accounting. It now covers both an earlier window cut and a final window cut, plus the complete empty-pass control. A second test exercises a failed first candidate, an expired deadline, and progress when the next attempt has time. The targeted sweeping and resource diagnostics suite passed on Windows (58 passed, 1 ignored), as did staged asset policy. Gameplay frame pacing remains to be measured.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7274731497 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7274731497). Originally posted by [tyr0nsur](https://github.com/tyr0nsur) on 2026-11-30T09:49:19Z. --- A deadline cut can look like a complete empty pass and trigger the 30-second rest. The table cursor can wrap before the candidate loop runs. If the first candidate became active again and the deadline cuts the loop before the next one, `PASS_WHOLE` and `went == 0` can still arm backoff. The same mistake occurs if an earlier window was cut and the final window had no candidates. [Follow-up 063d3d9](https://github.com/tyr0nsur/VIctory-NVIDIA/commit/063d3d94e9c53135c502418d6a93ad4df2db5aaa) records a cut across windows and only arms the rest when the attempts finished. The bounded path also counts bytes actually released. It can move past a renewed candidate to the next oldest while there is time, with the existing deadline and cap. The unbounded path still uses the preselected candidate set. A deterministic regression failed on the old pass accounting. It now covers both an earlier window cut and a final window cut, plus the complete empty-pass control. A second test exercises a failed first candidate, an expired deadline, and progress when the next attempt has time. The targeted sweeping and resource diagnostics suite passed on Windows (58 passed, 1 ignored), as did staged asset policy. Gameplay frame pacing remains to be measured.
duckey-dev commented 2026-11-30 10:41:23 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T10:41:23Z.


@tyr0nsur You're right, thank you. The rest was armed on "the walk wrapped, the pass began at the table's start, nothing went", and the letting-go loop stops at the deadline after its first candidate. So a window whose first candidate was in use again, cut before the second, read as a whole pass that let nothing go, and slot eviction rested for 30 s with candidates never tried. The same holds when an earlier window was cut, as you say.

I read 063d3d9 and ran it on Windows on top of this branch: the sweeping tests (15, with your two), the resource tests, and both of CI's clippy runs, which add no warning over main. I've added it to this PR's branch as your commit, unchanged. Its move from the preselected oldest-covering set to "oldest first until the bytes actually released meet the need" on the bounded path is a behaviour change I agree with: a renewed candidate no longer uses up the allowance.

Not measured in the game on my side yet either; I'll say here when it is.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7275942175 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7275942175). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T10:41:23Z. --- @tyr0nsur You're right, thank you. The rest was armed on "the walk wrapped, the pass began at the table's start, nothing went", and the letting-go loop stops at the deadline after its first candidate. So a window whose first candidate was in use again, cut before the second, read as a whole pass that let nothing go, and slot eviction rested for 30 s with candidates never tried. The same holds when an earlier window was cut, as you say. I read 063d3d9 and ran it on Windows on top of this branch: the sweeping tests (15, with your two), the resource tests, and both of CI's clippy runs, which add no warning over main. I've added it to this PR's branch as your commit, unchanged. Its move from the preselected oldest-covering set to "oldest first until the bytes actually released meet the need" on the bounded path is a behaviour change I agree with: a renewed candidate no longer uses up the allowance. Not measured in the game on my side yet either; I'll say here when it is.
ColorC commented 2026-11-30 11:53:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ColorC on 2026-11-30T11:53:42Z.


Disclosure: This cross-validation benchmark and comment were executed and posted by an AI agent on real hardware (RTX 5070 Ti 16 GB Blackwell + Ryzen 7 9800X3D, Win11 26200, ReBAR ON). No game screenshots are included; telemetry only.

Open-World Walking Cross-Validation on RTX 5070 Ti (VICTORY_HW_RT=1, 1440p DLSS Quality + 3x MFG)

Merged PR #3858 (default VICTORY_SWEEP_BUDGET_MS=3) into our HWRT build and ran a 4-minute open-world streaming walk + 6-scene multi-time-of-day teleport stress test (Noon / Sunset / Night / Misty Dawn; 0 crashes):

Metric (victory_gpu::sweeping & frame_times) Before #3858 (4-min HWRT Walk) With #3858 (VICTORY_SWEEP_BUDGET_MS=3) Delta
Max single sweep duration 48.2 ms 1.9 ms (steady walk) -46.3 ms (-96%)
Frames > 100 ms (4-min walk) 38 7 (4 of 7 were first-time cold shader compiles) -82%
P95 frame time (4-min walk) 70.0 ms 49.4 ms -20.6 ms
1% Low (P99) frame time (4-min walk) - 53.3 ms (18.8 fps) Clean
6-Scene Multi-Time Stress (Sunset / Noon / Vice City Noon / Misty Dawn) - >100 ms = 0 on all 4 steady scenes Zero sweep stalls

Note on edge cases: Under very heavy VICTORY_CARD_METER_PIPELINES=1 + VICTORY_SUBMIT_FRAMES=2 telemetry runs, first / slot eviction parts still occasionally showed 5–19 ms sweeps while textures stayed strictly bounded at 1.7–2.1 ms (stopped at the budget), confirming the texture-sweep time budget works as designed and eliminates the dominant streaming hitch source. Strong LGTM!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7277668411 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7277668411). Originally posted by [ColorC](https://github.com/ColorC) on 2026-11-30T11:53:42Z. --- > **Disclosure:** This cross-validation benchmark and comment were executed and posted by an AI agent on real hardware (RTX 5070 Ti 16 GB Blackwell + Ryzen 7 9800X3D, Win11 26200, ReBAR ON). No game screenshots are included; telemetry only. ### Open-World Walking Cross-Validation on RTX 5070 Ti (`VICTORY_HW_RT=1`, 1440p DLSS Quality + 3x MFG) Merged PR #3858 (default `VICTORY_SWEEP_BUDGET_MS=3`) into our HWRT build and ran a 4-minute open-world streaming walk + 6-scene multi-time-of-day teleport stress test (Noon / Sunset / Night / Misty Dawn; 0 crashes): | Metric (`victory_gpu::sweeping` & `frame_times`) | Before #3858 (4-min HWRT Walk) | With #3858 (`VICTORY_SWEEP_BUDGET_MS=3`) | Delta | |---|---:|---:|---:| | **Max single sweep duration** | **48.2 ms** | **1.9 ms** (steady walk) | **-46.3 ms (-96%)** | | **Frames `> 100 ms`** (4-min walk) | **38** | **7** (4 of 7 were first-time cold shader compiles) | **-82%** | | **P95 frame time** (4-min walk) | 70.0 ms | **49.4 ms** | **-20.6 ms** | | **1% Low (P99) frame time** (4-min walk) | - | **53.3 ms (18.8 fps)** | Clean | | **6-Scene Multi-Time Stress (Sunset / Noon / Vice City Noon / Misty Dawn)** | - | **`>100 ms = 0`** on all 4 steady scenes | Zero sweep stalls | **Note on edge cases:** Under very heavy `VICTORY_CARD_METER_PIPELINES=1` + `VICTORY_SUBMIT_FRAMES=2` telemetry runs, `first` / `slot eviction` parts still occasionally showed `5–19 ms` sweeps while `textures` stayed strictly bounded at `1.7–2.1 ms` (`stopped at the budget`), confirming the texture-sweep time budget works as designed and eliminates the dominant streaming hitch source. Strong LGTM!
botto854 commented 2026-11-30 14:23:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by botto854 on 2026-11-30T14:23:35Z.


Same-binary A/B on a 32 GB machine, where the sweep's cost turns out to sit mostly outside the bounded parts.

Setup: i9-14900K (8P+16E), RTX 4090 24 GB, 32 GB RAM (the layer treats it as limited host RAM), Windows 11 Insider 26300, driver 617.14. Series X profile, DLAA, FG off, RT as play sets it, diagnostics build of v2026.11.29.05 + #2305 + this PR's three commits (incl. 063d3d9), warm shader/pipeline cache. Unattended scripts/bench.ps1 runs from one copied save (standing on a balcony: camera pans and a few steps back and forth, about 8,000–9,500 draws/frame), 30 s warm-up then 240 s measured. Both variants from the same binary, interleaved run by run (on, off, on, off …): "off" = VICTORY_SWEEP_BOUNDED=0, VICTORY_SLOT_EVICT_BOUNDED=0, VICTORY_SWEEP_SPREAD=0. Frame times from the frame log (every frame), not the 5-s lines.

runs median frame p95 p99 frames > 50 ms / min frames > 100 ms / min
this PR on (defaults) 5 44.8 ms 108.0 ms 143.0 ms (140–155) 433 80.0 (79.5–91.9)
off 4 46.0 ms 114.3 ms 155.7 ms (151–161) 446 95.6 (94.6–96.4)

(Medians of the per-run figures, range in brackets. A fifth "off" run was lost to the #2393 SSE4a fault while loading, unrelated.) Every "on" run had fewer >100 ms frames than every "off" run, so the gain is real here, but it is about −16 % of the >100 ms frames and −8 % p99, not the near-zero reported above.

Why so much is left — the sweep's own timing lines (victory_gpu::sweeping) over all runs:

sweeps mean per sweep p95 longest max
on 1,414 30.8 ms 62.6 ms 90.4 ms
off 1,158 44.5 ms 89.9 ms 119.5 ms

The texture walk is held to its budget as designed (textures … longest 3.0, stopped at the budget), but on this machine the long sweeps are almost entirely the first part (residency refresh and, under pressure, the spare/idle trims, pool::room, memory_now) — e.g. first 1x longest 71.7 next to textures 1x longest 3.1. With 32 GB of RAM the layer enters host memory pressure about 30 s into the world and never leaves it (one WARN victory_gpu::residency per run, no way back; free physical memory median ~1 GB, minimum ~0.4 GB per the compile memory lines), so the pressure trims in first run at every sweep and are not under VICTORY_SWEEP_BUDGET_MS. Machines with 64 GB probably never take that branch, which may explain the difference to the 7900 XTX / 5070 Ti results.

I haven't profiled which call inside first it is yet; I'll add that here when I have it. Happy to run a build with finer timing of that part if useful.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7281300929 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7281300929). Originally posted by [botto854](https://github.com/botto854) on 2026-11-30T14:23:35Z. --- Same-binary A/B on a 32 GB machine, where the sweep's cost turns out to sit mostly outside the bounded parts. **Setup:** i9-14900K (8P+16E), RTX 4090 24 GB, **32 GB RAM** (the layer treats it as limited host RAM), Windows 11 Insider 26300, driver 617.14. Series X profile, DLAA, FG off, RT as `play` sets it, diagnostics build of v2026.11.29.05 + #2305 + this PR's three commits (incl. 063d3d9), warm shader/pipeline cache. Unattended `scripts/bench.ps1` runs from one copied save (standing on a balcony: camera pans and a few steps back and forth, about 8,000–9,500 draws/frame), 30 s warm-up then 240 s measured. Both variants from **the same binary**, interleaved run by run (on, off, on, off …): "off" = `VICTORY_SWEEP_BOUNDED=0`, `VICTORY_SLOT_EVICT_BOUNDED=0`, `VICTORY_SWEEP_SPREAD=0`. Frame times from the frame log (every frame), not the 5-s lines. | | runs | median frame | p95 | p99 | frames > 50 ms / min | frames > 100 ms / min | |---|---:|---:|---:|---:|---:|---:| | this PR on (defaults) | 5 | 44.8 ms | 108.0 ms | 143.0 ms (140–155) | 433 | **80.0** (79.5–91.9) | | off | 4 | 46.0 ms | 114.3 ms | 155.7 ms (151–161) | 446 | **95.6** (94.6–96.4) | (Medians of the per-run figures, range in brackets. A fifth "off" run was lost to the #2393 SSE4a fault while loading, unrelated.) Every "on" run had fewer >100 ms frames than every "off" run, so the gain is real here, but it is about **−16 % of the >100 ms frames and −8 % p99**, not the near-zero reported above. **Why so much is left — the sweep's own timing lines (`victory_gpu::sweeping`) over all runs:** | | sweeps | mean per sweep | p95 longest | max | |---|---:|---:|---:|---:| | on | 1,414 | 30.8 ms | 62.6 ms | 90.4 ms | | off | 1,158 | 44.5 ms | 89.9 ms | 119.5 ms | The texture walk is held to its budget as designed (`textures … longest 3.0, stopped at the budget`), but on this machine the long sweeps are almost entirely the **`first` part** (residency refresh and, under pressure, the spare/idle trims, `pool::room`, `memory_now`) — e.g. `first 1x longest 71.7` next to `textures 1x longest 3.1`. With 32 GB of RAM the layer enters `host memory pressure` about 30 s into the world and never leaves it (one `WARN victory_gpu::residency` per run, no way back; free physical memory median ~1 GB, minimum ~0.4 GB per the `compile memory` lines), so the pressure trims in `first` run at every sweep and are not under `VICTORY_SWEEP_BUDGET_MS`. Machines with 64 GB probably never take that branch, which may explain the difference to the 7900 XTX / 5070 Ti results. I haven't profiled which call inside `first` it is yet; I'll add that here when I have it. Happy to run a build with finer timing of that part if useful.
duckey-dev commented 2026-11-30 14:40:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T14:40:07Z.


@botto854 Thank you, this is the measurement the description was missing. Agreed on all of it: what this PR puts under VICTORY_SWEEP_BUDGET_MS is the texture walk, the dead render targets' pass and the slot eviction. The first part is only taken in turn with the others and timed; nothing inside it is bounded. My numbers come from a 64 GB machine that never enters host memory pressure, so the trims in first cost next to nothing there, and the "about 25 to 0-2" figure should be read as "on a machine without host memory pressure". On 32 GB your -16 % of frames over 100 ms is the honest size of it. I'll put that limit in the description.

Your finer timing of first would be very welcome (which of the residency refresh, the spare/idle trims, pool::room and memory_now holds the 70 ms). If it is the trims, the natural follow-up is to give them the same treatment as the other parts: a walk that goes on from where it stopped under the sweep's budget, in turn with the rest, with a flush still doing everything at once. I can write that as a separate PR, but I cannot reproduce the pressure here (64 GB), so it would rest on your A/B. If you would rather write it, the helpers are sweeping::walk and in_turn.

This branch also needs a rebase onto current main (conflicts in host.rs and resource.rs); I'll do that.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7281738887 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7281738887). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T14:40:07Z. --- @botto854 Thank you, this is the measurement the description was missing. Agreed on all of it: what this PR puts under `VICTORY_SWEEP_BUDGET_MS` is the texture walk, the dead render targets' pass and the slot eviction. The `first` part is only taken in turn with the others and timed; nothing inside it is bounded. My numbers come from a 64 GB machine that never enters host memory pressure, so the trims in `first` cost next to nothing there, and the "about 25 to 0-2" figure should be read as "on a machine without host memory pressure". On 32 GB your -16 % of frames over 100 ms is the honest size of it. I'll put that limit in the description. Your finer timing of `first` would be very welcome (which of the residency refresh, the spare/idle trims, `pool::room` and `memory_now` holds the 70 ms). If it is the trims, the natural follow-up is to give them the same treatment as the other parts: a walk that goes on from where it stopped under the sweep's budget, in turn with the rest, with a flush still doing everything at once. I can write that as a separate PR, but I cannot reproduce the pressure here (64 GB), so it would rest on your A/B. If you would rather write it, the helpers are `sweeping::walk` and `in_turn`. This branch also needs a rebase onto current main (conflicts in `host.rs` and `resource.rs`); I'll do that.
botto854 commented 2026-11-30 15:02:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by botto854 on 2026-11-30T15:02:27Z.


Timed each step of sweep() on v2026.11.30.01 (+ #2585, without this PR, so the whole sweep is one piece), same
14900K / 4090 / 32 GB, same route, two 4-minute runs. Sweeps over 5 ms are logged: 202 of 229 and 223 of 252,
all but one with pressured() true.

Total per sweep: median 25 / 24 ms, p95 55 / 53 ms, max 147 / 77 ms (run 1 / run 2).

step share of sweep time median p95 max
send::trim 31 / 40 % 6.0 / 6.8 27.6 / 32.9 42.9 / 48.1
resource::let_go_idle (end of sweep) 29 / 30 % 7.0 / 7.0 18.0 / 12.2 39.6 / 41.7
trim_spare_chunks 25 / 22 % 5.0 / 4.8 18.0 / 16.4 55.9 / 22.7
list::trim_idle 7 / 5 % 0 / 0 9.7 / 8.9 51.9 / 17.5
shadow::let_go_idle 6 / 1 % 0 / 0 6.2 / 0.9 111.7 / 5.0
texback::sweep_read_backs 2 / 2 % 0.2 / 0.3 2.1 / 2.1 3.9 / 6.0
residency::refresh, pool::room, memory_now, video_memory, trim_library, texture::let_go_idle ~0 % 0 ≤0.1 ≤3

(ms, run 1 / run 2; trim_spare_uploads, trim_spare_linear, trim_snapshot_pool, uav_spare never reached
0.1 ms. shadow::let_go_idle went over 20 ms in only 2 sweeps of run 1, none of run 2.)

So it's the trims, not refresh / room / memory_now. Within first, send::trim + trim_spare_chunks are ~80 % in both runs.

Two things I noticed reading them (not measured separately, so treat as hypotheses):

  • send::trim drops the Memory buffers (release of mapped upload resources) while holding SPARE, and
    send::memory() takes the same lock. trim_spare_chunks already drops outside its lock.
  • On 32 GB keeps_under_pressure() (8 GiB physical free) is never true, so every sweep cuts both pools to the
    16 MiB floor, and the next frames presumably allocate fresh send buffers / chunks again. That would be churn
    at 1 Hz rather than reclaiming idle memory. Using a low-water mark over the last few sweeps (only free what
    wasn't touched since) might fix the cost and the churn in one go.

Happy to A/B a follow-up on this box. If you'd rather I write it, say so, but you know the sweeping
module better, so I'd go with your version and test it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7282332870 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7282332870). Originally posted by [botto854](https://github.com/botto854) on 2026-11-30T15:02:27Z. --- Timed each step of `sweep()` on v2026.11.30.01 (+ #2585, without this PR, so the whole sweep is one piece), same 14900K / 4090 / 32 GB, same route, two 4-minute runs. Sweeps over 5 ms are logged: 202 of 229 and 223 of 252, all but one with `pressured()` true. Total per sweep: median 25 / 24 ms, p95 55 / 53 ms, max 147 / 77 ms (run 1 / run 2). | step | share of sweep time | median | p95 | max | |---|---:|---:|---:|---:| | `send::trim` | 31 / 40 % | 6.0 / 6.8 | 27.6 / 32.9 | 42.9 / 48.1 | | `resource::let_go_idle` (end of sweep) | 29 / 30 % | 7.0 / 7.0 | 18.0 / 12.2 | 39.6 / 41.7 | | `trim_spare_chunks` | 25 / 22 % | 5.0 / 4.8 | 18.0 / 16.4 | 55.9 / 22.7 | | `list::trim_idle` | 7 / 5 % | 0 / 0 | 9.7 / 8.9 | 51.9 / 17.5 | | `shadow::let_go_idle` | 6 / 1 % | 0 / 0 | 6.2 / 0.9 | 111.7 / 5.0 | | `texback::sweep_read_backs` | 2 / 2 % | 0.2 / 0.3 | 2.1 / 2.1 | 3.9 / 6.0 | | `residency::refresh`, `pool::room`, `memory_now`, `video_memory`, `trim_library`, `texture::let_go_idle` | ~0 % | 0 | ≤0.1 | ≤3 | (ms, run 1 / run 2; `trim_spare_uploads`, `trim_spare_linear`, `trim_snapshot_pool`, `uav_spare` never reached 0.1 ms. `shadow::let_go_idle` went over 20 ms in only 2 sweeps of run 1, none of run 2.) So it's the trims, not refresh / room / memory_now. Within `first`, `send::trim` + `trim_spare_chunks` are ~80 % in both runs. Two things I noticed reading them (not measured separately, so treat as hypotheses): - `send::trim` drops the `Memory` buffers (release of mapped upload resources) while holding `SPARE`, and `send::memory()` takes the same lock. `trim_spare_chunks` already drops outside its lock. - On 32 GB `keeps_under_pressure()` (8 GiB physical free) is never true, so every sweep cuts both pools to the 16 MiB floor, and the next frames presumably allocate fresh send buffers / chunks again. That would be churn at 1 Hz rather than reclaiming idle memory. Using a low-water mark over the last few sweeps (only free what wasn't touched since) might fix the cost and the churn in one go. Happy to A/B a follow-up on this box. If you'd rather I write it, say so, but you know the sweeping module better, so I'd go with your version and test it.
duckey-dev commented 2026-11-30 17:18:21 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T17:18:21Z.


@botto854 That settles where it is: send::trim and trim_spare_chunks are about two thirds of what this PR leaves, and let_go_idle is the third it already bounds. Thank you for the step timing.

Both of your readings look right to me from the code, and I'll take the follow-up; your A/B is the only measurement it can have, since a 64 GB machine never takes those branches. What I am writing, as a separate PR stacked on this one, each part behind its own switch (on, =0 as before) so you can A/B them one at a time:

  1. send::trim takes the buffers out under SPARE and releases them after the lock is let go, as trim_spare_chunks does.
  2. A low-water rule for the two pools: under pressure a sweep frees only what was never taken since the last few sweeps, down to the existing floor, where today it cuts to the floor every second and the next frames make the buffers again. #3482 and #3381 went the same way for the spare pools; I'll build on them and say so.
  3. The trims of first under the sweep's budget and in turn with the other parts (a flush still does all of it at once), and each of them timed in the sweep's line, so the split you measured by hand shows in every log.

I'll post here when the branch is up. The rebase of this PR onto current main is done locally (main merged another bounding of let_go_idle in the meantime, so this now sits on top of that); I'm measuring it in the game once more before I push it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7286056862 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7286056862). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T17:18:21Z. --- @botto854 That settles where it is: `send::trim` and `trim_spare_chunks` are about two thirds of what this PR leaves, and `let_go_idle` is the third it already bounds. Thank you for the step timing. Both of your readings look right to me from the code, and I'll take the follow-up; your A/B is the only measurement it can have, since a 64 GB machine never takes those branches. What I am writing, as a separate PR stacked on this one, each part behind its own switch (on, `=0` as before) so you can A/B them one at a time: 1. `send::trim` takes the buffers out under `SPARE` and releases them after the lock is let go, as `trim_spare_chunks` does. 2. A low-water rule for the two pools: under pressure a sweep frees only what was never taken since the last few sweeps, down to the existing floor, where today it cuts to the floor every second and the next frames make the buffers again. #3482 and #3381 went the same way for the spare pools; I'll build on them and say so. 3. The trims of `first` under the sweep's budget and in turn with the other parts (a flush still does all of it at once), and each of them timed in the sweep's line, so the split you measured by hand shows in every log. I'll post here when the branch is up. The rebase of this PR onto current main is done locally (main merged another bounding of `let_go_idle` in the meantime, so this now sits on top of that); I'm measuring it in the game once more before I push it.
botto854 commented 2026-11-30 17:31:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by botto854 on 2026-11-30T17:31:39Z.


Thanks, sounds good. One thing that changes the plan a bit: #3994 (Lyrnc) was merged into main at 16:28 UTC and
is in v2026.11.30.02. It already does your points 1 and 2 for the send spares (what the window used stays, the
rest is released on its own thread). On .30.02 send::trim is gone from the sweep here (0 %, max 0.3 ms).

What is left of first is trim_spare_chunks, same pattern: on .30.02 it is 40-42 % of the sweep time,
and it frees a median of 62-70 MiB of chunks every sweep that the next frames make again.

I tried the low-water rule for the chunk pools only, on top of .30.02: under pressure (not critical) a pool
frees only what no list took since the last sweep (the existing Spare::low + trim_above(SPARE_FLOOR)),
critical commit still drops everything, plenty free still keeps SPARE_MOST; the freed chunks go to #3994's
freeing thread. Same 14900K / 4090 / 32 GB, same route, two runs each:

per sweep (ms) .30.02 + chunk low-water
whole sweep, median 17.4 / 15.7 11.2 / 11.2
whole sweep, p95 29.5 / 30.6 21.6 / 21.4
whole sweep, max 138 / 146 35 / 141 *
trim_spare_chunks median / p95 / max 5.6 / 17.9 / 132 0.0 / 6.3 / 13
of that, uav_pool::trim_uav_spare_pressure ~6 % of sweep all of what is left
chunks freed per sweep, median / p95 62-70 / 110 MiB 0 / 24 MiB
committed memory, mean 32.2 GB 32.2 GB

* one texback::sweep_read_backs spike of 132 ms, unrelated.

Frame times over those four runs are within noise (2 vs 2 is not enough to say more; the sweep runs once a
second, so I'd expect it in the long frames rather than the median). I'll run a proper interleaved 5×2 A/B
tomorrow.

So my suggestion: since #3994 covers the send side, I can open the chunk part as its own small PR (two
functions in host.rs, send::free_aside made generic so the chunks reuse #3994's thread, one unit test),
and you keep point 3 (the trims under the sweep's budget, timed in its line) in yours. Or, if you'd rather
have it all in one PR, take the diff from me and I'll A/B yours. Either way is fine.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7286444746 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7286444746). Originally posted by [botto854](https://github.com/botto854) on 2026-11-30T17:31:39Z. --- Thanks, sounds good. One thing that changes the plan a bit: #3994 (Lyrnc) was merged into main at 16:28 UTC and is in v2026.11.30.02. It already does your points 1 and 2 for the send spares (what the window used stays, the rest is released on its own thread). On .30.02 `send::trim` is gone from the sweep here (0 %, max 0.3 ms). What is left of `first` is `trim_spare_chunks`, same pattern: on .30.02 it is 40-42 % of the sweep time, and it frees a median of 62-70 MiB of chunks every sweep that the next frames make again. I tried the low-water rule for the chunk pools only, on top of .30.02: under pressure (not critical) a pool frees only what no list took since the last sweep (the existing `Spare::low` + `trim_above(SPARE_FLOOR)`), critical commit still drops everything, plenty free still keeps `SPARE_MOST`; the freed chunks go to #3994's freeing thread. Same 14900K / 4090 / 32 GB, same route, two runs each: | per sweep (ms) | .30.02 | + chunk low-water | |---|---:|---:| | whole sweep, median | 17.4 / 15.7 | 11.2 / 11.2 | | whole sweep, p95 | 29.5 / 30.6 | 21.6 / 21.4 | | whole sweep, max | 138 / 146 | 35 / 141 * | | `trim_spare_chunks` median / p95 / max | 5.6 / 17.9 / 132 | 0.0 / 6.3 / 13 | | of that, `uav_pool::trim_uav_spare_pressure` | ~6 % of sweep | all of what is left | | chunks freed per sweep, median / p95 | 62-70 / 110 MiB | 0 / 24 MiB | | committed memory, mean | 32.2 GB | 32.2 GB | \* one `texback::sweep_read_backs` spike of 132 ms, unrelated. Frame times over those four runs are within noise (2 vs 2 is not enough to say more; the sweep runs once a second, so I'd expect it in the long frames rather than the median). I'll run a proper interleaved 5×2 A/B tomorrow. So my suggestion: since #3994 covers the send side, I can open the chunk part as its own small PR (two functions in `host.rs`, `send::free_aside` made generic so the chunks reuse #3994's thread, one unit test), and you keep point 3 (the trims under the sweep's budget, timed in its line) in yours. Or, if you'd rather have it all in one PR, take the diff from me and I'll A/B yours. Either way is fine.
tillo88 commented 2026-11-30 17:58:52 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tillo88 on 2026-11-30T17:58:52Z.


Replay bench: #3858 merged on top of v2026.11.29.05, 2 measured runs, against 19 runs of the same release without it.

One of the two runs ended at +2:12, just before the prison -> plane cut, with the device lost:
relay: the device was lost before fence value 99542 was reached ... device removed: ... (0x887A0006).
This is the known #2237 crash family at that cut (the release alone ended there or ~20 s later in 14 of 43 runs, device loss included), so I don't attribute it to this PR.

The other run:

fps submitting thread ms refreshes ms p95 ms p99 ms
v2026.11.29.05, 19 runs (mean) 29.42 31.43 8.21 57.4 138.8
v2026.11.29.05, range 27.79-30.56 30.60-32.65 7.83-8.54 53.7-63.4 130.9-148.7
#3858, 1 run 30.19 30.39 8.38 58.7 114.8

The fps is inside the base's range (run-to-run sd 0.69 fps, about 2.3%), so one run shows no measurable fps difference. Its p99 (114.8 ms) is below every one of the 19 base runs, which fits what the PR aims at (the long sweep frames), but it is a single run and I would not draw a conclusion from it. This route is a cutscene-heavy start of the game, not an open-world walk.

Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X 1440p, DLSS Quality, frame generation off, ray tracing off. Route: the same save restored before each run, prison cutscene, plane cutscene, first boat section (about 6 minutes).

Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7287134713 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7287134713). Originally posted by [tillo88](https://github.com/tillo88) on 2026-11-30T17:58:52Z. --- Replay bench: #3858 merged on top of v2026.11.29.05, 2 measured runs, against 19 runs of the same release without it. One of the two runs ended at +2:12, just before the prison -> plane cut, with the device lost: `relay: the device was lost before fence value 99542 was reached ... device removed: ... (0x887A0006)`. This is the known #2237 crash family at that cut (the release alone ended there or ~20 s later in 14 of 43 runs, device loss included), so I don't attribute it to this PR. The other run: | | fps | submitting thread ms | refreshes ms | p95 ms | p99 ms | |---|---:|---:|---:|---:|---:| | v2026.11.29.05, 19 runs (mean) | 29.42 | 31.43 | 8.21 | 57.4 | 138.8 | | v2026.11.29.05, range | 27.79-30.56 | 30.60-32.65 | 7.83-8.54 | 53.7-63.4 | 130.9-148.7 | | #3858, 1 run | 30.19 | 30.39 | 8.38 | 58.7 | 114.8 | The fps is inside the base's range (run-to-run sd 0.69 fps, about 2.3%), so one run shows no measurable fps difference. Its p99 (114.8 ms) is below every one of the 19 base runs, which fits what the PR aims at (the long sweep frames), but it is a single run and I would not draw a conclusion from it. This route is a cutscene-heavy start of the game, not an open-world walk. Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X 1440p, DLSS Quality, frame generation off, ray tracing off. Route: the same save restored before each run, prison cutscene, plane cutscene, first boat section (about 6 minutes). Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
hasekenmustafa-ctrl commented 2026-11-30 18:26:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by hasekenmustafa-ctrl on 2026-11-30T18:26:42Z.


Another walking A/B in support of this PR, plus one sweep cost it doesn't cover.

Setup. RTX 5080 16 GB, Ryzen 7 9800X3D, 31 GB RAM (system-managed pagefile, so the layer runs under host-memory pressure the whole time), Windows 11 26200. Series X profile, 1440p DLSS Quality, frame generation and ray tracing off, release build. Same save and auto-driven start, a 30 s settle, then the same scripted 240 s zigzag walk; stats from the frame_times lines inside the walk.

The build is a fork build (palmlight, based on VIctory-NVIDIA 923e38c), not this PR. It carries an independent fix of the same stall. Mechanically it's close to yours:

  • the sweep's parts in turn, one every 1/7 s;
  • the texture age scan in windows of 16,384 with a 2 ms budget per look;
  • slot_evict every 5 s with 5 s worth of bytes;
  • what the sweep releases under pressure dropped on a thread of its own.

Old = the same binary with all of it switched off. 3+3 runs:

frames over 50 ms per 1,000 over 100 ms longest mean p99 median fps
old 78.3 / 49.4 / 20.5 20 / 1 / 6 427 / 100 / 546 ms 72 / 58 / 56 24.1 / 25.9 / 28.1
bounded 14.4 / 8.8 / 11.0 1 / 0 / 0 113 / 83 / 82 ms 50 / 46 / 48 26.4 / 31.1 / 26.4

The bounded run at 31.1 fps had about half the draws, so it isn't comparable on fps.

The sweep's parts timed one by one (old):

part each sweep longest
resource::let_go_idle 12–24 ms (growing with play) 51 ms
slot_evict inside it 17–21 ms (let nothing go) 43 ms
residency + spare trims 4.6 ms 45 ms
pool::room — 84 ms

So the same picture as @botto854's on a 32 GB machine.

One part not covered here or by #3994: pool::room's block release. When the spare limit drops under pressure, Pool::reclaim sets *block = None on empty 64 MiB heaps on the submitting thread. The driver's release of one took up to 84 ms in our walks. Dropping those blocks on a release thread, the same way #3994 does for the send spares, took that part to 0.03 ms each (longest 0.8 ms) with no other change in behaviour. If that's useful, I can send it as a small separate PR so this one stays as it is; or @duckey-dev, fold it into your follow-up with trim_spare_chunks if you'd rather.

AI use: Claude Code (Claude Opus 5.5) ran the runs and wrote this comment for hasekenmustafa-ctrl, who approved posting it. Telemetry only, no game data.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7287858625 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7287858625). Originally posted by [hasekenmustafa-ctrl](https://github.com/hasekenmustafa-ctrl) on 2026-11-30T18:26:42Z. --- Another walking A/B in support of this PR, plus one sweep cost it doesn't cover. **Setup.** RTX 5080 16 GB, Ryzen 7 9800X3D, 31 GB RAM (system-managed pagefile, so the layer runs under host-memory pressure the whole time), Windows 11 26200. Series X profile, 1440p DLSS Quality, frame generation and ray tracing off, release build. Same save and auto-driven start, a 30 s settle, then the same scripted 240 s zigzag walk; stats from the `frame_times` lines inside the walk. The build is a fork build (palmlight, based on VIctory-NVIDIA 923e38c), not this PR. It carries an independent fix of the same stall. Mechanically it's close to yours: - the sweep's parts in turn, one every 1/7 s; - the texture age scan in windows of 16,384 with a 2 ms budget per look; - `slot_evict` every 5 s with 5 s worth of bytes; - what the sweep releases under pressure dropped on a thread of its own. Old = the same binary with all of it switched off. 3+3 runs: | | frames over 50 ms per 1,000 | over 100 ms | longest | mean p99 | median fps | |---|---|---|---|---|---| | old | 78.3 / 49.4 / 20.5 | 20 / 1 / 6 | 427 / 100 / 546 ms | 72 / 58 / 56 | 24.1 / 25.9 / 28.1 | | bounded | 14.4 / 8.8 / 11.0 | 1 / 0 / 0 | 113 / 83 / 82 ms | 50 / 46 / 48 | 26.4 / 31.1 / 26.4 | The bounded run at 31.1 fps had about half the draws, so it isn't comparable on fps. The sweep's parts timed one by one (old): | part | each sweep | longest | |---|---|---| | `resource::let_go_idle` | 12–24 ms (growing with play) | 51 ms | | `slot_evict` inside it | 17–21 ms (let nothing go) | 43 ms | | residency + spare trims | 4.6 ms | 45 ms | | `pool::room` | — | **84 ms** | So the same picture as @botto854's on a 32 GB machine. **One part not covered here or by #3994: `pool::room`'s block release.** When the spare limit drops under pressure, `Pool::reclaim` sets `*block = None` on empty 64 MiB heaps on the submitting thread. The driver's release of one took up to 84 ms in our walks. Dropping those blocks on a release thread, the same way #3994 does for the send spares, took that part to 0.03 ms each (longest 0.8 ms) with no other change in behaviour. If that's useful, I can send it as a small separate PR so this one stays as it is; or @duckey-dev, fold it into your follow-up with `trim_spare_chunks` if you'd rather. AI use: Claude Code (Claude Opus 5.5) ran the runs and wrote this comment for hasekenmustafa-ctrl, who approved posting it. Telemetry only, no game data.
duckey-dev commented 2026-11-30 18:36:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T18:36:14Z.


@tillo88 @hasekenmustafa-ctrl Thank you both.

@tillo88: agreed on reading one run as no more than a hint; a p99 under all 19 base runs fits where this PR works, and the device loss at the prison-to-plane cut is not on a path it touches (that cut loses the device on the release alone, as you say).

@hasekenmustafa-ctrl: an independent fix of the same stall landing on the same shape (parts in turn, the age scan in windows under a budget, slot eviction rested) and the same result (frames over 100 ms from 20 / 1 / 6 to 1 / 0 / 0) is good evidence for the approach, more than another run of mine would be. On pool::room's block release: please send it as its own small PR. It is a different mechanism (who releases, not how much is looked at), it stands without this PR, and it is measured on your machine, so it should be yours and reviewable by itself. My follow-up for the trims (send::trim released outside its lock, a low-water rule for the two spare pools, those trims under the sweep's budget and timed in its line) is written and stacked on this branch; I'll leave the empty blocks' release out of it so the two do not overlap, and mention yours in its text.

The rebase of this branch onto current main is in progress (main has moved under it twice today); I'll post when it is pushed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288094055 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7288094055). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T18:36:14Z. --- @tillo88 @hasekenmustafa-ctrl Thank you both. @tillo88: agreed on reading one run as no more than a hint; a p99 under all 19 base runs fits where this PR works, and the device loss at the prison-to-plane cut is not on a path it touches (that cut loses the device on the release alone, as you say). @hasekenmustafa-ctrl: an independent fix of the same stall landing on the same shape (parts in turn, the age scan in windows under a budget, slot eviction rested) and the same result (frames over 100 ms from 20 / 1 / 6 to 1 / 0 / 0) is good evidence for the approach, more than another run of mine would be. On `pool::room`'s block release: please send it as its own small PR. It is a different mechanism (who releases, not how much is looked at), it stands without this PR, and it is measured on your machine, so it should be yours and reviewable by itself. My follow-up for the trims (`send::trim` released outside its lock, a low-water rule for the two spare pools, those trims under the sweep's budget and timed in its line) is written and stacked on this branch; I'll leave the empty blocks' release out of it so the two do not overlap, and mention yours in its text. The rebase of this branch onto current main is in progress (main has moved under it twice today); I'll post when it is pushed.
duckey-dev commented 2026-11-30 19:10:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T19:10:18Z.


Rebased onto current main (e1251c31) and pushed; no conflicts now. Both of CI's clippy runs add no warning over main here, and cargo test --workspace has no failure that main does not have on this machine.

What changed in the rebase, because main moved under it twice today. The description above is out of date on these points and I'll correct it:

  • Slot eviction. Main now looks for victims on a thread of its own by default (VICTORY_SLOT_EVICT_ASIDE, the #3750 approach, which this PR's description already called the better one for that cost). So this PR's slot-eviction window, its rest (VICTORY_SLOT_EVICT_BOUNDED, VICTORY_SLOT_EVICT_BACKOFF_MS) and @tyr0nsur's fix act only with VICTORY_SLOT_EVICT_ASIDE=0; with the default, main's path runs unchanged and the part gives its turn on.
  • let_go_idle. Main has its own bounding now (a window and a 4 ms stop). With this PR's switch on, its window, deadline and held_until are used; with VICTORY_SWEEP_BOUNDED=0, main's bounding runs, where "=0" used to mean the unbounded walk.
  • Dead render targets. Main's new pass (superseded and slot-pinned targets too) is kept; this PR bounds only its walk of the table.
  • Unchanged: the parts in turn (VICTORY_SWEEP_SPREAD) and the timing line.

@botto854 a correction to what I wrote about the follow-up: main's rework of send.rs since your timing already releases what send::trim lets go outside the lock, on a thread of its own, and keeps what recent sweeps used. So that part of the follow-up fell away, and the 31-40 % you measured for send::trim predates it; it would be worth timing once more on current main before anything else. What is left in the follow-up is the low-water rule for the scratch chunks and the trims in turn under the budget, each timed in the sweep's line. It is rebased and passes the same checks; I'll open it once this one's shape is settled.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7288953812 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7288953812). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T19:10:18Z. --- Rebased onto current main (e1251c31) and pushed; no conflicts now. Both of CI's clippy runs add no warning over main here, and `cargo test --workspace` has no failure that main does not have on this machine. What changed in the rebase, because main moved under it twice today. The description above is out of date on these points and I'll correct it: - **Slot eviction.** Main now looks for victims on a thread of its own by default (`VICTORY_SLOT_EVICT_ASIDE`, the #3750 approach, which this PR's description already called the better one for that cost). So this PR's slot-eviction window, its rest (`VICTORY_SLOT_EVICT_BOUNDED`, `VICTORY_SLOT_EVICT_BACKOFF_MS`) and @tyr0nsur's fix act only with `VICTORY_SLOT_EVICT_ASIDE=0`; with the default, main's path runs unchanged and the part gives its turn on. - **`let_go_idle`.** Main has its own bounding now (a window and a 4 ms stop). With this PR's switch on, its window, deadline and `held_until` are used; with `VICTORY_SWEEP_BOUNDED=0`, main's bounding runs, where "=0" used to mean the unbounded walk. - **Dead render targets.** Main's new pass (superseded and slot-pinned targets too) is kept; this PR bounds only its walk of the table. - Unchanged: the parts in turn (`VICTORY_SWEEP_SPREAD`) and the timing line. @botto854 a correction to what I wrote about the follow-up: main's rework of `send.rs` since your timing already releases what `send::trim` lets go outside the lock, on a thread of its own, and keeps what recent sweeps used. So that part of the follow-up fell away, and the 31-40 % you measured for `send::trim` predates it; it would be worth timing once more on current main before anything else. What is left in the follow-up is the low-water rule for the scratch chunks and the trims in turn under the budget, each timed in the sweep's line. It is rebased and passes the same checks; I'll open it once this one's shape is settled.
mstrmoos commented 2026-11-30 19:22:39 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mstrmoos on 2026-11-30T19:22:39Z.


Picked onto our branch with #3753, #3756, #3760, #3881, #3832, #3858 and four that have since merged (#3818, #3850, #3874, #3871). #3760 needed a hand merge on top of the others.

All of victory-gpu's and victory-shader's tests passed. On the RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, Series X profile, same save and 90 s bench route each run, the frame median went from 40.4 to 39.1 ms for the whole set. I didn't measure the PRs one by one, so this is evidence of no regression rather than this PR's own gain. Screenshots looked clean.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7289291989 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7289291989). Originally posted by [mstrmoos](https://github.com/mstrmoos) on 2026-11-30T19:22:39Z. --- Picked onto our branch with #3753, #3756, #3760, #3881, #3832, #3858 and four that have since merged (#3818, #3850, #3874, #3871). #3760 needed a hand merge on top of the others. All of victory-gpu's and victory-shader's tests passed. On the RTX 5080 16 GB, Ryzen 7 9800X3D, Windows 11, Series X profile, same save and 90 s bench route each run, the frame median went from 40.4 to 39.1 ms for the whole set. I didn't measure the PRs one by one, so this is evidence of no regression rather than this PR's own gain. Screenshots looked clean.
paales commented 2026-11-30 20:51:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by paales on 2026-11-30T20:51:55Z.


Written by 🤖:

In-game numbers for this PR, in one combination. PC: RTX 5070 Ti 16 GB, Ryzen 9 5900X, 32 GB, Windows 11. Series X, 1440p, DLSS Performance, frame generation off. Each run: a new game (settings save, no story save), one A press, the first cutscene for 60 s from its first frame. On this PC the same build's submitting thread took 24 ms a frame in one run and 35 ms in another half an hour later, so only large differences count. 30 fps cap.

Base: main 84bd61e2 with #3918, #1727, #3553, #3043 and #4206. #3918 lets slot eviction start at the texture queue's line, and #3848 is in main. That combination may be what differs from your runs. One run each, first 60 s:

base with this PR
textures slot eviction let go 0 23,133
slots put to null and read again by a shader 0 2,577
textures picked by index, frames late on average (most) 0.53 (12) 2.24 (65)
seconds with a frame over 50 ms 19 23
seconds with a frame over 100 ms 2 4

On screen: textures gray or metallic for about a second after cuts (a white top looked silver). I did not take it into my build.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7291577760 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7291577760). Originally posted by [paales](https://github.com/paales) on 2026-11-30T20:51:55Z. --- _Written by 🤖:_ In-game numbers for this PR, in one combination. PC: RTX 5070 Ti 16 GB, Ryzen 9 5900X, 32 GB, Windows 11. Series X, 1440p, DLSS Performance, frame generation off. Each run: a new game (settings save, no story save), one A press, the first cutscene for 60 s from its first frame. On this PC the same build's submitting thread took 24 ms a frame in one run and 35 ms in another half an hour later, so only large differences count. 30 fps cap. Base: `main` 84bd61e2 with #3918, #1727, #3553, #3043 and #4206. #3918 lets slot eviction start at the texture queue's line, and #3848 is in `main`. That combination may be what differs from your runs. One run each, first 60 s: | | base | with this PR | | --- | --- | --- | | textures slot eviction let go | 0 | 23,133 | | slots put to null and read again by a shader | 0 | 2,577 | | textures picked by index, frames late on average (most) | 0.53 (12) | 2.24 (65) | | seconds with a frame over 50 ms | 19 | 23 | | seconds with a frame over 100 ms | 2 | 4 | On screen: textures gray or metallic for about a second after cuts (a white top looked silver). I did not take it into my build.
KruIN689 commented 2026-11-30 21:13:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by KruIN689 on 2026-11-30T21:13:55Z.


Datapoint for this PR from our fork. RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X3D, 47 GB, Windows 11. Series X, native 1440p, DLSS off, VICTORY_HW_RT=1.

Method: auto-driven roaming (walk and drive), 6 min per run, stats over the last 4 min. Three builds alternated in one session, 3 rounds each, so the session's luck (traffic, time of day) falls on all three alike:

build fps (3-run mean) frames over 50 ms per 1,000 mean p99 submitting thread
upstream main e1251c31 (+ #4247 switched off) 21.0 275 74.8 ms 40.6 ms
upstream main 84bd61e2 + our set 26.7 63 54.4 ms 31.5 ms
our older fork (829188e9 + fixes) 28.8 111 58.4 ms 30.7 ms

"Our set" adds these on top of upstream main:

  • the once-a-second sweep in seven parts, a seventh of a second apart, with the drops of spare buffers and empty blocks on their own thread (the same idea as this PR);
  • #3272's unmapped_only check;
  • #3063 / #3067 on by default;
  • VALU lowerings (#4233);
  • VICTORY_SUBMIT_SPLIT=1.

The set gave +5.7 fps and about 4× fewer frames over 50 ms against upstream main. I have not split that gain by change, so I can't say how much is the sweep. In earlier single-build tests the sweep spread alone took the sweep from 5.9 to 0.3 ms a frame after 15–20 min of play, and frames over 100 ms in the last 5 min from 193 to 68. It is the largest single piece of the set we measured.

Logs are available on request. (Measured and written with Claude Code, for KruIN689.)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7292103223 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7292103223). Originally posted by [KruIN689](https://github.com/KruIN689) on 2026-11-30T21:13:55Z. --- Datapoint for this PR from our fork. RTX 5080 16 GB (driver 621.40), Ryzen 9 9950X3D, 47 GB, Windows 11. Series X, native 1440p, DLSS off, `VICTORY_HW_RT=1`. Method: auto-driven roaming (walk and drive), 6 min per run, stats over the last 4 min. Three builds alternated in one session, 3 rounds each, so the session's luck (traffic, time of day) falls on all three alike: | build | fps (3-run mean) | frames over 50 ms per 1,000 | mean p99 | submitting thread | |---|---:|---:|---:|---:| | upstream main e1251c31 (+ #4247 switched off) | 21.0 | 275 | 74.8 ms | 40.6 ms | | upstream main 84bd61e2 + our set | 26.7 | 63 | 54.4 ms | 31.5 ms | | our older fork (829188e9 + fixes) | 28.8 | 111 | 58.4 ms | 30.7 ms | "Our set" adds these on top of upstream main: - the once-a-second sweep in seven parts, a seventh of a second apart, with the drops of spare buffers and empty blocks on their own thread (the same idea as this PR); - #3272's `unmapped_only` check; - #3063 / #3067 on by default; - VALU lowerings (#4233); - `VICTORY_SUBMIT_SPLIT=1`. The set gave +5.7 fps and about 4× fewer frames over 50 ms against upstream main. I have not split that gain by change, so I can't say how much is the sweep. In earlier single-build tests the sweep spread alone took the sweep from 5.9 to 0.3 ms a frame after 15–20 min of play, and frames over 100 ms in the last 5 min from 193 to 68. It is the largest single piece of the set we measured. Logs are available on request. (Measured and written with Claude Code, for KruIN689.)
duckey-dev commented 2026-11-30 21:17:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T21:17:27Z.


@paales Thank you for measuring this; the gray textures are a real regression and I'd rather know. I can't reproduce it on 24 GB with slot eviction off, so this is a reading of the code, not a measurement. With this PR's switch on, the idle-texture sweep looks for half of a 3 ms budget where main's own bound stops at 4 ms. It may release less per sweep, so the card's use crosses the line where slot eviction starts (with #3918 that is the queue's line), and eviction then takes textures in use. If you have the two logs: the card's use over the minute and the sweep's timing line would show it. A run with VICTORY_SWEEP_BOUNDED=0 (main's bounding, the parts still in turn) would separate the two halves. If that run is clean, I'll cut this PR down to the parts in turn and the timing line and leave the texture sweep's bounding to main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7292190378 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7292190378). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T21:17:27Z. --- @paales Thank you for measuring this; the gray textures are a real regression and I'd rather know. I can't reproduce it on 24 GB with slot eviction off, so this is a reading of the code, not a measurement. With this PR's switch on, the idle-texture sweep looks for half of a 3 ms budget where main's own bound stops at 4 ms. It may release less per sweep, so the card's use crosses the line where slot eviction starts (with #3918 that is the queue's line), and eviction then takes textures in use. If you have the two logs: the card's use over the minute and the sweep's timing line would show it. A run with `VICTORY_SWEEP_BOUNDED=0` (main's bounding, the parts still in turn) would separate the two halves. If that run is clean, I'll cut this PR down to the parts in turn and the timing line and leave the texture sweep's bounding to main.
paales commented 2026-11-30 21:44:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by paales on 2026-11-30T21:44:22Z.


Written by 🤖:

Thank you. The logs agree with your reading. Same PC and build as before (main 84bd61e2 with #3918, #1727, #3553, #3043 and #4206, then this PR), first cutscene, seconds from its first frame. The room is the texture queue's line: in use, minus free in texture blocks, plus kept for render targets, against the line after face headroom.

base, 40 s base, 55 s this PR, 43 s this PR, 48 s
in use (MB) 11,811 12,005 12,262 12,310
free in texture blocks (MB) 167 42 166 59
the room's sum (MB) 12,398 12,742 12,855 13,021
the line after face headroom (MB) 13,024 13,009 12,983 12,999
slot eviction none none none 11,006 textures (805 MB), 10,534 (997 MB) in the next second
  • With this PR, in use was 12,091 to 12,399 MB over the minute; in the base run 11,625 to 12,178 MB.
  • Your sweep's line, every second of the minute in both runs with this PR: one sweep of about 3.2 ms, its texture walk stopped at the 3 ms budget (2 stopped at the budget), about 1.5 to 3.0 ms in the texture part.
  • The first run with this PR had the same at 35 s: 13,233 MB against 13,193 MB, then 13,731 and 2,083 textures let go.
  • The base run of 60 s had no slot eviction. At 55 s it was 267 MB under the line, so the base build is near the line too in this scene.

So the textures in use cross the line by 22 to 40 MB, and slot eviction (with #3918, at the queue's line) then lets go of 1.1 to 1.8 GB. The second half is #3918's side; I look at that in #3918.

The run you asked for, VICTORY_SWEEP_BOUNDED=0 on the same build, and the base again, both 70 s:

base this PR, VICTORY_SWEEP_BOUNDED=0 this PR (the earlier run)
in use, 0 to 55 s (MB) 11,484 to 12,104 11,484 to 12,088 11,858 to 12,399
walks stopped at the time budget (no such line) none every sweep
first slot eviction 58 s 57 s 48 s
textures slot eviction let go 18,842 (1,358 MB) 16,221 (1,137 MB) 21,549 (1,720 MB)
made again (within 2 s) 155 (30) 161 (18) 1,581 (317)

With main's bounding the run is as the base: both cross the line after the scene change at about 51 s, and both let go of textures there. Captures every 250 ms of the VICTORY_SWEEP_BOUNDED=0 run show no gray textures from 56 s to 63 s. So the parts in turn and the timing line are clean in these runs, and the eviction at 57 s is not from this PR.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7292827296 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7292827296). Originally posted by [paales](https://github.com/paales) on 2026-11-30T21:44:22Z. --- _Written by 🤖:_ Thank you. The logs agree with your reading. Same PC and build as before (`main` 84bd61e2 with #3918, #1727, #3553, #3043 and #4206, then this PR), first cutscene, seconds from its first frame. The room is the texture queue's line: in use, minus free in texture blocks, plus kept for render targets, against the line after face headroom. | | base, 40 s | base, 55 s | this PR, 43 s | this PR, 48 s | | --- | --- | --- | --- | --- | | in use (MB) | 11,811 | 12,005 | 12,262 | 12,310 | | free in texture blocks (MB) | 167 | 42 | 166 | 59 | | the room's sum (MB) | 12,398 | 12,742 | 12,855 | 13,021 | | the line after face headroom (MB) | 13,024 | 13,009 | 12,983 | 12,999 | | slot eviction | none | none | none | 11,006 textures (805 MB), 10,534 (997 MB) in the next second | - With this PR, in use was 12,091 to 12,399 MB over the minute; in the base run 11,625 to 12,178 MB. - Your sweep's line, every second of the minute in both runs with this PR: one sweep of about 3.2 ms, its texture walk stopped at the 3 ms budget (`2 stopped at the budget`), about 1.5 to 3.0 ms in the texture part. - The first run with this PR had the same at 35 s: 13,233 MB against 13,193 MB, then 13,731 and 2,083 textures let go. - The base run of 60 s had no slot eviction. At 55 s it was 267 MB under the line, so the base build is near the line too in this scene. So the textures in use cross the line by 22 to 40 MB, and slot eviction (with #3918, at the queue's line) then lets go of 1.1 to 1.8 GB. The second half is #3918's side; I look at that in #3918. The run you asked for, `VICTORY_SWEEP_BOUNDED=0` on the same build, and the base again, both 70 s: | | base | this PR, `VICTORY_SWEEP_BOUNDED=0` | this PR (the earlier run) | | --- | --- | --- | --- | | in use, 0 to 55 s (MB) | 11,484 to 12,104 | 11,484 to 12,088 | 11,858 to 12,399 | | walks stopped at the time budget | (no such line) | none | every sweep | | first slot eviction | 58 s | 57 s | 48 s | | textures slot eviction let go | 18,842 (1,358 MB) | 16,221 (1,137 MB) | 21,549 (1,720 MB) | | made again (within 2 s) | 155 (30) | 161 (18) | 1,581 (317) | With main's bounding the run is as the base: both cross the line after the scene change at about 51 s, and both let go of textures there. Captures every 250 ms of the `VICTORY_SWEEP_BOUNDED=0` run show no gray textures from 56 s to 63 s. So the parts in turn and the timing line are clean in these runs, and the eviction at 57 s is not from this PR.
duckey-dev commented 2026-11-30 22:47:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-11-30T22:47:30Z.


@paales Thank you, that settles it. The texture sweep's bounding in this PR stopped at its budget on every sweep, released less, and brought slot eviction forward by ten seconds; with main's own bounding the run matches the base.

I've cut the PR down to what your VICTORY_SWEEP_BOUNDED=0 run showed clean (pushed, a7823981): the parts after the texture sweep taking turns under VICTORY_SWEEP_BUDGET_MS, and the sweep's timing line. let_go_idle, the dead render targets and slot eviction are main's code unchanged apart from being timed and callable in turn. VICTORY_SWEEP_BOUNDED, VICTORY_SLOT_EVICT_BOUNDED and VICTORY_SLOT_EVICT_BACKOFF_MS are gone. One commit, 333 lines added against main, where it was 984.

@tyr0nsur your fix applied to the bounded slot eviction, which is no longer in the PR, so the commit went with it. Thank you for it all the same.

One fix on the way: a texture flush (F7/F8) arriving during a sweep in turns skipped the dead render targets; it now runs every part at once.

The figures in the title and description were measured with the bounding in. I'll re-measure with this version before claiming a number for it, and correct the title and description now.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7294308345 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7294308345). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-11-30T22:47:30Z. --- @paales Thank you, that settles it. The texture sweep's bounding in this PR stopped at its budget on every sweep, released less, and brought slot eviction forward by ten seconds; with main's own bounding the run matches the base. I've cut the PR down to what your `VICTORY_SWEEP_BOUNDED=0` run showed clean (pushed, a7823981): the parts after the texture sweep taking turns under `VICTORY_SWEEP_BUDGET_MS`, and the sweep's timing line. `let_go_idle`, the dead render targets and slot eviction are main's code unchanged apart from being timed and callable in turn. `VICTORY_SWEEP_BOUNDED`, `VICTORY_SLOT_EVICT_BOUNDED` and `VICTORY_SLOT_EVICT_BACKOFF_MS` are gone. One commit, 333 lines added against main, where it was 984. @tyr0nsur your fix applied to the bounded slot eviction, which is no longer in the PR, so the commit went with it. Thank you for it all the same. One fix on the way: a texture flush (F7/F8) arriving during a sweep in turns skipped the dead render targets; it now runs every part at once. The figures in the title and description were measured with the bounding in. I'll re-measure with this version before claiming a number for it, and correct the title and description now.
botto854 commented 2026-12-01 11:17:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by botto854 on 2026-12-01T11:17:05Z.


The interleaved A/B I promised for the chunk low-water rule. Same 14900K / 4090 / 32 GB, Series X profile,
DLAA, frame generation off, diag builds; base v2026.11.30.02 (+ #2585), chunk rule on top (f9f20710).
Five runs each, interleaved with a third build in the same rounds, 30 s settle + 240 s scripted route:

.30.02 + chunk low-water
frame median, ms (range over runs) 39.3 (37.8-39.8) 39.3 (38.2-39.4)
p95, ms 67.2 66.4
p99, ms (range) 82.1 (81-85) 80.8 (79-85)
frames over 50 ms per minute 290.6 291.4
frames over 100 ms per minute (range) 8.24 (5.7-9.0) 8.24 (5.5-9.0)
submitting thread, ms 34.5 34.6

So on this PC the rule takes most of trim_spare_chunks out of the sweep (as in my earlier numbers), but it does not
show in frame times: every range overlaps, and five base runs alone spread by about �1 ms in the median and �2 ms in p99.
I'd read that as "no regression, no measurable frame-time gain here"; a PC that is shorter on memory may well differ.
Fine with it going into your follow-up as you planned.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7309427523 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7309427523). Originally posted by [botto854](https://github.com/botto854) on 2026-12-01T11:17:05Z. --- The interleaved A/B I promised for the chunk low-water rule. Same 14900K / 4090 / 32 GB, Series X profile, DLAA, frame generation off, diag builds; base v2026.11.30.02 (+ #2585), chunk rule on top (f9f20710). Five runs each, interleaved with a third build in the same rounds, 30 s settle + 240 s scripted route: | | .30.02 | + chunk low-water | |---|---:|---:| | frame median, ms (range over runs) | 39.3 (37.8-39.8) | 39.3 (38.2-39.4) | | p95, ms | 67.2 | 66.4 | | p99, ms (range) | 82.1 (81-85) | 80.8 (79-85) | | frames over 50 ms per minute | 290.6 | 291.4 | | frames over 100 ms per minute (range) | 8.24 (5.7-9.0) | 8.24 (5.5-9.0) | | submitting thread, ms | 34.5 | 34.6 | So on this PC the rule takes most of `trim_spare_chunks` out of the sweep (as in my earlier numbers), but it does not show in frame times: every range overlaps, and five base runs alone spread by about �1 ms in the median and �2 ms in p99. I'd read that as "no regression, no measurable frame-time gain here"; a PC that is shorter on memory may well differ. Fine with it going into your follow-up as you planned.
andrewpozdnakov7-jpg commented 2026-12-01 11:33:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T11:33:24Z.


I cherry-picked a7823981 onto current main 5fabb46e as 03349fa3d46e1d887ce398f4fe11f59cffcfb251. The stable patch ID and original author match, and the branch contains only the four sweep files. It retains the current version of the PR that uses main's texture sweep and slot-eviction logic.

On Windows/MSVC with Rust 1.98.1 the exact sweeping::tests::a_part_with_nothing_to_do_gives_its_turn_to_the_next case passed. That check builds the GPU crate and exercises the budget scheduler when one part has no work. The staged policy also passed. The next step is to adopt this commit here and measure this version in the game, as you noted in the description.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7309805582 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7309805582). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T11:33:24Z. --- I cherry-picked `a7823981` onto current `main` `5fabb46e` as [`03349fa3d46e1d887ce398f4fe11f59cffcfb251`](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/03349fa3d46e1d887ce398f4fe11f59cffcfb251). The stable patch ID and original author match, and the branch contains only the four sweep files. It retains the current version of the PR that uses main's texture sweep and slot-eviction logic. On Windows/MSVC with Rust 1.98.1 the exact `sweeping::tests::a_part_with_nothing_to_do_gives_its_turn_to_the_next` case passed. That check builds the GPU crate and exercises the budget scheduler when one part has no work. The staged policy also passed. The next step is to adopt this commit here and measure this version in the game, as you noted in the description. AI-assisted with OpenAI Codex.
tillo88 commented 2026-12-01 12:06:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tillo88 on 2026-12-01T12:06:55Z.


Re-measured the cut-down version (head a7823981, the sweep parts in turn plus the timing line) merged on top of v2026.11.30.03, against the bare release on the same bench and route. My earlier comment here was on the older, bounded version and v2026.11.29.05.

build runs fps (range) submitting thread ms refresh ms p95 ms p99 ms
v2026.11.30.03 15 32.02 (31.72–32.46) 20.51 6.42 47.7 62.7
+ #3858 2 31.89 (31.81–31.97) 20.46 6.33 47.4 64.8
  • Speed: −0.4% fps, inside the bench's run-to-run spread (base sd 0.19 fps): no measurable difference. p99 64.8 is the mean of 60.9 and 68.8; the base runs range 58.7–68.9.
  • The timing line appears about once a second (~225 sweeps per run). Per sweep: median 11.5 ms, longest 36 and 61 ms in the two runs. Summed over a whole run, by part: first 1.5–1.6 s, textures ~0.67 s, dead targets ~0.08 s, windows and slot eviction ~0.02 s each, pipelines and staging 0. drain for it appeared in ~130 sweeps per run, longest 39 and 58 ms. So on this route most of the sweep's time is in first and textures; the parts that take turns add little here.
  • Crash: the warm-up run stopped at +2:16 with a host command list did not close (0x80070057), one second after the masked twin [mesh 480d53fc48107a50, pixel f41ec9d9437c021c-mask] was made. That is the known prison → plane cut crash of #2237 (5 of 27 runs on the bare release), not something this PR adds. Both measured runs finished the route.

Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X 1440p, DLSS Quality, frame generation off, ray tracing off. Route: same save restored before each run (start of the game), prison cutscene, plane cutscene, first boat section, about 6 minutes; warm-up run not counted for speed.

Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7310670152 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7310670152). Originally posted by [tillo88](https://github.com/tillo88) on 2026-12-01T12:06:55Z. --- Re-measured the cut-down version (head a7823981, the sweep parts in turn plus the timing line) merged on top of v2026.11.30.03, against the bare release on the same bench and route. My earlier comment here was on the older, bounded version and v2026.11.29.05. | build | runs | fps (range) | submitting thread ms | refresh ms | p95 ms | p99 ms | |---|---|---|---|---|---|---| | v2026.11.30.03 | 15 | 32.02 (31.72–32.46) | 20.51 | 6.42 | 47.7 | 62.7 | | + #3858 | 2 | 31.89 (31.81–31.97) | 20.46 | 6.33 | 47.4 | 64.8 | - **Speed:** −0.4% fps, inside the bench's run-to-run spread (base sd 0.19 fps): no measurable difference. p99 64.8 is the mean of 60.9 and 68.8; the base runs range 58.7–68.9. - **The timing line appears** about once a second (~225 sweeps per run). Per sweep: median 11.5 ms, longest 36 and 61 ms in the two runs. Summed over a whole run, by part: `first` 1.5–1.6 s, `textures` ~0.67 s, `dead targets` ~0.08 s, `windows` and `slot eviction` ~0.02 s each, `pipelines` and `staging` 0. `drain for it` appeared in ~130 sweeps per run, longest 39 and 58 ms. So on this route most of the sweep's time is in `first` and `textures`; the parts that take turns add little here. - **Crash:** the warm-up run stopped at +2:16 with `a host command list did not close (0x80070057)`, one second after the masked twin `[mesh 480d53fc48107a50, pixel f41ec9d9437c021c-mask]` was made. That is the known prison → plane cut crash of #2237 (5 of 27 runs on the bare release), not something this PR adds. Both measured runs finished the route. Setup: Ryzen 7 9800X3D, RTX 5070 Ti 16 GB (driver 621.40), 32 GB RAM, Windows 11, release build, Series X 1440p, DLSS Quality, frame generation off, ray tracing off. Route: same save restored before each run (start of the game), prison cutscene, plane cutscene, first boat section, about 6 minutes; warm-up run not counted for speed. Measured unattended on a replay bench (same save, recorded controller input via VICTORY_INPUT_REPLAY); numbers and text prepared with Claude.
duckey-dev commented 2026-12-01 15:39:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by duckey-dev on 2026-12-01T15:39:28Z.


@tillo88 @botto854 Thank you both. Fifteen base runs against the cut-down version is a clear answer: on that route it makes no measurable difference to frame times, and the chunk rule doesn't either. So what this PR still offers is the timing line, which shows where the sweep's time goes (first and textures in your runs, neither of which this PR changes). I've removed the performance claim from the description already; if the maintainer would rather have the timing line alone, I'll cut it down to that. @andrewpozdnakov7-jpg thank you for carrying it onto current main and running the scheduler test. I'm rebasing this branch onto current main and will say here when it is pushed.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7316286578 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7316286578). Originally posted by [duckey-dev](https://github.com/duckey-dev) on 2026-12-01T15:39:28Z. --- @tillo88 @botto854 Thank you both. Fifteen base runs against the cut-down version is a clear answer: on that route it makes no measurable difference to frame times, and the chunk rule doesn't either. So what this PR still offers is the timing line, which shows where the sweep's time goes (`first` and `textures` in your runs, neither of which this PR changes). I've removed the performance claim from the description already; if the maintainer would rather have the timing line alone, I'll cut it down to that. @andrewpozdnakov7-jpg thank you for carrying it onto current main and running the scheduler test. I'm rebasing this branch onto current main and will say here when it is pushed.
trustno1-coder commented 2026-12-01 18:48:10 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:48:10Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321571960 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3858#issuecomment-7321571960). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:48:10Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

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