VICTORY_CARD_BUFFERS_MIN_KB=64 starves >=1 MiB buffers out of VRAM when CARD_BUFFERS_MB=1024 (RTX 4080 measurements) #1163

Open
opened 2026-11-26 03:58:43 +00:00 by github-bot · 7 comments
Owner

@⁠Proudnoob4 on GitHub · 2026-11-25 22:13 UTC · original

AI-assisted testing (Gemini in OpenCode); measured locally on my own machine.

Summary

When VICTORY_CARD_BUFFERS_MIN_KB=64 (c36971b) is combined with VICTORY_CARD_BUFFERS_MB=1024, small 64 KiB buffers fill the 1024 MB budget first and starve large (≥1 MiB) buffers out to PC RAM. On an RTX 4080 16 GB (Series X profile), that flips MIN_KB=64 from a massive GPU win into a severe regression (129.5 ms GPU lists instead of 36.4–42.0 ms).

Measured comparison (RTX 4080 16 GB, Windows 10 22H2 + Agility 1.620.2, i5-13600K)

All runs use the same diagnostics release build (9c184b3 + bundled perf PRs including #1014 CARD_HASH_WIDE, #1029, #1032, #1097, #1117, #1138), warm cache, Series X profile, VICTORY_CARD_BUFFERS_MIN_KB=64, VICTORY_CARD_HASH_LEN=1:

Run / Cap Buffers on card Buffers left in PC RAM CPU shader-write compare cardmeter title lists framelog all other lists
CARD_BUFFERS_MB=1024 (no INDIRECT_WINDOW) 3,381 (1,025 MB) 495×64K + 9×256K–1M + 17 ≥1 MiB (151 MB) 122.6 MB/frame (121.6 MB in ≥1 MiB) 131.8 ms 129.5 ms
CARD_BUFFERS_MB=1536 (no INDIRECT_WINDOW) 3,943 (1,213 MB) 5×64K (0 MB), 0 ≥1 MiB 0.0 MB/frame 95.7 ms 95.9 ms
CARD_BUFFERS_MB=1536 + INDIRECT_WINDOW=1 + INDIRECT_GATHER=1 3,896 (1,210 MB) 0 0.0 MB/frame 42.0 ms 36.4 ms

For reference, our prior stack on ca8829f with VICTORY_CARD_BUFFERS_MIN_MB=1 and VICTORY_CARD_BUFFERS_MB=1024 had 28.8 MB/frame CPU shader-write compare and 59.8 ms (cardmeter 60.0 ms) GPU title lists.

Secondary note: VICTORY_CARD_WINDOWS_MB=1024 + VICTORY_WINDOW_UPLOAD=1 when ReBAR GPU upload heaps are unavailable

On this Windows 10 22H2 / RTX 4080 setup, GPU upload heaps logged supported=false. Enabling VICTORY_CARD_WINDOWS_MB=1024 alongside CARD_BUFFERS_MIN_KB=64 (CARD_BUFFERS_MB=2048) hit no room on the card for one of 4096 KiB; so far 263 on the card (1024 MB), 512 turned down for the card's room, which slowed cardmeter GPU lists to 88.0 ms.

Suggestion

When VICTORY_CARD_BUFFERS_MIN_KB is set below 1024:

  1. Either reserve part of VICTORY_CARD_BUFFERS_MB for ≥1 MiB buffers (e.g., refuse sub-1 MiB card placements once headroom falls below ~256–384 MB) so small buffers cannot crowd out the large buffers that shaders hit hardest, or
  2. Log a clear warning when VICTORY_CARD_BUFFERS_MIN_KB < 1024 and VICTORY_CARD_BUFFERS_MB <= 1024 (recommending 1536+ on 12–16 GB cards).

With CARD_BUFFERS_MB=1536 + #1014 (CARD_HASH_WIDE), VICTORY_CARD_BUFFERS_MIN_KB=64 is a huge win on RTX 4080: send-and-hash stays at 6.9 ms, compare at 1.4 ms, and title GPU lists drop to 36.4–42.0 ms (44.7 ms total GPU = 22.4 fps Series X GPU ceiling).

**@⁠Proudnoob4** on GitHub · 2026-11-25 22:13 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163) *AI-assisted testing (Gemini in OpenCode); measured locally on my own machine.* ### Summary When `VICTORY_CARD_BUFFERS_MIN_KB=64` (`c36971b`) is combined with `VICTORY_CARD_BUFFERS_MB=1024`, small 64 KiB buffers fill the 1024 MB budget first and starve large (≥1 MiB) buffers out to PC RAM. On an RTX 4080 16 GB (Series X profile), that flips `MIN_KB=64` from a massive GPU win into a severe regression (`129.5 ms` GPU lists instead of `36.4–42.0 ms`). ### Measured comparison (RTX 4080 16 GB, Windows 10 22H2 + Agility 1.620.2, i5-13600K) All runs use the same diagnostics release build (`9c184b3` + bundled perf PRs including `#1014` `CARD_HASH_WIDE`, `#1029`, `#1032`, `#1097`, `#1117`, `#1138`), warm cache, Series X profile, `VICTORY_CARD_BUFFERS_MIN_KB=64`, `VICTORY_CARD_HASH_LEN=1`: | Run / Cap | Buffers on card | Buffers left in PC RAM | CPU shader-write compare | `cardmeter` title lists | `framelog` `all other lists` | |---|---|---|---|---|---| | `CARD_BUFFERS_MB=1024` (no `INDIRECT_WINDOW`) | 3,381 (`1,025 MB`) | 495×64K + 9×256K–1M + **17 ≥1 MiB (`151 MB`)** | **`122.6 MB/frame`** (`121.6 MB` in ≥1 MiB) | `131.8 ms` | `129.5 ms` | | `CARD_BUFFERS_MB=1536` (no `INDIRECT_WINDOW`) | 3,943 (`1,213 MB`) | 5×64K (`0 MB`), **0 ≥1 MiB** | **`0.0 MB/frame`** | `95.7 ms` | `95.9 ms` | | `CARD_BUFFERS_MB=1536` + `INDIRECT_WINDOW=1` + `INDIRECT_GATHER=1` | 3,896 (`1,210 MB`) | **0** | **`0.0 MB/frame`** | **`42.0 ms`** | **`36.4 ms`** | For reference, our prior stack on `ca8829f` with `VICTORY_CARD_BUFFERS_MIN_MB=1` and `VICTORY_CARD_BUFFERS_MB=1024` had `28.8 MB/frame` CPU shader-write compare and `59.8 ms` (`cardmeter` `60.0 ms`) GPU title lists. ### Secondary note: `VICTORY_CARD_WINDOWS_MB=1024` + `VICTORY_WINDOW_UPLOAD=1` when ReBAR GPU upload heaps are unavailable On this Windows 10 22H2 / RTX 4080 setup, `GPU upload heaps` logged `supported=false`. Enabling `VICTORY_CARD_WINDOWS_MB=1024` alongside `CARD_BUFFERS_MIN_KB=64` (`CARD_BUFFERS_MB=2048`) hit `no room on the card for one of 4096 KiB; so far 263 on the card (1024 MB), 512 turned down for the card's room`, which slowed `cardmeter` GPU lists to `88.0 ms`. ### Suggestion When `VICTORY_CARD_BUFFERS_MIN_KB` is set below `1024`: 1. Either reserve part of `VICTORY_CARD_BUFFERS_MB` for ≥1 MiB buffers (e.g., refuse sub-1 MiB card placements once headroom falls below ~256–384 MB) so small buffers cannot crowd out the large buffers that shaders hit hardest, or 2. Log a clear warning when `VICTORY_CARD_BUFFERS_MIN_KB < 1024` and `VICTORY_CARD_BUFFERS_MB <= 1024` (recommending `1536+` on 12–16 GB cards). With `CARD_BUFFERS_MB=1536` + `#1014` (`CARD_HASH_WIDE`), `VICTORY_CARD_BUFFERS_MIN_KB=64` is a huge win on RTX 4080: `send-and-hash` stays at `6.9 ms`, `compare` at `1.4 ms`, and title GPU lists drop to `36.4–42.0 ms` (`44.7 ms` total GPU = `22.4 fps` Series X GPU ceiling).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:58:43 +00:00
Author
Owner

@⁠Ym1r1710 on GitHub · 2026-11-25 22:18 UTC · original

Same here on an RTX 5080 16 GB (Series X, 9c184b3 merged, CARD_BUFFERS_MB left at the default). Two runs with MIN_KB=64 against two without, same build and scene:

  • CPU compare of shader writes went from 26 MB/frame (0 MB in copies of 1 MiB or more) to about 100 MB/frame, 99 MB of it in copies of 1 MiB or more
  • median frame 115 / 115 ms vs 104 / 108 ms without it

The worse part: in both MIN_KB=64 runs the world turned black a few seconds after entering it (only the controls hint left on screen) and stayed black through world+800. The two control runs were normal. I didn't try a bigger CARD_BUFFERS_MB, so I can't say if that fixes the black screen too.

**@⁠Ym1r1710** on GitHub · 2026-11-25 22:18 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7176200357) Same here on an RTX 5080 16 GB (Series X, 9c184b3 merged, CARD_BUFFERS_MB left at the default). Two runs with MIN_KB=64 against two without, same build and scene: - CPU compare of shader writes went from 26 MB/frame (0 MB in copies of 1 MiB or more) to about 100 MB/frame, 99 MB of it in copies of 1 MiB or more - median frame 115 / 115 ms vs 104 / 108 ms without it The worse part: in both MIN_KB=64 runs the world turned black a few seconds after entering it (only the controls hint left on screen) and stayed black through world+800. The two control runs were normal. I didn't try a bigger CARD_BUFFERS_MB, so I can't say if that fixes the black screen too.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-26 07:11 UTC · original

Confirming Ym1r1710's visual corruption finding on an RTX 4080 16 GB (Windows 10, Series S) even with a larger VICTORY_CARD_BUFFERS_MB=2048 budget (controlled A/B in the opening prison cell scene):

  • VICTORY_CARD_BUFFERS_MIN_KB=64 + VICTORY_CARD_BUFFERS_MB=2048: 6 one-frame black shard / corruption flashes in 20 s (~18/min) — dark patches on Lucia's shirt and orange streaks across the yard — at 24.9 fps median.
  • VICTORY_CARD_BUFFERS_MIN_MB=1 + VICTORY_CARD_BUFFERS_MB=1536 (same binary, same scene): 0 flashes in 90 s at 21.9 fps median.

So even when CARD_BUFFERS_MB is raised to 2 GB (avoiding ≥1 MiB starvation), lowering the threshold to 64 KB still introduces one-frame stale/corrupt buffer flashes on NVIDIA. Keeping VICTORY_CARD_BUFFERS_MIN_MB=1 eliminates them cleanly.

**@⁠Proudnoob4** on GitHub · 2026-11-26 07:11 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7185189867) Confirming `Ym1r1710`'s visual corruption finding on an **RTX 4080 16 GB (Windows 10, Series S)** even **with** a larger `VICTORY_CARD_BUFFERS_MB=2048` budget (controlled A/B in the opening prison cell scene): - **`VICTORY_CARD_BUFFERS_MIN_KB=64` + `VICTORY_CARD_BUFFERS_MB=2048`:** **6 one-frame black shard / corruption flashes in 20 s (~18/min)** — dark patches on Lucia's shirt and orange streaks across the yard — at `24.9 fps` median. - **`VICTORY_CARD_BUFFERS_MIN_MB=1` + `VICTORY_CARD_BUFFERS_MB=1536` (same binary, same scene):** **0 flashes in 90 s** at `21.9 fps` median. So even when `CARD_BUFFERS_MB` is raised to 2 GB (avoiding ≥1 MiB starvation), lowering the threshold to 64 KB still introduces one-frame stale/corrupt buffer flashes on NVIDIA. Keeping `VICTORY_CARD_BUFFERS_MIN_MB=1` eliminates them cleanly.
Author
Owner

@⁠m335671 on GitHub · 2026-11-26 08:35 UTC · original

A data point from a 12 GB card, RTX 4070 (Windows 11, Series X profile, first room, idle, one launch per row). It agrees with the cap explanation, and with a large enough cap it's a clear win here.

Our tree (diagnostics build, main 9c184b3 + #1093 + #1096 + #215 + #799 with VICTORY_WAVE_LDS_LOOSE=0; VICTORY_INDIRECT_WINDOW=1 VICTORY_LEVELS_ON_DEMAND=1 VICTORY_JOIN_PARTS=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_COPY_PLAIN=1 VICTORY_INDIRECT_GATHER=1 VICTORY_CARD_REHASH_RUNS=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_TEXTURE_BACK=1 VICTORY_AMBIENT=0.6). Last eight frame-log lines once settled:

fps ms/frame on the GPU preparing
default (MIN_MB=1, 1024 MB) 5.9–6.8 148–170 55–79 48–60
MIN_KB=64 + CARD_BUFFERS_MB=1536 + CARD_HASH_LEN=1 7.2–7.9 127–139 43–50 52–58

With the second row, 3885 in the card's memory 1210 MB, none left in the PC's memory. No exception and no device removal. The end capture looks the same as the default one. I only have that one capture, though, so I can't rule out the one-frame flashes reported above.

The other side of it. A build whose launcher sets MIN_KB=64 while capping card buffers at 512 MB (card_buffers_max_mb=512 in its log) ran this room at 2.7–2.9 fps, about 300 ms on the GPU. Without MIN_KB=64 it ran at 6.1–6.3 fps, about 95–105 ms. That's the same starvation as in the first post, only worse with the smaller cap.

So on 12 GB it looks safe to use only together with a cap that holds every copy (about 1.2 GB here).

AI use: the runs were done on my machine. Claude Code (Claude Opus 5.5) ran them, read the logs and wrote this comment.

**@⁠m335671** on GitHub · 2026-11-26 08:35 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7186772091) A data point from a 12 GB card, RTX 4070 (Windows 11, Series X profile, first room, idle, one launch per row). It agrees with the cap explanation, and with a large enough cap it's a clear win here. **Our tree** (diagnostics build, `main` `9c184b3` + #1093 + #1096 + #215 + #799 with `VICTORY_WAVE_LDS_LOOSE=0`; `VICTORY_INDIRECT_WINDOW=1 VICTORY_LEVELS_ON_DEMAND=1 VICTORY_JOIN_PARTS=1 VICTORY_BACK_OWN_VIEW=1 VICTORY_COPY_PLAIN=1 VICTORY_INDIRECT_GATHER=1 VICTORY_CARD_REHASH_RUNS=1 VICTORY_TEXTURE_NO_WAIT=1 VICTORY_TEXTURE_BACK=1 VICTORY_AMBIENT=0.6`). Last eight frame-log lines once settled: | | fps | ms/frame | on the GPU | preparing | |---|---|---|---|---| | default (`MIN_MB=1`, 1024 MB) | 5.9–6.8 | 148–170 | 55–79 | 48–60 | | `MIN_KB=64` + `CARD_BUFFERS_MB=1536` + `CARD_HASH_LEN=1` | **7.2–7.9** | **127–139** | **43–50** | 52–58 | With the second row, `3885 in the card's memory 1210 MB`, none left in the PC's memory. No exception and no device removal. The end capture looks the same as the default one. I only have that one capture, though, so I can't rule out the one-frame flashes reported above. **The other side of it.** A build whose launcher sets `MIN_KB=64` while capping card buffers at 512 MB (`card_buffers_max_mb=512` in its log) ran this room at **2.7–2.9 fps, about 300 ms on the GPU**. Without `MIN_KB=64` it ran at 6.1–6.3 fps, about 95–105 ms. That's the same starvation as in the first post, only worse with the smaller cap. So on 12 GB it looks safe to use only together with a cap that holds every copy (about 1.2 GB here). AI use: the runs were done on my machine. Claude Code (Claude Opus 5.5) ran them, read the logs and wrote this comment.
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-26 08:52 UTC · original

SOLVED — VICTORY_FETCH_CHECK=1 eliminates the MIN_KB=64 black-shard flashes on RTX 4080 (32.0 fps median, 34.4 fps max, 0/60 corrupted frames)!

We found and verified the root cause of the 1-frame black-shard flashes we previously reported with VICTORY_CARD_BUFFERS_MIN_KB=64:

  • Root cause (host/torn.rs): With VICTORY_RELAY_COPY=1, the copy queue fetches small <1 MiB dynamic buffers back while a later flight is clearing/refilling them, landing torn intermediate bytes into the CPU side that later upload back over valid data.
  • Fix: Combine VICTORY_CARD_BUFFERS_MIN_KB=64 + VICTORY_CARD_BUFFERS_MB=2048 + VICTORY_FETCH_CHECK=1 + VICTORY_SKIP_WC_BACK=1 + VICTORY_SKIP_WC_COMPARE=1.
    • VICTORY_SKIP_WC_BACK=1 + VICTORY_SKIP_WC_COMPARE=1 keeps write-combining buffers off the copy-back path (0.3 MB/frame copy-back), so VICTORY_FETCH_CHECK=1 only has to verify ~52 pieces/frame.
    • VICTORY_FETCH_CHECK=1 actively caught and repaired 0.9–3.5 torn 64 KiB pieces per frame (100% recovered whole on re-fetch!).

Measured 10-minute RTX 4080 16 GB (Windows 10, i5-13600K, Series S render_scale=0.6667, RT skipped)

Run Settings World entry Settled median (n=109 / 114) Tail-40 median Peak FPS Copy-back Visual check
Pass 12 MIN_MB=1, CARD_BUFFERS_MB=1536 76.5 s 25.70 fps (38.9 ms) 25.90 fps 28.40 0.9 MB clean
Pass 13 MIN_KB=64, CARD_BUFFERS_MB=2048, FETCH_CHECK=1 70.1 s 32.00 fps (31.2 ms) 32.00 fps (worst 33.4 ms, 0 stutters >55 ms) 34.40 0.3 MB 0/60 black flashes across two 15 s / 2 fps burst contact sheets (t=420..435, t=520..535), native frosted glass intact

GPU wait dropped to 0.0 ms on the GPU (13,375 MiB peak VRAM, 104.7 W, 2805 MHz) — shifting the frame from GPU-bound to 100% CPU-bound (24.2 ms preparing + 6.7 ms copy-back).

**@⁠Proudnoob4** on GitHub · 2026-11-26 08:52 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7187123431) ### SOLVED — `VICTORY_FETCH_CHECK=1` eliminates the `MIN_KB=64` black-shard flashes on RTX 4080 (`32.0 fps` median, `34.4 fps` max, `0/60` corrupted frames)! We found and verified the root cause of the 1-frame black-shard flashes we previously reported with `VICTORY_CARD_BUFFERS_MIN_KB=64`: - **Root cause (`host/torn.rs`):** With `VICTORY_RELAY_COPY=1`, the copy queue fetches small `<1 MiB` dynamic buffers back while a later flight is clearing/refilling them, landing torn intermediate bytes into the CPU side that later upload back over valid data. - **Fix:** Combine **`VICTORY_CARD_BUFFERS_MIN_KB=64` + `VICTORY_CARD_BUFFERS_MB=2048` + `VICTORY_FETCH_CHECK=1` + `VICTORY_SKIP_WC_BACK=1` + `VICTORY_SKIP_WC_COMPARE=1`**. - `VICTORY_SKIP_WC_BACK=1` + `VICTORY_SKIP_WC_COMPARE=1` keeps write-combining buffers off the copy-back path (`0.3 MB/frame` copy-back), so `VICTORY_FETCH_CHECK=1` only has to verify `~52` pieces/frame. - `VICTORY_FETCH_CHECK=1` actively caught and repaired **`0.9–3.5` torn 64 KiB pieces per frame** (`100%` recovered whole on re-fetch!). #### Measured 10-minute RTX 4080 16 GB (Windows 10, i5-13600K, Series S `render_scale=0.6667`, RT skipped) | Run | Settings | World entry | Settled median (`n=109` / `114`) | Tail-40 median | Peak FPS | Copy-back | Visual check | |---|---|---:|---:|---:|---:|---:|---| | Pass 12 | `MIN_MB=1`, `CARD_BUFFERS_MB=1536` | `76.5 s` | `25.70 fps` (`38.9 ms`) | `25.90 fps` | `28.40` | `0.9 MB` | clean | | **Pass 13** | **`MIN_KB=64`, `CARD_BUFFERS_MB=2048`, `FETCH_CHECK=1`** | **`70.1 s`** | **`32.00 fps` (`31.2 ms`)** | **`32.00 fps` (worst `33.4 ms`, `0` stutters `>55 ms`)** | **`34.40`** | **`0.3 MB`** | **`0/60` black flashes across two 15 s / 2 fps burst contact sheets (`t=420..435`, `t=520..535`), native frosted glass intact** | GPU wait dropped to **`0.0 ms` on the GPU** (`13,375 MiB` peak VRAM, `104.7 W`, `2805 MHz`) — shifting the frame from GPU-bound to **100% CPU-bound** (`24.2 ms` preparing + `6.7 ms` copy-back).
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-26 14:39 UTC · original

CRITICAL correction to our Pass 13 comment + verified root-cause fix (VICTORY_SKIP_WC_MIN_KB, default 1024 KiB)

After posting Pass 13 above, 5 consecutive 10-minute follow-up runs (Pass 14, 14b, 14c, 14d on the exact same commit 6733ddf, and 14e) revealed that Pass 13 was a lucky 1-of-6 run: combining VICTORY_CARD_BUFFERS_MIN_KB=64 with unguarded VICTORY_SKIP_WC_COMPARE=1 / VICTORY_SKIP_WC_BACK=1 actually causes 66–72% full-screen black frames (spreading NaN/firefly blackout while 2D HUD stays crisp) and silently drops ~600–744 draws/frame.

Exact root cause (measured from GTA 6 buffer census + 10-min A/B matrix)

Under VICTORY_CARD_BUFFERS_MIN_KB=64, GTA 6 creates 4,258 carded buffers (711.1 MB):

  • 4,179 are < 1 MiB (4,056 < 64 KiB, 69 64–256 KiB, 54 256 KiB–1 MiB), and 4,045 of those (45.8 MB) live inside GTA 6's 0x948a00000..0x998700000 write-combining (0x2404) heap.
  • 79 are >= 1 MiB (665.3 MB), of which ~40 are WC buffers.

Piece-landing arithmetic across our controlled 10-minute A/B runs on RTX 4080 / Win10:

  • >= 1 MiB non-WC card copies: 54 pieces/frame (1.3 MB)
  • < 1 MiB WC buffers: 263 pieces/frame (3.3 MB) — MUST NOT BE SKIPPED. Skipping them drops ~744 draws/frame (4,562 -> 3,818) and causes 66–72% black frames.
  • >= 1 MiB WC buffers: 516 pieces/frame (39.0 MB) — SAFE TO SKIP. Skipping them saves 39.0 MB/frame and -7.9 ms copy-back with 0/230 black frames across 8 runs.

Fix: gate SKIP_WC_COMPARE and SKIP_WC_BACK by buffer size (VICTORY_SKIP_WC_MIN_KB, default 1024 KiB)

In crates/victory-gpu/src/census.rs and host.rs:

  • Add skip_wc_min_bytes() reading VICTORY_SKIP_WC_MIN_KB (default 1024 KiB = 1 MiB).
  • In host.rs (card_before declared.retain): only drop WC compare if shadow.span().1 >= skip_wc_min_bytes() && all_wc(ranges).
  • In census::skip_back(copy_bytes, declared, bytes): return false when copy_bytes < skip_wc_min_bytes().

This preserves the exact MIN_MB=1 safety boundary for WC skipping while letting < 1 MiB buffers live in fast VRAM (MIN_KB=64). (Especially important on Windows 10 WDDM 2.7 where GPUUploadHeapSupported=false, so SMALL_BUFFERS_BAR_MB cannot place < 1 MiB buffers in ReBAR.)

Controlled 10-minute verification matrix (RTX 4080 16 GB, i5-13600K, Win10, Series S render_scale=0.6667, RT skipped, t=140..600s n=230 frame scan)

Run Config Settled median FPS Tail-40 median (max) Draws/frame Landed pieces (dirty MB) GPU busy BLACK frames (n=230)
Pass 14d (6733ddf) MIN_KB=64, unguarded SKIP_WC_COMPARE=1 33.85 33.9 (35.6) 3,818 (-744!) 54 (1.3 MB) 74% 152/230 (66% BLACK)
Pass 14f MIN_MB=1 (1024 KiB), SKIP_WC_COMPARE=1 25.55 25.6 (28.1) 4,562 317 (4.6 MB) 99% (~39 ms) 0/230 (60/60 bursts)
Pass 14g MIN_KB=64, SKIP_WC_COMPARE=0, SKIP_WC_BACK=0 26.85 26.9 (28.2) 4,525 833 (43.5 MB) 77% 0/230 (59/60 bursts)
Pass 15 (Fix) MIN_KB=64, FETCH_CHECK=1, SKIP_WC_COMPARE=1, SKIP_WC_MIN_KB=1024 32.00 32.00 (32.70, 0 >55 ms) 4,505 317 (4.5 MB) 61% (~18 ms) 0/230 (120/120 bursts)

Pass 15 highlights:

  • +25.2% FPS over MIN_MB=1 (25.55 -> 32.00 fps median, 31.3 ms med / 32.3 ms max in tail-40, 0 stutters >55 ms).
  • Full draw count restored (4,505 draws/frame) and identical copy-back volume (317 pieces / 4.5 MB) to MIN_MB=1.
  • VICTORY_FETCH_CHECK=1 checked 309.3 pieces/frame and caught + recovered 2.55 torn pieces/frame (100% recovered whole).
  • GPU dropped from 99% (~39 ms) to 61% busy (~18 ms) — completely shifting the bottleneck from GPU to victory-submit (32.8 ms CPU).
**@⁠Proudnoob4** on GitHub · 2026-11-26 14:39 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7195129620) ### CRITICAL correction to our Pass 13 comment + verified root-cause fix (`VICTORY_SKIP_WC_MIN_KB`, default `1024` KiB) After posting Pass 13 above, **5 consecutive 10-minute follow-up runs** (`Pass 14`, `14b`, `14c`, `14d` on the exact same commit `6733ddf`, and `14e`) revealed that Pass 13 was a lucky 1-of-6 run: combining **`VICTORY_CARD_BUFFERS_MIN_KB=64`** with unguarded **`VICTORY_SKIP_WC_COMPARE=1` / `VICTORY_SKIP_WC_BACK=1`** actually causes **66–72% full-screen black frames** (spreading NaN/firefly blackout while 2D HUD stays crisp) and silently drops **~600–744 draws/frame**. #### Exact root cause (measured from GTA 6 buffer census + 10-min A/B matrix) Under `VICTORY_CARD_BUFFERS_MIN_KB=64`, GTA 6 creates `4,258` carded buffers (`711.1 MB`): - **`4,179` are `< 1 MiB`** (`4,056` `< 64 KiB`, `69` `64–256 KiB`, `54` `256 KiB–1 MiB`), and **`4,045` of those (`45.8 MB`) live inside GTA 6's `0x948a00000..0x998700000` write-combining (`0x2404`) heap**. - **`79` are `>= 1 MiB`** (`665.3 MB`), of which ~40 are WC buffers. Piece-landing arithmetic across our controlled 10-minute A/B runs on RTX 4080 / Win10: - `>= 1 MiB` non-WC card copies: **`54` pieces/frame (`1.3 MB`)** - `< 1 MiB` WC buffers: **`263` pieces/frame (`3.3 MB`)** — **MUST NOT BE SKIPPED.** Skipping them drops `~744 draws/frame` (`4,562 -> 3,818`) and causes `66–72%` black frames. - `>= 1 MiB` WC buffers: **`516` pieces/frame (`39.0 MB`)** — **SAFE TO SKIP.** Skipping them saves `39.0 MB/frame` and `-7.9 ms` copy-back with `0/230` black frames across 8 runs. #### Fix: gate `SKIP_WC_COMPARE` and `SKIP_WC_BACK` by buffer size (`VICTORY_SKIP_WC_MIN_KB`, default `1024` KiB) In `crates/victory-gpu/src/census.rs` and `host.rs`: - Add `skip_wc_min_bytes()` reading `VICTORY_SKIP_WC_MIN_KB` (default `1024` KiB = `1 MiB`). - In `host.rs` (`card_before` `declared.retain`): only drop WC compare if `shadow.span().1 >= skip_wc_min_bytes() && all_wc(ranges)`. - In `census::skip_back(copy_bytes, declared, bytes)`: return `false` when `copy_bytes < skip_wc_min_bytes()`. This preserves the exact `MIN_MB=1` safety boundary for WC skipping while letting `< 1 MiB` buffers live in fast VRAM (`MIN_KB=64`). (Especially important on Windows 10 WDDM 2.7 where `GPUUploadHeapSupported=false`, so `SMALL_BUFFERS_BAR_MB` cannot place `< 1 MiB` buffers in ReBAR.) #### Controlled 10-minute verification matrix (RTX 4080 16 GB, i5-13600K, Win10, Series S `render_scale=0.6667`, RT skipped, `t=140..600s` `n=230` frame scan) | Run | Config | Settled median FPS | Tail-40 median (max) | Draws/frame | Landed pieces (dirty MB) | GPU busy | `BLACK` frames (`n=230`) | |---|---|---:|---:|---:|---|---:|---:| | Pass 14d (`6733ddf`) | `MIN_KB=64`, unguarded `SKIP_WC_COMPARE=1` | `33.85` | `33.9` (`35.6`) | `3,818` (-744!) | `54` (`1.3 MB`) | `74%` | **`152/230` (66% BLACK)** | | Pass 14f | `MIN_MB=1` (1024 KiB), `SKIP_WC_COMPARE=1` | `25.55` | `25.6` (`28.1`) | `4,562` | `317` (`4.6 MB`) | `99%` (`~39 ms`) | **`0/230`** (`60/60` bursts) | | Pass 14g | `MIN_KB=64`, `SKIP_WC_COMPARE=0`, `SKIP_WC_BACK=0` | `26.85` | `26.9` (`28.2`) | `4,525` | `833` (`43.5 MB`) | `77%` | **`0/230`** (`59/60` bursts) | | **Pass 15 (Fix)** | **`MIN_KB=64`, `FETCH_CHECK=1`, `SKIP_WC_COMPARE=1`, `SKIP_WC_MIN_KB=1024`** | **`32.00`** | **`32.00` (`32.70`, `0` >55 ms)** | **`4,505`** | **`317` (`4.5 MB`)** | **`61%` (`~18 ms`)** | **`0/230`** (`120/120` bursts) | Pass 15 highlights: - **+25.2% FPS over `MIN_MB=1`** (`25.55 -> 32.00 fps` median, `31.3 ms` med / `32.3 ms` max in tail-40, `0` stutters `>55 ms`). - **Full draw count restored** (`4,505` draws/frame) and **identical copy-back volume** (`317` pieces / `4.5 MB`) to `MIN_MB=1`. - **`VICTORY_FETCH_CHECK=1`** checked `309.3` pieces/frame and caught + recovered `2.55` torn pieces/frame (`100%` recovered whole). - **GPU dropped from `99%` (`~39 ms`) to `61%` busy (`~18 ms`)** — completely shifting the bottleneck from GPU to `victory-submit` (`32.8 ms` CPU).
Author
Owner

@⁠anon31-006459 on GitHub · 2026-11-26 17:08 UTC · original

A Linux data point for the MIN_KB=64 artefacts, matching your SKIP_WC_BACK finding.

Setup: RTX 3070 Ti 8 GB, NVIDIA 595.104.02, Proton Experimental 11.0-20261112. Fork main ac25549 merged into Zayfway's perf/exopus-recipe, with VICTORY_SKIP_WC_BACK=1 RELAY=2 CARD_HASH_LEN=1 MERGE_GAP=64 MERGE_RUNS=4096 CARD_WINDOWS_MB=1024, Series S. (RELAY_COPY and FETCH_CHECK not set.)

With CARD_BUFFERS_MIN_KB=64: constant flicker in the prison. Frames alternate between lit, untextured and black, and characters lose their heads with only the eyes, lips and earrings drawn. It happens in every run with it (runs 9, 10, 12 and 13). A run with the older #1820 set, without MIN_KB, was clean.

Bisected by switch groups, one run each:

  • FILLS_PLAIN/STEP_INDEX off: no change.
  • MIN_KB, HASH_LEN, MERGE_GAP and MERGE_RUNS off: stable.
  • HASH_LEN and the merges back on, only MIN_KB off: stable (run 16).

So MIN_KB=64 alone, with SKIP_WC_BACK=1 on as in your Pass 14. I have not tried your VICTORY_SKIP_WC_MIN_KB fix yet.

The same symptom also appeared in a build of the cool_fox line (grimygunnz/nvidia-3070-VI), whose launcher sets CARD_BUFFERS_MIN_KB=64 too.

AI-assisted (Claude Code, Claude Opus 5.5); observations from runs on my machine.

**@⁠anon31-006459** on GitHub · 2026-11-26 17:08 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7198567243) A Linux data point for the `MIN_KB=64` artefacts, matching your `SKIP_WC_BACK` finding. **Setup:** RTX 3070 Ti 8 GB, NVIDIA 595.104.02, Proton Experimental 11.0-20261112. Fork main `ac25549` merged into Zayfway's `perf/exopus-recipe`, with `VICTORY_SKIP_WC_BACK=1 RELAY=2 CARD_HASH_LEN=1 MERGE_GAP=64 MERGE_RUNS=4096 CARD_WINDOWS_MB=1024`, Series S. (`RELAY_COPY` and `FETCH_CHECK` not set.) **With `CARD_BUFFERS_MIN_KB=64`:** constant flicker in the prison. Frames alternate between lit, untextured and black, and characters lose their heads with only the eyes, lips and earrings drawn. It happens in every run with it (runs 9, 10, 12 and 13). A run with the older #1820 set, without `MIN_KB`, was clean. **Bisected by switch groups, one run each:** - `FILLS_PLAIN`/`STEP_INDEX` off: no change. - `MIN_KB`, `HASH_LEN`, `MERGE_GAP` and `MERGE_RUNS` off: stable. - `HASH_LEN` and the merges back on, only `MIN_KB` off: stable (run 16). So `MIN_KB=64` alone, with `SKIP_WC_BACK=1` on as in your Pass 14. I have not tried your `VICTORY_SKIP_WC_MIN_KB` fix yet. The same symptom also appeared in a build of the cool_fox line (`grimygunnz/nvidia-3070-VI`), whose launcher sets `CARD_BUFFERS_MIN_KB=64` too. *AI-assisted (Claude Code, Claude Opus 5.5); observations from runs on my machine.*
Author
Owner

@⁠grosterr on GitHub · 2026-11-26 22:17 UTC · original

An independent confirmation of Proudnoob4's size gate (Pass 15), from a 12 GB card: RTX 3060 12 GB, Ryzen 7 5700X, 32 GB RAM, Windows 11, Series S profile, prison prologue. Tree: fork main 52ac4ec + #868 + #1081 + #798 + #1352 and others, release build.

Every run used CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1536 SKIP_WC_BACK=1 SKIP_WC_COMPARE=1, on top of our usual switch set (LEVELS_ON_DEMAND INDIRECT_WINDOW INDIRECT_GATHER COPY_PLAIN JOIN_PARTS BACK_OWN_VIEW CARD_HASH_WIDE ASYNC_SUBMIT QUEUE2 ..., RELAY at its default).

run size gate picture world frame (median) draws/frame
1 none (as in #868) grey, then black flashes; Lucia's head gone not comparable: half the scene missing ~2,700
2 1 MiB on SKIP_WC_BACK only still flashing, head still gone not comparable 500-1,900
3 1 MiB on both SKIP_WC_BACK and SKIP_WC_COMPARE clean: head there, no flashes in 15 minutes 107-111 ms (9.0-9.3 fps), p90 123-140 5,500-6,100

So on this card it is the compare skip that matters, as in your Pass 14d. Gating only the copy-back changed nothing visible: with the gate, that run skipped no copy at all. In run 3 the frame splits into preparation 55 ms, copies 28, card 10-18, copy-back 7. On the Series X profile, our previous build (without these switches) measured about 180-190 ms, with 79 ms on the card and 56 ms of copy-back. The frame is now limited by the submitting thread, not the card.

We did not need FETCH_CHECK (we do not set RELAY_COPY), and saw no flashes in run 3 without it.

Our version of the gate is one variable for both skips, VICTORY_SKIP_WC_MIN_KB (default 1024, the name used above): copies below it are always compared and always come back. Since #868 has neither skip gated, it may be worth adding there. Happy to open that as a small PR against #868's branch if its author wants it.

**@⁠grosterr** on GitHub · 2026-11-26 22:17 UTC · [original](https://github.com/fxceless/victory-fork/issues/1163#issuecomment-7204546502) An independent confirmation of Proudnoob4's size gate (Pass 15), from a 12 GB card: RTX 3060 12 GB, Ryzen 7 5700X, 32 GB RAM, Windows 11, Series S profile, prison prologue. Tree: fork main `52ac4ec` + #868 + #1081 + #798 + #1352 and others, release build. Every run used `CARD_BUFFERS_MIN_KB=64 CARD_BUFFERS_MB=1536 SKIP_WC_BACK=1 SKIP_WC_COMPARE=1`, on top of our usual switch set (`LEVELS_ON_DEMAND INDIRECT_WINDOW INDIRECT_GATHER COPY_PLAIN JOIN_PARTS BACK_OWN_VIEW CARD_HASH_WIDE ASYNC_SUBMIT QUEUE2 ...`, `RELAY` at its default). | run | size gate | picture | world frame (median) | draws/frame | |---|---|---|---|---| | 1 | none (as in #868) | grey, then black flashes; Lucia's head gone | not comparable: half the scene missing | ~2,700 | | 2 | 1 MiB on `SKIP_WC_BACK` only | still flashing, head still gone | not comparable | 500-1,900 | | 3 | 1 MiB on both `SKIP_WC_BACK` and `SKIP_WC_COMPARE` | clean: head there, no flashes in 15 minutes | **107-111 ms (9.0-9.3 fps)**, p90 123-140 | 5,500-6,100 | So on this card it is the compare skip that matters, as in your Pass 14d. Gating only the copy-back changed nothing visible: with the gate, that run skipped no copy at all. In run 3 the frame splits into preparation 55 ms, copies 28, card 10-18, copy-back 7. On the Series X profile, our previous build (without these switches) measured about 180-190 ms, with 79 ms on the card and 56 ms of copy-back. The frame is now limited by the submitting thread, not the card. We did not need `FETCH_CHECK` (we do not set `RELAY_COPY`), and saw no flashes in run 3 without it. Our version of the gate is one variable for both skips, `VICTORY_SKIP_WC_MIN_KB` (default 1024, the name used above): copies below it are always compared and always come back. Since #868 has neither skip gated, it may be worth adding there. Happy to open that as a small PR against #868's branch if its author wants it.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#1163
No description provided.