Texture flickering huge improvement. More tests by other setups needed. #543

Open
github-bot wants to merge 9 commits from github-bot/gh-543 into main AGit
Owner

@⁠RhaegonGrey on GitHub · 2026-12-05 02:05 UTC · original
RhaegonGrey:texture-backlog → main · +1379 −361 · 18 files · 9 commits · open

VICTORY_SMALL_BACKLOG=1 (off by default): while the texture pass is behind, a texture's first host copy holds only its first page's levels (a few KiB). The slot then shows the texture blurred instead of the neutral stand-in until the whole copy is uploaded.

Related: #396, #331 (texture flicker and black or grey surfaces on RX 9070 XT, with a standing queue of 20–30k textures waiting).

Explainer with the mechanism and the log numbers: https://claude.ai/artifact/P8x1ee7WoqCtLmonDZdb1p

Why

#216's description found that the long black waits are "slots of textures not made yet, which small-first does not reach". VICTORY_SMALL_FIRST only covers copies that were let go for room. This switch covers the other case: textures shown for the first time while thousands of slots are due, which happens after a load or on a fast drive. In #396, 394,468 of 915,000 slots showed the neutral texture while their upload ran.

What it does

  • Backlog: a pass that finds ≥ 1024 slots due turns it on. It stays on while passes find ≥ 256, and ends when none has for 500 ms. Each view heap has its own pass, several a frame, so the two thresholds keep it from flipping every frame.
  • Small first: while the backlog is on, a texture's first copy goes through #216's slice 2b path with its first page's levels only. Copies and bakes that read every level still get the whole texture.
  • Growing: parked small copies grow when the backlog ends. In play, streaming often keeps it on for minutes, so a parked copy is also let out 1 s after it was made (SMALL_DUE) and grows on the pass's next visit if the card has room. Only a texture's first copy is made small (made_once). A copy that grew is never made small again.
  • Counted on the stats: vram line as backlog (0/1) and backlog_small.
  • A no-behaviour-change cleanup of the texture code: copyloc helpers, crate::lock, switch_is_1!, Staging::take_whole.
  • VICTORY_SMALL_BACKLOG and VICTORY_SMALL_FIRST added to run.conf.default (which also puts them in the menu) and to docs/SETTINGS.md.

Stacking

This branch sits on #216's current head (624d18c). #216 was split, and its small-first commits (VICTORY_SMALL_FIRST, slice 2b) are no longer in any open PR. This switch is built on them, so they are carried here with @⁠skalel kept as their author. VICTORY_SMALL_FIRST stays its own switch and is off by default. Until #216 is merged, its commit shows in this diff too. If you would rather have small-first in its own PR, I can split it out.

Measured, and not measured

  • Five runs on an RX 9070 XT (Series X, FSR quality), every one with the switch on. The vram line shows the backlog switching on during loads and fast drives. 464,005 first copies were made small in a 40-minute run, and the parked ones grow afterwards.
  • No like-for-like A/B yet. The log's "neutral texture meanwhile" counter counts slots, not how long each waited. Its share was about the same with the backlog on and off inside a run (43.6% vs 47.4%) and next to #396's off-run (43%). An A/B on one route comparing texture_late kind="new_texture" and a screen recording is the next step.
  • The objects that blink out for single frames in #396 (worse with VICTORY_BVH_BUILDER=0) could also be improved by this fix.

Checked

  • clippy --all-targets -p victory-gpu: no new warnings compared with 624d18c.
  • Under Wine, the tests matching resource:: (29 passed), vram:: (6 passed) and texture (38 passed) pass. The full victory-gpu suite aborts partway in this Wine prefix, and does the same on 624d18c.

🤖 Generated with Claude Code

**@⁠RhaegonGrey** on GitHub · 2026-12-05 02:05 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/543) `RhaegonGrey:texture-backlog` → `main` · +1379 −361 · 18 files · 9 commits · open `VICTORY_SMALL_BACKLOG=1` (off by default): while the texture pass is behind, a texture's **first** host copy holds only its first page's levels (a few KiB). The slot then shows the texture blurred instead of the neutral stand-in until the whole copy is uploaded. Related: #396, #331 (texture flicker and black or grey surfaces on RX 9070 XT, with a standing queue of 20–30k textures waiting). Explainer with the mechanism and the log numbers: https://claude.ai/artifact/P8x1ee7WoqCtLmonDZdb1p ## Why #216's description found that the long black waits are *"slots of textures not made yet, which small-first does not reach"*. `VICTORY_SMALL_FIRST` only covers copies that were let go for room. This switch covers the other case: textures shown for the first time while thousands of slots are due, which happens after a load or on a fast drive. In #396, 394,468 of 915,000 slots showed the neutral texture while their upload ran. ## What it does - **Backlog:** a pass that finds ≥ 1024 slots due turns it on. It stays on while passes find ≥ 256, and ends when none has for 500 ms. Each view heap has its own pass, several a frame, so the two thresholds keep it from flipping every frame. - **Small first:** while the backlog is on, a texture's first copy goes through #216's slice 2b path with its first page's levels only. Copies and bakes that read every level still get the whole texture. - **Growing:** parked small copies grow when the backlog ends. In play, streaming often keeps it on for minutes, so a parked copy is also let out **1 s** after it was made (`SMALL_DUE`) and grows on the pass's next visit if the card has room. Only a texture's first copy is made small (`made_once`). A copy that grew is never made small again. - **Counted** on the `stats: vram` line as `backlog` (0/1) and `backlog_small`. - A no-behaviour-change cleanup of the texture code: `copyloc` helpers, `crate::lock`, `switch_is_1!`, `Staging::take_whole`. - `VICTORY_SMALL_BACKLOG` and `VICTORY_SMALL_FIRST` added to `run.conf.default` (which also puts them in the menu) and to `docs/SETTINGS.md`. ## Stacking This branch sits on #216's current head (`624d18c`). #216 was split, and its small-first commits (`VICTORY_SMALL_FIRST`, slice 2b) are no longer in any open PR. This switch is built on them, so they are carried here with @⁠skalel kept as their author. `VICTORY_SMALL_FIRST` stays its own switch and is off by default. Until #216 is merged, its commit shows in this diff too. If you would rather have small-first in its own PR, I can split it out. ## Measured, and not measured - Five runs on an RX 9070 XT (Series X, FSR quality), every one with the switch **on**. The `vram` line shows the backlog switching on during loads and fast drives. 464,005 first copies were made small in a 40-minute run, and the parked ones grow afterwards. - **No like-for-like A/B yet.** The log's "neutral texture meanwhile" counter counts slots, not how long each waited. Its share was about the same with the backlog on and off inside a run (43.6% vs 47.4%) and next to #396's off-run (43%). An A/B on one route comparing `texture_late kind="new_texture"` and a screen recording is the next step. - The objects that blink out for single frames in #396 (worse with `VICTORY_BVH_BUILDER=0`) could also be improved by this fix. ## Checked - `clippy --all-targets -p victory-gpu`: no new warnings compared with `624d18c`. - Under Wine, the tests matching `resource::` (29 passed), `vram::` (6 passed) and `texture` (38 passed) pass. The full `victory-gpu` suite aborts partway in this Wine prefix, and does the same on `624d18c`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A `stats: vram` line after the frame line, every 5 s. It changes nothing
the run does; it is what a change to how textures and title memory share
the card can be measured by.

- How the card is shared: budget, use, the card's free memory, what the
  texture side compares with its keep line and the band it falls in
  (`host::keep_band`, which `vram_keep` now goes by), the room kept for
  render targets, title memory on the card (movable and fixed) and its
  room, host copies of textures and those idle, render targets, free room
  in texture blocks.
- What letting copies go costs, since the last line: copies let go and
  their MB, copies made again within 5 s of their let-go, slots the
  texture pass found waiting for a copy that was let go, textures let go
  at least once, streamed out, refused passes.

The band is no longer worked out from vram_keep's idle times: keep_band
holds the percentages, and vram_keep and the line both go by it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y2Qqrun6kxcg5bnqZExNca
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y2Qqrun6kxcg5bnqZExNca
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y2Qqrun6kxcg5bnqZExNca
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y2Qqrun6kxcg5bnqZExNca
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y2Qqrun6kxcg5bnqZExNca
A scene's first minutes leave thousands of slots due and surfaces black
until the per-frame upload budget reaches them. While a pass finds 1024 or
more due (256 once behind; ended after 500 ms without), a texture's first
host copy is made small first through slice 2b's path: a few KiB to upload,
shown blurred. The pass does not grow such copies, nor are parked ones let
grow, until the backlog ends; then the parked ones grow. What needs every
level (copies, bakes) still grows at once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- copyloc: footprints, sub_location, placed_location (from replay, which
  only the diagnostics build has) and layers, used by alias, twin copies,
  prelude uploads and zeros instead of a copy of each at every site.
- crate::lock for the poison-tolerant lock written out ~60 times in the
  texture modules; switch_is_1! for their VICTORY_*=1 switches.
- Staging::take_whole: the two identical hash-and-detile paths of
  refresh_timed as one.

No change in behaviour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two ways a copy made small for a backlog kept its small levels:
- Its growth waited for the backlog to end, and while the world streams
  a pass keeps finding 256 slots due: the backlog never ended. A copy
  parked for it is now let out after 1 s (SMALL_DUE) and grows at the
  pass's next visit if the card has room, backlog or not. Copies not let
  out yet stay parked instead of being made due every pass.
- A texture whose copy had grown (or gone) was made small again when the
  backlog was on as its next copy was made. Only a texture's first copy
  is made small now (made_once).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 02:09:02 +00:00
github-bot changed title from victory-gpu: VICTORY_SMALL_BACKLOG: textures first shown while the texture pass is behind get their first page's levels, and grow whole once it caught up to Texture flickering huge improvement. More tests by other setups needed. 2026-12-05 02:15:01 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-12-05 02:34 UTC · original

Checked 9cad413 on native Windows (one NVIDIA desktop card plus WARP, didn't run the game).

cargo test -p victory-gpu --lib (skipping descriptor::tests::views_die_with_their_resource as I do on every branch) gives 369 passed and 5 failed on the PR, and 352 passed with the same 5 failed on current main (b581f7e). The five already fail on main on this machine, namely the two indirect::host_list_*, the two pipeline::host library loads and the flaky watch::the_rest_of_the_one_asking_has_a_number_of_its_own. All 21 new tests pass on the card, the resource ones included (a_texture_first_shown_in_a_backlog_is_small_until_it_ends, without_room_a_slot_takes_the_small_copy, a_bake_source_comes_back_whole and the rest). I get the same result with VICTORY_SMALL_BACKLOG=1 VICTORY_SMALL_FIRST=1 set for the whole suite. The branch is 16 commits behind main but merges cleanly, and the merged tree gives 373 passed with the same 5 failures. cargo check -p victory builds, and the victory-core menu tests that read run.conf.default pass (18). Clippy --all-targets -p victory-gpu shows no new warnings next to the merge base (2382b4c). Once merged it also clears main's current "room_lately is never used" warning, because want_level_in uses it again.

I also wrote a quick throwaway test on the card (since removed) that runs the switch from start to finish. With the backlog on, the first Slot ask gets a copy from level 3 (256x256 BC7) in SMALL_MADE. A Slot visit and a Pass visit before the upload leave it alone. After small_filled, with the backlog off, a Pass visit grows it to base 0 in a new copy marked SMALL_NO. When that copy is let go and made again with the backlog back on, it comes back whole, so made_once does its job. I tried a second one to free a texture while its small copy was parked, but the placed-texture table still held the resource, so the copy never died and that case stayed untested.

On behaviour, default off holds up. Everything that makes a copy small depends either on vram::backlog() or on small_first() (resource.rs:2684). Only backlog_due sets vram::backlog(), and backlog_due returns early without the switch (vram.rs:153-156). With both switches unset every copy stays SMALL_NO, growth(SMALL_NO, ..) is always Now, and the bake path moving to placed_texture_whole (draw.rs:3316) and readable_inner moving to placed_texture_growing (draw.rs:6126) act the same as the old want_level. The cleanup in texture.rs (copyloc helpers, take_whole, crate::lock, switch_is_1!) and the keep_band split in host.rs read as equivalent to me. It isn't byte-identical by default though, mostly because the vram commits from #216 come along with it. The following run with both switches unset.

  • the stats: vram line every 5 s next to the frame line (host.rs:8153 calling vram.rs:204, which takes the pool lock for texture_room)
  • vram::seen() before every submission in let_go_idle (resource.rs:2757)
  • the let_go_ms stamp in take_idle (resource.rs:2679-2681)
  • the ROOM_NOW/PRESSED stores in the residency tick (um/residency.rs:677-678)
  • the SMALL_FILLED_AFTER lock at the top of every heap's pass (descriptor/host.rs:2441)
  • the GROW_PARKED lock on every pass with room (draw.rs:3645)
  • a small_first load per prelude upload (texture.rs:1426)
  • for every late slot whose texture was let go, a lock of that texture's made through host_waits, only to bump a counter (draw.rs:4072-4076)

None of these changes what gets drawn, and each one is cheap, but it might deserve a line in the description. The per-slot host_waits lock is the one I'd put behind a switch.

The hysteresis matches the description (vram.rs:124-126, 172-180), and the unit test covers on, hold and the single end. backlog_due does a load, a compute and a store, not one atomic step, so if two heap passes ever run at once one of them can lose an update. I don't see that stranding anything. When the card has room, grow_parked already runs on every pass (draw.rs:3645), so the extra call at draw.rs:3677 only matters when there's none. Passes are also the only thing that writes BACKLOG, and backlog_due is skipped while baking (draw.rs:3676). So through a bake, or a stretch with no texture pass, backlog() keeps its last value and slot asks can still mark first copies small. The first pass afterwards puts that right.

I don't see how a small copy could stay small for good. SMALL_MADE becomes SMALL_FILLED from both upload paths (texture.rs:1426-1433 through small_filled_after, texture/ahead.rs:365), and staging is keyed by copy serial, so a new small copy always gets its own first upload. Parked copies leave the queue after BACKLOG_GROW_MS even while the backlog stays on, and right away when it's off (resource.rs:2541-2545). From reading the code, a copy freed while parked leaves only a dead Weak that grow_parked skips (resource.rs:2590 and the upgrade()? in grow_parked). Copies and bakes go through Asked::Copy and get the whole texture (a copy source that finds a level missing falls back to want_level, list.rs:1253-1264). hosted_for won't make a small copy of a copy destination or of anything the host wrote (resource.rs:1781-1790). The digest side looks fine too. holds lives on the copy, and growing makes a new HostTexture, so a small copy's Held (tail levels only) can't be taken later as the fingerprint of the whole texture. While the copy is small, compare_source limits itself to copy.base (texture.rs:2098) the same way it already does for any copy made from a later level.

On lock order, park() pushes into GROW_PARKED while holding the texture's made lock (resource.rs:1484), and grow_parked lets go of GROW_PARKED before it touches any copy, so I couldn't find an inversion. The new code has no unwraps outside tests.

A few smaller things. The description says a parked copy is let out "1 s after it was made", but the clock starts when it's parked (park() stamps now_ms(), resource.rs:2588-2590). That only happens after its upload ran and a pass visit found the backlog still on or no room, so it's a bit over 1 s after the fill. Next, the small_first flag on Hosted is set by a Slot/Pass ask during the backlog (resource.rs:1458) but only used when the copy is actually made (resource.rs:1760). If the backlog ends in between, that copy still comes out small, which costs one extra small upload before it grows on the next pass with room. Last, "a texture's first copy" really means the first copy of the placed resource for that address and description. texture_at reuses the cached resource for the same pair (resource.rs:4080-4082), so made_once stays set until that entry is trimmed. New content streamed into an old placement doesn't get the backlog treatment, and after a let-go only VICTORY_SMALL_FIRST covers it. That looks intended, but the description could say so.

Claims I could match to the code are the 1024/256/500 ms marks (vram.rs:124-126), backlog and backlog_small on the vram line (vram.rs:292-293), first copy only through made_once (resource.rs:1458, 1818), copies and bakes whole (resource.rs:1456, draw.rs:3316), both switches in run.conf.default and docs/SETTINGS.md, and the stack sitting on 624d18c with #216's commits below it.

The part that matters most is what I didn't test, the flicker in game, and anything on AMD, where #396 and #331 come from. The tests and the throwaway only show that the state machine and the copy sizes behave as described on one NVIDIA card. Whether the picture actually improves is still down to the A/B run you mention.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-12-05 02:34 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/543#issuecomment-7430373538) Checked 9cad413 on native Windows (one NVIDIA desktop card plus WARP, didn't run the game). `cargo test -p victory-gpu --lib` (skipping `descriptor::tests::views_die_with_their_resource` as I do on every branch) gives 369 passed and 5 failed on the PR, and 352 passed with the same 5 failed on current main (b581f7e). The five already fail on main on this machine, namely the two `indirect::host_list_*`, the two `pipeline::host` library loads and the flaky `watch::the_rest_of_the_one_asking_has_a_number_of_its_own`. All 21 new tests pass on the card, the resource ones included (`a_texture_first_shown_in_a_backlog_is_small_until_it_ends`, `without_room_a_slot_takes_the_small_copy`, `a_bake_source_comes_back_whole` and the rest). I get the same result with `VICTORY_SMALL_BACKLOG=1 VICTORY_SMALL_FIRST=1` set for the whole suite. The branch is 16 commits behind main but merges cleanly, and the merged tree gives 373 passed with the same 5 failures. `cargo check -p victory` builds, and the victory-core menu tests that read `run.conf.default` pass (18). Clippy `--all-targets -p victory-gpu` shows no new warnings next to the merge base (2382b4c). Once merged it also clears main's current "`room_lately` is never used" warning, because `want_level_in` uses it again. I also wrote a quick throwaway test on the card (since removed) that runs the switch from start to finish. With the backlog on, the first `Slot` ask gets a copy from level 3 (256x256 BC7) in `SMALL_MADE`. A `Slot` visit and a `Pass` visit before the upload leave it alone. After `small_filled`, with the backlog off, a `Pass` visit grows it to base 0 in a new copy marked `SMALL_NO`. When that copy is let go and made again with the backlog back on, it comes back whole, so `made_once` does its job. I tried a second one to free a texture while its small copy was parked, but the placed-texture table still held the resource, so the copy never died and that case stayed untested. On behaviour, default off holds up. Everything that makes a copy small depends either on `vram::backlog()` or on `small_first()` (resource.rs:2684). Only `backlog_due` sets `vram::backlog()`, and `backlog_due` returns early without the switch (vram.rs:153-156). With both switches unset every copy stays `SMALL_NO`, `growth(SMALL_NO, ..)` is always `Now`, and the bake path moving to `placed_texture_whole` (draw.rs:3316) and `readable_inner` moving to `placed_texture_growing` (draw.rs:6126) act the same as the old `want_level`. The cleanup in texture.rs (`copyloc` helpers, `take_whole`, `crate::lock`, `switch_is_1!`) and the `keep_band` split in host.rs read as equivalent to me. It isn't byte-identical by default though, mostly because the vram commits from #216 come along with it. The following run with both switches unset. - the `stats: vram` line every 5 s next to the frame line (host.rs:8153 calling vram.rs:204, which takes the pool lock for `texture_room`) - `vram::seen()` before every submission in `let_go_idle` (resource.rs:2757) - the `let_go_ms` stamp in `take_idle` (resource.rs:2679-2681) - the `ROOM_NOW`/`PRESSED` stores in the residency tick (um/residency.rs:677-678) - the `SMALL_FILLED_AFTER` lock at the top of every heap's pass (descriptor/host.rs:2441) - the `GROW_PARKED` lock on every pass with room (draw.rs:3645) - a `small_first` load per prelude upload (texture.rs:1426) - for every late slot whose texture was let go, a lock of that texture's `made` through `host_waits`, only to bump a counter (draw.rs:4072-4076) None of these changes what gets drawn, and each one is cheap, but it might deserve a line in the description. The per-slot `host_waits` lock is the one I'd put behind a switch. The hysteresis matches the description (vram.rs:124-126, 172-180), and the unit test covers on, hold and the single end. `backlog_due` does a load, a compute and a store, not one atomic step, so if two heap passes ever run at once one of them can lose an update. I don't see that stranding anything. When the card has room, `grow_parked` already runs on every pass (draw.rs:3645), so the extra call at draw.rs:3677 only matters when there's none. Passes are also the only thing that writes `BACKLOG`, and `backlog_due` is skipped while baking (draw.rs:3676). So through a bake, or a stretch with no texture pass, `backlog()` keeps its last value and slot asks can still mark first copies small. The first pass afterwards puts that right. I don't see how a small copy could stay small for good. `SMALL_MADE` becomes `SMALL_FILLED` from both upload paths (texture.rs:1426-1433 through `small_filled_after`, texture/ahead.rs:365), and staging is keyed by copy serial, so a new small copy always gets its own first upload. Parked copies leave the queue after `BACKLOG_GROW_MS` even while the backlog stays on, and right away when it's off (resource.rs:2541-2545). From reading the code, a copy freed while parked leaves only a dead `Weak` that `grow_parked` skips (resource.rs:2590 and the `upgrade()?` in `grow_parked`). Copies and bakes go through `Asked::Copy` and get the whole texture (a copy source that finds a level missing falls back to `want_level`, list.rs:1253-1264). `hosted_for` won't make a small copy of a copy destination or of anything the host wrote (resource.rs:1781-1790). The digest side looks fine too. `holds` lives on the copy, and growing makes a new `HostTexture`, so a small copy's `Held` (tail levels only) can't be taken later as the fingerprint of the whole texture. While the copy is small, `compare_source` limits itself to `copy.base` (texture.rs:2098) the same way it already does for any copy made from a later level. On lock order, `park()` pushes into `GROW_PARKED` while holding the texture's `made` lock (resource.rs:1484), and `grow_parked` lets go of `GROW_PARKED` before it touches any copy, so I couldn't find an inversion. The new code has no unwraps outside tests. A few smaller things. The description says a parked copy is let out "1 s after it was made", but the clock starts when it's parked (`park()` stamps `now_ms()`, resource.rs:2588-2590). That only happens after its upload ran and a pass visit found the backlog still on or no room, so it's a bit over 1 s after the fill. Next, the `small_first` flag on `Hosted` is set by a `Slot`/`Pass` ask during the backlog (resource.rs:1458) but only used when the copy is actually made (resource.rs:1760). If the backlog ends in between, that copy still comes out small, which costs one extra small upload before it grows on the next pass with room. Last, "a texture's first copy" really means the first copy of the placed resource for that address and description. `texture_at` reuses the cached resource for the same pair (resource.rs:4080-4082), so `made_once` stays set until that entry is trimmed. New content streamed into an old placement doesn't get the backlog treatment, and after a let-go only `VICTORY_SMALL_FIRST` covers it. That looks intended, but the description could say so. Claims I could match to the code are the 1024/256/500 ms marks (vram.rs:124-126), `backlog` and `backlog_small` on the vram line (vram.rs:292-293), first copy only through `made_once` (resource.rs:1458, 1818), copies and bakes whole (resource.rs:1456, draw.rs:3316), both switches in `run.conf.default` and `docs/SETTINGS.md`, and the stack sitting on 624d18c with #216's commits below it. The part that matters most is what I didn't test, the flicker in game, and anything on AMD, where #396 and #331 come from. The tests and the throwaway only show that the state machine and the copy sizes behave as described on one NVIDIA card. Whether the picture actually improves is still down to the A/B run you mention. AI-assisted: yes
Author
Owner

@⁠Widget9337 on GitHub · 2026-12-05 02:43 UTC · original

Tried this on an RX 9070 XT 16 GB (Ryzen 9 7950X3D, 64 GB RAM, CachyOS, this repo's Mesa and vkd3d-proton), Series X, 1080p with FSR 4 Balanced, ray tracing on, VICTORY_VRAM_BUDGET_MB=17000. The PR merged cleanly onto main b581f7e (plus #428 and #445), release build, only VICTORY_SMALL_BACKLOG=1 on (VICTORY_SMALL_FIRST off).

The switch ran like it should. The vram line had the backlog on from about a minute in, and it never went off again for the rest of the session:

02:35:37 backlog=0 backlog_small=0
02:36:29 backlog=1 backlog_small=31565
02:37:20 backlog=1 backlog_small=44296
02:37:45 backlog=1 backlog_small=51502

No errors and no device loss.

The stand-in share didn't move the neutral texture meanwhile in 42,160 of 80,000 slots (53 %), against about 51 % in my runs without the PR. Same as your own numbers, so the small copies don't seem to reach the slots that wait on the stand-in.

A regression: some bushes vanished. Low detail bushes in the distance disappeared completely as I got close, instead of switching to their full texture. With the PR off they swap normally. My guess is that it's the growth: with the backlog never ending, the small copy is let out after 1 s, and for those the full copy isn't shown in its place, so for a while there's nothing. I haven't confirmed that in the code.

The one frame flashes (#69, #463) didn't change. For those I had already ruled out the stand-in here: with the neutral texture colored magenta (45,384 slots given it), no magenta showed anywhere, and the flashes stayed black or bright (details on #463). So on this card the stand-in isn't visible, and I wouldn't expect this switch to change the flashes.

**@⁠Widget9337** on GitHub · 2026-12-05 02:43 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/543#issuecomment-7430505097) Tried this on an RX 9070 XT 16 GB (Ryzen 9 7950X3D, 64 GB RAM, CachyOS, this repo's Mesa and vkd3d-proton), Series X, 1080p with FSR 4 Balanced, ray tracing on, `VICTORY_VRAM_BUDGET_MB=17000`. The PR merged cleanly onto `main` `b581f7e` (plus #428 and #445), release build, only `VICTORY_SMALL_BACKLOG=1` on (`VICTORY_SMALL_FIRST` off). The switch ran like it should. The `vram` line had the backlog on from about a minute in, and it never went off again for the rest of the session: ``` 02:35:37 backlog=0 backlog_small=0 02:36:29 backlog=1 backlog_small=31565 02:37:20 backlog=1 backlog_small=44296 02:37:45 backlog=1 backlog_small=51502 ``` No errors and no device loss. The stand-in share didn't move the neutral texture meanwhile in 42,160 of 80,000 slots (53 %), against about 51 % in my runs without the PR. Same as your own numbers, so the small copies don't seem to reach the slots that wait on the stand-in. A regression: some bushes vanished. Low detail bushes in the distance disappeared completely as I got close, instead of switching to their full texture. With the PR off they swap normally. My guess is that it's the growth: with the backlog never ending, the small copy is let out after 1 s, and for those the full copy isn't shown in its place, so for a while there's nothing. I haven't confirmed that in the code. The one frame flashes (#69, #463) didn't change. For those I had already ruled out the stand-in here: with the neutral texture colored magenta (45,384 slots given it), no magenta showed anywhere, and the flashes stayed black or bright (details on #463). So on this card the stand-in isn't visible, and I wouldn't expect this switch to change the flashes.
Author
Owner

@⁠RhaegonGrey on GitHub · 2026-12-05 03:10 UTC · original

Weird, I'm no longer having those texture issues as much as I've had before. I can turn around on stores and the house isn't glitchy all the time (seems to be for the first seconds the game is open). Could it be some sort of configuration that goes alongside this change? Here's my variables:

VICTORY_SKIP_BINK=0
VICTORY_KEEP_GPU_WRITTEN=1
VICTORY_POOL_MOVE=1
KEEP_FREE=2048
VICTORY_FSR_HOST=1
VICTORY_FSR_4K=balanced
VICTORY_PAGE_ADAPTIVE=1
VICTORY_PAGES=1
VICTORY_BVH_BUILDER=1
VICTORY_BVH_HARDWARE=1
VICTORY_FULLSCREEN_RES=3840x2160
VICTORY_FULLSCREEN=1
VICTORY_OUTPUT=3840x2160
CONSOLE=series-x
VICTORY_HW_RT_DEMOTE=1
VICTORY_SMALL_BACKLOG=1
VICTORY_SMALL_FIRST=1

**@⁠RhaegonGrey** on GitHub · 2026-12-05 03:10 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/543#issuecomment-7430849751) Weird, I'm no longer having those texture issues as much as I've had before. I can turn around on stores and the house isn't glitchy all the time (seems to be for the first seconds the game is open). Could it be some sort of configuration that goes alongside this change? Here's my variables: VICTORY_SKIP_BINK=0 VICTORY_KEEP_GPU_WRITTEN=1 VICTORY_POOL_MOVE=1 KEEP_FREE=2048 VICTORY_FSR_HOST=1 VICTORY_FSR_4K=balanced VICTORY_PAGE_ADAPTIVE=1 VICTORY_PAGES=1 VICTORY_BVH_BUILDER=1 VICTORY_BVH_HARDWARE=1 VICTORY_FULLSCREEN_RES=3840x2160 VICTORY_FULLSCREEN=1 VICTORY_OUTPUT=3840x2160 CONSOLE=series-x VICTORY_HW_RT_DEMOTE=1 VICTORY_SMALL_BACKLOG=1 VICTORY_SMALL_FIRST=1
Author
Owner

@⁠LloydNicholson on GitHub · 2026-12-05 18:57 UTC · original

An off/on test of VICTORY_SMALL_BACKLOG on an RX 9060 XT 16 GB (RDNA 4), with a Ryzen 7 5700X on Linux. It uses this repo's Mesa and vkd3d-proton, Series X, 1080p output with FSR 4 quality, and ray tracing on (VICTORY_BVH_BUILDER=1).

Setup

  • Code: #216 and #543's 8 commits cherry-picked onto a fork of main at e015c66, which carries other local changes. The only conflict was in texture.rs with cea6856 (the clean-up commit): our tree had extra prefix hashes there, so I kept our side. take_whole merged with them as is.
  • Tests: victory-gpu --lib under Wine gives 390 passed and 6 failed. The same 6 fail on our tree without the PR: the two indirect::host_list_* and four watch:: tests.
  • Runs: both drives used the same exe, the same save copied fresh for each run, and the same settings. The only difference was VICTORY_SMALL_BACKLOG=0 against =1 on run.sh's command line. Each drive was cut at 6 minutes after the first texture_late line, and both are scored over those same 6 minutes.

Results

From the last texture_late line of each drive (these are running counts):

off on
new_texture, n 267,941 341,050
new_texture, mean 42.3 ms 35.4 ms
new_texture, p90 / p99 <100 / <166 ms <66 / <100 ms
away_to_upload, mean 342 ms 309 ms
away_to_upload, p99 <8000 ms <4000 ms
part_to_whole, mean 7.0 s 5.6 s
backlog=1 lines (of 71) 0 52
backlog_small 0 135,074
fps median, in the world 23.1 22.7
fps, slowest 10% 17.8 16.3

Caveats:

  • This is one pair of drives, by hand, so the routes were not identical: the on drive showed 27% more new textures. Total blank time (n × mean) is therefore about the same in both, 11,334 against 12,083 slot-seconds. What improved is the wait per texture, the 90th and 99th percentiles most of all.
  • The fps median is 0.4 lower with the switch on, and the slowest 10% of frames are 1.5 fps lower. One pair can't separate that from the difference between two drives.

In play

The player found the on drive "much smoother". That fits the shorter tail: fewer slots stayed blank long enough to be seen.

Also seen (#216's line, both drives)

At 80–86 % of the budget, copies let go after 4 s idle were very rarely wanted again. In these two drives, 57,422 and 86,919 copies were let go, and only 64 and 79 of them were made again within 5 s. In a separate 14-minute drive, the figures were 122,584 and 210 (0.2 %). So on this card the let-go rule is not where the blank time comes from. It comes from new_texture, which #216's description already pointed to for the long black waits, and from away_to_upload.

🤖 Generated with Claude Code

**@⁠LloydNicholson** on GitHub · 2026-12-05 18:57 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/543#issuecomment-7443581285) An off/on test of `VICTORY_SMALL_BACKLOG` on an RX 9060 XT 16 GB (RDNA 4), with a Ryzen 7 5700X on Linux. It uses this repo's Mesa and vkd3d-proton, Series X, 1080p output with FSR 4 quality, and ray tracing on (`VICTORY_BVH_BUILDER=1`). ## Setup - **Code:** #216 and #543's 8 commits cherry-picked onto a fork of `main` at `e015c66`, which carries other local changes. The only conflict was in `texture.rs` with `cea6856` (the clean-up commit): our tree had extra prefix hashes there, so I kept our side. `take_whole` merged with them as is. - **Tests:** `victory-gpu --lib` under Wine gives 390 passed and 6 failed. The same 6 fail on our tree without the PR: the two `indirect::host_list_*` and four `watch::` tests. - **Runs:** both drives used the same exe, the same save copied fresh for each run, and the same settings. The only difference was `VICTORY_SMALL_BACKLOG=0` against `=1` on `run.sh`'s command line. Each drive was cut at 6 minutes after the first `texture_late` line, and both are scored over those same 6 minutes. ## Results From the last `texture_late` line of each drive (these are running counts): | | off | on | |---|---|---| | `new_texture`, n | 267,941 | 341,050 | | `new_texture`, mean | 42.3 ms | **35.4 ms** | | `new_texture`, p90 / p99 | <100 / <166 ms | **<66 / <100 ms** | | `away_to_upload`, mean | 342 ms | **309 ms** | | `away_to_upload`, p99 | <8000 ms | **<4000 ms** | | `part_to_whole`, mean | 7.0 s | 5.6 s | | `backlog=1` lines (of 71) | 0 | 52 | | `backlog_small` | 0 | 135,074 | | fps median, in the world | 23.1 | 22.7 | | fps, slowest 10% | 17.8 | 16.3 | **Caveats:** - This is one pair of drives, by hand, so the routes were not identical: the on drive showed 27% more new textures. Total blank time (n × mean) is therefore about the same in both, 11,334 against 12,083 slot-seconds. What improved is the wait per texture, the 90th and 99th percentiles most of all. - The fps median is 0.4 lower with the switch on, and the slowest 10% of frames are 1.5 fps lower. One pair can't separate that from the difference between two drives. ## In play The player found the on drive "much smoother". That fits the shorter tail: fewer slots stayed blank long enough to be seen. ## Also seen (#216's line, both drives) At 80–86 % of the budget, copies let go after 4 s idle were very rarely wanted again. In these two drives, 57,422 and 86,919 copies were let go, and only 64 and 79 of them were made again within 5 s. In a separate 14-minute drive, the figures were 122,584 and 210 (0.2 %). So on this card the let-go rule is not where the blank time comes from. It comes from `new_texture`, which #216's description already pointed to for the long black waits, and from `away_to_upload`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/texture.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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