perf(gpu): unify BVH arena pool and coordinate VRAM budget (#339) #342
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!342
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-342"
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 14:20 UTC · original
Androtim:feat/hw-rt-phase1-arena-pool→main· +895 −149 · 6 files · 2 commits · openPart of #339 (Phase 1 — Unified BVH Arena Pool & VRAM Budget Coordination).
Summary
Adapts GPL-3.0 upstream
ReTerryDavis/ReVIctorycommit925ac0acleanly to MiniVI's newer sparse-VRAM and LRU fault-paging architecture, while coordinatingVICTORY_MEMORY_CARD_MBwithVICTORY_RT_MEMORY_MBandpool.rsheadroom tiers:host/reserved.rs,shadow.rs,memory.rs):ArenaPool,VICTORY_BVH_ONE_ARENA=1default) occupying descriptor slot0(copy == 1).Shadow::card_offset()/by_address_inand propagates offsets across card copies,CopyBufferRegion, compute root UAV scatter (send.rs), piece-hash passes (host.rs), copyback, and diagnostics (host/upcheck.rs), deduplicating transitions per underlyingID3D12Resource.MiniVI's dynamicfault_order/give_back()LRU page eviction (keepingSLOT_FAULTSactive for camera traversal),release_packed_pages(tracking chunkfree_pages),FAILEDguard inanother(), and split reader/builder fault buffer offsets.memory.rs):dirty_frame,directory_dirty_frame, anddirty_epochto skip redundantGetWriteWatchscans on cold static BVH chunks inbring_up.bring_buf(1copy_mappedper page vs 16) and avoids per-dispatchHashSetallocations innamed_in_upload.shadow.rs,memory.rs):memory::card_room_for(85%on<= 9 GiB,90%on<= 12 GiB,97%on> 12 GiB) withshadow::memory_card_budgetso fault paging recycles old pages instead of allocating 64 MiB PC-RAMshared_buffers past 85%.85%/90%/97%) even whenVICTORY_MEMORY_CARD_MBoverrides the cap so texture pools on 8–12 GB cards do not starve into WDDM paging.memory::most_pages_forbyVICTORY_MEMORY_CARD_MB(when>= 64MiB) so RT arenas stay within the card copy cap rather than spilling over PCIe.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy --stagedpassed (325 files ok).cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warningsand--all-featurespassed.memory::tests: 8/8 matching CPU filters includingrt_memory_caps_scale_with_vram_and_override,rt_fault_budget_and_card_room_scale_with_vram,replacing_packed_structure_keeps_overlapping_pages_and_frees_solo_tail;shadow::hash_pool_tests::memory_card_budget_keeps_tier_ceiling_with_override: passed).reserved_arena_pool_maps_chunks_and_copies_roundtriptest skipped locally because another engine process (victory.exe) owns the shared GPU; full suite runs on PR CI.github-bot referenced this pull request2026-12-02 14:39:31 +00:00
@Androtim on GitHub · 2026-12-02 15:04 UTC · original
Holding merge (
triage: needs work) per deep static audit routing (#282comment7349410307, P0/P1 findings #13, #14, #16, #17 routed to#339). Please resolve the flagged findings, re-verify CI, and run a paired plain---releaseRT-off A/B +--features diagnosticsPNG check before merge.@Androtim on GitHub · 2026-12-02 15:06 UTC · original · edited 2026-12-02 17:09 UTC
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingReview Summary
Solid implementation adapting a unified 2 GiB reserved BVH arena pool (
VICTORY_BVH_ONE_ARENA=1) to MiniVI's sparse-VRAM / LRU fault-paging architecture, with consistentShadow::card_offset()propagation and coordinated VRAM budget ceilings. CI is passing and no blocking logic or safety defects were found, but the new D3D12 tiled-resource path and VRAM budget changes warrant a local real-GPU smoke test before merging.Verified Details
crates/victory-gpu/src/host/reserved.rs,crates/victory-gpu/src/shadow.rs,crates/victory-gpu/src/memory.rs):Host::reserved_uav_bufferchecksTiledResourcesTierbefore creating a 2 GiBD3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESSreserved buffer (ArenaPool 0at descriptor slot0/copy == 1).Host::map_buffer_tilesmaps 64 MiB default heaps via a dedicatedD3D12_COMMAND_LIST_TYPE_COPYqueue, synchronizes via fence wait, and defensively unmaps (D3D12_TILE_RANGE_FLAG_NULL) + retires the heap on signal/wait failure.shadow::by_address_inrolls backBY_ADDRESS_USEDon staging or tile-mapping failure and falls back cleanly to standaloneshadow::by_addressinMemory::another.host.rs,host/send.rs,host/upcheck.rs):Shadow::card_offset()is applied consistently acrossHost::card_sync,Host::card_compare(batched and unbatched),Host::relay_fetch,Own::record(CopyBufferRegion+ root UAV),upcheck::record/look, andMemory::dump.Own::recordandupcheck::recorddeduplicate transition barriers by rawID3D12Resourcepointer (as_raw()), matchingHost::card_sync.host.rs,memory.rs):dirty_epoch/refreshed_epochtracking ondirectoryandArenaChunkwithSubmitRefreshScope/submit_refresh/Batch::add_freshensures submit-timeland_and_refreshwrites invalidate pre-scannedBatch::aheadstate and cannot drop delayed refreshes.bring_buf(single 64 KiBcopy_mappedper page) andnamed_in_upload(Vecsort/dedup instead ofHashSet) are clean.memory.rs,shadow.rs):memory::card_room_for(85%/90%/97%) now matchesshadow::memory_card_budget,VICTORY_MEMORY_CARD_MBno longer relaxes the GPU tier ceiling, andmemory::most_pages_foris bounded byVICTORY_MEMORY_CARD_MBwhen>= 64MiB.Non-blocking Notes
host/reserved.rsuses a blocking null-handleID3D12Fence::SetEventOnCompletion(value, HANDLE::default())onTILE_QUEUE; valid in D3D12, worth confirming during the real-GPU smoke test (especially if also tested under Wine/vkd3d-proton).reserved_arena_pool_maps_chunks_and_copies_roundtripwas skipped locally by the author due to GPU contention; run it on a real GPU as part of verification.Next Step
Run a local real-GPU test (unit test + short title run with RT/BVH active) before merging.
Generated with Antigravity CLI (
agy).@Androtim on GitHub · 2026-12-02 16:23 UTC · original
Rebased onto \main\ (\
3efe907) and resolved #282\ P0 findings #13 & #14:efreshed_epoch\ via \etch_max\ only inside submitted \defer_host\ callbacks / active \Batch\ refreshes, never at recording time), and wired submit-time \land_and_refresh\ -> \host::submit_refresh\ -> \Batch::add_fresh\ (clearing any stale \atch.ahead\ entry) so \directory\ and every chunk touched or allocated during \land\ always refresh before GPU execution.
Verified (\VICTORY_D3D12_WARP=1): \memory::tests\ (\10 passed; 0 failed), \shadow::window_tests\ (\10 passed; 0 failed), \host::\ (\193 passed; 0 failed; 17 pre-existing ignored), workspace \clippy --all-targets\ (normal & --all-features), and \xtask policy --staged\ (\4 files ok). Ready for CI and maintainer GPU check.
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.