Iter 18: Recycle RT/BVH fault-mapped arena pages with 8 GiB VRAM scaling #3
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3"
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?
Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T00:37:38Z.
Summary
Ports
fxceless/victory-fork3e573d2("Ray tracing: pages for the ray programs are a recycled budget, not a limit for the run") intocrates/victory-gpu/src/memory.rswhile preserving MiniVI's 8 GiB VRAM scaling and upstream64d4931protections:FAULTS_ALLcap (where later faulted RT/BVH pages read zeros for the rest of the session) with a rolling FIFO fault-page budget that recycles pages older thanFAULT_YOUNG(128 frames), splits walker vs. builder fault notes into a 2x fault buffer, prioritizes re-faulted evicted pages, and adopts fault pages touched by command lists or unpacked structures.fault_pages_for()(128 MiBon <= 6 GiB,256 MiBon <= 9 GiB,512 MiBon > 9 GiB; overridable viaVICTORY_BVH_FAULTS_ALL), while keepingmost_pages()/spare_pages()VRAM scaling andcard_room_for()safety headroom (90% on <= 9 GiB GPUs, 97% on > 9 GiB).Memory::another()'s per-frameFAILEDlockout guard andVirtualFreecleanup from64d4931.crates/victory-gpu/src/memory.rs(+470/-92) — zero merge conflicts with open PR #1 and PR #2.Rig Specs Tested On
33,304,932KiB visible)10.0.26300), NVIDIA driver32.0.16.2124Run Settings & Profile
diag/release@f9de875series-s(unattended live runtime smoke verification; CI & unit tests)off(unattended smoke test)offVICTORY_*Overrides: default (VICTORY_BVH_FAULTS_ALLunset -> 256 MiB / 4,096 recycled fault pages on 8 GiB GPU)Measurements & Verification
verify-live.ps1+ CI results will be posted below)256 MiBdefault on 8 GiB,128 MiBon <= 6 GiB,512 MiBon > 9 GiB) + 90%card_room_for()arena threshold on <= 9 GiB GPUs0cargo clippy --workspace --all-targets -- -D warnings(0 warnings)cargo clippy --workspace --all-targets --all-features -- -D warnings(0 warnings)cargo test -p xtask(6 passed) +xtask policy(294 files ok)cargo test -p victory-gpu -- --test-threads=1:452 passed; 0 failed; 36 ignored, including all 7memory::tests::*)Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T00:43:14Z.
Automated triage for the maintainers (not an approval).
Verdict:
needs-gpu-test· CI (check):passingAutomated Review Summary
Verdict:
needs-gpu-test— Logic, memory-safety invariants, and VRAM-scaling integration look solid and CI is passing, but the PR modifies the D3D12 RT/BVH fault buffer layout and runtime VRAM eviction policy incrates/victory-gpu/src/memory.rs, which warrants a real-GPU ray-tracing smoke test before merging.What Was Verified
Memory::new()doublesfaultstoMEMORY_FAULTS * 8bytes (zeroed in full),ready()offsetsReady::faultsbyMEMORY_FAULTS * 4bytes whenbuildsis true, andMemory::take_faults()scans both halves while skipping dword 0 of each half (i == 0andi == MEMORY_FAULTS).noted()deduplicates pages per frame while preserving builder ownership (first.1 |= same && later.1).Held::serial+Memory::holdingsprevent staleorder/fault_orderentries from evicting or sweeping re-mapped pages.Memory::adopt()clearsHeld::faultand decrementsfault_heldwhenever a list names a page (map_for(..., None)) or a packed structure unpacks into it (land()), preventing eviction of GPU-only builder state. When a recycled arena slot is reused,hold()initializestaken: 0, sobring()unconditionally merges and callsshadow.resend(...)for the full 64 KiB page.fault_pages_for()scales the fault budget (128 MiB<= 6 GiB,256 MiB<= 9 GiB,512 MiB> 9 GiB, clamped toMOSTonVICTORY_BVH_FAULTS_ALLoverride) andcard_room_for()enforces 90% headroom on <= 9 GiB GPUs (97% on > 9 GiB).most_pages(),spare_pages(), andMemory::another()'s per-frameFAILEDlockout +VirtualFreecleanup remain intact.crates/victory-gpu/src/memory.rswith 4 new unit tests coveringnoted,goes_first,mark,fault_pages_for, andcard_room_for. (Minor non-blocking note:give_back()only checks the queue chosen bygoes_first()and returnsfalseif its front entry is younger thanFAULT_YOUNG, which is reasonable to avoid prematurely evicting builder pages.)Recommended Local GPU Test
Run a live ray-tracing session on the 8 GiB RTX 4060 Ti with default settings (
VICTORY_BVH_FAULTS_ALLunset -> 256 MiB / 4,096 fault pages) long enough to exceedFAULT_YOUNG(128+ frames) and trigger fault-page recycling:title memory by address:reports showfrom faults ... (<= 256 MB), non-zerogiven back for othersonce saturated, and boundedwanted again within 4 frameswithout runaway thrashing.card_room_for()threshold without spilling arenas to system memory or triggering DRED/device removal.Generated with Antigravity CLI (
agy).Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T00:47:03Z.
Verification summary for
feat/iter18-rt-fault-page-recycling@f9de875:46088894625completed withsuccess.cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy:asset policy: 294 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p xtask:6 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings:0warningscargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-features --all-targets -- -D warnings:0warningscargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1:452 passed; 0 failed; 36 ignored(all 7memory::tests::*includingrt_fault_budget_and_card_room_scale_with_vrampassed)diag\victory.exe,diag\victory_sm.exe, andrelease\victory.exeintoD:\victory-build\miniviwithRUSTFLAGS='-C link-self-contained=yes'(non_system_mingw_dlls=0on all 3).verify-live.ps1):32s, 3 active windows (max_draws=11),30.0 fps(33.3 ms/frame),dropped=0, 6/7[PASS]:[PASS]Watchdog hookapplied=2[PASS]Active rendering reached[PASS]0crashes or DRED resets[PASS]DLSS / Streamline clean (loaded=2, fails=0)[PASS]Process ran cleanly (exited_early=False)[PASS]0lingering processes[FAIL]$badWave64list (untranslated_total=2, critical_fails=1): logged6b82bc7d22016cb5and926c46bab3b86bd6(no wave32 lowering for this wave64 program), plus 8 pre-existingERROR victory_gpu::poollines frombook.rs. Both are pre-existing onmain(f3c0c33) prior to open PR #1 (wave32recovery) and open PR #2 (book.rsNVIDIA guard), unrelated tomemory.rs.Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T21:11:17Z.
Real-GPU Playtest Report (Combined Build 1 Stack — RT ON)
Tested in combined Build 1 (
origin/main+ Build 1 PRs including#3, #4, #7, #10) on NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (quality-720p, DLSS Quality,-RayTracing):1c-build1-rt.log) — 0 crashes, 0 DRED resets, clean exit.7.6 fps(132.2 ms/frame,4,022draws/frame).12,653pages /790 MBacross13arenas,98build dispatches/frame).0"a shader reads view addresses without a view heap set"warnings.1,374DLSS upscalings (0failed); VRAM stayed bounded (6,460 MBin use,554 MBfree across27texture blocks).