GPU: the look for idle textures in slices, the longest refreshes first #3578

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

@⁠BaRian29 on GitHub · 2026-11-30 01:20 UTC · original
BaRian29:pr/texture-sweep-slices → main · +335 −18 · 4 files · 4 commits · closed without merging

GPU: the look for idle textures in slices, the longest refreshes first

Branch: BaRian29:pr/texture-sweep-slices (one commit on main 41adb551)
Open: https://github.com/trustno1-coder/VIctory-NVIDIA/compare/main...BaRian29:VIctory-NVIDIA:pr/texture-sweep-slices

Summary

Two changes on the submitting thread (victory-submit), the thread the frame waits for when the CPU is the limit.

1. resource::let_go_idle runs in slices instead of one block a second.
Once a second, before a submission, the look for host copies of textures to let go walked its part of the texture table with that table's lock held. With the host under memory pressure most of that time went into VirtualQuery for textures that stay mapped and are asked about again at the next look. The frame line said 26-27 ms per look, the longest 59.6 ms, once a second: one late frame every second, and title threads that make or drop a texture waited behind the lock meanwhile.

Now both parts of the table (streamed-out copies, then idle ones) stop after VICTORY_SWEEP_SLICE_US (1,000 us by default, the clock read every 8 textures) and go on where they stopped at the next submission (let_go_idle_more). A resumed call only finishes what was left: it starts no part anew, and the rest of the look (by age, dead render targets, slot eviction, flushes) stays once a second. Letting go later keeps a copy a little longer, it never loses one.

2. Refreshes of copies are handed to the helper threads longest first.
refresh_front gives the spans to wide_each_scoped in list order, and the submitting thread waits for the last one to finish. A long span taken last kept it waiting alone. The spans are sorted by length, longest first (the classic LPT rule). They are independent (one span of one copy each, already run concurrently in any order).

Measurements

i5-14600KF (6P+8E), RTX 4070 Ti SUPER, 32 GB, Series S profile, DLSS Quality + FG, diagnostics build, 30 s sampling profiles of the same area, 2026-11-29/30:

before after
look for idle textures 26-27 ms each, longest 59.6 ms, once a second slices of ~1-3 ms
its share of victory-submit samples 4.1 % 2.3 %
victory-submit waiting for the last refresh 9.3 % of samples 7.7 %
victory-submit waiting samples overall 78 59
fps 20-25 20-25 (within run-to-run noise)

The gain is frame pacing (no hitch every second), not average fps: on this machine the copies of title memory (14-17 ms and 36-42 MB a frame) hold most of the preparing.

Switches

  • VICTORY_SWEEP_SLICE_US=0: the whole look at once, as before.
  • VICTORY_REFRESH_IN_ORDER=1: refreshes in list order, as before.

Testing

  • cargo clippy --workspace --all-targets --locked and the same with --all-features: no new warning. (main itself does not pass -D warnings right now: 5 and 4 errors in victory-shader and victory-loader. This branch has exactly the same set, 34 and 35 warnings in all.)
  • cargo test -p victory-gpu --lib -- --test-threads=1: 921 passed. The failures are also on main: shader_cache::tests::every_switch_of_the_translator_is_in_the_key (VICTORY_SCALAR_SPLITS is no longer read by the translator), plus the order-dependent card_steps::places_written_after_sending_are_learned.
  • New test refreshes_go_longest_first_and_none_is_lost. It sorts an array, not vectors: allocating there moved the heap under places_written_after_sending_are_learned, which finds pages another test marked when its memory lands at their address.
  • Several play sessions on the PC above, no crash.
**@⁠BaRian29** on GitHub · 2026-11-30 01:20 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578) `BaRian29:pr/texture-sweep-slices` → `main` · +335 −18 · 4 files · 4 commits · closed without merging # GPU: the look for idle textures in slices, the longest refreshes first **Branch:** `BaRian29:pr/texture-sweep-slices` (one commit on `main` 41adb551) **Open:** https://github.com/trustno1-coder/VIctory-NVIDIA/compare/main...BaRian29:VIctory-NVIDIA:pr/texture-sweep-slices ## Summary Two changes on the submitting thread (`victory-submit`), the thread the frame waits for when the CPU is the limit. **1. `resource::let_go_idle` runs in slices instead of one block a second.** Once a second, before a submission, the look for host copies of textures to let go walked its part of the texture table with that table's lock held. With the host under memory pressure most of that time went into `VirtualQuery` for textures that stay mapped and are asked about again at the next look. The frame line said **26-27 ms per look, the longest 59.6 ms**, once a second: one late frame every second, and title threads that make or drop a texture waited behind the lock meanwhile. Now both parts of the table (streamed-out copies, then idle ones) stop after `VICTORY_SWEEP_SLICE_US` (1,000 us by default, the clock read every 8 textures) and go on where they stopped at the next submission (`let_go_idle_more`). A resumed call only finishes what was left: it starts no part anew, and the rest of the look (by age, dead render targets, slot eviction, flushes) stays once a second. Letting go later keeps a copy a little longer, it never loses one. **2. Refreshes of copies are handed to the helper threads longest first.** `refresh_front` gives the spans to `wide_each_scoped` in list order, and the submitting thread waits for the last one to finish. A long span taken last kept it waiting alone. The spans are sorted by length, longest first (the classic LPT rule). They are independent (one span of one copy each, already run concurrently in any order). ## Measurements i5-14600KF (6P+8E), RTX 4070 Ti SUPER, 32 GB, Series S profile, DLSS Quality + FG, diagnostics build, 30 s sampling profiles of the same area, 2026-11-29/30: | | before | after | |---|---|---| | look for idle textures | 26-27 ms each, longest 59.6 ms, once a second | slices of ~1-3 ms | | its share of `victory-submit` samples | 4.1 % | 2.3 % | | `victory-submit` waiting for the last refresh | 9.3 % of samples | 7.7 % | | `victory-submit` waiting samples overall | 78 | 59 | | fps | 20-25 | 20-25 (within run-to-run noise) | The gain is frame pacing (no hitch every second), not average fps: on this machine the copies of title memory (14-17 ms and 36-42 MB a frame) hold most of the preparing. ## Switches - `VICTORY_SWEEP_SLICE_US=0`: the whole look at once, as before. - `VICTORY_REFRESH_IN_ORDER=1`: refreshes in list order, as before. ## Testing - `cargo clippy --workspace --all-targets --locked` and the same with `--all-features`: no new warning. (`main` itself does not pass `-D warnings` right now: 5 and 4 errors in `victory-shader` and `victory-loader`. This branch has exactly the same set, 34 and 35 warnings in all.) - `cargo test -p victory-gpu --lib -- --test-threads=1`: 921 passed. The failures are also on `main`: `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` (`VICTORY_SCALAR_SPLITS` is no longer read by the translator), plus the order-dependent `card_steps::places_written_after_sending_are_learned`. - New test `refreshes_go_longest_first_and_none_is_lost`. It sorts an array, not vectors: allocating there moved the heap under `places_written_after_sending_are_learned`, which finds pages another test marked when its memory lands at their address. - Several play sessions on the PC above, no crash.
The look for host copies of textures to let go ran once a second on the
submitting thread with the table of textures locked: 26-27 ms each, the
longest 59.6 ms, with the host under pressure (i5-14600KF, 32 GB,
2026-11-29), most of it in VirtualQuery for textures still mapped and asked
about again at every look. One late frame a second, and title threads that
make or let go a texture waited behind the lock.

- Its two parts of the table (streamed-out copies, then idle ones) stop
  after VICTORY_SWEEP_SLICE_US (1,000 µs; 0: no limit, as before), the
  clock read every 8 textures, and go on where they stopped at the next
  submission (let_go_idle_more), which begins no part anew: the rest of
  the look (by age, render targets, slot eviction, flushes) stays once a
  second. Letting go later keeps a copy longer, never loses one.
- The refreshes of copies are handed to the threads longest first, so a
  long one taken last no longer keeps the submitting thread waiting alone
  (VICTORY_REFRESH_IN_ORDER=1: as before).

Sampled in game for 30 s against the run before: the look went from 4.1 %
to 2.3 % of the submitting thread, in slices of about 3 ms instead of one
block of 27 ms; the wait for the last refresh from 9.3 % to 7.7 %, and the
thread's waits overall from 78 samples to 59. The frame rate stayed
within run-to-run noise (20-25 fps): the copies of title memory, 14-17 ms
and 36-42 MB a frame, hold most of the preparing.

The new test sorts an array, not vectors: allocating there moved the heap
under card_steps' places_written_after_sending_are_learned, which finds
pages another test marked when its memory lands at their address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 01:25:47 +00:00
Author
Owner

@⁠Yoruiopz on GitHub · 2026-11-30 07:31 UTC · original

I tested the idle-sweep slicing portion independently on an RTX 5070 Laptop GPU (8 GB), leaving refresh order unchanged. Both runs used one diagnostics build on 41adb551 plus the Series X 1080p startup patch from #3774. The only renderer switch changed between runs was VICTORY_SWEEP_SLICE_US=0 versus 1000. Series X, 1920×1080 output, DLSS Performance and 2× FG, 15 rendered FPS cap, warm cache, same saved starting point and input tape.

90–130 s after first present 0 µs 1,000 µs
Median draws per render 7,613 8,005
Streamed-out scan on regular pass, p95 1.83 ms 1.00 ms
Continuations, count / p95 0 / — 40 / 1.00 ms
Descriptor-slot eviction, median 27.56 ms 28.21 ms
Whole submit maintenance, median 36.78 ms 38.17 ms
Rendered interval, p95 80.25 ms 81.72 ms
Rendered intervals ≥95 ms 11 / 598 12 / 599

The streaming duty moved into short continuations as intended. The pressure-limited idle pass was active throughout this window, and descriptor-slot eviction was still about three quarters of the regular maintenance time. The two runs diverged in draw load later, so I would not treat the late percentiles as an A/B speed comparison. The 1 ms slice leaves the once-per-second hitch intact on this route, while confirming that the streamed-out work can be bounded. I posted the matching control's breakdown on #1644.

**@⁠Yoruiopz** on GitHub · 2026-11-30 07:31 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7271821626) I tested the idle-sweep slicing portion independently on an RTX 5070 Laptop GPU (8 GB), leaving refresh order unchanged. Both runs used one diagnostics build on `41adb551` plus the Series X 1080p startup patch from #3774. The only renderer switch changed between runs was `VICTORY_SWEEP_SLICE_US=0` versus `1000`. Series X, 1920×1080 output, DLSS Performance and 2× FG, 15 rendered FPS cap, warm cache, same saved starting point and input tape. | 90–130 s after first present | 0 µs | 1,000 µs | | --- | ---: | ---: | | Median draws per render | 7,613 | 8,005 | | Streamed-out scan on regular pass, p95 | 1.83 ms | 1.00 ms | | Continuations, count / p95 | 0 / — | 40 / 1.00 ms | | Descriptor-slot eviction, median | 27.56 ms | 28.21 ms | | Whole submit maintenance, median | 36.78 ms | 38.17 ms | | Rendered interval, p95 | 80.25 ms | 81.72 ms | | Rendered intervals ≥95 ms | 11 / 598 | 12 / 599 | The streaming duty moved into short continuations as intended. The pressure-limited idle pass was active throughout this window, and descriptor-slot eviction was still about three quarters of the regular maintenance time. The two runs diverged in draw load later, so I would not treat the late percentiles as an A/B speed comparison. The 1 ms slice leaves the once-per-second hitch intact on this route, while confirming that the streamed-out work can be bounded. I posted the matching control's breakdown on #1644.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 11:00 UTC · original

@⁠BaRian29 The split sweep counters are useful because our RTX 4070 Ti SUPER / 32 GB setup also has long frames. In a native 2560×1440 Series X route with full RT and DLSS/FG off, we saw one multi-second stall near low commit headroom and many shorter >100 ms frames. I am looking for the exact evidence that isolates the shorter stalls. Did you mark the duration of each idle-texture slice separately from slot eviction? If you are interested in an independent match, a 15-second open-world walk with the two switches recorded and GPU list time included would tell us whether the narrowed sweep moves our limit too. Aggregate time and settings are enough.

**@⁠akimfomin** on GitHub · 2026-11-30 11:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7276402548) @⁠BaRian29 The split sweep counters are useful because our RTX 4070 Ti SUPER / 32 GB setup also has long frames. In a native 2560×1440 Series X route with full RT and DLSS/FG off, we saw one multi-second stall near low commit headroom and many shorter >100 ms frames. I am looking for the exact evidence that isolates the shorter stalls. Did you mark the duration of each idle-texture slice separately from slot eviction? If you are interested in an independent match, a 15-second open-world walk with the two switches recorded and GPU list time included would tell us whether the narrowed sweep moves our limit too. Aggregate time and settings are enough.
With the texture table's walk in slices, the late frame left once a second
was slot eviction (VICTORY_SLOT_EVICT, which `victory play` turns on): its
look at every slot of every descriptor heap, a lock and a hash a slot, took
27.6-28.2 ms (median) on an RTX 5070 Laptop GPU, three quarters of the
sweep's time (Yoruiopz, a report on trustno1-coder/VIctory-NVIDIA#3578,
2026-11-30). It cannot be cut into slices as the table's walk was: a slot
written between two parts would show a host copy let go meanwhile, and the
copies it lets go are retired behind the submissions begun, which only the
submitting thread knows before the next one begins.

- The next look waits in proportion to how long this one took
  (VICTORY_SLOT_EVICT_DUTY, 1 % unless given; 0: every sweep, as before):
  a look of 28 ms comes every 2.8 s, every 2 s at the most past the card's
  budget, every 10 s at the least. What it lets go does not shrink: that
  is how far the card is over its line, whenever it looks.
- The slot walk asks an address-hashed set, not a SipHash one.
- The slot eviction line says the looks, their time each and the longest.

On an i5-14600KF with an RTX 4070 Ti SUPER, Series S, the line forced to
60 % so that it looks at all (it never does on that card otherwise): 268
looks in 5.5 min at 24.15 ms each (52.95 ms the longest) every sweep, 112
at 23.32 ms (50.14) with the 1 % share. Every look let go of nothing: of
68,604 idle-looking textures none was shown by slots it could take. Free
play, slow frames: 16.3 a minute and 28.4 a minute, which says that route
and noise decide them there, not the looks.

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

@⁠BaRian29 on GitHub · 2026-11-30 11:24 UTC · original

I tested the idle-sweep slicing portion independently on an RTX 5070 Laptop GPU (8 GB), leaving refresh order unchanged. Both runs used one diagnostics build on 41adb551 plus the Series X 1080p startup patch from #3774. The only renderer switch changed between runs was VICTORY_SWEEP_SLICE_US=0 versus 1000. Series X, 1920×1080 output, DLSS Performance and 2× FG, 15 rendered FPS cap, warm cache, same saved starting point and input tape.

90–130 s after first present 0 µs 1,000 µs
Median draws per render 7,613 8,005
Streamed-out scan on regular pass, p95 1.83 ms 1.00 ms
Continuations, count / p95 0 / — 40 / 1.00 ms
Descriptor-slot eviction, median 27.56 ms 28.21 ms
Whole submit maintenance, median 36.78 ms 38.17 ms
Rendered interval, p95 80.25 ms 81.72 ms
Rendered intervals ≥95 ms 11 / 598 12 / 599
The streaming duty moved into short continuations as intended. The pressure-limited idle pass was active throughout this window, and descriptor-slot eviction was still about three quarters of the regular maintenance time. The two runs diverged in draw load later, so I would not treat the late percentiles as an A/B speed comparison. The 1 ms slice leaves the once-per-second hitch intact on this route, while confirming that the streamed-out work can be bounded. I posted the matching control's breakdown on #1644.

Thanks for the careful A/B: one switch changed, same tape, and the note that the draw load diverged later. That's exactly what I couldn't get from free play.

You're right that the slices only bound the texture-table walk. On your route the late frame left once a second is slot eviction, and the PR's "no hitch every second" only held on my machine. There, the card never crosses its line, so slot_evict never runs, and the table walk itself was the 27 ms.

I've pushed a second commit (aba135ad) for slot eviction:

  • It can't be sliced like the table walk. A slot written between two parts could show a host copy let go meanwhile. The copies it lets go are retired behind the submissions already begun, which only the submitting thread knows before the next one starts. So I didn't move it off that thread either.
  • Instead, its share of the time is bounded. The next look waits in proportion to how long the last one took (VICTORY_SLOT_EVICT_DUTY, 1 % by default; 0 keeps the old every-sweep behaviour). A 28 ms look comes every 2.8 s, every 2 s at most when the card is past its budget, and every 10 s at least. What it lets go per look doesn't shrink: that's set by how far the card is over its line.
  • The slot walk uses an address-hashed set instead of SipHash.
  • The VICTORY_SLOT_EVICT line now reports the looks: looks, ms_each, longest_ms.

On my side (i5-14600KF, RTX 4070 Ti SUPER, Series S), I had to force the line to 60 % (VICTORY_SLOT_EVICT_PERCENT=60) to make it look at all:

every sweep (DUTY=0) 1 % share (default)
looks in ~5.5 min 268 112
time per look 24.15 ms (longest 52.95) 23.32 ms (longest 50.14)
textures let go 0 0

So about 2.4x less submit-thread time spent on it. My free-play slow-frame counts went the other way (16.3 vs 28.4 a minute over 100 ms), which says route and noise decide those here, not the looks. Your tape is the fair test.

One more thing your numbers and mine share: on my runs, every look let go of nothing. Of 68,604 idle-looking textures, none was shown only by slots it could take, so the whole 24 ms bought nothing. If your logs show the same, an early exit before the slot walk would be the next step. I'd rather see your counts first.

If you have time, could you run your tape once more on aba135ad, with VICTORY_SLOT_EVICT_DUTY=0 against the default? The new line's looks / ms_each plus your rendered-interval p95 and the ≥95 ms count would settle it.

**@⁠BaRian29** on GitHub · 2026-11-30 11:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7276988531) > I tested the idle-sweep slicing portion independently on an RTX 5070 Laptop GPU (8 GB), leaving refresh order unchanged. Both runs used one diagnostics build on `41adb551` plus the Series X 1080p startup patch from [#3774](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/3774). The only renderer switch changed between runs was `VICTORY_SWEEP_SLICE_US=0` versus `1000`. Series X, 1920×1080 output, DLSS Performance and 2× FG, 15 rendered FPS cap, warm cache, same saved starting point and input tape. > > 90–130 s after first present 0 µs 1,000 µs > Median draws per render 7,613 8,005 > Streamed-out scan on regular pass, p95 1.83 ms 1.00 ms > Continuations, count / p95 0 / — 40 / 1.00 ms > Descriptor-slot eviction, median 27.56 ms 28.21 ms > Whole submit maintenance, median 36.78 ms 38.17 ms > Rendered interval, p95 80.25 ms 81.72 ms > Rendered intervals ≥95 ms 11 / 598 12 / 599 > The streaming duty moved into short continuations as intended. The pressure-limited idle pass was active throughout this window, and descriptor-slot eviction was still about three quarters of the regular maintenance time. The two runs diverged in draw load later, so I would not treat the late percentiles as an A/B speed comparison. The 1 ms slice leaves the once-per-second hitch intact on this route, while confirming that the streamed-out work can be bounded. I posted the matching control's breakdown on [#1644](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/issues/1644). Thanks for the careful A/B: one switch changed, same tape, and the note that the draw load diverged later. That's exactly what I couldn't get from free play. You're right that the slices only bound the texture-table walk. On your route the late frame left once a second is slot eviction, and the PR's "no hitch every second" only held on my machine. There, the card never crosses its line, so `slot_evict` never runs, and the table walk itself was the 27 ms. I've pushed a second commit (aba135ad) for slot eviction: - **It can't be sliced like the table walk.** A slot written between two parts could show a host copy let go meanwhile. The copies it lets go are retired behind the submissions already begun, which only the submitting thread knows before the next one starts. So I didn't move it off that thread either. - **Instead, its share of the time is bounded.** The next look waits in proportion to how long the last one took (`VICTORY_SLOT_EVICT_DUTY`, 1 % by default; `0` keeps the old every-sweep behaviour). A 28 ms look comes every 2.8 s, every 2 s at most when the card is past its budget, and every 10 s at least. What it lets go per look doesn't shrink: that's set by how far the card is over its line. - **The slot walk uses an address-hashed set instead of SipHash.** - **The `VICTORY_SLOT_EVICT` line now reports the looks:** `looks`, `ms_each`, `longest_ms`. On my side (i5-14600KF, RTX 4070 Ti SUPER, Series S), I had to force the line to 60 % (`VICTORY_SLOT_EVICT_PERCENT=60`) to make it look at all: | | every sweep (`DUTY=0`) | 1 % share (default) | |---|---|---| | looks in ~5.5 min | 268 | 112 | | time per look | 24.15 ms (longest 52.95) | 23.32 ms (longest 50.14) | | textures let go | 0 | 0 | So about 2.4x less submit-thread time spent on it. My free-play slow-frame counts went the other way (16.3 vs 28.4 a minute over 100 ms), which says route and noise decide those here, not the looks. Your tape is the fair test. One more thing your numbers and mine share: on my runs, every look let go of **nothing**. Of 68,604 idle-looking textures, none was shown only by slots it could take, so the whole 24 ms bought nothing. If your logs show the same, an early exit before the slot walk would be the next step. I'd rather see your counts first. If you have time, could you run your tape once more on aba135ad, with `VICTORY_SLOT_EVICT_DUTY=0` against the default? The new line's `looks` / `ms_each` plus your rendered-interval p95 and the ≥95 ms count would settle it.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-30 11:27 UTC · original

@⁠BaRian29 The zero-eviction pattern also occurs in our full Series X native 1440p stock-RT control, RTX 4070 Ti SUPER (617.14), i5-13600KF, 32 GB. With the normal threshold, the last four periodic reports while the open-world scene stayed loaded each said 0 textures and 0 slots released since start. Each sampled look saw about 54.6k–55.1k idle-looking textures, of which roughly 32.3k–33.2k were shown in indexable slots that could not be taken. No pressure threshold was forced. This is a stock idle/AFK stability run. I have not measured the new DUTY switch in movement. A safe early exit for zero-work looks would be worth a matched test here as well. Do you already have a preferred way of detecting those without missing a slot that changes during submission?

**@⁠akimfomin** on GitHub · 2026-11-30 11:27 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7277041724) @⁠BaRian29 The zero-eviction pattern also occurs in our full Series X native 1440p stock-RT control, RTX 4070 Ti SUPER (617.14), i5-13600KF, 32 GB. With the normal threshold, the last four periodic reports while the open-world scene stayed loaded each said 0 textures and 0 slots released since start. Each sampled look saw about 54.6k–55.1k idle-looking textures, of which roughly 32.3k–33.2k were shown in indexable slots that could not be taken. No pressure threshold was forced. This is a stock idle/AFK stability run. I have not measured the new DUTY switch in movement. A safe early exit for zero-work looks would be worth a matched test here as well. Do you already have a preferred way of detecting those without missing a slot that changes during submission?
The counter of the looks for textures to let go (SWEPT_US, "N looks for
textures to let go, X ms each, the longest Y") was started at the idle
part of a look, after the streamed-out part: a slice's streamed-out part
was in no counter. It is started where the look begins now, with its
deadline, and still stops before slot eviction, which has a counter of
its own (SLOT_EVICT_US). Asked on trustno1-coder/VIctory-NVIDIA#3578
(2026-11-30), to tell the sweep's slices from slot eviction in long frames.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Slot eviction's looks let go of nothing on two RTX 4070 Ti SUPER PCs,
while each cost 23-27 ms on the submitting thread: of 68,604 idle-looking
textures none was shown by slots a look could take (the line forced to
60 %), and in a stock Series X run at native 1440p with ray tracing some
33,000 of 55,000 were shown by slots shaders pick by index, every look the
same (a report on trustno1-coder/VIctory-NVIDIA#3578, 2026-11-30).

Whether a look will find anything cannot be told ahead of it without
missing a slot that changes during a submission, so nothing here decides
what to let go: after a look that let go of nothing the next waits twice
as long, up to 16 times and 30 s (VICTORY_SLOT_EVICT_BACKOFF=0: as
before). A copy can only be kept longer, never taken while a slot shows
it. The waits end after a look that lets go of something, past the card's
budget, or once a look is to let go of a quarter more than when they
began. The slot eviction line says the looks in a row that let go of
nothing (idle_in_a_row).

i5-14600KF, RTX 4070 Ti SUPER, Series S, the line forced to 60 %: 30 looks
in 10.7 min (idle_in_a_row up to 8) where 112 came in 5.5 min with the 1 %
share alone; 27 ms a look, nothing let go in either.

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

@⁠BaRian29 on GitHub · 2026-11-30 11:57 UTC · original

@⁠akimfomin
Thanks for both reports. Answers to each, then what the latest run showed.

Is each idle-texture slice timed separately from slot eviction? Yes, as of f800aebb. What's timed (diagnostics build):

  • Idle-texture sweep, per look. Each slice is one look. The line "N looks for textures to let go, X ms each, the longest Y" gives the count, the mean and the max since start. It covers the whole slice, both the streamed-out part and the idle part, and excludes slot eviction. Until f800aebb it started after the streamed-out part, so that part of a slice was in no counter; your question caught that. It's still an aggregate (mean and max), not each slice's duration.
  • Slot eviction is timed on its own: the VICTORY_SLOT_EVICT line carries looks, ms_each, longest_ms and, since 121b43a9, idle_in_a_row.
  • GPU list time is the card meter line ("the card's time per frame by kind of list"), every 5 s in every build.

Detecting zero-work looks without missing a slot that changes during submission. My preferred way is not to predict zero work from slot state at all, and to make the early exit able only to skip, never to take. Pushed as 121b43a9:

  • Doubling wait. After a look that lets go of nothing, the next look waits twice as long, up to 16× and 30 s (VICTORY_SLOT_EVICT_BACKOFF=0 turns it off).
  • Plain wait again after a look that lets go of something, once the card is past its budget, or once a look has to let go of a quarter more than when the waits began.
  • Real evictions are untouched. They go through exactly the same path as before: the full slot walk, evict_slots under the slots' locks, then the idle and strong_count checks before the copy is retired. A slot that changes during a submission can't be missed because of this: the worst a skipped look can do is keep a copy a little longer.

A predictor, say a per-texture count of index-picked slots kept up to date at every slot write, would sit on a hot path, and it's exactly where a slot changing at the wrong moment would bite.

Measured here (i5-14600KF, 4070 Ti SUPER, Series S). I forced the line to 60 % (VICTORY_SLOT_EVICT_PERCENT=60), since slot eviction never looks on this card otherwise:

1 % share only + backoff
looks 112 in 5.5 min 30 in 10.7 min
idle_in_a_row – up to 8 (looks 30 s apart by then)
per look 23.3 ms 27.0 ms
let go 0 0

So your stock idle run should show idle_in_a_row climbing and looks flattening.

One more stall the new timer found: the card-limited branch of the idle sweep isn't sliced. When the card is over its line (12.9 of 14.7 GB on the boat here), the sweep takes the "oldest first" path. That path walks every old-enough copy, about 85k per look here, sorts them, and lets go down to the limit, all in one go: 512 such looks, 8.2 ms on average and 121.8 ms the longest. My slices only cover the host-pressure path. On an 8 GB card that's over its line most of the time, I'd expect this to be the next periodic stall after slot eviction. That's what I'd look at next, unless your numbers point elsewhere.

On your multi-second stall. On the same hardware (4070 Ti SUPER, 32 GB, 63 GB commit limit), a Series X run here hit 60.2 of 63 GB committed, 36.4 GB private with only 21 GB resident. The card sat at 14.5 of 14.9 GB with 10.8 GB pushed to shared memory, and 47 host pipelines failed with 0x8007000e. Frames went from 3-15 fps down to 0.2 fps (5 s frames). That matches your "multi-second stall near low commit headroom". In my runs it was memory pressure, not the sweep.

Happy to do the independent match. My plan, so we compare like with like:

  • Route: 15 s open-world walk after load, the same path each time.
  • Runs: VICTORY_SWEEP_SLICE_US=0/1000 crossed with VICTORY_SLOT_EVICT_DUTY=0/1, with VICTORY_SLOT_EVICT_BACKOFF on and off for the eviction runs.
  • Reported: settings; frames over 100 ms; the sweep's looks and ms each; slot eviction's looks, ms each and idle_in_a_row; card meter list time; commit and resident memory.

My default is Series S with DLSS Quality and FG. If you'd rather I match your native 1440p Series X, full RT, DLSS and FG off, say so. On 32 GB that route runs close to the commit limit here too, so I'd note the commit at the end of each run.

**@⁠BaRian29** on GitHub · 2026-11-30 11:57 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7277742087) @⁠akimfomin Thanks for both reports. Answers to each, then what the latest run showed. **Is each idle-texture slice timed separately from slot eviction?** Yes, as of f800aebb. What's timed (diagnostics build): - **Idle-texture sweep, per look.** Each slice is one look. The line "`N looks for textures to let go, X ms each, the longest Y`" gives the count, the mean and the max since start. It covers the whole slice, both the streamed-out part and the idle part, and **excludes slot eviction**. Until f800aebb it started after the streamed-out part, so that part of a slice was in no counter; your question caught that. It's still an aggregate (mean and max), not each slice's duration. - **Slot eviction is timed on its own:** the `VICTORY_SLOT_EVICT` line carries `looks`, `ms_each`, `longest_ms` and, since 121b43a9, `idle_in_a_row`. - **GPU list time** is the card meter line ("the card's time per frame by kind of list"), every 5 s in every build. **Detecting zero-work looks without missing a slot that changes during submission.** My preferred way is not to predict zero work from slot state at all, and to make the early exit able only to *skip*, never to *take*. Pushed as 121b43a9: - **Doubling wait.** After a look that lets go of nothing, the next look waits twice as long, up to 16× and 30 s (`VICTORY_SLOT_EVICT_BACKOFF=0` turns it off). - **Plain wait again** after a look that lets go of something, once the card is past its budget, or once a look has to let go of a quarter more than when the waits began. - **Real evictions are untouched.** They go through exactly the same path as before: the full slot walk, `evict_slots` under the slots' locks, then the idle and `strong_count` checks before the copy is retired. A slot that changes during a submission can't be missed because of this: the worst a skipped look can do is keep a copy a little longer. A predictor, say a per-texture count of index-picked slots kept up to date at every slot write, would sit on a hot path, and it's exactly where a slot changing at the wrong moment would bite. **Measured here** (i5-14600KF, 4070 Ti SUPER, Series S). I forced the line to 60 % (`VICTORY_SLOT_EVICT_PERCENT=60`), since slot eviction never looks on this card otherwise: | | 1 % share only | + backoff | |---|---|---| | looks | 112 in 5.5 min | 30 in 10.7 min | | `idle_in_a_row` | – | up to 8 (looks 30 s apart by then) | | per look | 23.3 ms | 27.0 ms | | let go | 0 | 0 | So your stock idle run should show `idle_in_a_row` climbing and `looks` flattening. **One more stall the new timer found: the card-limited branch of the idle sweep isn't sliced.** When the card is over its line (12.9 of 14.7 GB on the boat here), the sweep takes the "oldest first" path. That path walks every old-enough copy, about 85k per look here, sorts them, and lets go down to the limit, all in one go: 512 such looks, 8.2 ms on average and 121.8 ms the longest. My slices only cover the host-pressure path. On an 8 GB card that's over its line most of the time, I'd expect this to be the next periodic stall after slot eviction. That's what I'd look at next, unless your numbers point elsewhere. **On your multi-second stall.** On the same hardware (4070 Ti SUPER, 32 GB, 63 GB commit limit), a Series X run here hit **60.2 of 63 GB committed**, 36.4 GB private with only 21 GB resident. The card sat at 14.5 of 14.9 GB with 10.8 GB pushed to shared memory, and 47 host pipelines failed with `0x8007000e`. Frames went from 3-15 fps down to 0.2 fps (5 s frames). That matches your "multi-second stall near low commit headroom". In my runs it was memory pressure, not the sweep. **Happy to do the independent match.** My plan, so we compare like with like: - **Route:** 15 s open-world walk after load, the same path each time. - **Runs:** `VICTORY_SWEEP_SLICE_US=0/1000` crossed with `VICTORY_SLOT_EVICT_DUTY=0/1`, with `VICTORY_SLOT_EVICT_BACKOFF` on and off for the eviction runs. - **Reported:** settings; frames over 100 ms; the sweep's looks and ms each; slot eviction's looks, ms each and `idle_in_a_row`; card meter list time; commit and resident memory. My default is Series S with DLSS Quality and FG. If you'd rather I match your native 1440p Series X, full RT, DLSS and FG off, say so. On 32 GB that route runs close to the commit limit here too, so I'd note the commit at the end of each run.
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:50 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:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3578#issuecomment-7321666796) 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:17 +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!3578
No description provided.