Repository navigation
Conversation
Phase 1b — Unified BVH arena pool & VRAM headroom coordination: - Add `host::reserved` (`reserved_uav_buffer`, `map_buffer_tiles`) to map 64 MiB BVH arena chunks into a shared 2 GiB reserved raw-UAV buffer (`ArenaPool`, `VICTORY_BVH_ONE_ARENA=1`) at descriptor slot 0 (`copy=1`), eliminating non-uniform descriptor waterfalls on static/fault BVH reads. - Propagate `Shadow::card_offset()` through card copies (`host.rs`, `host/send.rs`, `host/upcheck.rs`), piece hash passes, and copyback, and deduplicate resource state transitions per raw `ID3D12Resource`. - Add `bring_buf` (single 64 KiB `copy_mapped` per dirty page), dirty-epoch `GetWriteWatch` skip (`directory_dirty_frame` / `ArenaChunk::dirty_frame`) on untouched static arenas, and zero-hashset `named_in_upload` dedup. - Coordinate `VICTORY_MEMORY_CARD_MB` with `VICTORY_RT_MEMORY_MB` and `memory::most_pages_for` / `card_room_for` (`85%`/`90%`/`97%` VRAM-tier ceilings matching `shadow::memory_card_budget`) so 8-12 GB cards recycle arena pages cleanly without spilling into shared system RAM or starving sparse texture pools. Adapted from GPL-3.0 upstream `ReTerryDavis/ReVIctory` commit `925ac0a`, preserving MiniVI's dynamic `fault_order` LRU paging, `release_packed_pages`, and split read/build fault buffers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 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.