Sampled eviction under pressure: let unread textures picked by index go when the card is full #4580

Closed
mcozcan wants to merge 4 commits from upstream-pr/4580 into main
mcozcan commented 2026-11-30 23:12:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-11-30T23:12:02Z.


What it changes

On a 12 GB card in Series X mode the card stays over its budget for most of a session, and new textures stay at their small levels ("textures never load" for the player). Slot eviction can free almost nothing, because most idle textures are shown by slots that shaders pick by index. VICTORY_SAMPLED_MARKS=1 already knows which of those slots no shader read. VICTORY_SAMPLED_EVICT=1 used to act on that, but victory play turned it off on 2026-11-28 because foliage flickered: foliage that is read every few seconds was let go within the idle time and came back a frame late.

This adds a third value, VICTORY_SAMPLED_EVICT=pressure, and makes it victory play's default:

  • The marks are trusted only while the card's use is at 95 % of its budget or more (sampled::PRESSURE_PERCENT). With room on the card, indexed textures are left alone, as with 0.
  • Even then, a texture picked by index goes only if no shader marked any of its slots for 1,800 frames (sampled::PRESSURE_COLD_FRAMES, about a minute at 30 fps), or for the pass's own idle time if that is longer. Foliage read every few seconds never qualifies.
  • slots_still_evictable (the aside path) asks again just before the eviction, so a decision made with the card full is not carried out after it has room again.
  • Re-queueing a slot a shader reads again is unchanged (evict_on() stays true in this mode).
  • 1 behaves exactly as before. The card's memory is only queried in pressure mode.

What it trades: the room it frees goes to the textures that were waiting for room, so they reach their full levels. It does not lower the card's use (see @DoubleD17's like-for-like A/B below).

How it was tested

  • GPU and profile: RTX 5070 12 GB, Ryzen 5 9600X, 32 GB RAM, Windows 11 26300, driver 621.24. Series X, 2560x1440, DLSS Performance, DLSS frame generation 2x, ray tracing off.
  • Before (50 minutes of open-world play, v2026.11.30.03-based build, VICTORY_SAMPLED_EVICT=0):
    • the card at 10.1 GB in use after two minutes, rising to 11.9-12.0 GB against a budget of 10.7 GB for the rest of the run;
    • slot eviction: of 27,434 idle-looking textures, 19,936 not taken because a slot picked by index shows them;
    • the marks: 1.2 to 3.1 GB of textures picked by index that no shader read within the idle time, every five-second line;
    • 406,876 textures made from their small levels for want of room; "no room, new textures wait" in 569 of 574 texture-queue lines;
    • frame generation switched off and on 76 times with "out of VRAM" (code 39).
  • Like-for-like A/B by @DoubleD17 (comment): RTX 5070 12 GB, Ryzen 7 5800X, 64 GB RAM, main 5fabb46e with this PR, Series X 2560x1440 DLAA, frame generation and ray tracing off; idle camera, 150 s, four runs per arm alternated, only VICTORY_SAMPLED_EVICT=pressure against 0 differing; the card at 10.3-11.0 GB of a 10.74 GB budget:
    • textures made from their small levels for want of room: with 0, 2 to 5 % grew to their levels; with pressure, all of them did (30,934 to 50,213 a run);
    • card use: the same in both arms (mean 10,620 MB against 10,619 MB): the room freed went to the waiting textures;
    • frame rate: no difference beyond run-to-run noise;
    • no foliage flicker in 800 frames;
    • not tested: movement (the case =1 was turned off for), other cards, Series S, frame generation on.
  • Run by @Lyrnc (comment): RTX 5080 16 GB with VICTORY_VRAM_BUDGET_MB=8192 standing in for an 8 GB card, Series X 1440p DLSS Quality, a 12-minute scripted walk, two runs each against main 5fabb46e:
    • main let go of no texture (27,612 of 27,804 idle-looking ones blocked by slots picked by index); this lets 600-900 MB of texture copies go, the queue's counted use ends under its line, and the oldest due texture drops from 6,665-9,012 frames to 21-3,002;
    • about 27,000 slots a run were read again while null (the neutral texture until the next readback and upload; not looked at on screen);
    • frame rate within run-to-run noise;
    • about 200 "uploaded again" warnings in the first two minutes (main: 2-16). Cause: before frame 1,800 the cutoff saturated to 0, so a slot never marked counted as a minute cold. Fixed in 981dd225 by @andrewpozdnakov7-jpg: pressure mode leaves textures picked by index alone until a full 1,800-frame window has passed (cutoff_for checked at frames 1,799 / 1,800 / 1,801: None / Some(0) / Some(1)). Not run in the game on the new head yet.
  • After (my run, not like-for-like, read it as an indication only): a 6-minute open-world run with this branch's change in a build that also carries #4247, #4294, #4288, #4206, #4255, #4200, #4219, #4226, #4297, #4233, #3487, #4080 and #3975 (VICTORY_SAMPLED_EVICT=pressure, the rest as before). Not the same route or length as the 50-minute run:
    • the card at 10.44-10.47 GB of a 10.72-10.79 GB budget from the second minute to the end (under budget throughout; the A/B above did not reproduce this, and this run carried the other PRs listed);
    • 35,327 slots picked by index put back to null, 9,753 of them queued again as a shader read them, 25,574 still null at the end;
    • textures held at their small levels with "the card past 97 %": 0 (50.9 million refusals in the 50-minute run);
    • frame generation "out of VRAM": 1 (77);
    • no foliage flicker noticed by the player; the session ended normally.
  • For shader changes: none.
  • cargo test -p victory-gpu --lib passed for this branch, with two new tests (the_evict_switch_reads_its_modes, pressure_trusts_the_marks_only_with_the_card_full_and_a_minute_back). 981dd225 adds the frame-1,800 boundary to the second. The two failures list::thin::tests::bindings_record_no_work and shader_cache::tests::every_switch_of_the_translator_is_in_the_key fail on main too (#4296 fixes them).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3128 (enables sampled eviction by default through 10 GB of VRAM; this keeps it off until the card is full and asks for a minute without a read), #3127 (F1 menu item), #3697 and #4432/#4465 (backoff and sampling windows of slot eviction; they touch the same path but not the trust decision).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5575482669 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-11-30T23:12:02Z. --- ## What it changes On a 12 GB card in Series X mode the card stays over its budget for most of a session, and new textures stay at their small levels ("textures never load" for the player). Slot eviction can free almost nothing, because most idle textures are shown by slots that shaders pick by index. `VICTORY_SAMPLED_MARKS=1` already knows which of those slots no shader read. `VICTORY_SAMPLED_EVICT=1` used to act on that, but `victory play` turned it off on 2026-11-28 because foliage flickered: foliage that is read every few seconds was let go within the idle time and came back a frame late. This adds a third value, `VICTORY_SAMPLED_EVICT=pressure`, and makes it `victory play`'s default: - The marks are trusted only while the card's use is at 95 % of its budget or more (`sampled::PRESSURE_PERCENT`). With room on the card, indexed textures are left alone, as with `0`. - Even then, a texture picked by index goes only if no shader marked any of its slots for 1,800 frames (`sampled::PRESSURE_COLD_FRAMES`, about a minute at 30 fps), or for the pass's own idle time if that is longer. Foliage read every few seconds never qualifies. - `slots_still_evictable` (the aside path) asks again just before the eviction, so a decision made with the card full is not carried out after it has room again. - Re-queueing a slot a shader reads again is unchanged (`evict_on()` stays true in this mode). - `1` behaves exactly as before. The card's memory is only queried in `pressure` mode. What it trades: the room it frees goes to the textures that were waiting for room, so they reach their full levels. It does not lower the card's use (see @DoubleD17's like-for-like A/B below). ## How it was tested - GPU and profile: RTX 5070 12 GB, Ryzen 5 9600X, 32 GB RAM, Windows 11 26300, driver 621.24. Series X, 2560x1440, DLSS Performance, DLSS frame generation 2x, ray tracing off. - Before (50 minutes of open-world play, v2026.11.30.03-based build, `VICTORY_SAMPLED_EVICT=0`): - the card at 10.1 GB in use after two minutes, rising to 11.9-12.0 GB against a budget of 10.7 GB for the rest of the run; - slot eviction: of 27,434 idle-looking textures, 19,936 not taken because a slot picked by index shows them; - the marks: 1.2 to 3.1 GB of textures picked by index that no shader read within the idle time, every five-second line; - 406,876 textures made from their small levels for want of room; "no room, new textures wait" in 569 of 574 texture-queue lines; - frame generation switched off and on 76 times with "out of VRAM" (code 39). - Like-for-like A/B by @DoubleD17 ([comment](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7304346423)): RTX 5070 12 GB, Ryzen 7 5800X, 64 GB RAM, main 5fabb46e with this PR, Series X 2560x1440 DLAA, frame generation and ray tracing off; idle camera, 150 s, four runs per arm alternated, only `VICTORY_SAMPLED_EVICT=pressure` against `0` differing; the card at 10.3-11.0 GB of a 10.74 GB budget: - textures made from their small levels for want of room: with `0`, 2 to 5 % grew to their levels; with `pressure`, all of them did (30,934 to 50,213 a run); - card use: the same in both arms (mean 10,620 MB against 10,619 MB): the room freed went to the waiting textures; - frame rate: no difference beyond run-to-run noise; - no foliage flicker in 800 frames; - not tested: movement (the case `=1` was turned off for), other cards, Series S, frame generation on. - Run by @Lyrnc ([comment](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7309890079)): RTX 5080 16 GB with `VICTORY_VRAM_BUDGET_MB=8192` standing in for an 8 GB card, Series X 1440p DLSS Quality, a 12-minute scripted walk, two runs each against main 5fabb46e: - main let go of no texture (27,612 of 27,804 idle-looking ones blocked by slots picked by index); this lets 600-900 MB of texture copies go, the queue's counted use ends under its line, and the oldest due texture drops from 6,665-9,012 frames to 21-3,002; - about 27,000 slots a run were read again while null (the neutral texture until the next readback and upload; not looked at on screen); - frame rate within run-to-run noise; - about 200 "uploaded again" warnings in the first two minutes (main: 2-16). Cause: before frame 1,800 the cutoff saturated to 0, so a slot never marked counted as a minute cold. Fixed in 981dd225 by @andrewpozdnakov7-jpg: pressure mode leaves textures picked by index alone until a full 1,800-frame window has passed (`cutoff_for` checked at frames 1,799 / 1,800 / 1,801: `None` / `Some(0)` / `Some(1)`). Not run in the game on the new head yet. - After (my run, not like-for-like, read it as an indication only): a 6-minute open-world run with this branch's change in a build that also carries #4247, #4294, #4288, #4206, #4255, #4200, #4219, #4226, #4297, #4233, #3487, #4080 and #3975 (`VICTORY_SAMPLED_EVICT=pressure`, the rest as before). Not the same route or length as the 50-minute run: - the card at 10.44-10.47 GB of a 10.72-10.79 GB budget from the second minute to the end (under budget throughout; the A/B above did not reproduce this, and this run carried the other PRs listed); - 35,327 slots picked by index put back to null, 9,753 of them queued again as a shader read them, 25,574 still null at the end; - textures held at their small levels with "the card past 97 %": 0 (50.9 million refusals in the 50-minute run); - frame generation "out of VRAM": 1 (77); - no foliage flicker noticed by the player; the session ended normally. - For shader changes: none. - `cargo test -p victory-gpu --lib` passed for this branch, with two new tests (`the_evict_switch_reads_its_modes`, `pressure_trusts_the_marks_only_with_the_card_full_and_a_minute_back`). 981dd225 adds the frame-1,800 boundary to the second. The two failures `list::thin::tests::bindings_record_no_work` and `shader_cache::tests::every_switch_of_the_translator_is_in_the_key` fail on `main` too (#4296 fixes them). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3128 (enables sampled eviction by default through 10 GB of VRAM; this keeps it off until the card is full and asks for a minute without a read), #3127 (F1 menu item), #3697 and #4432/#4465 (backoff and sampling windows of slot eviction; they touch the same path but not the trust decision).
DoubleD17 commented 2026-12-01 07:40:37 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by DoubleD17 on 2026-12-01T07:40:37Z.


A like-for-like A/B of this PR on the card it targets, in case it helps.

Setup

  • Hardware: RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X, 64 GB RAM, Windows 11.
  • Build: one release build, main 5fabb46e with this PR (02fe88f6) merged. The two arms differ only by --set VICTORY_SAMPLED_EVICT=pressure against --set VICTORY_SAMPLED_EVICT=0.
  • Profile: Series X, 2560x1440 DLAA, frame generation off, ray tracing off, VICTORY_TEXTURE_ROOM_PERCENT=80.
  • Runs: idle camera from the same starting point, 150 s from the first world frame. Four runs per arm, alternated (ABBA twice). Each run ends with 200 frames captured at 10 a second.
  • Card state: the card sat at 10.3 to 11.0 GB of a 10.74 GB budget, so the 95 % trigger was live in every pressure run. Both arms logged "no room, new textures wait" in 28 to 30 of the ~30 texture-queue lines of every run.

Textures made from their small levels for want of room, at 150 s:

arm made small grown to their levels
0, 4 runs 23,126 / 14,152 / 25,675 / 18,674 801 / 741 / 609 / 527 (2 to 5 %)
pressure, 4 runs 38,622 / 46,906 / 30,934 / 50,213 38,622 / 46,902 / 30,934 / 50,213 (all)
  • In the pressure runs this PR put 30,860 to 33,227 slots picked by index back to null, and 27,561 to 28,490 were still null at the end of each run.
  • For comparison, seven of our runs without this PR used the same profile:
    • builds: main e1251c31, and 5fabb46e-based builds whose one extra change was switched off or never acted;
    • five grew 1 to 7 % of these textures, one 32 %, and one all of them.

VRAM: no change on average.

  • Mean use over each run's world time was 10,620 MB with pressure against 10,619 MB with 0.
  • It varied more between runs than between arms:
    • pressure: 10,354 / 10,320 / 10,803 / 11,004 MB.
    • 0: 10,586 / 10,496 / 10,629 / 10,764 MB.
  • Our reading, not measured: the queue was waiting all the time, so the room this frees seems to go to the textures that were waiting (the table above) rather than back under the budget.

Frame rate: no difference beyond our run-to-run noise.

  • Base fps, mean per run:
    • pressure: 16.71 / 15.60 / 15.25 / 15.53.
    • 0: 15.96 / 7.70 / 17.08 / 16.54.
  • The 7.70 run (0) spent 136 ms a frame in CPU preparation from the start while under its budget, so it is unrelated to eviction.
  • Without that run, 0 averages 16.53 and pressure 15.77 (-4.6 %), inside the 15.25 to 17.08 spread of the runs.

Picture: 800 frames per arm. We looked at every frame a frame-to-frame check flagged.

  • No foliage flicker or other texture popping in the pressure runs.
  • 0: one frame with foliage missing, the one-frame vegetation gap we also see on main.
  • pressure: three frames where the whole picture is drawn from a slightly different camera position for one frame. The same kind shows in our main runs without this PR (4 in 1,840 frames tonight), so we don't attribute it to this change.

Not tested: movement (idle camera only), other cards, Series S, frame generation on, runs longer than 150 s.

AI Assisted

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7304346423 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7304346423). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-12-01T07:40:37Z. --- A like-for-like A/B of this PR on the card it targets, in case it helps. **Setup** - **Hardware:** RTX 5070 12 GB (driver 621.40), Ryzen 7 5800X, 64 GB RAM, Windows 11. - **Build:** one release build, main 5fabb46e with this PR (02fe88f6) merged. The two arms differ only by `--set VICTORY_SAMPLED_EVICT=pressure` against `--set VICTORY_SAMPLED_EVICT=0`. - **Profile:** Series X, 2560x1440 DLAA, frame generation off, ray tracing off, `VICTORY_TEXTURE_ROOM_PERCENT=80`. - **Runs:** idle camera from the same starting point, 150 s from the first world frame. Four runs per arm, alternated (ABBA twice). Each run ends with 200 frames captured at 10 a second. - **Card state:** the card sat at 10.3 to 11.0 GB of a 10.74 GB budget, so the 95 % trigger was live in every `pressure` run. Both arms logged "no room, new textures wait" in 28 to 30 of the ~30 texture-queue lines of every run. **Textures made from their small levels for want of room**, at 150 s: | arm | made small | grown to their levels | |---|---|---| | `0`, 4 runs | 23,126 / 14,152 / 25,675 / 18,674 | 801 / 741 / 609 / 527 (2 to 5 %) | | `pressure`, 4 runs | 38,622 / 46,906 / 30,934 / 50,213 | 38,622 / 46,902 / 30,934 / 50,213 (all) | - In the `pressure` runs this PR put 30,860 to 33,227 slots picked by index back to null, and 27,561 to 28,490 were still null at the end of each run. - For comparison, seven of our runs without this PR used the same profile: - builds: main e1251c31, and 5fabb46e-based builds whose one extra change was switched off or never acted; - five grew 1 to 7 % of these textures, one 32 %, and one all of them. **VRAM: no change on average.** - Mean use over each run's world time was 10,620 MB with `pressure` against 10,619 MB with `0`. - It varied more between runs than between arms: - `pressure`: 10,354 / 10,320 / 10,803 / 11,004 MB. - `0`: 10,586 / 10,496 / 10,629 / 10,764 MB. - Our reading, not measured: the queue was waiting all the time, so the room this frees seems to go to the textures that were waiting (the table above) rather than back under the budget. **Frame rate: no difference beyond our run-to-run noise.** - Base fps, mean per run: - `pressure`: 16.71 / 15.60 / 15.25 / 15.53. - `0`: 15.96 / 7.70 / 17.08 / 16.54. - The 7.70 run (`0`) spent 136 ms a frame in CPU preparation from the start while under its budget, so it is unrelated to eviction. - Without that run, `0` averages 16.53 and `pressure` 15.77 (-4.6 %), inside the 15.25 to 17.08 spread of the runs. **Picture: 800 frames per arm.** We looked at every frame a frame-to-frame check flagged. - No foliage flicker or other texture popping in the `pressure` runs. - `0`: one frame with foliage missing, the one-frame vegetation gap we also see on main. - `pressure`: three frames where the whole picture is drawn from a slightly different camera position for one frame. The same kind shows in our main runs without this PR (4 in 1,840 frames tonight), so we don't attribute it to this change. **Not tested:** movement (idle camera only), other cards, Series S, frame generation on, runs longer than 150 s. AI Assisted
mcozcan commented 2026-12-01 11:01:41 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-12-01T11:01:41Z.


@DoubleD17 thank you, that's the like-for-like run this PR was missing.

My reading: the main claim holds. The PR is for textures stuck at their small levels, and in your pressure runs every texture made small grew to its levels (all of 30,934 to 50,213, against 2 to 5 % with 0), with no flicker in 800 frames. The second claim does not hold: my "after" run had the card under its budget, but that run was not like-for-like and carried other PRs too. In yours, VRAM is the same in both arms, because the room this frees goes to the textures that were waiting. I'll correct the description to say so: this trades cold indexed textures for full levels of the ones in view, and does not lower the card's use. The frame rate difference is inside your run-to-run spread.

The gap is movement. =1 was turned off for foliage flicker while moving, and with an idle camera the 1,800-frame rule is never tested against textures that come back into view. If you can, a run of the same length while driving or walking a fixed route, both arms, would settle it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7309064351 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7309064351). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-12-01T11:01:41Z. --- @DoubleD17 thank you, that's the like-for-like run this PR was missing. My reading: the main claim holds. The PR is for textures stuck at their small levels, and in your pressure runs every texture made small grew to its levels (all of 30,934 to 50,213, against 2 to 5 % with 0), with no flicker in 800 frames. The second claim does not hold: my "after" run had the card under its budget, but that run was not like-for-like and carried other PRs too. In yours, VRAM is the same in both arms, because the room this frees goes to the textures that were waiting. I'll correct the description to say so: this trades cold indexed textures for full levels of the ones in view, and does not lower the card's use. The frame rate difference is inside your run-to-run spread. The gap is movement. =1 was turned off for foliage flicker while moving, and with an idle camera the 1,800-frame rule is never tested against textures that come back into view. If you can, a run of the same length while driving or walking a fixed route, both arms, would settle it.
Lyrnc commented 2026-12-01 11:37:06 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-12-01T11:37:06Z.


Test of this pull request in game (head 02fe88f6, cherry-picked unchanged onto main 5fabb46e), against main 5fabb46e.

  • PC: RTX 5080 16 GB (driver 610.88), Ryzen 7 9800X3D, 32 GB RAM, Windows 11.
  • Profile: Series X, 2560x1440, DLSS Quality, frame generation off, ray tracing off. victory play defaults otherwise: VICTORY_SAMPLED_MARKS=1 and VICTORY_SLOT_EVICT=1, plus VICTORY_SAMPLED_EVICT=pressure on this branch.
  • VICTORY_VRAM_BUDGET_MB=8192 stands in for an 8 GB card. It is not one: the driver still has 16 GB, so nothing is paged when use goes past 8,192 MB. Read "card MB in use" as what a real 8 GB card would have to page.
  • Release builds, one warm shader cache for both, the same save, and a 12-minute scripted walk (walking from world+30 s to about world+660 s). Two runs of each. This PR's runs come from #4850's build with VICTORY_SAMPLED_SHRINK=0, which is this PR's code exactly.

Columns are world+30-330 s / 330-630 s / 630-690 s (the last one is short). Where a cell has two values separated by ";", they are the two runs.

main 5fabb46e this PR
card MB in use (median), budget 8,192 8,780 / 8,841 / 8,892; 8,698 / 8,765 / 8,782 8,344 / 8,280 / 8,029; 8,618 / 8,456 / 8,414
texture copies MB (the queue's room line), first two segments 3,193 / 3,149; 3,189 / 3,144 2,404 / 2,260; 2,589 / 2,687
queue's counted use against its line of 7,424 MB: mean over the run / last line 8,492 / 8,632; 8,534 / 8,706 7,886 / 6,733; 8,221 / 6,884
texture queue lines saying "no room, new textures wait" 130 of 135; 131 of 136 123 of 137; 125 of 136
textures picked by index due (median), oldest due in frames (median), first segment 1,114, 9,012; 1,055, 6,665 178, 21; 435, 3,002
served late: frames after due, the most 463; 313 63; 55
slots picked by index put back to null / of them read again while null 0 70,126 / 27,358; 62,453 / 27,071
fps 29.2 / 30.3 / 29.7; 27.2 / 28.1 / 33.3 28.2 / 30.0 / 35.1; 25.9 / 27.4 / 34.2
frames over 50 ms, per 1,000 96 / 87 / 92; 123 / 100 / 16 117 / 83 / 14; 170 / 135 / 16
frames over 100 ms, per 1,000 2.6 / 3.0 / 1.1; 2.3 / 1.7 / 0.0 3.6 / 1.5 / 0.0; 3.4 / 1.1 / 0.0

What I read from it:

  • It frees memory where main frees none. Main's slot eviction let go of 0 textures: 27,612 of its 27,804 idle-looking textures were blocked by slots picked by index. With this PR, 600-900 MB of texture copies go, the queue's counted use is under its line by the end of the walk, and the queue catches up (the oldest due texture is far younger).
  • About 27,000 slots per run were read again while null. Each showed the neutral texture from the read until the next readback (every 4 frames in these runs, because slots were held for room) and the upload of its texture. I did not look at this on screen: these were release builds without captures.
  • In the first segment, both runs had more frames over 50 ms than either main run (117 and 170 against 96 and 123). Main's own two runs differ by up to 76 per 1,000, so I cannot say whether this is real.
  • In the first two minutes after start, this branch logged about 200 "a texture picked by index changed after its upload with nothing to tell of it: uploaded again" warnings, almost all of them on one slot (slot 115 in one run). Main logged 2 and 16 in all. A likely cause is the cutoff early in a run: until frame 1,800, frame - PRESSURE_COLD_FRAMES saturates to 0, so any slot not marked since the start counts as a minute cold. Holding the trust back until frame 1,800 might avoid it.
  • At the 16 GB budget, the card sat at 87-91 % of it on this route, below PRESSURE_PERCENT, so this PR changes nothing there (seen in a run of #4850's build, which has this commit).
  • Not tested: a real 8 or 12 GB card, frame generation.

We built on this PR in #4850 (draft, depends on this one). Textures picked by index whose copy takes more than one 64 KiB piece of the texture pool are cut to their small levels instead of put to null, so their slots never show the neutral texture. Textures of one piece, which are most of them, go this PR's way.

AI use: Claude Code (Claude Opus 5.5) ran the comparison from our bench logs and wrote this comment.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7309890079 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7309890079). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-12-01T11:37:06Z. --- Test of this pull request in game (head 02fe88f6, cherry-picked unchanged onto main 5fabb46e), against main 5fabb46e. - PC: RTX 5080 16 GB (driver 610.88), Ryzen 7 9800X3D, 32 GB RAM, Windows 11. - Profile: Series X, 2560x1440, DLSS Quality, frame generation off, ray tracing off. `victory play` defaults otherwise: `VICTORY_SAMPLED_MARKS=1` and `VICTORY_SLOT_EVICT=1`, plus `VICTORY_SAMPLED_EVICT=pressure` on this branch. - `VICTORY_VRAM_BUDGET_MB=8192` stands in for an 8 GB card. It is not one: the driver still has 16 GB, so nothing is paged when use goes past 8,192 MB. Read "card MB in use" as what a real 8 GB card would have to page. - Release builds, one warm shader cache for both, the same save, and a 12-minute scripted walk (walking from world+30 s to about world+660 s). Two runs of each. This PR's runs come from #4850's build with `VICTORY_SAMPLED_SHRINK=0`, which is this PR's code exactly. Columns are world+30-330 s / 330-630 s / 630-690 s (the last one is short). Where a cell has two values separated by ";", they are the two runs. | | main 5fabb46e | this PR | |---|---|---| | card MB in use (median), budget 8,192 | 8,780 / 8,841 / 8,892; 8,698 / 8,765 / 8,782 | 8,344 / 8,280 / 8,029; 8,618 / 8,456 / 8,414 | | texture copies MB (the queue's room line), first two segments | 3,193 / 3,149; 3,189 / 3,144 | 2,404 / 2,260; 2,589 / 2,687 | | queue's counted use against its line of 7,424 MB: mean over the run / last line | 8,492 / 8,632; 8,534 / 8,706 | 7,886 / 6,733; 8,221 / 6,884 | | texture queue lines saying "no room, new textures wait" | 130 of 135; 131 of 136 | 123 of 137; 125 of 136 | | textures picked by index due (median), oldest due in frames (median), first segment | 1,114, 9,012; 1,055, 6,665 | 178, 21; 435, 3,002 | | served late: frames after due, the most | 463; 313 | 63; 55 | | slots picked by index put back to null / of them read again while null | 0 | 70,126 / 27,358; 62,453 / 27,071 | | fps | 29.2 / 30.3 / 29.7; 27.2 / 28.1 / 33.3 | 28.2 / 30.0 / 35.1; 25.9 / 27.4 / 34.2 | | frames over 50 ms, per 1,000 | 96 / 87 / 92; 123 / 100 / 16 | 117 / 83 / 14; 170 / 135 / 16 | | frames over 100 ms, per 1,000 | 2.6 / 3.0 / 1.1; 2.3 / 1.7 / 0.0 | 3.6 / 1.5 / 0.0; 3.4 / 1.1 / 0.0 | What I read from it: - It frees memory where main frees none. Main's slot eviction let go of 0 textures: 27,612 of its 27,804 idle-looking textures were blocked by slots picked by index. With this PR, 600-900 MB of texture copies go, the queue's counted use is under its line by the end of the walk, and the queue catches up (the oldest due texture is far younger). - About 27,000 slots per run were read again while null. Each showed the neutral texture from the read until the next readback (every 4 frames in these runs, because slots were held for room) and the upload of its texture. I did not look at this on screen: these were release builds without captures. - In the first segment, both runs had more frames over 50 ms than either main run (117 and 170 against 96 and 123). Main's own two runs differ by up to 76 per 1,000, so I cannot say whether this is real. - In the first two minutes after start, this branch logged about 200 "a texture picked by index changed after its upload with nothing to tell of it: uploaded again" warnings, almost all of them on one slot (slot 115 in one run). Main logged 2 and 16 in all. A likely cause is the cutoff early in a run: until frame 1,800, `frame - PRESSURE_COLD_FRAMES` saturates to 0, so any slot not marked since the start counts as a minute cold. Holding the trust back until frame 1,800 might avoid it. - At the 16 GB budget, the card sat at 87-91 % of it on this route, below `PRESSURE_PERCENT`, so this PR changes nothing there (seen in a run of #4850's build, which has this commit). - Not tested: a real 8 or 12 GB card, frame generation. We built on this PR in #4850 (draft, depends on this one). Textures picked by index whose copy takes more than one 64 KiB piece of the texture pool are cut to their small levels instead of put to null, so their slots never show the neutral texture. Textures of one piece, which are most of them, go this PR's way. AI use: Claude Code (Claude Opus 5.5) ran the comparison from our bench logs and wrote this comment.
andrewpozdnakov7-jpg commented 2026-12-01 11:42:23 +00:00 (Migrated from github.com)

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


The startup observation from Lyrnc matches the current cutoff in 02fe88f6: before frame 1,800, the saturating subtraction returns 0. A slot with no mark can therefore be considered cold even though there have been fewer than 1,800 frames.

981dd22555 makes pressure mode wait for the full 1,800-frame window. At the boundary the cutoff is 0, and after that the existing budget threshold and idle-time rules apply. Mode 1 is unchanged. Review commit

I ran the existing cutoff test with boundary checks at frames 1,799, 1,800, and 1,801, using the exact selector on Rust 1.98.1. The author version returned Some(0) at 1,799 and failed. The fix returned None there, then Some(0) and Some(1); the rest of that test and the one-file staged policy passed. A repeat of the same startup route on this change would show whether it reduces the early reupload warnings.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7310016349 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7310016349). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T11:42:23Z. --- The [startup observation from Lyrnc](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7309890079) matches the current cutoff in `02fe88f6`: before frame 1,800, the saturating subtraction returns 0. A slot with no mark can therefore be considered cold even though there have been fewer than 1,800 frames. 981dd22555fa550a1585218a9561789639981963 makes pressure mode wait for the full 1,800-frame window. At the boundary the cutoff is 0, and after that the existing budget threshold and idle-time rules apply. Mode `1` is unchanged. [Review commit](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/981dd22555fa550a1585218a9561789639981963) I ran the existing cutoff test with boundary checks at frames 1,799, 1,800, and 1,801, using the exact selector on Rust 1.98.1. The author version returned `Some(0)` at 1,799 and failed. The fix returned `None` there, then `Some(0)` and `Some(1)`; the rest of that test and the one-file staged policy passed. A repeat of the same startup route on this change would show whether it reduces the early reupload warnings. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
mcozcan commented 2026-12-01 12:08:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-12-01T12:08:42Z.


@andrewpozdnakov7-jpg thanks, confirmed. A slot never marked has stamp 0 and seen_since(0, _) is false, so before frame 1,800 pressure mode took every unmarked slot for a minute cold, including slots the title had just written and no shader had read yet. A minute without a read can't be judged before a minute has passed. I took 981dd225 as is (a fast-forward, your authorship kept), and checked cutoff_for at frames 1,799, 1,800 and 1,801 on its own: None, Some(0), Some(1).

@Lyrnc thanks for the bench. This fits the ~200 early "uploaded again" warnings; a repeat of the startup route on the new head would confirm it. The ~27,000 slots read again while null are the cost of putting slots to null under pressure. #4850's cut to small levels covers the textures of more than one piece, and I'll watch for the neutral texture on screen in real 8 GB runs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7310715279 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7310715279). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-12-01T12:08:42Z. --- @andrewpozdnakov7-jpg thanks, confirmed. A slot never marked has stamp 0 and `seen_since(0, _)` is false, so before frame 1,800 pressure mode took every unmarked slot for a minute cold, including slots the title had just written and no shader had read yet. A minute without a read can't be judged before a minute has passed. I took 981dd225 as is (a fast-forward, your authorship kept), and checked `cutoff_for` at frames 1,799, 1,800 and 1,801 on its own: `None`, `Some(0)`, `Some(1)`. @Lyrnc thanks for the bench. This fits the ~200 early "uploaded again" warnings; a repeat of the startup route on the new head would confirm it. The ~27,000 slots read again while null are the cost of putting slots to null under pressure. #4850's cut to small levels covers the textures of more than one piece, and I'll watch for the neutral texture on screen in real 8 GB runs.
Lyrnc commented 2026-12-01 13:08:20 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-12-01T13:08:20Z.


Startup route on the new head (981dd225), as asked. Built as this PR's two commits on main 5fabb46e, the same base as my earlier runs. Same PC, profile (Series X 1440p, DLSS Quality, frame generation off), route and warm cache, VICTORY_VRAM_BUDGET_MB=8192, 300 s runs.

This counts "a texture picked by index changed after its upload with nothing to tell of it" in the first 120 s after start. The line is logged only for the first 200, so 200 means at least 200.

run build first 120 s of them on slots under 1,000 world's first frame
new 1 981dd225 200 193 (most on slot 114) 60 s
new 2 981dd225 200 193 (most on slot 136) 56 s
earlier 1 02fe88f6 200 194 (slot 115) 56 s
earlier 2 02fe88f6 10 0 59 s
main, 2 runs 5fabb46e 15, 2 0, 0 60 s

So on this route the fix does not remove it. In both new runs, the first slots were put to null 36-47 s after start, while the loading screen was still up. The low-slot warnings began within a few seconds of that, as in the earlier run that had them. The loading screen runs at 600-970 fps here, so frame 1,800 comes about 3 s after it starts and the history window is full long before the world. A guard counted from the world's first frame, or in seconds, would cover this. So would leaving alone slots that were never marked. We can run whichever you pick.

A correction to my earlier comment: only one of my two earlier runs had this burst. The other reached the 200-line cap later, spread over minutes 1-6 on high slots. Main at the 16 GB budget also reached that cap once, at minute 3. What sets this branch apart is the burst on low slots right after the first evictions during loading. It appeared in 4 of 5 runs of builds with 02fe88f6 at 8 GB (two of this PR alone, three with #4850 on top), in 2 of 2 with 981dd225, and in 0 of 2 main runs.

AI use: Claude Code (Claude Opus 5.5) ran these from our bench and wrote this comment.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7312160717 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7312160717). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-12-01T13:08:20Z. --- Startup route on the new head (981dd225), as asked. Built as this PR's two commits on main 5fabb46e, the same base as my earlier runs. Same PC, profile (Series X 1440p, DLSS Quality, frame generation off), route and warm cache, `VICTORY_VRAM_BUDGET_MB=8192`, 300 s runs. This counts "a texture picked by index changed after its upload with nothing to tell of it" in the first 120 s after start. The line is logged only for the first 200, so 200 means at least 200. | run | build | first 120 s | of them on slots under 1,000 | world's first frame | |---|---|---:|---:|---:| | new 1 | 981dd225 | 200 | 193 (most on slot 114) | 60 s | | new 2 | 981dd225 | 200 | 193 (most on slot 136) | 56 s | | earlier 1 | 02fe88f6 | 200 | 194 (slot 115) | 56 s | | earlier 2 | 02fe88f6 | 10 | 0 | 59 s | | main, 2 runs | 5fabb46e | 15, 2 | 0, 0 | 60 s | So on this route the fix does not remove it. In both new runs, the first slots were put to null 36-47 s after start, while the loading screen was still up. The low-slot warnings began within a few seconds of that, as in the earlier run that had them. The loading screen runs at 600-970 fps here, so frame 1,800 comes about 3 s after it starts and the history window is full long before the world. A guard counted from the world's first frame, or in seconds, would cover this. So would leaving alone slots that were never marked. We can run whichever you pick. A correction to my earlier comment: only one of my two earlier runs had this burst. The other reached the 200-line cap later, spread over minutes 1-6 on high slots. Main at the 16 GB budget also reached that cap once, at minute 3. What sets this branch apart is the burst on low slots right after the first evictions during loading. It appeared in 4 of 5 runs of builds with 02fe88f6 at 8 GB (two of this PR alone, three with #4850 on top), in 2 of 2 with 981dd225, and in 0 of 2 main runs. AI use: Claude Code (Claude Opus 5.5) ran these from our bench and wrote this comment.
mcozcan commented 2026-12-01 13:17:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-12-01T13:17:07Z.


@Lyrnc thanks, that settles it: at 600-970 fps the loading screen fills the 1,800-frame window in about 3 s, so 981dd225 only moved the start.

A guard in seconds wouldn't fix the cause either. The slots that go are ones the title has just written during loading and no shader has read yet. A slot's mark stamp is only set by a mark and never reset by a write, so "never read since it was written" looked the same as "unread for a minute". A slot read once in a menu and then rewritten has the same problem. A guard from the world's first frame would only move it again.

e0f562de counts the window from a slot's last write as well as its last mark, in pressure mode only:

  • crate::sampled keeps a write stamp per slot next to the mark stamp. The texture queue notes it with every write it records (written_returning, so also the re-queue after a slot read while null).
  • Pressure mode keeps a slot picked by index unless it has been neither read nor written within the window (trust_keeps, used by both evictable_slots and slots_still_evictable).
  • Mode 1 is unchanged, and so is the 1,800-frame floor.

Slots left unwritten and unread for a whole window still go, so the memory it frees should stay close to what you measured. A new test (a_slot_written_within_the_window_is_kept_unread) covers four cases: read before the window, written within it and unread, written before it and unread, and read again after a write. It and the existing history test pass when run on their own; not built on Windows or run in the game yet.

If you can, the same startup route on e0f562de would show whether the low-slot burst is gone. The other numbers from your first table (MB freed, oldest due texture, slots read again while null) would show whether it costs any of the memory.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7312381824 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7312381824). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-12-01T13:17:07Z. --- @Lyrnc thanks, that settles it: at 600-970 fps the loading screen fills the 1,800-frame window in about 3 s, so 981dd225 only moved the start. A guard in seconds wouldn't fix the cause either. The slots that go are ones the title has just written during loading and no shader has read yet. A slot's mark stamp is only set by a mark and never reset by a write, so "never read since it was written" looked the same as "unread for a minute". A slot read once in a menu and then rewritten has the same problem. A guard from the world's first frame would only move it again. e0f562de counts the window from a slot's last write as well as its last mark, in pressure mode only: - `crate::sampled` keeps a write stamp per slot next to the mark stamp. The texture queue notes it with every write it records (`written_returning`, so also the re-queue after a slot read while null). - Pressure mode keeps a slot picked by index unless it has been neither read nor written within the window (`trust_keeps`, used by both `evictable_slots` and `slots_still_evictable`). - Mode `1` is unchanged, and so is the 1,800-frame floor. Slots left unwritten and unread for a whole window still go, so the memory it frees should stay close to what you measured. A new test (`a_slot_written_within_the_window_is_kept_unread`) covers four cases: read before the window, written within it and unread, written before it and unread, and read again after a write. It and the existing history test pass when run on their own; not built on Windows or run in the game yet. If you can, the same startup route on e0f562de would show whether the low-slot burst is gone. The other numbers from your first table (MB freed, oldest due texture, slots read again while null) would show whether it costs any of the memory.
andrewpozdnakov7-jpg commented 2026-12-01 13:19:09 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T13:19:09Z.


The startup replay on 981dd225 still hit the warning cap in both runs. The first nulls appeared at 36–47 s. The loading screen can accumulate 1,800 frames in about three seconds, so even the per-slot write timestamp added in e0f562de can age out quickly there.

84313ebf keeps the new per-slot write check and limits pressure eviction to marks or writes at least 60 elapsed seconds and 1,800 frames old. It uses the eviction sweep's existing frame/time ring, and keeps indexed textures until that history exists. The selected cutoff is the oldest of the elapsed-time, frame-count, and pass cutoffs.

I ran the exact decision and history functions at a synthetic 960 FPS. e0f562de allowed pressure eviction at 45 s. The patch kept it disabled then, selected frame 1 at 60 s and frame 961 at 61 s, and kept the original 95% budget and 1,800-frame gates. Mode 1 still uses the pass cutoff without querying the card budget. The staged check passed for both files.

The next replay should use the current PR head, e0f562de, to isolate the per-slot write fix. If the same early burst persists there, 84313ebf is a follow-up that guards the elapsed window as well.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7312433191 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7312433191). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T13:19:09Z. --- The [startup replay on 981dd225](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7312160717) still hit the warning cap in both runs. The first nulls appeared at 36–47 s. The loading screen can accumulate 1,800 frames in about three seconds, so even the per-slot write timestamp added in `e0f562de` can age out quickly there. [84313ebf](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/84313ebf2eb77c30841b0ff505031186085cf426) keeps the new per-slot write check and limits pressure eviction to marks or writes at least 60 elapsed seconds and 1,800 frames old. It uses the eviction sweep's existing frame/time ring, and keeps indexed textures until that history exists. The selected cutoff is the oldest of the elapsed-time, frame-count, and pass cutoffs. I ran the exact decision and history functions at a synthetic 960 FPS. `e0f562de` allowed pressure eviction at 45 s. The patch kept it disabled then, selected frame 1 at 60 s and frame 961 at 61 s, and kept the original 95% budget and 1,800-frame gates. Mode `1` still uses the pass cutoff without querying the card budget. The staged check passed for both files. The next replay should use the current PR head, e0f562de, to isolate the per-slot write fix. If the same early burst persists there, 84313ebf is a follow-up that guards the elapsed window as well. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
mcozcan commented 2026-12-01 13:20:54 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-12-01T13:20:54Z.


@andrewpozdnakov7-jpg thanks. I read 84313ebf and agree with it. A minute should be a minute of time and not only of frames, and the two fixes cover different things:

  • e0f562de keeps slots written within the window.
  • Yours makes the window itself at least 60 s, taking the frame from record_frame_ring (one point a second, 120 s kept). With the oldest of the three cutoffs, and no eviction of indexed textures until the ring holds 60 s, a slot written during a fast loading screen stays until it has been both unread and unwritten for a real minute.

I'll follow your order: the next startup replay on e0f562de alone, so the write stamp is measured by itself. Then 84313ebf on top, with your authorship kept. I'll take it whatever that replay shows, since the frame-only window is wrong at loading-screen frame rates either way; the replay tells us how much of the burst each part removes. If the ring is empty (slot eviction off), pressure mode keeps indexed textures, which is the safe side.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7312477114 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7312477114). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-12-01T13:20:54Z. --- @andrewpozdnakov7-jpg thanks. I read 84313ebf and agree with it. A minute should be a minute of time and not only of frames, and the two fixes cover different things: - e0f562de keeps slots written within the window. - Yours makes the window itself at least 60 s, taking the frame from `record_frame_ring` (one point a second, 120 s kept). With the oldest of the three cutoffs, and no eviction of indexed textures until the ring holds 60 s, a slot written during a fast loading screen stays until it has been both unread and unwritten for a real minute. I'll follow your order: the next startup replay on e0f562de alone, so the write stamp is measured by itself. Then 84313ebf on top, with your authorship kept. I'll take it whatever that replay shows, since the frame-only window is wrong at loading-screen frame rates either way; the replay tells us how much of the burst each part removes. If the ring is empty (slot eviction off), pressure mode keeps indexed textures, which is the safe side.
Jesper-Andersson commented 2026-12-01 16:35:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Jesper-Andersson on 2026-12-01T16:35:42Z.


Test on a real 8 GB card, head 732ee452 (with e0f562de; without 84313ebf). One session, so read it as one data point.

Setup: our fork's diagnostics build with this PR (all four commits, to 732ee452) and #4581 (to cef63b9c) cherry-picked onto it, not your branch on main. victory play's memory defaults (VICTORY_SLOT_EVICT=1, VICTORY_SAMPLED_MARKS=1), plus VICTORY_SAMPLED_EVICT=pressure, VICTORY_COMPACT_SPARSE=1, VICTORY_COMPACT_WHOLE=1. RTX 2070 SUPER 8 GB (driver 621.40, ReBAR off), Ryzen 7 5800X, 32 GB RAM, Windows 11 Pro Insider 10.0.26320. Series S, DLSS Performance, FSR 3 frame generation. Free play on my own save, 24 minutes in the world before the crash. GPU clocks locked at 1890 MHz in this run only. The session ended in a device hang and a PC crash (details on #4581; compaction never acted there).

Baseline: the census run from #4462 (comment): our build before these picks (this PR's first commit was in it, but with SAMPLED_EVICT unset its sampled line reports no eviction; #4581's first commit was in it with COMPACT_SPARSE=0), same defaults otherwise, 31.2 minutes, clocks not locked. Different route and length, so the comparison is rough.

baseline this PR
card over its budget first at 172 s, 10 % of 1,097 lines, worst +314 MB never; closest -341 MB of 7,048 MB
textures let go (MB) 5 (1) 11,642 (261)
made again: count (made again soon) 0 (0) 1,160 (15)
index-picked slots put to null / queued again as read none (sampled eviction off) 11,598 / 424
index-picked and unread in idle time, at the end 530 MB 557 MB
  • Pressure mode acted once. The card reached 6,696 of 7,048 MB (95 %) at world + 4.3 min, and about 10 s later almost everything went between two 5-second lines: 11,598 slots to null and 11,603 textures (256 MB) let go. After that only 39 more textures went, in 20 minutes.
  • "Uploaded again" warnings: both runs hit the 200-line cap before the world, and none of them were on slots under 1,000. This doesn't test e0f562de: nothing was put to null until 4.5 minutes into the world, so no slots went during loading.

Picture: screenshots every 46 s (baseline: every 91 s); I looked at all 20 and all 21. My worst ones show black sign boards and a black pole, neon-green blobs on foliage and a fence, white washed-out roads and grey shard-shaped tree LODs. The baseline run shows the same kinds: a black flag, black bollards and furniture, small green patches in trees, white ground and the same shard LODs. The worst shot of this run was also taken at world + 3.9 min, about 30 s before the eviction step, when only 5 textures had gone (as in the baseline). So I don't think these come from this PR.

  • One open item: after the step, the pause menu's blurred backdrop had a strong magenta/blue/green cast in 7 shots over about 5 minutes (the shot just before them, also the pause menu, looked normal). The baseline has no pause-menu shot, so I can't compare it.

A question: a slot put back to null shows "the neutral texture" until the next readback and upload (Lyrnc's bench didn't look at it on screen). Is the neutral texture all-zero black? If so, a nulled slot on screen would look the same as the black boards above, and only shots at the same spot with and without the PR would tell them apart.

Spec dependence:

  • Likely general: the eviction comes in one burst when the card reaches 95 % of its budget.
  • May depend on our specs: 8 GB card near its budget, Turing, ReBAR off, Series S; clocks locked by me for this run.
  • Untested elsewhere: other GPUs, AMD, 12-16 GB, Series X, frame generation off, ray tracing.

Not tested: a VICTORY_SAMPLED_EVICT=0 control on the same build and route; 84313ebf; release build; Series X; other cards; ray tracing; DLSS frame generation; flicker while moving (stills only).

Drafted with AI assistance (Claude Code).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7317865109 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7317865109). Originally posted by [Jesper-Andersson](https://github.com/Jesper-Andersson) on 2026-12-01T16:35:42Z. --- Test on a real 8 GB card, head 732ee452 (with e0f562de; without 84313ebf). One session, so read it as one data point. **Setup:** our fork's diagnostics build with this PR (all four commits, to 732ee452) and #4581 (to cef63b9c) cherry-picked onto it, not your branch on main. `victory play`'s memory defaults (`VICTORY_SLOT_EVICT=1`, `VICTORY_SAMPLED_MARKS=1`), plus `VICTORY_SAMPLED_EVICT=pressure`, `VICTORY_COMPACT_SPARSE=1`, `VICTORY_COMPACT_WHOLE=1`. RTX 2070 SUPER 8 GB (driver 621.40, ReBAR off), Ryzen 7 5800X, 32 GB RAM, Windows 11 Pro Insider 10.0.26320. Series S, DLSS Performance, FSR 3 frame generation. Free play on my own save, 24 minutes in the world before the crash. GPU clocks locked at 1890 MHz in this run only. The session ended in a device hang and a PC crash (details on #4581; compaction never acted there). **Baseline:** the census run from #4462 ([comment](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/4462#issuecomment-7316010584)): our build before these picks (this PR's first commit was in it, but with `SAMPLED_EVICT` unset its sampled line reports no eviction; #4581's first commit was in it with `COMPACT_SPARSE=0`), same defaults otherwise, 31.2 minutes, clocks not locked. Different route and length, so the comparison is rough. | | baseline | this PR | |---|---|---| | card over its budget | first at 172 s, 10 % of 1,097 lines, worst +314 MB | never; closest -341 MB of 7,048 MB | | textures let go (MB) | 5 (1) | 11,642 (261) | | made again: count (made again soon) | 0 (0) | 1,160 (15) | | index-picked slots put to null / queued again as read | none (sampled eviction off) | 11,598 / 424 | | index-picked and unread in idle time, at the end | 530 MB | 557 MB | - Pressure mode acted once. The card reached 6,696 of 7,048 MB (95 %) at world + 4.3 min, and about 10 s later almost everything went between two 5-second lines: 11,598 slots to null and 11,603 textures (256 MB) let go. After that only 39 more textures went, in 20 minutes. - "Uploaded again" warnings: both runs hit the 200-line cap before the world, and none of them were on slots under 1,000. This doesn't test e0f562de: nothing was put to null until 4.5 minutes into the world, so no slots went during loading. **Picture:** screenshots every 46 s (baseline: every 91 s); I looked at all 20 and all 21. My worst ones show black sign boards and a black pole, neon-green blobs on foliage and a fence, white washed-out roads and grey shard-shaped tree LODs. The baseline run shows the same kinds: a black flag, black bollards and furniture, small green patches in trees, white ground and the same shard LODs. The worst shot of this run was also taken at world + 3.9 min, about 30 s before the eviction step, when only 5 textures had gone (as in the baseline). So I don't think these come from this PR. - One open item: after the step, the pause menu's blurred backdrop had a strong magenta/blue/green cast in 7 shots over about 5 minutes (the shot just before them, also the pause menu, looked normal). The baseline has no pause-menu shot, so I can't compare it. A question: a slot put back to null shows "the neutral texture" until the next readback and upload (Lyrnc's bench didn't look at it on screen). Is the neutral texture all-zero black? If so, a nulled slot on screen would look the same as the black boards above, and only shots at the same spot with and without the PR would tell them apart. **Spec dependence:** - Likely general: the eviction comes in one burst when the card reaches 95 % of its budget. - May depend on our specs: 8 GB card near its budget, Turing, ReBAR off, Series S; clocks locked by me for this run. - Untested elsewhere: other GPUs, AMD, 12-16 GB, Series X, frame generation off, ray tracing. **Not tested:** a `VICTORY_SAMPLED_EVICT=0` control on the same build and route; 84313ebf; release build; Series X; other cards; ray tracing; DLSS frame generation; flicker while moving (stills only). Drafted with AI assistance (Claude Code).
mcozcan commented 2026-12-01 17:03:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by mcozcan on 2026-12-01T17:03:13Z.


@Jesper-Andersson thanks, a real 8 GB card is what this PR needed.

On your question: no, a slot put back to null shows gray, not black. texture_slot_evicted (descriptor/host.rs:4702) calls unmake (:4758-4778), which writes the slot through neutral_for (:576). For 2D textures and 2D arrays, that is a view of a 1x1 R8G8B8A8_UNORM texture filled with 0x80 in every channel, alpha included (make_neutral, :505). With VICTORY_NEUTRAL_ALL_KINDS on, which is the default, 1D, 3D and cube views get a gray stand-in of their own kind too. A slot gets a real null view, which reads as zeros (black), only when its view description can't be found or it is of some other kind.

So a nulled slot on screen should look mid-gray, or whatever the material does with 0.5 in every channel. It shouldn't look like the black boards. Your baseline run had those too, and the worst one in this run was taken before the eviction step. That fits with them not coming from this PR. Your line also caps how much could show: of the 11,598 slots put to null, 424 were read again. Only those could have shown gray, each one until its texture was uploaded again.

I can't explain the colour cast on the pause-menu backdrop from the code. Gray in a texture the blur reads would make the picture duller, not magenta or green. Still, 7 shots after the step and none before it is worth checking. The cleanest check is a pause-menu shot at the same spot with VICTORY_SAMPLED_EVICT=0 on the same build.

The burst you saw is how this mode works: nothing goes until the card reaches 95 % of its budget, and then everything picked by index that is idle for the window goes at once. 84313ebf, which isn't in your build, changes the window and not that.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318674663 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7318674663). Originally posted by [mcozcan](https://github.com/mcozcan) on 2026-12-01T17:03:13Z. --- @Jesper-Andersson thanks, a real 8 GB card is what this PR needed. On your question: no, a slot put back to null shows gray, not black. `texture_slot_evicted` (`descriptor/host.rs:4702`) calls `unmake` (`:4758-4778`), which writes the slot through `neutral_for` (`:576`). For 2D textures and 2D arrays, that is a view of a 1x1 `R8G8B8A8_UNORM` texture filled with `0x80` in every channel, alpha included (`make_neutral`, `:505`). With `VICTORY_NEUTRAL_ALL_KINDS` on, which is the default, 1D, 3D and cube views get a gray stand-in of their own kind too. A slot gets a real null view, which reads as zeros (black), only when its view description can't be found or it is of some other kind. So a nulled slot on screen should look mid-gray, or whatever the material does with 0.5 in every channel. It shouldn't look like the black boards. Your baseline run had those too, and the worst one in this run was taken before the eviction step. That fits with them not coming from this PR. Your line also caps how much could show: of the 11,598 slots put to null, 424 were read again. Only those could have shown gray, each one until its texture was uploaded again. I can't explain the colour cast on the pause-menu backdrop from the code. Gray in a texture the blur reads would make the picture duller, not magenta or green. Still, 7 shots after the step and none before it is worth checking. The cleanest check is a pause-menu shot at the same spot with `VICTORY_SAMPLED_EVICT=0` on the same build. The burst you saw is how this mode works: nothing goes until the card reaches 95 % of its budget, and then everything picked by index that is idle for the window goes at once. 84313ebf, which isn't in your build, changes the window and not that.
trustno1-coder commented 2026-12-01 18:37:04 +00:00 (Migrated from github.com)

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


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:7321225944 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4580#issuecomment-7321225944). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:37:04Z. --- 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!4580
No description provided.