GPU: giving up a texture nulls the dynamic descriptor slots of lists recorded before #2597
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2597
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@BastienRodz on GitHub · 2026-11-25 16:29 UTC · original
What happens
Since
69d1e8e,resource::evict_unusedgives up host textures fed from title memory: those idle for a while, and the least recently used ones while video memory is past the card's budget. It does this at the start ofHost::execute.HostHeap::evictgives each heap slot viewing such a texture a null view and drops its hold on it. Sinceed25c0eit finds the slots by scanningkept, which covers the dynamic slots as well: the descriptor tables a list builds for its draws (HostHeap::dynamicandmake_atindraw.rs). A list that is recorded but not yet reset still owns those slots, since they are released only at reset. Its table is not made again before it runs. So its draws read a null 2D view (black, or a dimension mismatch for 3D, cube and array views), and the dynamic slot no longer holds the texture.Expected
resource.rs(69d1e8e): "Gives up host textures gone at frame: first every heap slot viewing one gets a null view (made again when a draw or a shader reads it), then the title textures let go of it. Lists recorded before hold it until they are reset, so no GPU work reads it freed". The dynamic slots of lists not yet reset should keep their views. Title slots, and dynamic slots already released, can still be nulled.Where
crates/victory-gpu/src/descriptor/host.rs,HostHeap::evict.AI-assisted (Gemini 4 Neon found it, Claude Code reviewed and verified it); synthetic test only, no game data.
@Marvisak on GitHub · 2026-11-25 18:46 UTC · original · edited 2026-11-26 06:48 UTC
Automated triage for the maintainers.
Confirmed in
main, incrates/victory-gpu/src/descriptor/host.rs.HostHeap::evictwalks all ofkept, which is sizedcount + extraand so includes the dynamic slots thatHostHeap::make_atfills for draw tables. It nulls every slot holding an evicted texture and does not check whether the slot is still taken by a list that has not been reset (HostHeap::releaseonly frees them at reset). A recorded list's table can therefore read a null view.Open PRs #2598 and #2707 address this. New since the last triage: a comparison on an RTX 4070 against
main63bcca4found both regression tests fail onmainand pass with either fix. #2598 merges cleanly; #2707 conflicts in its test tail but holds locks for less time and has a GPU-readback test that could be carried over.Generated by Claude Code
@pawrenity on GitHub · 2026-11-26 04:06 UTC · original
Comparative verification of #2598 and #2707 against
mainat63bcca4.Hardware: NVIDIA GeForce RTX 4070, Windows 11 (rustc 1.98.1 MSVC, debug,
--locked). Unit tests only. No title run, no game data. Both regression tests reach their GPU assertions on this card and do not take the no-host early return.main(test only, no fix)-D warnings(victory-gpu, default +diagnostics)main1c356e5live_dynamic_slots_keep_a_texture_given_uppasses, at its head and merged ontomaina live dynamic slot keeps its viewevictfb10ff3evict_keeps_taken_dynamic_slots_until_releasedpasses, at its head and merged ontomain(conflict resolved by hand)ours + taken dynamic slot(refcount assertion)evictdescriptor/host.rs. It is only at the end of the test module, where both sides append tests, and keeping both resolves itFull
cargo test -p victory-gpu --lib, merged ontomain: 230 passed, 2 failed, 1 ignored for each PR.maingives 229/2/1. The two failures (descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views) also fail onmainwhen run alone with--test-threads=1. They are the NVIDIA heap cap failures (#1744).Review notes (both checked against
main'sHostHeap:kepthascount + dynamicentries,next.1hasdynamic,madehascount):host.rs:787-808: skips dynamic slots still marked taken (:800). The indexi - countstays withinnext.1. Lock order ismade→next→kept.mirrortakesmade→kept, anddynamic/releasetake onlynext, so I found no inversion. Trade-off:madeandnextare now held for the wholekeptscan (:793-794), somirroranddynamic()wait during an eviction pass.host.rs:787-852: title slots as before (0..count). A second pass over the dynamic range holdsnext→keptand nulls only released slots. Old resources are retired after the locks drop.retiretakes only its own leaf lock. It holds locks for less time than #2598. Nits: it duplicateskeep()'s diagnostics/retire block (:840-851vs:520-536), andlet _ = index;(:850) is a leftover. Its test is about 220 lines (FXC compile, compute dispatch, exact COM refcounts). It checks the GPU actually reads the texture through the kept slot, which #2598's test does not.Recommendation: the two fixes are functionally equivalent on these tests. Each PR's test passes with the other's fix, and both fail on
main. #2598 is the smaller change and merges cleanly as is. #2707 holds locks for less time and has the stronger GPU-level test, but it needs a rebase (test tail only) and a small cleanup. Either one closes the issue. Merging #2598 is the shorter path. #2707's GPU readback test could be carried over as extra coverage.AI-assisted (Claude Code).