Skip to content

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

Draft
ballsimulation wants to merge 2 commits into
trustno1-coder:mainfrom
ballsimulation:perf/lazy-card-compare
Draft

ballsimulation wants to merge 2 commits into
trustno1-coder:mainfrom
ballsimulation:perf/lazy-card-compare

Conversation

@ballsimulation

@ballsimulation ballsimulation commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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

…nly for that (VICTORY_LAZY_COMPARE_MB, VICTORY_LAZY_NARROW; off by default)

The constants heap (174 MB) is declared written by the skinning passes in
every submission, so it was compared whole after each of ~12 submissions a
frame (2.2 GB of the card's reads to find ~2.6 MB written), and every
constant fill from it counted as blocked by flights and was planned onto
the card (`card_steps`, 7-12 ms a frame on the submitting thread).

VICTORY_LAZY_COMPARE_MB=<MiB>: of a card copy at least this large, a
submission compares only the pieces found written lately
(VICTORY_LAZY_HOT compares, 64), the left-out pieces about to be sent up
(their rehash is held back, so the compare still sees older shader
writes), and the next VICTORY_LAZY_SWEEP (128) left-out pieces in turn.
Those compares store their hashes (mode 2). The write-back itself is
unchanged: what is found is fetched and merged as before.

VICTORY_LAZY_NARROW=1 (with the above): where submission steps wait for
flights or are done on the card in their order (late_blocked, card_steps,
cut_for, the relay's wait), such a copy counts as written only on those
pieces. Refreshes still see every declared write.

Accepted: a piece written for the first time reaches title memory, and is
read as the title has it, only once the sweep finds it (~2 frames).

Series S, DLSS Performance, 30 fps cap, RTX 4070, same walk, one build:
frame time by draws per frame, switches off -> on:
4-6k 53.7 -> 50.4 ms, 6-7k 56.8 -> 54.4, 7-8k 59.2 -> 57.1,
8-9.5k 62.7 -> 58.8; submitting thread 49.5 -> 45.8 ms, its planning of
steps on the card 7.4 -> 1.7 ms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@POMXARK

POMXARK commented Nov 28, 2026 •

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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.

dkdknight added a commit to dkdknight/victory-fork that referenced this pull request Nov 28, 2026
…for that (VICTORY_LAZY_COMPARE_MB, VICTORY_LAZY_NARROW; off, A/B-able)

Port of trustno1-coder/VIctory-NVIDIA#501 (ballsimulation, f7cc776d),
with the hot_within fix Machad3x gave in its review.

The skinning passes declare the whole 174 MB constants heap written in
every submission. Its card copy is then compared in full after each of
~12 submissions a frame (about 2.2 GB of reads to find ~2.6 MB that
shaders wrote), and nearly every constant fill from it counts as blocked
by flights, so it is planned onto the card (card_steps, 7-12 ms a frame on
the submitting thread). Upstream measured frames 4-6 % faster on an RTX
4070 at 1440p, and the planning 7.4 -> 1.7 ms.

- VICTORY_LAZY_COMPARE_MB=<MiB>: a copy at least that large is compared
  only on pieces found written in the last VICTORY_LAZY_HOT compares (64),
  pieces about to be sent up (their rehash held back), and the next
  VICTORY_LAZY_SWEEP pending pieces (128); those compares store their
  hashes (mode 2). Trade-off: a piece shaders write for the first time
  comes back when the sweep reaches it, about 2 frames later.
- VICTORY_LAZY_NARROW=1 (with the above): late_blocked, card_steps,
  cut_for and the relay's wait count such a copy written only on its hot
  pieces (Line::narrow, via Line::blocking). Refreshes still see every
  declared write. A 0xc0000005 was reported on a 5080 with both on, on a
  modified branch.

Fix (Machad3x): hot_within joined a hot piece onto out.last_mut() without
checking last.0 <= a; out already holds unrelated ranges (texture
read-backs), so a hot piece below one was swallowed and, with NARROW, its
flight not waited for. Now push_joined, with a test.

Adapted here: lazy ranges carry this tree's CardRange.left
(crate::wc_skip) like declared ones; mod font is not ours. In-run A/B:
VICTORY_AB can name VICTORY_LAZY_COMPARE_MB (64 MiB when the variable is
unset) and VICTORY_LAZY_NARROW. Line::narrow is kept whenever the compare
is set up, so NARROW can turn on with flights in the air; with the
compare off, narrow takes the whole declared ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@POMXARK

POMXARK commented Nov 28, 2026 •

Copy link
Copy Markdown

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

POMXARK commented Nov 28, 2026 •

Copy link
Copy Markdown

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.

465d6a0eac added a commit to 465d6a0eac/VIctory-NVIDIA-Experiment that referenced this pull request Nov 28, 2026
…default; notes on copies back and memory types

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGw6DM2fQu3WKmCUhFxrrM
…by it (hot_within)

hot_within joined a hot piece onto the last range of `out` whenever that
range ended at or after the piece's start, without checking that it began
at or before it. `out` already holds other ranges there (Line::joined seeds
it with the texture read-backs, the line's rebuild with other flights'
ranges), so a hot piece lying below one of them was dropped, and with
VICTORY_LAZY_NARROW=1 steps that read it did not wait for the flight that
writes it. Found and fixed in review by Machad3x on trustno1-coder#501.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hazben

hazben commented Nov 28, 2026

Copy link
Copy Markdown

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 8fc2254 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

Copy link
Copy Markdown
Contributor Author

Thanks for testing this, all of you.

Marking this as a draft until the crash is understood.

@ballsimulation

Copy link
Copy Markdown
Contributor Author

@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

POMXARK commented Nov 28, 2026

Copy link
Copy Markdown

@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, victory-gpu: open write-faulted guarded blocks without the guards' lock by default, and build soft runs once per guard pass #516 (unlocked write-watch faults + hoisted soft_runs), and Sweeps behind flights every 15 s while memory is not pressed (a 36-100 ms frame every 1.5 s) #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

Copy link
Copy Markdown

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 GPU: narrow placed-copy, enhanced-group, buffer and pipeline-sync barriers (VICTORY_NARROW_BARRIERS) #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

POMXARK commented Nov 28, 2026

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants