Keep draw-table buffer slots out of heap_buffer_pass and reclaim unmapped loose-window slots #4983
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4983
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-4982"
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?
@danielibabet on GitHub · 2026-12-01 16:25 UTC · original
danielibabet:perf/tabled-and-unmapped-buffer-windows→main· +750 −28 · 5 files · 1 commits · openRefs #4774, #4463
What it changes
Fixes two compounding causes of unbounded
BufferSweepgrowth and un-reclaimable 6 MiBshadow::LOOSEwindows invictory-gpu:Keep draw-table buffer slots out of
heap_buffer_pass(VICTORY_TABLED_BUFFERS=1by default,=0disables):Draw-table descriptor slots are claimed via
slot_tabled, which previously expired fromcopied_tabledafterCOPIED_FRAMES = 8frames. Once expired (or during low-FPS stalls before the draw-table ring wraps),heap_buffer_passadopted thousands of transient draw-table buffer slots as permanent bindless entries, keepingShadow::usedfresh every frame and pinningLOOSEwindowID3D12Resources inHostHeap::kept.HostHeapnow trackstabled_key(the exactVIEW_BOOK(generation << 32) | irecord last claimed by a draw table viaslot_tabled_at/mirror_tabled_batched).heap_buffer_passandHostHeap::note_buffer_atleave a slot to draws as long asis_tabled_recordmatches that exact record; overwriting the slot with any new record immediately clears the match soheap_buffer_passpicks up repurposed bindless slots normally.Skip and unmake unmapped address-only buffer slots & release stale window holds (
VICTORY_SWEEP_UNMAPPED_BUFFERS=1by default,=0disables):Unlike placed textures (
resource::let_go_idle+wholly_unmapped), address-only buffer views (View::Placedbuffer SRVs/UAVs andView::Constantoutside registered title buffers) continued to allocate or pin 6 MiBshadow::LOOSEwindows over decommitted/unmapped title memory.heap_buffer_passskips unmapped address-only buffer slots (avoiding freshLOOSEallocations) and unmakes already-made slots (unmake_if_made) if their backing is decommitted.shadow::let_go_idlenow also identifies idle or wholly-unmappedLOOSEwindows pinned only byHostHeap::kept(references(&s.buffer) > 1,Arc::strong_count == 1, no pending shader writes) and callsdescriptor::release_idle_window_slots(scanning onlyHostHeap::kept_bufferswith 1 s / 5 s backoff) to reset staleView::Constant, unmapped, or long-idle draw-table buffer slots so the underlyingLOOSEwindow can be retired.How it was tested
BufferSweepviews / 4,606 copies / 2,691 MB refreshed and 13.0 GB shared GPU memory before commit exhaustion).copied_tabledexpired after 8 frames andlet_go_idlenever releasedLOOSEwindows still referenced inHostHeap::keptby stale constant/tabled/unmapped buffer slots.VICTORY_BURY_LAG=0 cargo test --locked -p victory-gpu --lib -j 16 -- audit_regressions --test-threads=1— 7 passed, 0 failed (including 3 new D3D12 tests:tabled_buffer_slot_stays_out_of_heap_pass_past_copied_frames_until_repurposed,unmapped_placed_buffer_slot_skips_loose_window_until_mapped_and_unmakes_on_decommit, andlet_go_idle_unmakes_constant_slot_and_reclaims_unmapped_root_window).cargo test --locked -p victory-gpu --lib -j 16 -- descriptor:: shadow:: draw:: --test-threads=4— 240 passed, 0 failed, 10 ignored.cargo test --locked -p victory-gpu --lib -j 16 -- resource::tests::— 65 passed, 0 failed, 1 ignored.cargo clippy --workspace --all-targets --locked&--all-features: 0 warnings/errors in touched files (pre-existingorigin/mainerrors inhost/{font,menu,panel}.rstracked in #4708).cargo xtask policy: 464 files ok.cargo build --release --locked -p victory -j 16: clean.cargo testpassed for the crates it touches: yes (descriptor::,shadow::,draw::,resource::tests::invictory-gpu).Checked for overlap
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.