Repository navigation
Fix green/black textures on 8 GB GPUs (target reserve settle, slot eviction, neutral stand-in) - #1179
Conversation
…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).
…anged) and merged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
|
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.
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: self.keep(index, kept);
self.place_back(index);— the neutral stand-in kept and the slot placed back. The cargo test -p victory-gpu --locked: 460 green. |
|
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 (
So nothing against it from the Series X side. |
…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
…), driver 621.14 measured (+10 %) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
(cherry picked from commit 20c79c6)
…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>
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.
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
crates/victory-gpu/src/resource.rs—targets_kept):targets_keptpreviously requiredtargets >= most / 2(1,536 MB) before settling to0. On 8 GB / Series S / DLSS setups, in-world render targets stabilize around 1,185–1,450 MB, so the condition was never met andtargets_room_kept()permanently added 1,620–1,887 MB of phantom usage toroom(), locking 16k–31k textures out of the queue.(most / 4).min(1024 << 20)(768 MB with defaultmost = 3072 MB), still safely above the ~652 MB pre-world menu baseline while allowing 8 GB / Series S / DLSS targets to settle.resource.rs—slot_evict,descriptor/host.rs—HostHeap::slots_showing):slot_evict's high/low watermarks againstroom_line(budget)and subtractedcrate::pool::texture_room()fromused, so eviction actually triggers whenroom()is capped at e.g. 80% (FrameGen).HostHeap::slots_showingfromself.tabled_lately(i, frame)(which expired afterTABLED_FRAMES = 240, shorter thanidle_ms) totabled_out() && self.tabled_stamp(i) != 0so idle table-held textures can be evicted and re-mirrored on demand.crates/victory-gpu/src/descriptor/host.rs—unmake,make_at,mirror):null_for((0, 0, 0, 0)), which renders black for albedo and bright green in YCoCg / BC5 normal-chrominance shaders (where0.5is subtracted). Replaced withneutral_for(1x1 R8G8B8A8_UNORM = 0x80).Testing
cargo test --release -p victory-gpu: 453 passed; 0 failed (including updatedroom_for_targets_is_given_up_once_they_settlecovering 1,185 MB world targets).cargo build --release --locked -p victory: clean release build.