feat(gpu/pool): default-on sparse texture pool drain and compaction #302
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
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
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
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/Androtim--MiniVI!302
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-302"
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?
@Androtim on GitHub · 2026-12-02 02:02 UTC · original
Androtim:feat/pool-sparse-compaction→main· +600 −35 · 4 files · 1 commits · closed without mergingSummary
Implements default-on sparse 64 MiB texture block drain and compaction (\VICTORY_POOL_COMPACT=0\ kill-switch) to reclaim fragmented VRAM heaps back to D3D12 under pressure and curb Shared GPU spillover, using dynamic budget-reactive headroom across 8 GB to 16 GB+ GPUs.
ote_load_burst\ / \call_off_drains\ during streaming bursts.
esource.rs, \draw.rs):
esource::drain_moves\ (moving non-host-written placed textures into \REPLACED\ while descriptor slots keep displaying the valid old copy until the relocated copy uploads and lands).
Verification
Paired Plain --release\ 90s A/B Benchmarks (RTX 4060 Ti 8 GB / Series X Parity, vs \main\ \
73f4cc8)ot made\ \4,556 -> 0, \given back\ \
@Androtim on GitHub · 2026-12-02 02:20 UTC · original
Audited full diff (
e3065e2a,+600 -35across 4 files) — architecture and lock discipline look strong:LIVE_BLOCKSintoPool::live, dynamiccompact_headroom/move_budget(8 GB tight vs 16–24+ GB spacious),VICTORY_POOL_COMPACT=0kill-switch, burst cancellation (note_load_burst),existing_onlyprotection againstGrow::Must, and lock ordering indrain_moves()(draining_textures()+video_memory()beforetextures()) all look solid.--releaseA/B is very promising (5.8 -> 6.6 fps+13.8%,preparing 30.6 -> 22.6 ms,copyback 20.3 -> 13.7 ms,mapped() 5.21 -> 2.56 ms/s,not_made 4,556 -> 0).However, the PR body was truncated right at
given backby a PowerShell\0escape, cutting off required gate fields. Please post a comment (using a single-quoted PowerShell here-string@' ... '@so backticks and0are not escaped) with:--releaseA/B numbers (4K and 1440p if run):median/min fps,preparing ms,copyback ms,VRAM used_max / budget / over / room_false,pool given_back,final_waiting,untranslated,0crashes/DRED, andshared_mb/private_commit_mb/commit_left_mbfrom the 5 s memory log if available.--features diagnosticsvisual verification (luma,near_black,edge_energy,magenta,0black/swapped textures during live compaction relocations) and the verification run folder name so we can inspect the PNGs directly before merging.github-bot referenced this pull request2026-12-02 02:27:15 +00:00
@Androtim on GitHub · 2026-12-02 03:04 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Logic, lock ordering, and safety invariants for default-on sparse texture pool compaction (
VICTORY_POOL_COMPACT=0kill-switch) look solid, and CI is passing. Because this enables live D3D12 placed-texture relocation and heap reclamation by default under VRAM pressure, a local real-GPU smoke test is recommended before merging.Verified Details
crates/victory-gpu/src/pool.rs):LIVE_BLOCKSmutex withPool::liveunderTEXTURESeliminates cross-lock coordination inblock_used_bytesandrelease.take_ripe(best_fit,fullest, linear scan, unripe fallback, andaheadempty count), andPool::reclaimimmediately drops emptied draining blocks without counting them againstSPARES.note_load_burst/call_off_drainsand the 30s give-up / 120s cooldown (DRAIN_GIVE_UP_MS/DRAIN_AGAIN_MS) properly clearself.no_fitso freed holes become allocatable again.compact_choice,compact_headroom,move_budget, draining exclusion/reclamation, timeout backoff, and burst cancellation.crates/victory-gpu/src/resource.rs,crates/victory-gpu/src/draw.rs,crates/victory-gpu/src/descriptor/host.rs):resource::drain_movesfetchespool::draining_textures()before lockingtextures(), skipstwin/tiled/host_wrotetextures, and retires old copies intoREPLACEDso existing descriptor slots stay valid until the relocated copy uploads.draw::heap_textures, guarding!roomrelocations (made_copy(...).is_none()) withpool::existing_onlyprevents relocated copies from triggeringGrow::Mustnew-block allocations while VRAM is full.Minor Non-Blocking Notes
compact_choice(crates/victory-gpu/src/pool.rs): When selecting multiple blocks in a single pass, an earlier candidate'sfitscheck (g.longest >= f.largest) can rely on a block that is subsequently chosen later in the same loop. This is safe (the block will time out afterDRAIN_GIVE_UP_MSand back off), though re-checking or reserving the destination'slongestwould avoid futile drain attempts.crates/victory-gpu/src/resource.rs): The doc comment ondrain_movesbegins with/// `VICTORY_SLOT_EVICT=1` (`crate::resource::slot_evict`).rather thanVICTORY_POOL_COMPACT.Recommended Local GPU Smoke Test
VICTORY_POOL_COMPACTunset) and confirm:texture pool compaction) logsemptied > 0without D3D12 device removal, descriptor corruption, or black/missing textures during relocation.!room(not made/paststay bounded).VICTORY_POOL_COMPACT=0cleanly disables compaction and restores baseline behavior.Generated with Antigravity CLI (
agy).github-bot referenced this pull request2026-12-02 03:10:41 +00:00
github-bot referenced this pull request2026-12-02 03:10:42 +00:00
github-bot referenced this pull request2026-12-02 04:08:41 +00:00
github-bot referenced this pull request2026-12-02 05:07:13 +00:00
@Androtim on GitHub · 2026-12-02 15:03 UTC · original
Holding merge (
triage: needs work) per deep static audit routing (#282comment7349410307, P1 finding #15): relocated non-level0textures never update host SRVs, which can double VRAM usage. Please fix and re-run CI +driving-loop.csvA/B before merge.@Androtim on GitHub · 2026-12-02 15:40 UTC · original
Closing as regressing under the paired plain-
--releasedriving-loop.csvA/B gate againstmain(79b7589).Even after fixing
#282finding#15locally (relocated: AtomicBool, unconditionallevels_changed_afterrefresh for relocated copies,draining_planhole verification before unstaging,existing_onlyfallback guard, andcompact_choicedestination pinning), 120s paireddriving-loop.csvA/B runs showed significant regressions:4K DLSS Quality (120s
driving-loop.csv, Series X, RTX 4060 Ti 8 GB)5.9 -> 5.3 fpsmed (168.7 -> 188.1 ms,-0.6 fps, min5.3 -> 5.0 fps)20.45 -> 23.2 ms(+2.75 ms), GPU132.05 -> 139.8 ms(+7.75 ms), copyback10.65 -> 12.8 ms(+2.15 ms)used_max 6776 -> 6931 MB(+155 MB),over=56 -> 204 MBchosen=7,emptied=2,given_up=2,given_back_total=2,moved=9078(174 MB),slots_due=9005,not_made 16776 -> 3004,final_waiting 9988 -> 15741,0crashes/DRED1440p DLSS Quality (120s
driving-loop.csv, Series X, RTX 4060 Ti 8 GB)8.7 -> 8.75 fpsmed (114.85 -> 114.0 ms), min4.9 -> 2.2 fpsused_max 6265 -> 6395 MB(+130 MB),room_false 42.9% -> 60.9%,pool free_mb 298 -> 364 MBchosen=22,emptied=1,given_up=0,given_back_total=1,moved=9485(337 MB),slots_due=9456,not_made 4865 -> 1885,final_waiting 3140 -> 11248,0crashes/DREDLive-relocating 9,000+ small textures across 64 MiB blocks kept both old (
REPLACED) and new copies resident while churning CPU uploads/re-tabling for only 1–2 freed blocks. Moving directly to#282P0 #1 & #2 (slot_evictidle-threshold deadlock +CardPoolfree-bitset) instead.Pull request closed