perf(gpu): compare big card copies only where written lately #501

Merged
ballsimulation merged 2 commits from upstream-pr/501 into main 2026-11-29 08:17:00 +00:00
ballsimulation commented 2026-11-27 23:38:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ballsimulation on 2026-11-27T23:38:12Z.


Summary

Two opt-in switches, both off by default, that cut the cost of the title's 174 MB constants heap:

  • VICTORY_LAZY_COMPARE_MB=64: the GPU compares only the parts of the heap that shaders recently wrote, plus a rotating sweep of the rest.
  • VICTORY_LAZY_NARROW=1: constant reads from the heap stop counting as blocked by in-flight work, except on those recently written parts.

On main, with both on: frames 4–6% faster, and the submitting thread's planning of steps on the card drops from 7.4 to 1.7 ms.

Why

The skinning passes declare the whole heap written in every submission, through one view of it. That has two costs:

  • GPU: the heap's card copy is compared in full after each of ~12 submissions per frame. That is about 2.2 GB of reads per frame to find ~2.6 MB that shaders actually wrote.
  • CPU: while flights are in the air, nearly every constant fill from the heap counts as blocked, so each is planned onto the card (card_steps). That costs 7–12 ms per frame on the submitting thread.

What changes

VICTORY_LAZY_COMPARE_MB=<MiB>

For a card copy at least this large, a submission compares only:

  1. pieces found written in the last VICTORY_LAZY_HOT compares (default 64);
  2. skipped pieces that are about to be sent up. Their rehash is held back, so the compare still sees older shader writes;
  3. the next VICTORY_LAZY_SWEEP skipped pieces in turn (default 128).

These compares store their hashes (mode 2). Anything found is fetched and merged exactly as before. A log line every 5 s shows the counts.

VICTORY_LAZY_NARROW=1 (needs the switch above)

Where submission steps wait for flights, or are done on the card in flight order (late_blocked, card_steps, cut_for, the relay's wait), such a copy counts as written only on its recently written pieces. Refreshes still see every declared write.

Trade-off

A heap piece that shaders write for the first time reaches title memory only when the sweep finds it, about 2 frames later. Until then, CPU steps read the title's own bytes there.

Results

RTX 4070, Ryzen 9 7950X. Series X profile at native 2560x1440, no DLSS, frame rate uncapped. One build of main 64d4931b with this change, the same save and walk, run with the switches off and then on. Median frame time by draws per frame:

Draws per frame Off On
4–6k 53.7 ms 50.4 ms
6–7k 56.8 ms 54.4 ms
7–8k 59.2 ms 57.1 ms
8–9.5k 62.7 ms 58.8 ms
Submitting thread 49.5 ms 45.8 ms
Its planning of steps on the card 7.4 ms 1.7 ms
  • The card was ~90–95% busy in both runs (native 1440p), so only part of the CPU saving shows up in frame time. On an older integration branch with the Series S profile and DLSS Performance, where the card was less busy, the same change brought frames from 46–55 ms down to 39–48 ms.
  • No new warnings or errors in the log. Clippy is clean for the new code.
  • On the integration branch, water and reflections looked the same with the switches on and off.

Caveats

  • Both switches are off by default; nothing changes unless they are set.
  • The two runs on main loaded at slightly different spots in the save, and the samples per bin are small (15–56).

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5534509980 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501). Originally posted by [ballsimulation](https://github.com/ballsimulation) on 2026-11-27T23:38:12Z. --- ## Summary Two opt-in switches, both off by default, that cut the cost of the title's 174 MB constants heap: - `VICTORY_LAZY_COMPARE_MB=64`: the GPU compares only the parts of the heap that shaders recently wrote, plus a rotating sweep of the rest. - `VICTORY_LAZY_NARROW=1`: constant reads from the heap stop counting as blocked by in-flight work, except on those recently written parts. On main, with both on: **frames 4–6% faster**, and the submitting thread's planning of steps on the card drops from **7.4 to 1.7 ms**. ## Why The skinning passes declare the whole heap written in every submission, through one view of it. That has two costs: - **GPU:** the heap's card copy is compared in full after each of ~12 submissions per frame. That is about 2.2 GB of reads per frame to find ~2.6 MB that shaders actually wrote. - **CPU:** while flights are in the air, nearly every constant fill from the heap counts as blocked, so each is planned onto the card (`card_steps`). That costs 7–12 ms per frame on the submitting thread. ## What changes ### `VICTORY_LAZY_COMPARE_MB=<MiB>` For a card copy at least this large, a submission compares only: 1. pieces found written in the last `VICTORY_LAZY_HOT` compares (default 64); 2. skipped pieces that are about to be sent up. Their rehash is held back, so the compare still sees older shader writes; 3. the next `VICTORY_LAZY_SWEEP` skipped pieces in turn (default 128). These compares store their hashes (mode 2). Anything found is fetched and merged exactly as before. A log line every 5 s shows the counts. ### `VICTORY_LAZY_NARROW=1` (needs the switch above) Where submission steps wait for flights, or are done on the card in flight order (`late_blocked`, `card_steps`, `cut_for`, the relay's wait), such a copy counts as written only on its recently written pieces. Refreshes still see every declared write. ### Trade-off A heap piece that shaders write for the first time reaches title memory only when the sweep finds it, about 2 frames later. Until then, CPU steps read the title's own bytes there. ## Results RTX 4070, Ryzen 9 7950X. Series X profile at native 2560x1440, no DLSS, frame rate uncapped. One build of main `64d4931b` with this change, the same save and walk, run with the switches off and then on. Median frame time by draws per frame: | Draws per frame | Off | On | |---|---|---| | 4–6k | 53.7 ms | **50.4 ms** | | 6–7k | 56.8 ms | **54.4 ms** | | 7–8k | 59.2 ms | **57.1 ms** | | 8–9.5k | 62.7 ms | **58.8 ms** | | Submitting thread | 49.5 ms | **45.8 ms** | | Its planning of steps on the card | 7.4 ms | **1.7 ms** | - The card was ~90–95% busy in both runs (native 1440p), so only part of the CPU saving shows up in frame time. On an older integration branch with the Series S profile and DLSS Performance, where the card was less busy, the same change brought frames from 46–55 ms down to 39–48 ms. - No new warnings or errors in the log. Clippy is clean for the new code. - On the integration branch, water and reflections looked the same with the switches on and off. ## Caveats - Both switches are off by default; nothing changes unless they are set. - The two runs on main loaded at slightly different spots in the save, and the samples per bin are small (15–56). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
POMXARK commented 2026-11-28 00:29:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T00:29:33Z.


Testing feedback on RTX 5080 16 GB / AMD Ryzen 7 5700X (8C/16T) / 32 GB RAM, Windows 11, Series X 1440p + DLSS Quality + DLSS MFG 4×, based on v2026.11.27.8 (64d4931) with VICTORY_LAZY_COMPARE_MB=64 and VICTORY_LAZY_NARROW=1:

Hit a guest access violation at 3m44s (Frame: 5348, 3D workload) that did not occur on prior 12-minute runs without VICTORY_LAZY_*:

  • unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x4e9b54a (read 0xffffffffffffffff: outside the address space)
  • Registers: rcx 0x31ff84a045495676 (non-canonical pointer), rax 0x0, rbx 0xd0418f3a8, rdi 0xd04189938, r8/r9 0xffffffff00000000
  • Top frames: +0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x2484ac4 -> +0x321c5 -> +0x3346d -> +0x555e921

Full disclosure: this was tested on a custom branch with additional local GPU patches on top of v2026.11.27.8 (also with PR #498 and PR #499 enabled), so it is not yet a clean main-only repro. Sharing the crash trace here since it looks consistent with the documented risk in lazy.rs around delayed/missed first-time shader write-backs into the 174 MB constants heap when VICTORY_LAZY_NARROW=1 is enabled.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7230954850 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7230954850). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T00:29:33Z. --- Testing feedback on RTX 5080 16 GB / AMD Ryzen 7 5700X (8C/16T) / 32 GB RAM, Windows 11, Series X 1440p + DLSS Quality + DLSS MFG 4×, based on `v2026.11.27.8` (`64d4931`) with `VICTORY_LAZY_COMPARE_MB=64` and `VICTORY_LAZY_NARROW=1`: Hit a guest access violation at **3m44s** (`Frame: 5348`, 3D workload) that did not occur on prior 12-minute runs without `VICTORY_LAZY_*`: - `unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x4e9b54a (read 0xffffffffffffffff: outside the address space)` - Registers: `rcx 0x31ff84a045495676` (non-canonical pointer), `rax 0x0`, `rbx 0xd0418f3a8`, `rdi 0xd04189938`, `r8/r9 0xffffffff00000000` - Top frames: `+0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x2484ac4 -> +0x321c5 -> +0x3346d -> +0x555e921` Full disclosure: this was tested on a custom branch with additional local GPU patches on top of `v2026.11.27.8` (also with PR #498 and PR #499 enabled), so it is not yet a clean `main`-only repro. Sharing the crash trace here since it looks consistent with the documented risk in `lazy.rs` around delayed/missed first-time shader write-backs into the 174 MB constants heap when `VICTORY_LAZY_NARROW=1` is enabled.
Machad3x commented 2026-11-28 01:19:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T01:19:42Z.


Tested merged on top of main (RTX 3080 Ti, Ryzen 7 5700X, 1440p DLSS Quality, title ray tracing on). With the switch at its default (off) the run was fine. Review found one bug in host/lazy.rs hot_within:

It joins a hot piece onto out.last_mut() whenever last.1 >= a, without checking last.0 <= a. out already holds unrelated ranges at that point (Line::joined seeds it with textures.to_vec(), and the line rebuild adds other ranges first). A hot piece that lies below an unrelated range above it gets swallowed: last.1 = max(last.1, b) changes nothing, so [a, b) is lost. With VICTORY_LAZY_NARROW=1, the waits (late_blocked, card_steps, cut_for, relay_wait) then do not wait for the flight that writes those bytes, and a later list reads stale data.

Fix we use (callers already sort and join afterwards):

-                Some(last) if last.1 >= a => last.1 = last.1.max(b),
+                // `out` may already hold unrelated ranges; callers sort and join after.
+                Some(last) if last.0 <= a && last.1 >= a => last.1 = last.1.max(b),

plus a test hot_piece_below_an_unrelated_range_stays.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7231586507 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7231586507). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T01:19:42Z. --- Tested merged on top of main (RTX 3080 Ti, Ryzen 7 5700X, 1440p DLSS Quality, title ray tracing on). With the switch at its default (off) the run was fine. Review found one bug in `host/lazy.rs` `hot_within`: It joins a hot piece onto `out.last_mut()` whenever `last.1 >= a`, without checking `last.0 <= a`. `out` already holds unrelated ranges at that point (`Line::joined` seeds it with `textures.to_vec()`, and the line rebuild adds other ranges first). A hot piece that lies below an unrelated range above it gets swallowed: `last.1 = max(last.1, b)` changes nothing, so `[a, b)` is lost. With `VICTORY_LAZY_NARROW=1`, the waits (`late_blocked`, `card_steps`, `cut_for`, `relay_wait`) then do not wait for the flight that writes those bytes, and a later list reads stale data. Fix we use (callers already sort and join afterwards): ```diff - Some(last) if last.1 >= a => last.1 = last.1.max(b), + // `out` may already hold unrelated ranges; callers sort and join after. + Some(last) if last.0 <= a && last.1 >= a => last.1 = last.1.max(b), ``` plus a test `hot_piece_below_an_unrelated_range_stays`.
POMXARK commented 2026-11-28 02:50:03 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T02:50:03Z.


Follow-up test confirming @Machad3x's 1-line fix in crates/victory-gpu/src/host/lazy.rs (last.0 <= a && last.1 >= a):

Setup: Same hardware (AMD Ryzen 7 5700X 8C/16T, RTX 5080 16 GB, 32 GB RAM, Windows 11, Series X 1440p + DLSS Quality + DLSS MFG 4×, 4 MiB windows), tested on a clean fork branch based on v2026.11.27.7 (x86-64-v3/ThinLTO, without PR #499), with VICTORY_LAZY_COMPARE_MB=64 and VICTORY_LAZY_NARROW=1 plus Machad3x's hot_within fix (and unit test hot_piece_below_an_unrelated_range_stays passing).

Result — 12-minute (720 s) 3D run

  • Stability on this run: 0 guest exceptions, 0 DeviceRemoved, clean render output across all draw tiers (the earlier 0xc0000005 at +0x4e9b54a at 3m44s did not reproduce in this run).
  • High-draw 3D gains (strictly 3D-only, draw-count-matched vs identical build without VICTORY_LAZY_*):
Bucket (3D only, fps < 20, draws >= 100) Baseline (PR #501 off) PR #501 + hot_within fix (64 + NARROW=1) Delta
Late 3D (last 30 samples) 9.4 p50 / 9.20 mean (106.4 ms, max 295.2, 2 frames >=250ms) 10.3 p50 / 9.63 mean (96.6 ms, max 218.5, 0 frames >=250ms) +9.6% p50 (-9.8 ms)
High-draw 3D (7k–10k draws) (p50 ~8.4–8.6k) 9.30 p50 / 9.37 mean (107.4 ms, back 14.1 ms) 10.30 p50 / 9.79 mean (96.6 ms, back 12.8 ms) +10.8% p50 (-10.8 ms)
Very-high-draw 3D (>=10k draws) (p50 ~11.2k) 7.80 p50 (127.6 ms, copies 67.2 ms) 8.10 p50 (123.9 ms, copies 59.6 ms) +3.8% p50 (-7.6 ms copies)
480..760 s stutters (GPU>=50 / F>=250) 1 / 2 0 / 0 clean
  • card_steps fills dropped ~10× (~9,800 -> 949 fills/frame, 529.6 KB), planning steps done on the card down to 1.6–2.4 ms, and lazy compares skipped ~73% of big-copy pieces (left=477k–618k per 5 s, hot_now=455–711).
  • (Note: 0..360 s early frames had extra variance in this run due to low system pagefile headroom during initial load, while 480..760 s ran with 0 frames >=250 ms.)

Thanks to @Machad3x — adding last.0 <= a && last.1 >= a in hot_within looks essential before merging this PR.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232623069 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7232623069). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T02:50:03Z. --- Follow-up test confirming **@Machad3x's 1-line fix** in `crates/victory-gpu/src/host/lazy.rs` (`last.0 <= a && last.1 >= a`): **Setup:** Same hardware (**AMD Ryzen 7 5700X 8C/16T, RTX 5080 16 GB, 32 GB RAM**, Windows 11, Series X 1440p + DLSS Quality + DLSS MFG 4×, `4 MiB` windows), tested on a clean fork branch based on `v2026.11.27.7` (`x86-64-v3`/ThinLTO, without PR #499), with `VICTORY_LAZY_COMPARE_MB=64` and `VICTORY_LAZY_NARROW=1` plus `Machad3x`'s `hot_within` fix (and unit test `hot_piece_below_an_unrelated_range_stays` passing). ### Result — 12-minute (720 s) 3D run - **Stability on this run:** **0 guest exceptions**, **0 `DeviceRemoved`**, clean render output across all draw tiers (the earlier `0xc0000005` at `+0x4e9b54a` at `3m44s` did not reproduce in this run). - **High-draw 3D gains (strictly 3D-only, draw-count-matched vs identical build without `VICTORY_LAZY_*`):** | Bucket (3D only, `fps < 20`, `draws >= 100`) | Baseline (PR #501 off) | PR #501 + `hot_within` fix (`64` + `NARROW=1`) | Delta | |---|---:|---:|---:| | **Late 3D (last 30 samples)** | `9.4` p50 / `9.20` mean (`106.4 ms`, `max 295.2`, `2` frames `>=250ms`) | **`10.3` p50 / `9.63` mean** (`96.6 ms`, `max 218.5`, **`0` frames `>=250ms`**) | **`+9.6%` p50** (`-9.8 ms`) | | **High-draw 3D (`7k–10k draws`)** (`p50 ~8.4–8.6k`) | `9.30` p50 / `9.37` mean (`107.4 ms`, `back 14.1 ms`) | **`10.30` p50 / `9.79` mean** (`96.6 ms`, `back 12.8 ms`) | **`+10.8%` p50** (`-10.8 ms`) | | **Very-high-draw 3D (`>=10k draws`)** (`p50 ~11.2k`) | `7.80` p50 (`127.6 ms`, `copies 67.2 ms`) | **`8.10` p50** (`123.9 ms`, `copies 59.6 ms`) | **`+3.8%` p50** (`-7.6 ms copies`) | | **480..760 s stutters (`GPU>=50` / `F>=250`)** | `1` / `2` | **`0` / `0`** | clean | - `card_steps` fills dropped ~10× (`~9,800` -> `949` fills/frame, `529.6 KB`), `planning steps done on the card` down to `1.6–2.4 ms`, and `lazy compares` skipped ~73% of big-copy pieces (`left=477k–618k` per 5 s, `hot_now=455–711`). - *(Note: `0..360 s` early frames had extra variance in this run due to low system pagefile headroom during initial load, while `480..760 s` ran with `0` frames `>=250 ms`.)* Thanks to @Machad3x — adding `last.0 <= a && last.1 >= a` in `hot_within` looks essential before merging this PR.
POMXARK commented 2026-11-28 03:34:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T03:34:31Z.


Update after a 3rd run with VICTORY_LAZY_COMPARE_MB=64 + VICTORY_LAZY_NARROW=1 and @Machad3x's hot_within fix (last.0 <= a && last.1 >= a) applied:

Hit the exact same 4-frame guest access violation (+0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c) again intermittently at 5m48s (frame=26409, 25.4 fps, 1407 draws/frame during a scene transition), this time reading 0xc (rcx=0x0):

VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x4e9b54a (read 0xc: nothing mapped there)
  rax 0x0 rbx 0x0 rcx 0x0 rdx 0x0 rsi 0x86220ff9e0 rdi 0xd0418c9b0 rsp 0x86220ff890 rbp 0xff
  r8 0xffffffff00000000 r9 0xffffffff00000000 r10 0x18 r11 0x142a0000 r12 0xd080f0280 r13 0x1c46bfd6128 r14 0x86220ff9e8 r15 0x15c74668
  #0  victory-image-b99f876b74d4a77f.dll+0x4e9b54a
  #1  victory-image-b99f876b74d4a77f.dll+0x4e9b4bf
  #2  victory-image-b99f876b74d4a77f.dll+0x4a4a
  #3  victory-image-b99f876b74d4a77f.dll+0x4d9f49c
  #4  victory-image-b99f876b74d4a77f.dll+0x188463
  #5  victory-image-b99f876b74d4a77f.dll+0x6c6652

So Machad3x's hot_within fix reduced the frequency (2 full 12-minute runs passed cleanly), but +0x4e9b54a still occurs intermittently with VICTORY_LAZY_COMPARE_MB=64 + VICTORY_LAZY_NARROW=1 (likely the inherent delayed first-time shader write-back window before the rotating 128-piece sweep discovers a newly-written piece, or VICTORY_LAZY_NARROW=1 allowing a read before landing). Across 6+ full 12-minute control runs with VICTORY_LAZY_* disabled on the same hardware, +0x4e9b54a has not occurred once.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7233185976 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7233185976). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T03:34:31Z. --- Update after a 3rd run with `VICTORY_LAZY_COMPARE_MB=64` + `VICTORY_LAZY_NARROW=1` **and** `@Machad3x`'s `hot_within` fix (`last.0 <= a && last.1 >= a`) applied: Hit the **exact same 4-frame guest access violation** (`+0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c`) again intermittently at **5m48s** (`frame=26409`, `25.4 fps`, `1407 draws/frame` during a scene transition), this time reading `0xc` (`rcx=0x0`): ``` VIctory: unhandled exception 0xc0000005 at victory-image-b99f876b74d4a77f.dll+0x4e9b54a (read 0xc: nothing mapped there) rax 0x0 rbx 0x0 rcx 0x0 rdx 0x0 rsi 0x86220ff9e0 rdi 0xd0418c9b0 rsp 0x86220ff890 rbp 0xff r8 0xffffffff00000000 r9 0xffffffff00000000 r10 0x18 r11 0x142a0000 r12 0xd080f0280 r13 0x1c46bfd6128 r14 0x86220ff9e8 r15 0x15c74668 #0 victory-image-b99f876b74d4a77f.dll+0x4e9b54a #1 victory-image-b99f876b74d4a77f.dll+0x4e9b4bf #2 victory-image-b99f876b74d4a77f.dll+0x4a4a #3 victory-image-b99f876b74d4a77f.dll+0x4d9f49c #4 victory-image-b99f876b74d4a77f.dll+0x188463 #5 victory-image-b99f876b74d4a77f.dll+0x6c6652 ``` So `Machad3x`'s `hot_within` fix reduced the frequency (2 full 12-minute runs passed cleanly), but **`+0x4e9b54a` still occurs intermittently with `VICTORY_LAZY_COMPARE_MB=64` + `VICTORY_LAZY_NARROW=1`** (likely the inherent delayed first-time shader write-back window before the rotating 128-piece sweep discovers a newly-written piece, or `VICTORY_LAZY_NARROW=1` allowing a read before landing). Across 6+ full 12-minute control runs with `VICTORY_LAZY_*` disabled on the same hardware, `+0x4e9b54a` has not occurred once.
hazben commented 2026-11-28 09:56:35 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by hazben on 2026-11-28T09:56:35Z.


A measurement of the two switches of #501 (VICTORY_LAZY_COMPARE_MB=64, VICTORY_LAZY_NARROW=1), on a build that already has #516 and #614 (called A below). The one change between the two runs is the switches.

Setup: RTX 4070 SUPER, 32 GB, DLSS Quality, frame generation off. Main 8fc22547 plus a local patch stack (24 commits, not upstream). A stick-steered walk of 270 s through one district with 13 marks, the same path in both runs, about 3,500-10,900 draws per frame (median per leg). One run each.

What it did to the work the PR targets: the planning of steps on the card by the submitting thread goes from 6.9 to 1.8 ms per frame (the PR text says 7.4 to 1.7). The submitting thread's total goes from 49.7 to 45.5 ms.

What it did to the frames:

A A + #501
fps (from 60 s after the world loads) 17.43 17.34
median frame ms 54.6 54.9
p95 / p99 ms 86 / 109 84 / 113
frames over 100 ms per min 22.0 19.5
dense stretch (marks 6-11, about 8,900 draws), fps 15.8 16.3

Nothing here is outside the noise: the base's own two runs differ by 0.55 fps (3.5 %) in fps and by 1.3 fps in the dense stretch. So on this card and route I cannot confirm the 4-6 % faster frames: the submitting thread got 4 ms cheaper and the frame did not get shorter. Likely (not checked) the frame here is limited by something other than the submitting thread's planning once #516 has removed the lock waits.

Memory: process private peak 25.10 GB (A) and 25.17 GB (A + #501); dedicated VRAM peak 8.70 and 8.62 GB. Both runs reached the end of the route with no crash, hang or device error.

Not measured: a second run of either build, a different route, a card or CPU other than this one. Unverified: that the local stack does not change these numbers.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7237566418 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7237566418). Originally posted by [hazben](https://github.com/hazben) on 2026-11-28T09:56:35Z. --- A measurement of the two switches of #501 (`VICTORY_LAZY_COMPARE_MB=64`, `VICTORY_LAZY_NARROW=1`), on a build that already has #516 and #614 (called A below). The one change between the two runs is the switches. Setup: RTX 4070 SUPER, 32 GB, DLSS Quality, frame generation off. Main 8fc22547 plus a local patch stack (24 commits, not upstream). A stick-steered walk of 270 s through one district with 13 marks, the same path in both runs, about 3,500-10,900 draws per frame (median per leg). One run each. **What it did to the work the PR targets:** the planning of steps on the card by the submitting thread goes from 6.9 to 1.8 ms per frame (the PR text says 7.4 to 1.7). The submitting thread's total goes from 49.7 to 45.5 ms. **What it did to the frames:** | | A | A + #501 | |---|---|---| | fps (from 60 s after the world loads) | 17.43 | 17.34 | | median frame ms | 54.6 | 54.9 | | p95 / p99 ms | 86 / 109 | 84 / 113 | | frames over 100 ms per min | 22.0 | 19.5 | | dense stretch (marks 6-11, about 8,900 draws), fps | 15.8 | 16.3 | Nothing here is outside the noise: the base's own two runs differ by 0.55 fps (3.5 %) in fps and by 1.3 fps in the dense stretch. So on this card and route I cannot confirm the 4-6 % faster frames: the submitting thread got 4 ms cheaper and the frame did not get shorter. Likely (not checked) the frame here is limited by something other than the submitting thread's planning once #516 has removed the lock waits. **Memory:** process private peak 25.10 GB (A) and 25.17 GB (A + #501); dedicated VRAM peak 8.70 and 8.62 GB. Both runs reached the end of the route with no crash, hang or device error. Not measured: a second run of either build, a different route, a card or CPU other than this one. Unverified: that the local stack does not change these numbers.
ballsimulation commented 2026-11-28 12:40:16 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ballsimulation on 2026-11-28T12:40:16Z.


Thanks for testing this, all of you.

  • hot_within fix: pushed as e3985af9, thanks @Machad3x. It's your one-line fix, with a comment saying why the check is needed.
  • The guest crash at +0x4e9b54a (thanks @POMXARK for the three runs): it's still open, so please keep both switches off for play for now. My guess is that the game's CPU reads a heap piece that shaders wrote for the first time before the sweep has found it, and VICTORY_LAZY_NARROW lets that read happen without waiting. Next I'll run VICTORY_LAZY_COMPARE_MB alone to see which switch is the cause.
  • @hazben's measurement: it matches what we saw. The submitting thread's planning drops from about 7 to 1.8 ms. But on a build that already has #516, the frame isn't limited by that thread, so frame times don't move. The 4–6 % figure in the description was measured on main without #516. I'll say that in the description.
  • #618 covers the GPU side (lean and hot compares) in a different way. It isn't tested in the game yet. Nothing else covers the CPU side (VICTORY_LAZY_NARROW). If #618 lands first, I'll rebase this PR onto it and keep only the narrowing.

Marking this as a draft until the crash is understood.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7239387003 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7239387003). Originally posted by [ballsimulation](https://github.com/ballsimulation) on 2026-11-28T12:40:16Z. --- Thanks for testing this, all of you. - **`hot_within` fix:** pushed as e3985af9, thanks @Machad3x. It's your one-line fix, with a comment saying why the check is needed. - **The guest crash at `+0x4e9b54a`** (thanks @POMXARK for the three runs): it's still open, so please keep both switches off for play for now. My guess is that the game's CPU reads a heap piece that shaders wrote for the first time before the sweep has found it, and `VICTORY_LAZY_NARROW` lets that read happen without waiting. Next I'll run `VICTORY_LAZY_COMPARE_MB` alone to see which switch is the cause. - **@hazben's measurement:** it matches what we saw. The submitting thread's planning drops from about 7 to 1.8 ms. But on a build that already has #516, the frame isn't limited by that thread, so frame times don't move. The 4–6 % figure in the description was measured on main without #516. I'll say that in the description. - **#618** covers the GPU side (lean and hot compares) in a different way. It isn't tested in the game yet. Nothing else covers the CPU side (`VICTORY_LAZY_NARROW`). If #618 lands first, I'll rebase this PR onto it and keep only the narrowing. Marking this as a draft until the crash is understood.
ballsimulation commented 2026-11-28 13:37:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ballsimulation on 2026-11-28T13:37:30Z.


@POMXARK, thanks again for the crash reports. I can't reproduce it here yet: an 8-minute prologue run with both switches had no crash (RTX 4070, Ryzen 9 7950X, Series X 1440p, DLSS Performance, no frame generation, main 63b902fe + this PR). A few details from your side would help a lot.

Leads so far

  1. Two copies are lazy at 64, not one. With VICTORY_LAZY_COMPARE_MB=64, the lazy compare covers every card copy of 64 MB or more. In my run there were two: the constants heap (174 MB) and a 90 MB copy (start=0xd7a770000 len=94371840). In both of your crashes, the game read through rbx/rdi = 0xd0418…, which is in the 0xd… range and not in the constants heap. So it may be the 90 MB copy: data the game's CPU reads back after shaders write it, which the lazy compare now finds late. That's a guess, since addresses differ between runs.
  2. A visual symptom with both switches. In the prologue's boat ride, the boat's hull was dark grey and its bow was missing (not drawn). In the same shot with the switches off, the boat was white and complete. That fits shader-written data reaching the title late.

What would help

  1. The two logs from a crashing run: the play log, and crashes.log plus the .crash.log from %LOCALAPPDATA%\VIctory\data\7952987A\temp\.
  2. The lines a buffer's host copy is in the card's memory start=… len=… with len of 67108864 or more from that log, to see whether the crash address falls in one of those copies.
  3. Each variable you set, including what "4 MiB windows" maps to, and the other patches on that branch.
  4. Where in the game it crashed: which mission or place, and whether it was a scene change, a cutscene or a load. Your second crash was "during a scene transition". If you have a save from shortly before, an export from the F1 menu (EXPORT SAVE) would let anyone try the same spot.
  5. If you have time, two runs to narrow it down:
    • VICTORY_LAZY_COMPARE_MB=128 with VICTORY_LAZY_NARROW=1. This keeps only the 174 MB constants heap lazy. If it stops crashing, the 90 MB copy is the cause.
    • VICTORY_LAZY_COMPARE_MB=64 without VICTORY_LAZY_NARROW. This tells which switch causes it.
  6. Whether you saw anything odd on screen shortly before the crash: missing parts of vehicles or people, or dark or wrong materials.

To make runs repeatable, there's now an unattended runner, scripts/bench.ps1 (#1099). Every run starts from the same save, and it can walk a fixed route from the world's first frame (#1098).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240067662 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7240067662). Originally posted by [ballsimulation](https://github.com/ballsimulation) on 2026-11-28T13:37:30Z. --- @POMXARK, thanks again for the crash reports. I can't reproduce it here yet: an 8-minute prologue run with both switches had no crash (RTX 4070, Ryzen 9 7950X, Series X 1440p, DLSS Performance, no frame generation, main `63b902fe` + this PR). A few details from your side would help a lot. **Leads so far** 1. **Two copies are lazy at 64, not one.** With `VICTORY_LAZY_COMPARE_MB=64`, the lazy compare covers every card copy of 64 MB or more. In my run there were two: the constants heap (174 MB) and a **90 MB copy** (`start=0xd7a770000 len=94371840`). In both of your crashes, the game read through `rbx`/`rdi` = `0xd0418…`, which is in the `0xd…` range and not in the constants heap. So it may be the 90 MB copy: data the game's CPU reads back after shaders write it, which the lazy compare now finds late. That's a guess, since addresses differ between runs. 2. **A visual symptom with both switches.** In the prologue's boat ride, the boat's hull was dark grey and its bow was missing (not drawn). In the same shot with the switches off, the boat was white and complete. That fits shader-written data reaching the title late. **What would help** 1. **The two logs from a crashing run:** the play log, and `crashes.log` plus the `.crash.log` from `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. 2. **The lines** `a buffer's host copy is in the card's memory start=… len=…` **with `len` of 67108864 or more** from that log, to see whether the crash address falls in one of those copies. 3. **Each variable you set**, including what "4 MiB windows" maps to, and the other patches on that branch. 4. **Where in the game** it crashed: which mission or place, and whether it was a scene change, a cutscene or a load. Your second crash was "during a scene transition". If you have a save from shortly before, an export from the F1 menu (EXPORT SAVE) would let anyone try the same spot. 5. **If you have time, two runs to narrow it down:** - `VICTORY_LAZY_COMPARE_MB=128` with `VICTORY_LAZY_NARROW=1`. This keeps only the 174 MB constants heap lazy. If it stops crashing, the 90 MB copy is the cause. - `VICTORY_LAZY_COMPARE_MB=64` without `VICTORY_LAZY_NARROW`. This tells which switch causes it. 6. Whether you saw anything odd on screen shortly before the crash: missing parts of vehicles or people, or dark or wrong materials. To make runs repeatable, there's now an unattended runner, `scripts/bench.ps1` (#1099). Every run starts from the same save, and it can walk a fixed route from the world's first frame (#1098).
POMXARK commented 2026-11-28 16:32:27 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T16:32:27Z.


@ballsimulation Here are the exact details from both saved crashing runs (VICTORY_LAZY_COMPARE_MB=64 + VICTORY_LAZY_NARROW=1).

1. Card-copy addresses (len >= 67108864)

Both crashing runs were --release at default INFO log level, and "a buffer's host copy is in the card's memory" is emitted at DEBUG (shadow.rs), so those creation lines were not captured in the two release logs.

However, the faulting register states and pre-crash lazy counters across both runs strongly fit your 90 MiB copy hypothesis:

  • Crash 1 (t ≈ 3m44s, steady ~5.5k–5.8k draws/frame, before e3985af9):
    • 0xc0000005 at +0x4e9b54a (read 0xffffffffffffffff: outside the address space)
    • Registers: rbx=0xd0418f3a8, rdi=0xd04189938, r12=0xd0c5eeb08, rcx=0x31ff84a045495676
    • Stack: +0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x2484ac4 -> +0x321c5 -> +0x3346d
    • Last lazy line (5 s before crash): hot=92298 forced=1097 swept=106240 left=338063 found=6748 hot_now=508
  • Crash 2 (t ≈ 5m48s, sharp draw transition 2319 -> 4870 -> 1407 draws/frame, WITH e3985af9 hot_within fix applied):
    • 0xc0000005 at +0x4e9b54a (read 0xc: nothing mapped there)
    • Registers: rbx=0x0, rdi=0xd0418c9b0, r12=0xd080f0280, r13=0x1c46bfd6128
    • Stack: +0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x188463 -> +0x6c6652 -> +0x5378c08
    • Pre-crash lazy stats spiked sharply during the transition:
      • -17s: hot=40200 forced=493 swept=32768 left=172009 found=1792 hot_now=547
      • -12s: hot=140676 forced=584 swept=70400 left=812524 found=4472 hot_now=290
      • -6s: hot=270120 forced=1511 swept=115072 left=1595878 found=6868 hot_now=229

In both independent runs, rdi (0xd04189938 / 0xd0418c9b0) and r12 (0xd0c5eeb08 / 0xd080f0280) sit in the same 0xd0... region while hot_now was dropping and left was climbing past 1.5M pieces right before the null/garbage dereference at +0x4e9b54a.

2. Exact switches & branch context

  • "4 MiB windows" just means VICTORY_WINDOW_KB left unset (default 4 MiB loose windows).
  • Switches active in Crash 2: VICTORY_NATIVE_1440P=1, VICTORY_DLSS=1, VICTORY_DLSS_MODE=quality, VICTORY_FRAMEGEN=1, VICTORY_FRAMEGEN_X=4, VICTORY_GPU_BCPACK=0, VICTORY_WAIT_RESIDENT=0, VICTORY_TEXTURE_ROOM_PERCENT=70, VICTORY_LAND_SKIP=1, VICTORY_RELAY=2, VICTORY_RELAY_COPY=1, VICTORY_CARD_STEPS=2, VICTORY_CARD_BUFFERS_MIN_KB=64, VICTORY_CARD_REHASH_RUNS=1, VICTORY_THIN=1, VICTORY_JOIN_COPIES=1, VICTORY_JOIN_PARTS=8, VICTORY_LAZY_COMPARE_MB=64, VICTORY_LAZY_NARROW=1 (plus standard play-foxhound defaults).
  • Other patches on Crash 2's branch: x86-64-v3 + ThinLTO, #516 (unlocked write-watch faults + hoisted soft_runs), and #340 (adaptive sweep).
  • Control comparison: With VICTORY_LAZY_COMPARE_MB and VICTORY_LAZY_NARROW unset on the exact same branch (and across 10+ subsequent 12–20 min runs), +0x4e9b54a has never occurred (0 guest crashes).
  • Visuals: No obvious missing meshes or dark/wrong materials were noticed in the periodic screenshots before Crash 2, though screenshots are only captured at 60 s intervals.

3. Next verification

I can run a targeted VICTORY_LAZY_COMPARE_MB=128 + VICTORY_LAZY_NARROW=1 check (with RUST_LOG=info,victory_gpu::shadow=debug to log exact len >= 67108864 card-copy spans) in a follow-up test slot to confirm whether excluding the ~90 MiB copy eliminates the +0x4e9b54a crash.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242320771 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7242320771). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T16:32:27Z. --- @ballsimulation Here are the exact details from both saved crashing runs (`VICTORY_LAZY_COMPARE_MB=64` + `VICTORY_LAZY_NARROW=1`). ### 1. Card-copy addresses (`len >= 67108864`) Both crashing runs were `--release` at default `INFO` log level, and `"a buffer's host copy is in the card's memory"` is emitted at `DEBUG` (`shadow.rs`), so those creation lines were not captured in the two release logs. However, the faulting register states and pre-crash `lazy` counters across both runs strongly fit your 90 MiB copy hypothesis: - **Crash 1 (`t ≈ 3m44s`, steady ~5.5k–5.8k draws/frame, before `e3985af9`):** - `0xc0000005` at `+0x4e9b54a` (`read 0xffffffffffffffff: outside the address space`) - Registers: `rbx=0xd0418f3a8`, `rdi=0xd04189938`, `r12=0xd0c5eeb08`, `rcx=0x31ff84a045495676` - Stack: `+0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x2484ac4 -> +0x321c5 -> +0x3346d` - Last `lazy` line (5 s before crash): `hot=92298 forced=1097 swept=106240 left=338063 found=6748 hot_now=508` - **Crash 2 (`t ≈ 5m48s`, sharp draw transition `2319 -> 4870 -> 1407 draws/frame`, WITH `e3985af9` `hot_within` fix applied):** - `0xc0000005` at `+0x4e9b54a` (`read 0xc: nothing mapped there`) - Registers: `rbx=0x0`, `rdi=0xd0418c9b0`, `r12=0xd080f0280`, `r13=0x1c46bfd6128` - Stack: `+0x4e9b54a -> +0x4e9b4bf -> +0x4a4a -> +0x4d9f49c -> +0x188463 -> +0x6c6652 -> +0x5378c08` - Pre-crash `lazy` stats spiked sharply during the transition: - `-17s`: `hot=40200 forced=493 swept=32768 left=172009 found=1792 hot_now=547` - `-12s`: `hot=140676 forced=584 swept=70400 left=812524 found=4472 hot_now=290` - `-6s`: `hot=270120 forced=1511 swept=115072 left=1595878 found=6868 hot_now=229` In both independent runs, `rdi` (`0xd04189938` / `0xd0418c9b0`) and `r12` (`0xd0c5eeb08` / `0xd080f0280`) sit in the same `0xd0...` region while `hot_now` was dropping and `left` was climbing past 1.5M pieces right before the null/garbage dereference at `+0x4e9b54a`. ### 2. Exact switches & branch context - **"4 MiB windows"** just means `VICTORY_WINDOW_KB` left **unset** (default `4 MiB` loose windows). - **Switches active in Crash 2:** `VICTORY_NATIVE_1440P=1`, `VICTORY_DLSS=1`, `VICTORY_DLSS_MODE=quality`, `VICTORY_FRAMEGEN=1`, `VICTORY_FRAMEGEN_X=4`, `VICTORY_GPU_BCPACK=0`, `VICTORY_WAIT_RESIDENT=0`, `VICTORY_TEXTURE_ROOM_PERCENT=70`, `VICTORY_LAND_SKIP=1`, `VICTORY_RELAY=2`, `VICTORY_RELAY_COPY=1`, `VICTORY_CARD_STEPS=2`, `VICTORY_CARD_BUFFERS_MIN_KB=64`, `VICTORY_CARD_REHASH_RUNS=1`, `VICTORY_THIN=1`, `VICTORY_JOIN_COPIES=1`, `VICTORY_JOIN_PARTS=8`, `VICTORY_LAZY_COMPARE_MB=64`, `VICTORY_LAZY_NARROW=1` (plus standard `play-foxhound` defaults). - **Other patches on Crash 2's branch:** `x86-64-v3` + ThinLTO, #516 (unlocked write-watch faults + hoisted `soft_runs`), and #340 (adaptive sweep). - **Control comparison:** With `VICTORY_LAZY_COMPARE_MB` and `VICTORY_LAZY_NARROW` unset on the exact same branch (and across 10+ subsequent 12–20 min runs), `+0x4e9b54a` has **never** occurred (`0` guest crashes). - **Visuals:** No obvious missing meshes or dark/wrong materials were noticed in the periodic screenshots before Crash 2, though screenshots are only captured at 60 s intervals. ### 3. Next verification I can run a targeted `VICTORY_LAZY_COMPARE_MB=128` + `VICTORY_LAZY_NARROW=1` check (with `RUST_LOG=info,victory_gpu::shadow=debug` to log exact `len >= 67108864` card-copy spans) in a follow-up test slot to confirm whether excluding the ~90 MiB copy eliminates the `+0x4e9b54a` crash.
x-nihil0 commented 2026-11-28 16:38:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by x-nihil0 on 2026-11-28T16:38:11Z.


RTX 5080 + Core Ultra 9 285: no crash in 19 runs with both switches (no frame generation), and the figures together with VICTORY_STORE_BESIDE

Machine: Intel Core Ultra 9 285, 64 GB RAM, RTX 5080 16 GB, driver 621.40, Windows 11. Release build of main 63b902f with this PR at f7cc776 (before the hot_within fix) plus #419 (at keep) and #799 (its switch off except in one run). The release launcher's set: Series X, 1440p, DLSS Quality, frame generation not made ready. Unattended runs from one save in the open world, the camera turning around a parked car: nothing is driven, so streaming at speed isn't covered.

  • Stability: 19 runs with VICTORY_LAZY_COMPARE_MB=64 + VICTORY_LAZY_NARROW=1 all ran to their time limit with no guest exception and no device error: 2 of 600 s and 17 of 300 s, 18 of them also with VICTORY_STORE_BESIDE=1, 2 on a diagnostics build, 9 on the same build plus two tunables of mine on the store path. Like your 8-minute run, no crash here, but my route has no loads or scene changes during play, where the second crash was, and no frame generation.
  • This PR alone (300 s, one run against two baselines in the same queue): the planning of steps on the card went from 5.3-7.8 to 1.4-2.0 ms a frame; fps at 7-9k / 9-11k draws 20.8 / 19.4 against 20.9 / 18.9 and 20.4 / 18.4. That's inside the spread here, as in @hazben's measurement.
  • With VICTORY_STORE_BESIDE=1 on top (off by default on main), 600 s runs in the order off, on, on, off: 23.1 / 23.2 fps at 7-9k draws against 20.6 / 20.3, and 20.5 / 20.4 at 9-11k against 18.3 / 18.5 (+11-13 %). The submitting thread went from 44-49 to 38-42 ms a frame: the refreshes from 17-19 to 12.5-13.5 ms (STORE_BESIDE), the planning from 5-8 to 1.6-2.3 ms (this PR). STORE_BESIDE alone gave +1.3-1.8 / +0.7-1.2 fps in a 300 s run of the earlier queue.
  • Picture: no white-out in the window grabs (1237x696) of these runs except the one with #799's switch on, and the ones I set beside the baseline looked alike. I haven't checked full-size frames, and the scene where you saw the dark hull isn't on my route.

I haven't run the two splits you asked @POMXARK for (64 without NARROW, 128 with it). No game files, captures or saves are attached. Made with AI help; the figures come from the run logs.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7242394782 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7242394782). Originally posted by [x-nihil0](https://github.com/x-nihil0) on 2026-11-28T16:38:11Z. --- **RTX 5080 + Core Ultra 9 285: no crash in 19 runs with both switches (no frame generation), and the figures together with `VICTORY_STORE_BESIDE`** Machine: Intel Core Ultra 9 285, 64 GB RAM, RTX 5080 16 GB, driver 621.40, Windows 11. Release build of `main` `63b902f` with this PR at `f7cc776` (before the `hot_within` fix) plus #419 (at `keep`) and #799 (its switch off except in one run). The release launcher's set: Series X, 1440p, DLSS Quality, frame generation not made ready. Unattended runs from one save in the open world, the camera turning around a parked car: nothing is driven, so streaming at speed isn't covered. - **Stability:** 19 runs with `VICTORY_LAZY_COMPARE_MB=64` + `VICTORY_LAZY_NARROW=1` all ran to their time limit with no guest exception and no device error: 2 of 600 s and 17 of 300 s, 18 of them also with `VICTORY_STORE_BESIDE=1`, 2 on a diagnostics build, 9 on the same build plus two tunables of mine on the store path. Like your 8-minute run, no crash here, but my route has no loads or scene changes during play, where the second crash was, and no frame generation. - **This PR alone** (300 s, one run against two baselines in the same queue): the planning of steps on the card went from 5.3-7.8 to 1.4-2.0 ms a frame; fps at 7-9k / 9-11k draws 20.8 / 19.4 against 20.9 / 18.9 and 20.4 / 18.4. That's inside the spread here, as in @hazben's measurement. - **With `VICTORY_STORE_BESIDE=1` on top** (off by default on `main`), 600 s runs in the order off, on, on, off: 23.1 / 23.2 fps at 7-9k draws against 20.6 / 20.3, and 20.5 / 20.4 at 9-11k against 18.3 / 18.5 (+11-13 %). The submitting thread went from 44-49 to 38-42 ms a frame: the refreshes from 17-19 to 12.5-13.5 ms (`STORE_BESIDE`), the planning from 5-8 to 1.6-2.3 ms (this PR). `STORE_BESIDE` alone gave +1.3-1.8 / +0.7-1.2 fps in a 300 s run of the earlier queue. - **Picture:** no white-out in the window grabs (1237x696) of these runs except the one with #799's switch on, and the ones I set beside the baseline looked alike. I haven't checked full-size frames, and the scene where you saw the dark hull isn't on my route. I haven't run the two splits you asked @POMXARK for (`64` without `NARROW`, `128` with it). No game files, captures or saves are attached. Made with AI help; the figures come from the run logs.
POMXARK commented 2026-11-28 18:22:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T18:22:24Z.


@ballsimulation @x-nihil0 Follow-up data point on VICTORY_STORE_BESIDE=1 from a 20-minute 3D run on RTX 5080 + Ryzen 7 5700X (8C/16T), Series X 1440p, DLSS Quality + MFG 4×, VICTORY_LAZY_* OFF, stacked on #516 (VICTORY_FAULT_UNLOCKED) + #834 + #1094 (PageEpochs) + #1038 (WATCH_LARGE_XMEM):

Metric (3D only, 20m) Baseline (STORE_BESIDE OFF) VICTORY_STORE_BESIDE=1 Delta
Engine / D3D12 / guest errors 0 0 clean
ALL 3D p50 FPS 14.80 12.90 -12.8%
4k–7k draws p50 FPS 14.80 (prep 51.5 ms) 11.90 (prep 64.7 ms) -19.6%
submitting total (median) 61.1 ms 68.2 ms +7.1 ms
steps (refreshes) 28.3 ms (18.4 ms) 31.6 ms (19.2 ms) +3.3 ms (+0.8 ms)
card / heaps_pre 8.2 ms / 1.4 ms 10.0 ms / 2.1 ms +1.8 ms / +0.7 ms
1s frame_times med / p95 / p99 62.7 / 81.3 / 92.3 ms 69.7 / 90.8 / 104.5 ms +7.0 / +9.5 / +12.2 ms
>100 ms frames 1,555 2,024 +30.2%

Takeaway: Unlike on stock main (where VICTORY_STORE_BESIDE=1 avoids taking GUARDS.lock on every write fault), when #516 (VICTORY_FAULT_UNLOCKED) + #1094 (PageEpochs) are already active, opening the block on fault is already lock-free — so decoding up to 5 faulting stores per block in the VEH (titlewrite.rs) becomes net overhead on 8C/16T + MFG 4×.

Also worth noting: porting the 3 small per-draw savings from voidopcode/vilocity@10b81fc (from ProjectLeonida/mandy / maren-halv/VIctory-Fast / DoubleGhosty/cool_fox: precomputed Stage::root_srvs_biased bitmask, cached Chunk::gpu address in scratch_piece, and AddressHash on States/twins/Deferred::textures) passed 473/473 victory-gpu tests and improved 7k–10k draws/frame 10.50 -> 11.50 p50 FPS (+9.5%, prep 73.0 -> 64.9 ms) with 0 errors over 20 minutes.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7243740541 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7243740541). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-11-28T18:22:24Z. --- @ballsimulation @x-nihil0 Follow-up data point on **`VICTORY_STORE_BESIDE=1`** from a 20-minute 3D run on RTX 5080 + Ryzen 7 5700X (8C/16T), Series X 1440p, DLSS Quality + MFG 4×, `VICTORY_LAZY_*` OFF, stacked on `#516` (`VICTORY_FAULT_UNLOCKED`) + `#834` + `#1094` (`PageEpochs`) + `#1038` (`WATCH_LARGE_XMEM`): | Metric (3D only, 20m) | Baseline (`STORE_BESIDE` OFF) | `VICTORY_STORE_BESIDE=1` | Delta | |---|---:|---:|---:| | Engine / D3D12 / guest errors | `0` | `0` | clean | | `ALL 3D` p50 FPS | `14.80` | `12.90` | `-12.8%` | | `4k–7k` draws p50 FPS | `14.80` (`prep 51.5 ms`) | `11.90` (`prep 64.7 ms`) | `-19.6%` | | `submitting` total (median) | `61.1 ms` | `68.2 ms` | `+7.1 ms` | | `steps` (`refreshes`) | `28.3 ms` (`18.4 ms`) | `31.6 ms` (`19.2 ms`) | `+3.3 ms` (`+0.8 ms`) | | `card` / `heaps_pre` | `8.2 ms` / `1.4 ms` | `10.0 ms` / `2.1 ms` | `+1.8 ms` / `+0.7 ms` | | `1s frame_times` med / p95 / p99 | `62.7 / 81.3 / 92.3 ms` | `69.7 / 90.8 / 104.5 ms` | `+7.0 / +9.5 / +12.2 ms` | | `>100 ms` frames | `1,555` | `2,024` | `+30.2%` | **Takeaway:** Unlike on stock `main` (where `VICTORY_STORE_BESIDE=1` avoids taking `GUARDS.lock` on every write fault), when `#516` (`VICTORY_FAULT_UNLOCKED`) + `#1094` (`PageEpochs`) are already active, opening the block on fault is already lock-free — so decoding up to 5 faulting stores per block in the VEH (`titlewrite.rs`) becomes net overhead on 8C/16T + MFG 4×. Also worth noting: porting the 3 small per-draw savings from [`voidopcode/vilocity@10b81fc`](https://github.com/voidopcode/vilocity/commit/10b81fc) (from `ProjectLeonida/mandy` / `maren-halv/VIctory-Fast` / `DoubleGhosty/cool_fox`: precomputed `Stage::root_srvs_biased` bitmask, cached `Chunk::gpu` address in `scratch_piece`, and `AddressHash` on `States`/`twins`/`Deferred::textures`) passed 473/473 `victory-gpu` tests and improved `7k–10k` draws/frame `10.50 -> 11.50 p50 FPS (+9.5%, prep 73.0 -> 64.9 ms)` with `0` errors over 20 minutes.
Castyan commented 2026-11-28 22:49:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Castyan on 2026-11-28T22:49:55Z.


Measured on an RTX 5060 8 GB / Ryzen 5 9600X, v2026.11.27.10 + #614 + VICTORY_HELPER_PRIORITY=on, --series-s --dlss quality --framegen 2, texture pool off. Two 8-minute runs of the opening cutscene with no input, the only difference being
VICTORY_LAZY_COMPARE_MB=64 VICTORY_LAZY_NARROW=1:

off on
fps p10 / median / p90 10.7 / 19.3 / 22.0 12.7 / 22.7 / 23.5
copies ms/frame (world) 22.8 18.2
submitting thread ms/frame 31.0 31.0
GPU ms/frame 4.7 7.5
crash / out of VRAM / DLSS failures none none

No visible defect on a mid-cutscene capture (animated characters, backlight through a window). Water and reflections were not in
that scene, so the "about 2 frames late" case is not checked yet. One run each, so treat the numbers as a first data point.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247013311 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/501#issuecomment-7247013311). Originally posted by [Castyan](https://github.com/Castyan) on 2026-11-28T22:49:55Z. --- Measured on an RTX 5060 8 GB / Ryzen 5 9600X, v2026.11.27.10 + #614 + `VICTORY_HELPER_PRIORITY=on`, `--series-s --dlss quality --framegen 2`, texture pool off. Two 8-minute runs of the opening cutscene with no input, the only difference being `VICTORY_LAZY_COMPARE_MB=64 VICTORY_LAZY_NARROW=1`: | | off | on | |---|---|---| | fps p10 / median / p90 | 10.7 / 19.3 / 22.0 | 12.7 / 22.7 / 23.5 | | copies ms/frame (world) | 22.8 | 18.2 | | submitting thread ms/frame | 31.0 | 31.0 | | GPU ms/frame | 4.7 | 7.5 | | crash / out of VRAM / DLSS failures | none | none | No visible defect on a mid-cutscene capture (animated characters, backlight through a window). Water and reflections were not in that scene, so the "about 2 frames late" case is not checked yet. One run each, so treat the numbers as a first data point.
Sign in to join this conversation.
No reviewers
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
trustno1-coder/VIctory-NVIDIA!501
No description provided.