Performance & Memory Suggestions (Unified Memory / PCIe overhead, DXIL instruction count & 8GB VRAM support) #1382

Open
opened 2026-11-26 21:22:47 +00:00 by Miniterror · 0 comments
Miniterror commented 2026-11-26 21:22:47 +00:00 (Migrated from github.com)
Contributor

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:

  1. Reducing the Unified Memory (UMA) -> Discrete PC Bottleneck

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.

  1. Tackling the New GPU Wall (2.4x DXIL Instruction 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.

  1. Dedicated 8GB VRAM Optimization (Mip-Level Skipping)

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!

<!-- greyfinch-sync:fxceless/victory-fork:issue:6635294100 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/issues/1382). Originally posted by [Miniterror](https://github.com/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: 1. Reducing the Unified Memory (UMA) -> Discrete PC Bottleneck 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. 2. Tackling the New GPU Wall (2.4x DXIL Instruction 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. 3. Dedicated 8GB VRAM Optimization (Mip-Level Skipping) 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!
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork#1382
No description provided.