GPU/memory+descriptor: evict dropped HostHeaps from MEMORY.heaps on Heap::drop #589
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!589
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-589"
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?
@AscilCH on GitHub · 2026-11-25 02:35 UTC · original
AscilCH:fix/gpu-memory-evict-dropped-host-heaps→main· +67 −4 · 2 files · 1 commits · openProblem
In
crates/victory-gpu/src/memory.rs,MEMORY.heapscaches(base, made)descriptor-run state keyed by rawHostHeappointer (std::ptr::from_ref(heap) as usize), whereHostHeapis stored inline insideHeap::host: OnceLock<Option<HostHeap>>.When a title releases a shader-visible view
Heap,Heap::drop()(crates/victory-gpu/src/descriptor.rs) removed it fromSHADER_HEAPSbut never removed itsHostHeapaddress fromMEMORY.heaps. If a newly createdHeapreused the freed address:MEMORY.heaps.get(&key)hit the stale(base, made)entry, skippingheap.dynamic(COPIES + 1)and leaving the null UAV and copies0..madeunwritten on the new heap.count,basecould land inside the title's own descriptor slots or past the end of the host descriptor heap.Fix
memory::forget_heap(heap: &HostHeap)incrates/victory-gpu/src/memory.rsand call it fromHeap::drop()incrates/victory-gpu/src/descriptor.rsafter dropping theSHADER_HEAPSlock.dropping_a_view_heap_evicts_its_memory_heaps_entry.Verification
cargo test -p victory-gpu --locked memory::tests -- --test-threads=1: 1 passed, 0 failedcargo test -p victory-gpu --locked descriptor -- --test-threads=1: 15 passed, 0 failedcargo xtask policy: 169 files okcargo clippy -p victory-gpu --all-targets --all-features --locked -- -D warnings: clean (default-features build onc96b4f2has only the pre-existingdead_codewarning onplaced_filler_twins, tracked in #491)(AI-assisted; synthetic unit tests only, no game data.)
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.Merge
Merge the changes and update on Forgejo.