Performance & Memory Suggestions (Unified Memory / PCIe overhead, DXIL instruction count & 8GB VRAM support) #1382
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 fxceless/victory-fork. Originally posted by Miniterror on 2026-11-26T21:22:47Z.
Subject: Performance & Memory Suggestions (Unified Memory / PCIe overhead, DXIL instruction count & 8GB VRAM support)
First off, huge thanks for the incredible progress on this fork—it's running surprisingly well given the complexity. I've been testing your latest builds on a laptop with an i7-14700HX, RTX 4070 (8GB), and 32GB RAM, and after reading through your recent profiling notes in the README, I wanted to share a few architectural ideas that might be great targets for your next Claude Code sessions:
Since the console uses a single 16GB unified pool while PC requires discrete RAM/VRAM transfers over PCIe, minimizing unnecessary bus traffic and CPU shadow copies seems like one of the biggest wins left:
• Skipping Unused GPU -> CPU Read-backs: In your notes from Run 277, you measured ~497 GB copied back from the GPU over 49 minutes, where 99.8% of those stores were never touched by the title's CPU code (only 0.19% were actually read). Could we track or heuristically blacklist buffers/addresses that are never CPU-read after a few frames, keeping them strictly GPU-resident without read-backs or comparison passes?
• Expanding ReBAR / GPU Upload Heaps (VICTORY_WINDOW_UPLOAD): Leveraging DirectX 12 GPU Upload Heaps (Resizable BAR) further for dynamic constant/vertex buffers could eliminate the need to maintain duplicate host-side shadow copies, saving both system RAM and PCIe sync overhead.
In your latest update (2026-11-26 11:50 UTC), you noted that the GPU has become the primary bottleneck (84–128 ms/frame on an RTX 4070) largely because the translated DXIL shaders average ~2.4x the console's instruction count across ~1,300 pipelines.
• Focusing optimization passes in crates/victory-shader on reducing this DXIL bloat—such as safe bounds-checked grouped scalar loads (avoiding the out-of-bounds read that blackened the water in VICTORY_SHADER_OPT=127) and tighter dead-code/redundancy elimination—would translate directly into higher frame rates on 4070-class GPUs.
On an 8GB card (~6.9 GB D3D12 budget), keeping VRAM from spilling over into shared system RAM requires capping VICTORY_TEXTURE_BUDGET_MB around 1850–2000 MB alongside VICTORY_LEVELS_ON_DEMAND=1. While this keeps VRAM at ~6.7/6.9 GB, it causes heavy texture eviction/re-creation churn.
• Idea: An opt-in switch (e.g., VICTORY_SKIP_MIP0=1 or a global mip-bias cap) for 8GB GPUs that drops the highest mip level (4K/top-tier textures) during upload/detiling. Cutting texture resolution by one mip step would drastically reduce the VRAM footprint without triggering constant eviction/re-upload stalls in open-world areas.
Hope these thoughts from testing on an 8GB 4070 setup are useful for your next round of profiling!