perf(gpu): range-filter CARDED in send_copied, reclaim idle ReBAR windows, and align mapped VRAM limits #3889
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3889"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by qlfu on 2026-11-30T10:36:33Z.
Summary
Four targeted improvements in
crates/victory-gpu/src/shadow.rsmeasured on Series X gameplay (1440p DLSS Balanced, RTX 4070 Ti 12 GB + Ryzen 7 5700X, base41adb551):CARDEDbeforeWeak::upgradeinsend_copied: Store(start, end, Weak<Shadow>)inCARDEDsosend_copied(dst, len)only upgradesWeakreferences whose[start, end)overlaps[dst, dst + len)instead of upgrading and dropping ~3,500–4,100Arc<Shadow>s on everyStep::Copy.VICTORY_CARD_WINDOWS_IDLE_MSto ReBAR-mapped windows (s.mapped) inlet_go_idle: Previouslylet_go_idlechecked onlys.card.is_some(), leaving idleVICTORY_WINDOWS_BAR_MB(D3D12_HEAP_TYPE_GPU_UPLOAD) windows pinned in VRAM for the 5-minute RAM timeout while active gameplay windows spilled to shared system RAM over PCIe.window_card_percent(budget)andresource::card_copy_fitsinwindow_mapped_forandwc_mapped_for: Replaces the hardcodedbudget / 10 * 8(80%) check withbudget / 100 * window_card_percent(budget)pluscrate::resource::card_copy_fits(budget, used, size). Behavior on<= 12 GiBcards withVICTORY_CARD_WINDOWS_PERCENTunset remains80%(now also bounded byroom_line), while 16/24 GB tiers (89%/91%) and explicitVICTORY_CARD_WINDOWS_PERCENToverrides allow newly arrived hot gameplay windows to refill evicted ReBAR slots without starving textures.Shadow::take_all: LowerLONG(1 MiB -> 256 KiB) andPART(256 KiB -> 64 KiB) so medium refreshes fan out across worker threads instead of stalling one core.Measured Results (90s Series X Native 1440p DLSS Balanced, RTX 4070 Ti 12 GB + R7 5700X)
All runs
0 WARNs,0 ERRORs, clear-weather matched (180-pipe ~2.0 ms):122438.log,WINDOWS_BAR=2560+WC_BAR=1)130827.log, + this PR +IDLE_MS=5000)25.30/26.29/31.7/45.025.60/26.50/34.4/46.4+0.30med /+0.21mean /+2.7p90all(med / mean)29.05/30.41 ms28.35/29.21 ms-0.70med /-1.20mean mscopies and fills(cfmed)3.30 ms1.80 ms-1.50 mscardmetertitle (med)30.00 ms29.50 ms-0.50 msdiag:125039vs130632)49idle (316 MB)0idle (0 MB)-316 MBreclaimed; active PC-RAM windows2690 -> 2242 MB(-448 MB)Verification
cargo +1.98.1-x86_64-pc-windows-msvc test -p victory-gpu --lib --locked -- --test-threads=1 shadow::-> 72 passed, 0 failed (5 ignored)cargo +1.98.1-x86_64-pc-windows-msvc check -p victory-gpu --all-targets --all-features --locked-> exit 0, zero new warningsgit merge-tree --write-tree 41adb551 HEAD-> clean merge (MERGEABLE)Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by qlfu on 2026-11-30T14:30:30Z.
Updated
window_line,window_mapped_for, andwc_mapped_forinshadow.rsafter live 12 GiB RTX 4070 Ti + DLSS Frame Generation 2x testing showedno room, new textures waitacross 47-81% of gameplay:window_mapped_for(VICTORY_WINDOWS_BAR_MB) andwc_mapped_for(VICTORY_WC_BAR=1) now callwindow_line(...)withcard_room_kept() + targets_room_kept(memory)androom_line(budget), matchingwindow_room_for.window_linenow respectscap.saturating_sub(kept)so render-target/buffer room kept under a lowered frame-generation texture line (80%2x /74%3x) is no longer overridden back up to80%.cargo test -p victory-gpu --lib --locked shadow:: -- --test-threads=1(72 passed, 0 failed) + cleanmerge-treeonto41adb551.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:47:56Z.
Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.
Pull request closed