diff --git a/README.md b/README.md index 171d7d9..2bb3064 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ A performance- and low-memory-tuned fork of [VIctory-NVIDIA](https://github.com/ - **6 GB / 4 GB VRAM support (`VICTORY_TEXTURE_DROP_MIPS` + ReBAR GPU windows):** Drops top texture mip levels (`1` = Half default for sharp visuals + ~500 MiB VRAM headroom on 6 GB GPUs; `2` = Quarter for 4 GB GPUs or extra VRAM room with larger ReBAR windows via `VICTORY_WINDOWS_BAR_MB` / `VICTORY_WINDOWS_VRAM_PERCENT`). Toggleable in the **F1** menu (`TEXTURE SCALE (VRAM)`). - **16 GB RAM stability & OOM recovery:** Automatically caps idle `STAGING`, upload `send::SPARE` (`128 MiB`), and CPU snapshot (`128 MiB`) pools on `<= 20 GB` / `<= 32 GB` RAM hosts, drains idle pools under critical commit pressure, and retries `E_OUTOFMEMORY` in command-list preludes instead of crashing. - **Custom windowed output sizes (`VICTORY_OUTPUT`) & DLSS Ultra Performance:** True `1280x720` and `1664x936` windowed output patching plus `640X360 (ULTRA FAST)` (`ultraperformance`) in **F1** (`SERIES S PICTURE` / `OUTPUT SIZE (WINDOW)`), working cleanly alongside DLSS and FSR 3 Frame Generation. -- **CPU submit-thread & refresh optimizations:** Fused single-pass write-watch `ask_once` with guarded-view skip, chunked `JOURNAL`-batched `nothing_new` filtering, AVX2 `word_runs` in `Shadow::take`, cached non-watched view-texture checks with zero-alloc `writes_since`, `AddressHash` on `Deferred::textures`, `has_gpu_write` fast-skip, deduplicated `card_before` root bindings, `Batch::last_ahead` 1-entry cache, lock-free `watch::AHEAD_KEPT` + binary-searched `ahead_contains`, `RwLock` shared-read fast path, incremental `HeapRanges` spans, and zero-alloc `HostList::prelude()` fast path. +- **CPU submit-thread, CBV & cutscene optimizations:** Direct 256-byte in-place CBV fast path (`VICTORY_DIRECT_CBV`, skips ~70% of CPU constant buffer fills when `VICTORY_PORT_CONSTANTS=1` is active), per-list `HostList::constant_scratch` CBV deduplication (`FillTo::Slots`), `Step::Host` premature `batch.fill()` flush fix + sorted/overlap-coalesced `Batch::fill()` (`VICTORY_FILL_BATCH`), short initial texture warm-up (`START_HOT_FRAMES=4`, killing the 12-second 265 MB/frame cutscene texture re-hashing storm while still promoting genuine alias-view updates to 64 frames), `heap_textures` early `VICTORY_TEXSPK_PASS_MS` budget exit (always running `texture_slots_flip()` first), fused single-pass write-watch `ask_once` with guarded-view skip, chunked `JOURNAL`-batched `nothing_new` filtering, AVX2 `word_runs` in `Shadow::take`, cached non-watched view-texture checks with zero-alloc `writes_since`, `AddressHash` on `Deferred::textures`, `has_gpu_write` fast-skip, deduplicated `card_before` root bindings, `Batch::last_ahead` 1-entry cache, lock-free `watch::AHEAD_KEPT` + binary-searched `ahead_contains`, `RwLock` shared-read fast path, incremental `HeapRanges` spans, and zero-alloc `HostList::prelude()` fast path. - **DLSS Super Resolution + AMD FSR 3 / DLSS Frame Generation:** Full F1 settings menu, F3 stats panel, HUD-less FSR 3 2X Frame Generation for RTX 20/30 and non-NVIDIA DX12 GPUs, and DLSS FG (2x–6x) for RTX 40/50. -- **Portable 6 GB / 16 GB launcher (`scripts/play-6gb.ps1`):** Pre-configured with verified settings (`VICTORY_FAST_CORES=0` for hybrid P+E CPUs, `VICTORY_PORT_CONSTANTS=1`, `VICTORY_COPY_BESIDE=1` + `VICTORY_STORE_BESIDE=1`, aligned `SLOT_EVICT` thresholds, `VICTORY_PIPELINE_WAIT_MS=50`, and safe `128–256 MB` ReBAR GPU windows). +- **Portable 6 GB / 16 GB launcher (`scripts/play-6gb.ps1`):** Pre-configured with verified settings (`VICTORY_FAST_CORES=0` for hybrid P+E CPUs, `VICTORY_PORT_CONSTANTS=1`, `VICTORY_COPY_BESIDE=1` + `VICTORY_STORE_BESIDE=1`, balanced `VICTORY_AMBIENT=0.8` + `VICTORY_AMBIENT_SHADE=0.5,0.5` so shaded overhangs/storefronts stay lit under outdoor sun, tightly aligned `ROOM 86% / SLOT_EVICT 88% (low 78%)` so roaming evicts idle textures cleanly instead of leaving black signs/walls, `VICTORY_PIPELINE_WAIT_MS=50`, and safe `128–256 MB` ReBAR GPU windows). --- @@ -142,22 +142,32 @@ Please do the following step by step: ## Measured Performance Gains (6 GB VRAM / 16 GB RAM Laptop) -All numbers below were measured on the same Windows 11 gaming laptop (**Intel Core i5-12450HX [4 P-cores + 4 E-cores], 16 GB RAM, NVIDIA GeForce RTX 3050 6 GB Laptop GPU** — measured even while GPU power was capped at **26–30 W**) in an open-world test scene (`0` crashes, `0` OOMs): +All numbers below were measured on the same Windows 11 gaming laptop (**Intel Core i5-12450HX [4 P-cores + 4 E-cores], 16 GB RAM, NVIDIA GeForce RTX 3050 6 GB Laptop GPU** — measured even while GPU power was capped at **26–31 W**) in an open-world test scene (`0` crashes, `0` OOMs, full lighting ON): -| Metric | Before (Stock `VIctory-NVIDIA` on 6 GB / 16 GB) | After (This Fork + Tuned Preset) | Change | +| Metric | Before (Stock `VIctory-NVIDIA` on 6 GB / 16 GB) | After (This Fork — Latest `main`) | Change | | :--- | :---: | :---: | :---: | | **Shader-warm frame stall** | `1.9 fps` (`520 ms` pipeline wait stalls) | `0` stalls (`VICTORY_PIPELINE_WAIT_MS=50`) | **Eliminated** | -| **CPU `preparing` per frame** | `94.2 ms` | **`37.3–40.5 ms`** *(1080p / 720p)* | **−57% to −60% (2.5× faster)** | -| **Texture refresh CPU time (all threads)** | `33.4 ms` (`6.6 ms` watch/guards) | **`17.8 ms`** (`1.7–2.3 ms` watch/guards) | **−47% (−65% watch)** | -| **GPU idle bubbles (waiting on CPU)** | `24.2 ms` *(with `FAST_CORES=2`)* | **`4.4–11.0 ms`** *(1080p)* | **GPU 88–98% busy** | -| **Standard open-world scene (~6k draws, real FPS)** | `8.5 fps` real (`117.8 ms`) | **`10.2–10.7 fps` real** *(full 1080p + all visuals ON)* | **+20% to +26% real** | -| **Heavy open-world scene (~11k draws, real FPS)** | `4.8 fps` real (`208 ms`) | **`7.0–7.4 fps` real** *(full 1080p + all visuals ON)* | **+46% to +54% real** | -| **With FSR 3 2X Frame Gen (HUD-less)** | `17.0 fps` displayed (`8.5` base) | **`20.0–21.4 fps`** *(1080p, 109/109 HUD-less)* | **+20% to +26% + cleaner pacing** | -| **VRAM usage (6 GB card, 5.2 GiB DXGI budget)** | `5,291 MiB` peak *(hitting `no room` stalls)* | **`4,604–5,043 MiB` avg** *(with 768 MiB ReBAR windows in GDDR6)* | **Under budget, zero spill** | -| **System RAM (16 GB host)** | `16,513 MiB` private commit | **`14,360 MiB`** private / **`4.1–5.5 GiB`** working set | **−2.15 GiB private RAM** | -| **Texture eviction `sweep()` overhead** | `8.0 ms/frame` *(when `ROOM% > SLOT_EVICT%`)* | **`0.3 ms/frame`** *(aligned `72–75% / 92%`)* | **26× faster** | +| **CPU `preparing` (steady ~6k draws)** | `94.2 ms` | **`39.2 ms`** *(submit thread `52.4 ms`, ~19 fps CPU ceiling)* | **−58% (2.4× faster)** | +| **CPU `preparing` (heavy ~11.2k cutscene)** | `113.3 ms` *(with `25.6 ms / 265.9 MB` texture storm)* | **`46.2 ms`** *(`2.3 ms / 23.3 MB` textures)* | **−59% (−91% tex hash)** | +| **CPU constant buffer fills (`PORT_CONSTANTS=1`)** | `12,691` fills/frame (`4.9 MB`) | **`3,523–3,744`** fills/frame (`1.0–1.1 MB`) | **−71% fills / −78% KB** | +| **GPU idle bubbles (waiting on CPU)** | `30.0 ms` *(card 73% busy)* | **`14.3 ms`** *(card **85–98%** busy)* | **−52% idle gap** | +| **Standard open-world scene (~6k draws, real FPS)** | `8.5 fps` real (`117.8 ms`) | **`10.8 fps` med / `11.4–12.8 fps` peak real** | **+27% med / +50% peak** | +| **Heavy cutscene (~11.2k draws, real FPS)** | `4.8 fps` real (`208 ms`) | **`7.0 fps` med / `7.3 fps` peak real** (`142.9 / 136.6 ms`) | **+46% to +52% real** | +| **With FSR 3 2X Frame Gen (HUD-less)** | `17.0 fps` displayed (`8.5` base) | **`21.6–25.6 fps`** *(1080p, HUD-less)* | **+27% to +50% + smoother pacing** | +| **VRAM usage (6 GB card, 5.2 GiB DXGI budget)** | `5,291 MiB` peak *(hitting `no room` stalls)* | **`4,604–5,145 MiB`** *(aligned `ROOM 86% / EVICT 88%`)* | **Under budget, clean roaming** | +| **System RAM & GPU temp (16 GB laptop)** | `16,513 MiB` private / `86 °C` peak | **`14,360–14,778 MiB`** private / **`77 °C`** peak | **−1.7 to −2.1 GiB RAM, −9 °C** | +| **Texture eviction `sweep()` overhead** | `8.0 ms/frame` *(when `ROOM% > SLOT_EVICT%`)* | **`0.3 ms/frame`** *(aligned `ROOM 86% / EVICT 88%`)* | **26× faster** | -> **Hybrid CPU note (`i5-12450HX` 4P + 4E):** Switching `VICTORY_FAST_CORES=2` → `0` alone lifted real FPS from **`8.9 → 10.1 fps`** (**+13.5%**, peak `10.4`) on ~6k-draw views and **`6.3 → 7.3 fps`** (**+16%**) on heavy ~11k-draw views, while cutting CPU `preparing` from `59.4 → 45.0 ms` with zero visual loss. Unlocking a 30 W-capped laptop GPU up to its full 65 W Performance Mode adds further real-FPS headroom on top of these numbers. +### Latest Changes (`ebd07c1` — Direct CBVs, Cutscene Texture Fix & Roaming Alignment) + +- **Direct 256-byte in-place CBVs (`VICTORY_DIRECT_CBV`, on by default; `=0` disables):** When `VICTORY_PORT_CONSTANTS=1` already maps the 185 MB constant heap in place, 256-byte-aligned constant buffers bind directly on the card with zero scratch allocation, zero `Step::Fill`, and zero CPU copy (cutting CPU CBV fills from `12,691 → 3,523–3,744/frame`). +- **Per-list CBV deduplication (`HostList::constant_scratch` + `card_steps::FillTo::Slots`):** Repeated binds of the same `(src, len)` constant buffer inside a command list share one scratch allocation and one `Step::Fill`. +- **`Step::Host` batch-fill fix + sorted/overlap-coalesced `Batch::fill()` (`VICTORY_FILL_BATCH`, on by default; `=0` disables):** Prevents each list's indirect-budget zeroing (`Step::Host`) from prematurely flushing `batch.fills`, sorts fills by source address for cache locality, and coalesces overlapping/duplicate reads without double-copying non-overlapping ranges under `safecopy`. +- **Cutscene texture re-hashing storm fix (`START_HOT_FRAMES=4` in `texture.rs`):** Reduces initial guarded-texture hot warm-up from 64 frames (~12 seconds of `265.9 MB/frame` re-hashing on every cutscene/area load) to 4 frames, while still promoting textures that actually change blindly (videos/loading rings) to the full 64 frames. Cut heavy cutscene `prep` from `113.3 → 46.2 ms` (`5.6 → 7.0–7.3 real fps`). +- **Texture-pass budget & flip fix (`draw.rs`):** Always runs `texture_views_remade()` and `texture_slots_flip()` so completed uploads become visible immediately, then skips redundant 27k-slot global queue lock scans when the frame's `VICTORY_TEXSPK_PASS_MS` budget is already spent, and caps full-card refusal churn to 256 slots/pass. +- **Lighting & roaming VRAM alignment (`scripts/play-6gb.ps1`):** Restored `VICTORY_AMBIENT=0.8` with softened `VICTORY_AMBIENT_SHADE=0.5,0.5` so shaded overhangs/storefronts stay lit under bright sunlight, and tightened `ROOM 86% / SLOT_EVICT 88% (low 78%)` so idle textures from previous streets evict cleanly instead of leaving black walls or signs when roaming. + +> **Hybrid CPU & stronger GPU note:** On Intel 12th–14th gen hybrid CPUs (`i5-12450HX` 4P + 4E), `VICTORY_FAST_CORES=0` adds `+13.5%` real FPS over `FAST_CORES=2`. With the submit thread now down to **`52.4 ms`** (~19 real FPS CPU ceiling), higher-wattage RTX 3060 / 4050 / 4060 6–8 GB GPUs can push toward **15–19 real FPS** (`30–38 FPS` with 2× FG), while 30–35 W RTX 3050 6 GB laptops are now primarily GPU-bound (`85%` card utilization at `10.8–12.8 real fps`). ---