RTX 4070 12 GB + Ryzen 5 5600: steady-state world 361 → 263 ms/frame with CARD_BUFFERS_MIN_MB=1 on RELAY=1 (313 → 285 on RELAY=2); page faults 66k → 0.5k #418

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

@⁠xunbreakablex on GitHub · 2026-11-25 00:34 UTC · original

Needs human attention: VICTORY_CARD_BUFFERS_MIN_MB=1 moves change detection for ~87 more title-buffer copies (97 copies in the card instead of 10) to the card. I checked card vs CPU copies with a diagnostic (below) and found no mismatch in those copies, but I have not compared rendered images, and everything here is from one machine. Please do not read this as a reason to change a default on its own.

Measurements of one switch in isolation, in steady state, on a card/CPU pair that is probably CPU-limited (the numbers other reports show for 4070-class cards on faster CPUs are lower: #125 187-205 ms, #27 4.3 fps).

Setup (#96 template)

field value
build fork 7b0f736 plus one local commit (texture hashing for changing view-memory textures); --profile diag --features diagnostics. This is older than current main (2119b0e): it does not have the in-flight-write fixes 1582757 (#89) and c75cb22 (#168/#191)
profile / title Series X, 1.0.2.1
adapter NVIDIA GeForce RTX 4070 12 GB, driver 621.01 (the only GPU: the Ryzen 5 5600 has no iGPU)
CPU / RAM / OS Ryzen 5 5600 (6c/12t), 48 GB, Windows 11 build 26300, page file raised so the commit limit is 78 GB
scene world right after the prologue; VICTORY_KEYS Enter presses to get through the start screens, no input afterwards; warm shader cache (misses=0) in every run below
device removals none in any run listed here
other switches VICTORY_RELAY as stated; CARD_BUFFERS = VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024

Result (steady-state frame time, mean ± sd of 6 s log windows)

config windows mean ± sd median
RELAY=1 21 361 ± 23 ms 355
RELAY=1 + CARD_BUFFERS (same binary, run right after) 25 263 ± 16 ms 257
RELAY=1 (second pair, earlier) 11 350 ± 15 ms 347
RELAY=1 + CARD_BUFFERS (second pair) 17 267 ± 26 ms 256
RELAY=2 (two runs) 15 / 14 313 ± 30 / 324 ± 13 ms 304 / 321
RELAY=2 + CARD_BUFFERS (one run) 17 285 ± 37 ms 267
  • With CARD_BUFFERS, RELAY=1 is as fast as RELAY=2 (256-263 vs 267 ms median). Without it RELAY=1 is about 45 ms slower than RELAY=2. If you have to avoid RELAY=2 (#89, #168), this is a way to avoid it without losing the speed.
  • Draws per frame (~4950-5010) and dropped draws (~346, all "a stage of the ray-tracing structure builder, which is off") are the same with and without it.
  • Per frame, steady state, RELAY=1 without → with CARD_BUFFERS: process page faults 66k → 0.5k; title-buffer bytes snapshotted on the CPU 349 → 24 MB; process kernel CPU ~194 → ~146 ms; relay (copy-back) thread busy 257 → 136 ms; time from present to the first command-list call 17 → 6 ms. The page-fault line is the copies per frame log line. The "on the GPU" wait goes up with RELAY=2 (about 94-111 → 124-163 ms) and down with RELAY=1 (156-163 → 122 ms).
  • The CARD_BUFFERS run varies more inside a run (sd 16-37 ms against 13-30 without it).

Method note: whole-world medians include the warm-up

For the first ~90-120 s after the first world frame, frame time is 500-1200 ms and draws per frame are still rising from ~1,400 to ~4,950; in those windows 70-90% of the texture refresh time is "waiting for title memory to hold still" (the thing #95 is about). A median over the whole world period is therefore a mix. In our runs it was 5-15% above the steady state (for example 343 ms against 304 ms for the same run). I defined steady state as the first three consecutive log windows with < 400 ms and > 4,800 draws per frame, and report the mean ± sd from there to the end of the run (11-25 windows of 6 s per run). Warm-up took 92-120 s in these runs (84-92 s with CARD_BUFFERS). If other reports use whole-period medians, the speed-up of a change that shortens the warm-up (#95) and one that changes steady state will be mixed together.

Does the card copy equal the CPU copy? (diagnostic, not in the fork)

I wrote a diagnostic for diagnostics builds that, every 10th frame, drains all flights, holds the submission lock, reads whole card copies back and compares them with the CPU copy in 64 KiB pieces (leaving out bytes the title wrote that have not gone up yet). Run with RELAY=1 + CARD_BUFFERS, 233 rounds, 98 copies, every copy checked at least once, 1,311 copy checks: 0 mismatches in 97 copies (1,302 checks). The remaining 9 checks all mismatch in one 24 MiB copy: 140 of its 384 pieces (~6 MiB) differ, the same pieces every time. That copy is already in the card's memory by default (≥ 16 MB), so it is not something CARD_BUFFERS_MIN_MB=1 adds. I do not know yet which side is newer there (shader writes that are not declared, or something that does not go up); a three-way comparison with the live title memory is next. Happy to open a PR for the diagnostic if it is useful.

What this does not show

  • No image comparison between runs yet (the check above is on bytes, not pictures).
  • One run per RELAY=2 + CARD_BUFFERS; two for the others. Other cards and CPUs.
  • Diagnostics build against release build overhead (not measured).

AI-assisted analysis (Claude); the runs were done on my machine.

**@⁠xunbreakablex** on GitHub · 2026-11-25 00:34 UTC · [original](https://github.com/fxceless/victory-fork/issues/418) **Needs human attention:** `VICTORY_CARD_BUFFERS_MIN_MB=1` moves change detection for ~87 more title-buffer copies (97 copies in the card instead of 10) to the card. I checked card vs CPU copies with a diagnostic (below) and found no mismatch in those copies, but I have **not** compared rendered images, and everything here is from one machine. Please do not read this as a reason to change a default on its own. Measurements of one switch in isolation, in steady state, on a card/CPU pair that is probably CPU-limited (the numbers other reports show for 4070-class cards on faster CPUs are lower: #125 187-205 ms, #27 4.3 fps). ## Setup (#96 template) | field | value | |---|---| | build | fork `7b0f736` plus one local commit (texture hashing for changing view-memory textures); `--profile diag --features diagnostics`. This is older than current `main` (`2119b0e`): it does not have the in-flight-write fixes `1582757` (#89) and `c75cb22` (#168/#191) | | profile / title | Series X, 1.0.2.1 | | adapter | NVIDIA GeForce RTX 4070 12 GB, driver 621.01 (the only GPU: the Ryzen 5 5600 has no iGPU) | | CPU / RAM / OS | Ryzen 5 5600 (6c/12t), 48 GB, Windows 11 build 26300, page file raised so the commit limit is 78 GB | | scene | world right after the prologue; `VICTORY_KEYS` Enter presses to get through the start screens, no input afterwards; warm shader cache (`misses=0`) in every run below | | device removals | none in any run listed here | | other switches | `VICTORY_RELAY` as stated; CARD_BUFFERS = `VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024` | ## Result (steady-state frame time, mean ± sd of 6 s log windows) | config | windows | mean ± sd | median | |---|---:|---|---| | `RELAY=1` | 21 | 361 ± 23 ms | 355 | | `RELAY=1` + CARD_BUFFERS (same binary, run right after) | 25 | **263 ± 16 ms** | 257 | | `RELAY=1` (second pair, earlier) | 11 | 350 ± 15 ms | 347 | | `RELAY=1` + CARD_BUFFERS (second pair) | 17 | 267 ± 26 ms | 256 | | `RELAY=2` (two runs) | 15 / 14 | 313 ± 30 / 324 ± 13 ms | 304 / 321 | | `RELAY=2` + CARD_BUFFERS (one run) | 17 | 285 ± 37 ms | 267 | - With CARD_BUFFERS, `RELAY=1` is as fast as `RELAY=2` (256-263 vs 267 ms median). Without it `RELAY=1` is about 45 ms slower than `RELAY=2`. If you have to avoid `RELAY=2` (#89, #168), this is a way to avoid it without losing the speed. - Draws per frame (~4950-5010) and dropped draws (~346, all "a stage of the ray-tracing structure builder, which is off") are the same with and without it. - Per frame, steady state, `RELAY=1` without → with CARD_BUFFERS: process page faults 66k → 0.5k; title-buffer bytes snapshotted on the CPU 349 → 24 MB; process kernel CPU ~194 → ~146 ms; relay (copy-back) thread busy 257 → 136 ms; time from present to the first command-list call 17 → 6 ms. The page-fault line is the `copies per frame` log line. The "on the GPU" wait goes up with `RELAY=2` (about 94-111 → 124-163 ms) and down with `RELAY=1` (156-163 → 122 ms). - The CARD_BUFFERS run varies more inside a run (sd 16-37 ms against 13-30 without it). ## Method note: whole-world medians include the warm-up For the first ~90-120 s after the first world frame, frame time is 500-1200 ms and draws per frame are still rising from ~1,400 to ~4,950; in those windows 70-90% of the texture refresh time is "waiting for title memory to hold still" (the thing #95 is about). A median over the whole world period is therefore a mix. In our runs it was 5-15% above the steady state (for example 343 ms against 304 ms for the same run). I defined steady state as the first three consecutive log windows with < 400 ms and > 4,800 draws per frame, and report the mean ± sd from there to the end of the run (11-25 windows of 6 s per run). Warm-up took 92-120 s in these runs (84-92 s with CARD_BUFFERS). If other reports use whole-period medians, the speed-up of a change that shortens the warm-up (#95) and one that changes steady state will be mixed together. ## Does the card copy equal the CPU copy? (diagnostic, not in the fork) I wrote a diagnostic for `diagnostics` builds that, every 10th frame, drains all flights, holds the submission lock, reads whole card copies back and compares them with the CPU copy in 64 KiB pieces (leaving out bytes the title wrote that have not gone up yet). Run with `RELAY=1` + CARD_BUFFERS, 233 rounds, 98 copies, every copy checked at least once, 1,311 copy checks: **0 mismatches in 97 copies (1,302 checks)**. The remaining 9 checks all mismatch in one 24 MiB copy: 140 of its 384 pieces (~6 MiB) differ, the same pieces every time. That copy is already in the card's memory by default (≥ 16 MB), so it is not something `CARD_BUFFERS_MIN_MB=1` adds. I do not know yet which side is newer there (shader writes that are not declared, or something that does not go up); a three-way comparison with the live title memory is next. Happy to open a PR for the diagnostic if it is useful. ## What this does not show - No image comparison between runs yet (the check above is on bytes, not pictures). - One run per `RELAY=2` + CARD_BUFFERS; two for the others. Other cards and CPUs. - Diagnostics build against release build overhead (not measured). AI-assisted analysis (Claude); the runs were done on my machine.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:42:58 +00:00
Author
Owner

@⁠Yorivel on GitHub · 2026-11-25 01:01 UTC · original

Data point from an RTX 4090 + i9-14900K (64 GB, Windows 11, diag build). CARD_BUFFERS_MIN_MB=1 on top of RELAY=2 lost the first room's walls here. RELAY=2 without it kept them.

Base: fork main at a803c87 plus the DirectStorage page-write notify fix from #62 (branch fix/dstorage-notify-on-a803c87 on Yorivel/victory-fork, VICTORY_DSTORAGE_NOTIFY=1). With that fix and no relay, the room was complete in 3 of 3 runs, where it used to be about 1 in 4. All runs also use SHADER_OPT=0 and SHADER_LOOP_LIMIT=256.

run RELAY CARD_BUFFERS_MIN_MB room at the barracks window steady state
A – – complete (3/3 runs) ~400 ms/frame
B 2 1 walls missing, sky beside the window, still missing after a minute 250-270 ms/frame
C1 2 – complete 217-226 ms/frame
C2 2 – complete, window grille too 235-261 ms/frame

A C2 log line: 235.4 ms/frame (112.5 preparing: copies 42.2 ms 138.7 MB, textures 2.7 ms; 108.0 on the GPU; 190.5 copying back 67.3 MB), 5025 draws/frame.

Caveats: B is a single run, and the room was random before the DirectStorage fix, so this is one bad run against two good ones, not proof. It does match #417 (card buffers + relay drop data) and #168 (relay loses walls). With the fix in, though, relay alone does not seem to lose them any more. On this machine the card-buffer setting also bought nothing with relay on: C was faster than B.

Under relay, copy-back now takes the most time: about 190 ms for about 70 MB a frame.

**@⁠Yorivel** on GitHub · 2026-11-25 01:01 UTC · [original](https://github.com/fxceless/victory-fork/issues/418#issuecomment-7149123994) Data point from an RTX 4090 + i9-14900K (64 GB, Windows 11, diag build). **`CARD_BUFFERS_MIN_MB=1` on top of `RELAY=2` lost the first room's walls here. `RELAY=2` without it kept them.** Base: fork `main` at `a803c87` plus the DirectStorage page-write notify fix from #62 (branch `fix/dstorage-notify-on-a803c87` on Yorivel/victory-fork, `VICTORY_DSTORAGE_NOTIFY=1`). With that fix and no relay, the room was complete in 3 of 3 runs, where it used to be about 1 in 4. All runs also use `SHADER_OPT=0` and `SHADER_LOOP_LIMIT=256`. | run | RELAY | CARD_BUFFERS_MIN_MB | room at the barracks window | steady state | |---|---|---|---|---| | A | – | – | complete (3/3 runs) | ~400 ms/frame | | B | 2 | 1 | walls missing, sky beside the window, still missing after a minute | 250-270 ms/frame | | C1 | 2 | – | complete | 217-226 ms/frame | | C2 | 2 | – | complete, window grille too | 235-261 ms/frame | A C2 log line: `235.4 ms/frame (112.5 preparing: copies 42.2 ms 138.7 MB, textures 2.7 ms; 108.0 on the GPU; 190.5 copying back 67.3 MB), 5025 draws/frame`. Caveats: B is a single run, and the room was random before the DirectStorage fix, so this is one bad run against two good ones, not proof. It does match #417 (card buffers + relay drop data) and #168 (relay loses walls). With the fix in, though, relay alone does not seem to lose them any more. On this machine the card-buffer setting also bought nothing with relay on: C was faster than B. Under relay, copy-back now takes the most time: about 190 ms for about 70 MB a frame.
Author
Owner

@⁠xunbreakablex on GitHub · 2026-11-25 01:06 UTC · original

Thanks, this is the data point I was missing: it says the CARD_BUFFERS gain depends on the CPU, and I should not have written it as a general recommendation.

My reading, which I have not tested on a fast CPU: on a Ryzen 5 5600 the card path replaces about 345 MB per frame of CPU-side snapshotting (the "title-buffer bytes snapshotted" in the numbers above) and about 66k page faults a frame; on a 14900K that CPU work is much cheaper, so there is less to save and the card-side compares (the GPU wait went up with RELAY=2 here too: ~94-111 → 124-163 ms) can cost more than they save. That would fit your C being faster than B.

On the walls: I have only one RELAY=2 + CARD_BUFFERS run (313-324 → 285 ms), most of my runs are RELAY=1, and I have not looked at the barracks window, so I cannot confirm or rule it out. Two things to keep apart: my byte check compares the card copy with the CPU copy, which does not cover an ordering problem like the one in #168 (a copy can be equal and still be read too early). And #417 saw a broken picture with CARD_BUFFERS_MB=4096, clean at 1024, which is the value I used.

If you want to see whether CARD_BUFFERS_MIN_MB=1 with RELAY=2 ever leaves the card and CPU copies different on your base, #455 adds VICTORY_CARD_VERIFY=N (diagnostics builds, based on a803c87): every Nth frame it drains the flights and compares the card copies with their CPU side, one card verify: line per copy. Its three-way part (which side is newer) has not been run in game yet.

(AI-assisted; the numbers above are from my own runs.)

**@⁠xunbreakablex** on GitHub · 2026-11-25 01:06 UTC · [original](https://github.com/fxceless/victory-fork/issues/418#issuecomment-7149209433) Thanks, this is the data point I was missing: it says the CARD_BUFFERS gain depends on the CPU, and I should not have written it as a general recommendation. My reading, which I have not tested on a fast CPU: on a Ryzen 5 5600 the card path replaces about 345 MB per frame of CPU-side snapshotting (the "title-buffer bytes snapshotted" in the numbers above) and about 66k page faults a frame; on a 14900K that CPU work is much cheaper, so there is less to save and the card-side compares (the GPU wait went up with `RELAY=2` here too: ~94-111 → 124-163 ms) can cost more than they save. That would fit your C being faster than B. On the walls: I have only one `RELAY=2` + CARD_BUFFERS run (313-324 → 285 ms), most of my runs are `RELAY=1`, and I have not looked at the barracks window, so I cannot confirm or rule it out. Two things to keep apart: my byte check compares the card copy with the CPU copy, which does not cover an ordering problem like the one in #168 (a copy can be equal and still be read too early). And #417 saw a broken picture with `CARD_BUFFERS_MB=4096`, clean at 1024, which is the value I used. If you want to see whether `CARD_BUFFERS_MIN_MB=1` with `RELAY=2` ever leaves the card and CPU copies different on your base, #455 adds `VICTORY_CARD_VERIFY=N` (diagnostics builds, based on `a803c87`): every Nth frame it drains the flights and compares the card copies with their CPU side, one `card verify:` line per copy. Its three-way part (which side is newer) has not been run in game yet. (AI-assisted; the numbers above are from my own runs.)
Author
Owner

@⁠xunbreakablex on GitHub · 2026-11-25 10:24 UTC · original

A hardware note I should have put in my measurements above: this machine is power- and clock-limited. RTX 4070 with a 100 W power limit (core at most ~2300 MHz), Ryzen 5 5600 held at 3.95 GHz (so below its normal boost). The 361 -> 263 ms steady-frame numbers come from that CPU-bound setup, which fits Yorivel's reading that the gain depends on the CPU; I would not expect them to carry over to a faster or unthrottled CPU. Single machine, as before.

AI-assisted (Claude).

**@⁠xunbreakablex** on GitHub · 2026-11-25 10:24 UTC · [original](https://github.com/fxceless/victory-fork/issues/418#issuecomment-7159648754) A hardware note I should have put in my measurements above: this machine is power- and clock-limited. RTX 4070 with a 100 W power limit (core at most ~2300 MHz), Ryzen 5 5600 held at 3.95 GHz (so below its normal boost). The 361 -> 263 ms steady-frame numbers come from that CPU-bound setup, which fits Yorivel's reading that the gain depends on the CPU; I would not expect them to carry over to a faster or unthrottled CPU. Single machine, as before. AI-assisted (Claude).
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#418
No description provided.