Skip to content

Fix green/black textures on 8 GB GPUs (target reserve settle, slot eviction, neutral stand-in) - #1179

Merged
trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
EduardoMFOliveira:fix/8gb-green-black-textures
Nov 28, 2026
Merged

trustno1-coder merged 1 commit into
trustno1-coder:mainfrom
EduardoMFOliveira:fix/8gb-green-black-textures

Conversation

@EduardoMFOliveira

Copy link
Copy Markdown
Contributor

Summary

Fixes green and black textures observed on 8 GB GPUs (tested on an RTX 5060 Laptop GPU, 6.6–7.1 GB local budget, both Series X and Series S + FrameGen modes) without regressing FPS or stability.

Root Causes & Fixes

  1. Permanent render-target reserve (crates/victory-gpu/src/resource.rs — targets_kept):
    • targets_kept previously required targets >= most / 2 (1,536 MB) before settling to 0. On 8 GB / Series S / DLSS setups, in-world render targets stabilize around 1,185–1,450 MB, so the condition was never met and targets_room_kept() permanently added 1,620–1,887 MB of phantom usage to room(), locking 16k–31k textures out of the queue.
    • Lowered the threshold to (most / 4).min(1024 << 20) (768 MB with default most = 3072 MB), still safely above the ~652 MB pre-world menu baseline while allowing 8 GB / Series S / DLSS targets to settle.
  2. Slot eviction thresholds & table eligibility (resource.rs — slot_evict, descriptor/host.rs — HostHeap::slots_showing):
    • Clamped slot_evict's high/low watermarks against room_line(budget) and subtracted crate::pool::texture_room() from used, so eviction actually triggers when room() is capped at e.g. 80% (FrameGen).
    • Changed HostHeap::slots_showing from self.tabled_lately(i, frame) (which expired after TABLED_FRAMES = 240, shorter than idle_ms) to tabled_out() && self.tabled_stamp(i) != 0 so idle table-held textures can be evicted and re-mirrored on demand.
  3. Neutral 2D/2D-Array stand-in instead of null SRV (crates/victory-gpu/src/descriptor/host.rs — unmake, make_at, mirror):
    • Waiting, evicted, or unmade 2D / 2D-Array texture slots previously wrote null_for ((0, 0, 0, 0)), which renders black for albedo and bright green in YCoCg / BC5 normal-chrominance shaders (where 0.5 is subtracted). Replaced with neutral_for (1x1 R8G8B8A8_UNORM = 0x80).

Testing

  • cargo test --release -p victory-gpu: 453 passed; 0 failed (including updated room_for_targets_is_given_up_once_they_settle covering 1,185 MB world targets).
  • cargo build --release --locked -p victory: clean release build.
  • Verified in-game on RTX 5060 Laptop (8 GB) — green/black textures resolved.

…iction, neutral stand-in)

- Lower targets_kept() world threshold from most/2 (1536 MB) to (most/4).min(1 GiB) (768 MB) so 8 GB / Series S / DLSS target footprints (1185-1450 MB) settle instead of holding ~1.6-1.9 GB permanently.
- Clamp slot_evict() high/low thresholds against room_line(budget) and subtract pool::texture_room() so eviction activates when room() is tight (e.g. 80% with FrameGen).
- Fix HostHeap::slots_showing() to check tabled_out() && tabled_stamp(i) != 0 instead of tabled_lately() so idle table-held textures remain evictable past TABLED_FRAMES (240 frames).
- Use neutral_for() instead of null_for() in HostHeap::unmake, make_at, and mirror for 2D/2D-array views so waiting/evicted slots sample (0.5, 0.5, 0.5, 0.5) instead of (0, 0, 0, 0) (avoiding green YCoCg/BC5 and black albedo).
465d6a0eac added a commit to 465d6a0eac/VIctory-NVIDIA-Experiment that referenced this pull request Nov 28, 2026
…anged) and merged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
@T1bolus

T1bolus commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Confirmed on a setup bigger than the report's 8 GB cards: GeForce RTX 4070 SUPER 12 GB, AMD Ryzen 5 7600 (6 Zen 4 cores), Windows 11, Series S profile with DLSS performance and frame generation 2x. Built main with this PR and #1095 on top, and drove the same kind of street-parking scene that held whole rows of parked cars showing stale texture content for minutes.

log figure before with this PR + #1095
texture pass, held back for room, max per 5 s window 77,687 23,334 (avg 2,233)
texture pass, brought up to date although the card has no room, lines per run 679 142
preparing per frame 33.7 ms 30.9 ms
draws dropped without a host pipeline, per frame 267 135
fps 17.2 17.4
changed after its upload warnings 92 75

The parked cars' textures arrived with the frame they first appeared in instead of minutes later; the re-upload competition against room-full textures is largely gone. The stale warnings left over trace to title writes through aliased views (fixed separately), so the two figures do not share a root cause.

One merge note from a tree that carries the view remap and the alias-write fixes: unmake resolved as

self.keep(index, kept);
self.place_back(index);

— the neutral stand-in kept and the slot placed back. The kept from neutral_for(&view, ...) and the place_back wiring are independent, so both fit one branch.

cargo test -p victory-gpu --locked: 460 green.

@Exopus-0x65f7ad0

Copy link
Copy Markdown

A run on an 8 GB desktop card in the Series X profile, as a complement to the 5060 Laptop and 4070 SUPER results above.

Setup: RTX 5060 Ti 8 GB (vram_budget_mb ~7,100), 16 GB RAM, Windows 11 26300. 63b902f + local commits, with and without this PR (one run each, same save). README launcher defaults: Series X, native 1440p, DLSS Quality, no frame generation. Prison opening: cutscene plus a scripted 90 s walk.

without with #1179
kept for render targets in the room lines 0 MB in 65 of 85 lines (2,831–2,863 MB only during the load) 0 MB in 69 of 88 (same load peaks)
room lines ending in no room 40 / 107 39 / 106
has no room for new ones lines 198 183
world fps, median (frame lines ≥ 4,000 draws) 16.4 16.2
ms/frame, median 60.9 61.6
errors 1 (Streamline presentCommon notice) the same 1
  • Neutral: at Series X 1440p the in-world targets are already above the old most / 2 threshold, so the reserve settles to 0 without the PR too. Fix 1 can't show here; it's the Series S / DLSS case, as you describe.
  • No regression: fps, room pressure and stability are unchanged, and the captured frames during the walk show no green or black surfaces with the neutral stand-in. This scene didn't show green/black textures without the PR either, though, so it doesn't exercise fix 3.

So nothing against it from the Series X side.

465d6a0eac added a commit to 465d6a0eac/VIctory-NVIDIA-Experiment that referenced this pull request Nov 28, 2026
…ted or that were waiting showed its white stand-in

Standing in place its numbers looked better (textures waiting 12k -> 1k, frame rate the same), but walking the
area with it (vnx60) palm leaves and plants came out flat white: the neutral stand-in it writes for waiting or
evicted texture slots, and its eviction takes textures still in use. The morning's walk without it (vnx32) had
them textured. The owner's play test called the game 'all bugged'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
465d6a0eac added a commit to 465d6a0eac/VIctory-NVIDIA-Experiment that referenced this pull request Nov 28, 2026
…), driver 621.14 measured (+10 %)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
@trustno1-coder
trustno1-coder merged commit 20c79c6 into trustno1-coder:main Nov 28, 2026
c1miano pushed a commit to c1miano/VIctory-NVIDIA-3070ti that referenced this pull request Nov 28, 2026
iGlideForever pushed a commit to iGlideForever/VIctory-iGL-NVIDIA that referenced this pull request Nov 28, 2026
…lock

Per texture a draw reads through a view, draw::readable took up to four
mutexes that every recording thread shares:

- PLACED_TEXTURES in resource::texture_at (descriptor::host::
  placed_texture), for each view the title places in its memory without
  a resource object (device 0x230, its streamed textures);
- TARGETS_AT in resource::alias_of, for each placed texture the title
  fills;
- HOST_WRITTEN in texture::upload_from, for each texture read;
- STAGING in texture::staged_from, on a read from another first level.

Placed views: each thread keeps the placed textures it found (256
slots, by address and description as asked). Nothing takes a texture
out of PLACED_TEXTURES, so what a thread found holds.

alias_of: a texture keeps its "no target at my memory" answer with the
change count of its memory's bucket (1,024 counters by 64 KiB block,
bumped under TARGETS_AT's lock when a target enters it). While the
count is unchanged the answer stands without the lock; a target leaving
the table cannot make "none" wrong. A texture with a target is looked
up as before.

Host-written and staged level: each texture keeps whether the host
wrote it (set with the set entry) and the first level its staging
buffer holds (written under STAGING's lock wherever the table gains or
loses the entry: staging, unstage, the idle sweep; forget runs as the
texture goes). upload_from reads them without the locks.

Same answers as the locked lookups; the tables stay for every other
reader. The tests hold each table's lock on one thread and read on
another: with the locked lookups the read waits.

Source: port of the idea of Marvisak/VIctory#3274 (KainanP), first
ported as LooperSalty/AnyXboxX#444 onto the Neptune base;
this is its port onto the Vice-Tay base (trustno1-coder#454).

Picked from upstream e6e7c9e98, applied onto our tree (compile and clippy checked, not run on a GPU).

(ported from commit 42d61974606d6e356e5dcd754d610f6ff10ae3fc of Fayberr/Victory-United integ/c25-rndne)

[iGL: ported by hand: the commit's tree is about 3,400 commits from ours, so
both files conflicted. Same changes: the three marks in Hosted (beside
slot_evicted/slot_returned), TARGET_CHANGES bumped where TARGETS_AT gains a
texture (its only insert here), the kept "no target" answer in alias_with,
the per-thread placed-texture finds around texture_at (PLACED_TEXTURES has no
removal here either), and staged_first kept with STAGING in the same four
places it changes here (the idle sweep, unstage, the insert in staging;
forget as the texture goes). read_marks_tests.rs as it was. gpu tests: 474
passed. Run 114332 (26 min, with the memory stack off): no stale texture
seen; at equal draws 5-18 % faster than run 222820 together with trustno1-coder#1179,
trustno1-coder#1095 and main 63b902f.]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rrxlb added a commit to OBERON-gg/miranda that referenced this pull request Nov 28, 2026
262 upstream commits, among them trustno1-coder#620 (VICTORY_THIN_BAKE: bakes no longer
sample textures before their uploads when lists are translated out of
order), trustno1-coder#1264 (small textures no longer blank their neighbours), trustno1-coder#1179,
trustno1-coder#1197, trustno1-coder#145, trustno1-coder#1134 and the DXIL optimizer.

Conflicts: README keeps the Miranda text; capture.rs keeps our shader
traces and dumps beside upstream's F9 capture; card_steps.rs takes
upstream's placed fills and keeps our in-the-way reporting; draw.rs and
host.rs keep the per-shader timer and the GPU split stamps. Where upstream
fixed what we had fixed too, upstream's code is kept and ours removed:
VICTORY_PLACED_CONSTANTS replaces VICTORY_FILLS_IN_PLACE, and
VICTORY_PRELUDE_RECHECK replaces VICTORY_KEEP_CARD_WRITES.

Also applied: upstream PR trustno1-coder#1450 (Nazzgy, open upstream), which retries
known wave64 compute kernels (water, vegetation, decal processing) with a
scoped write-only LDS policy, since the stricter Wave32 LDS analysis
merged here refused them on 32-lane hosts.

The shader translator's source is now 652 KiB, so the asset policy gives
that one file a 1 MiB size limit (LARGER_FILES); every other check still
applies to it.
@EduardoMFOliveira
EduardoMFOliveira deleted the fix/8gb-green-black-textures branch November 28, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants