Copy and copy-back cost 2.4-5.6 ms/MB per frame and the GPU idles; the waits, not the bandwidth, are the frame here #1003

Open
opened 2026-11-26 03:55:38 +00:00 by github-bot · 8 comments
Owner

@⁠Key-rs on GitHub · 2026-11-25 15:37 UTC · original

The per-frame copies and copy-backs cost far more per megabyte than the bandwidth allows, and on this machine they are where the frame goes — not the GPU.

Machine: Ryzen 7 8845H, RTX 4060 Laptop 8 GB, Windows 11 26300. Build 0b0074e, --release, with the switches from the README's "newer switches" line:

VICTORY_RELAY=2
VICTORY_LATE_WAIT=3  VICTORY_WIDE_BACK=1
VICTORY_CARD_BUFFERS_MIN_MB=1  VICTORY_CARD_BUFFERS_MB=1024

Six consecutive frame reports from one run (the fps line, shortened):

 3.2 fps   308.7 ms   692 draws  | copies  44.5 ms 101.2 MB | textures 211.7 ms  30.3 MB | GPU  5.4 ms | copy back  32.9 ms 10.1 MB
 3.7 fps   272.0 ms   703 draws  | copies  46.5 ms 101.4 MB | textures 123.3 ms  23.1 MB | GPU 27.9 ms | copy back  51.9 ms 17.1 MB
 3.3 fps   299.0 ms   628 draws  | copies  65.9 ms 135.7 MB | textures  96.5 ms  14.6 MB | GPU  2.3 ms | copy back  89.1 ms 37.6 MB
 2.2 fps   451.1 ms   967 draws  | copies  97.4 ms 185.4 MB | textures  31.1 ms  33.7 MB | GPU 23.2 ms | copy back  97.6 ms 20.3 MB
 2.9 fps   344.9 ms  1454 draws  | copies  50.3 ms  99.1 MB | textures  10.7 ms  18.6 MB | GPU 61.1 ms | copy back  85.1 ms  8.2 MB
 1.4 fps   701.4 ms  3050 draws  | copies 143.4 ms 212.2 MB | textures  42.7 ms  65.9 MB | GPU  1.1 ms | copy back  72.8 ms 23.8 MB

Per megabyte, against what a PCIe 4.0 link and a 4060 should manage (0.1–0.3 ms/MB for a straight upload):

path observed expected
copies 0.44–0.67 ms/MB ~0.1–0.3
copy back 2.4–5.6 ms/MB ~0.1–0.3
textures (the spikes) 7 ms/MB (211.7 ms for 30.3 MB) ~0.3

And the GPU is idle for most of it: 1.1–61.1 ms on the card in frames of 272–701 ms, i.e. the card is waiting while the host side reports 82–277 ms of "preparing" and 33–98 ms of "copying back".

What I take that to mean

The numbers do not look like bandwidth. 87.7 ms to move 15.5 MB, and 32.9 ms to move 10.1 MB in another frame, are the signature of waiting — a fence or a wait for the card inside the copy, not the copy itself. The texture spikes (211.7 ms for 30.3 MB, next frame 123.3 ms for 23.1 MB, then back to 10.7 ms for 18.6 MB) point the same way.

Two things I could check from the outside, both negative:

  • VICTORY_JOIN_COPIES=1 (from the "52–63 title buffer copies per frame, of them 0 continue the one before" line): copies stayed at 44.5–143 ms for 101–212 MB, so joining them does not move the per-megabyte cost.
  • VICTORY_HOIST_CLAMPS=32 (and =7 default): within noise, and =0 faults with 0xc0000005 about 36 s in — that one is a separate report.

What I am not claiming

I have not read the copy path in victory-gpu, so I cannot say which wait it is. This is a report of where the frame time goes on one machine, in case it is useful while the submission and copy work is in flight: the host-side copies and copy-backs, not the GPU, are what a 4060 is waiting on here, and at the current rates the whole frame budget is spent on a few dozen megabytes.

One caveat on the data: this machine's dump had a zero-filled navmeshes.rpf (found by checking the torrent's piece hashes); it is restored and the package verifies 634/634 on the pieces that matter, so the numbers above are from a clean, complete dump. Worth mentioning because a damaged dump makes the frame look like this too, and it cost me a day.

**@⁠Key-rs** on GitHub · 2026-11-25 15:37 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003) The per-frame copies and copy-backs cost far more per megabyte than the bandwidth allows, and on this machine they are where the frame goes — not the GPU. **Machine:** Ryzen 7 8845H, RTX 4060 Laptop 8 GB, Windows 11 26300. Build `0b0074e`, `--release`, with the switches from the README's "newer switches" line: ``` VICTORY_RELAY=2 VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024 ``` Six consecutive frame reports from one run (the `fps` line, shortened): ``` 3.2 fps 308.7 ms 692 draws | copies 44.5 ms 101.2 MB | textures 211.7 ms 30.3 MB | GPU 5.4 ms | copy back 32.9 ms 10.1 MB 3.7 fps 272.0 ms 703 draws | copies 46.5 ms 101.4 MB | textures 123.3 ms 23.1 MB | GPU 27.9 ms | copy back 51.9 ms 17.1 MB 3.3 fps 299.0 ms 628 draws | copies 65.9 ms 135.7 MB | textures 96.5 ms 14.6 MB | GPU 2.3 ms | copy back 89.1 ms 37.6 MB 2.2 fps 451.1 ms 967 draws | copies 97.4 ms 185.4 MB | textures 31.1 ms 33.7 MB | GPU 23.2 ms | copy back 97.6 ms 20.3 MB 2.9 fps 344.9 ms 1454 draws | copies 50.3 ms 99.1 MB | textures 10.7 ms 18.6 MB | GPU 61.1 ms | copy back 85.1 ms 8.2 MB 1.4 fps 701.4 ms 3050 draws | copies 143.4 ms 212.2 MB | textures 42.7 ms 65.9 MB | GPU 1.1 ms | copy back 72.8 ms 23.8 MB ``` Per megabyte, against what a PCIe 4.0 link and a 4060 should manage (0.1–0.3 ms/MB for a straight upload): | path | observed | expected | |---|---|---| | copies | 0.44–0.67 ms/MB | ~0.1–0.3 | | copy back | **2.4–5.6 ms/MB** | ~0.1–0.3 | | textures (the spikes) | **7 ms/MB** (211.7 ms for 30.3 MB) | ~0.3 | And the GPU is idle for most of it: 1.1–61.1 ms on the card in frames of 272–701 ms, i.e. **the card is waiting while the host side reports 82–277 ms of "preparing" and 33–98 ms of "copying back"**. ### What I take that to mean The numbers do not look like bandwidth. 87.7 ms to move 15.5 MB, and 32.9 ms to move 10.1 MB in another frame, are the signature of **waiting** — a fence or a wait for the card inside the copy, not the copy itself. The texture spikes (211.7 ms for 30.3 MB, next frame 123.3 ms for 23.1 MB, then back to 10.7 ms for 18.6 MB) point the same way. Two things I could check from the outside, both negative: * `VICTORY_JOIN_COPIES=1` (from the "52–63 title buffer copies per frame, of them 0 continue the one before" line): copies stayed at 44.5–143 ms for 101–212 MB, so joining them does not move the per-megabyte cost. * `VICTORY_HOIST_CLAMPS=32` (and `=7` default): within noise, and `=0` faults with `0xc0000005` about 36 s in — that one is a separate report. ### What I am not claiming I have not read the copy path in `victory-gpu`, so I cannot say which wait it is. This is a report of where the frame time goes on one machine, in case it is useful while the submission and copy work is in flight: **the host-side copies and copy-backs, not the GPU, are what a 4060 is waiting on here**, and at the current rates the whole frame budget is spent on a few dozen megabytes. One caveat on the data: this machine's dump had a zero-filled `navmeshes.rpf` (found by checking the torrent's piece hashes); it is restored and the package verifies 634/634 on the pieces that matter, so the numbers above are from a clean, complete dump. Worth mentioning because a damaged dump makes the frame look like this too, and it cost me a day.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:38 +00:00
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 16:09 UTC · original

A cross-reference that puts the numbers in this report in context: another fork of the same lineage, on the same machine and the same dump, spends 1.3–2.8 ms and 3–7 MB per frame on copies where this build spends 45–143 ms and 78–212 MB.

Measured here, back to back, warm shader cache both times, 0b0074e against DexNom 921d8d3:

copies per frame textures GPU frame
this build 45.7–143.4 ms / 78–212 MB 10–211 ms 1–70 ms 201–701 ms
DexNom 1.3–2.8 ms / 3–7 MB 1.8–23 ms 0 ms (idle) 298–1837 ms

DexNom is not faster overall on this card — it is CPU-bound somewhere else (its own window reports gpu 0-2% busy, cpu 53–71%) — but the copy path there is 30× cheaper, which is the part of this report.

What they do differently

Their crates/victory-gpu/src/memory.rs is 542 lines against 319 here, and the piece that matters reads:

pub(crate) fn ownership_changed(start: u64, len: u64) {
    if let Some(changes) = CHANGES.get() {
        let mut changes = changes.lock().unwrap_or_else(|e| e.into_inner());
        if changes.len() == 256 { changes.pop_front(); }
        changes.push_back((start / PAGE, start.saturating_add(len).div_ceil(PAGE)));
        GENERATION.fetch_add(1, Ordering::Release);
    }
}

So the range is recorded at the moment of the write, and only recorded ranges are refreshed afterwards. This build instead finds writes by looking: the per-frame line here says 623 hash passes over 1250 pieces, and the copy cost tracks that hashing rather than the bytes.

The relevant DexNom commits are Restore ray structure building and track guest shader writes precisely (memory.rs +303/−93, draw.rs +256, host.rs +86, inplace.rs +101, plus a new memory/ray_probe.rs) and Improve City texture streaming and recover sparse textures.

One thing I tried that is not the answer

VICTORY_INPLACE=1 on this build: copies stayed at 46–131 ms and textures went up, to 2763 ms for 256 MB in the worst frame (0.1 fps). Whatever the in-place stage does today, the flag alone does not get near the numbers above.

Why I am posting it rather than porting it

I could try to lift their memory model into this tree, but this branch has moved a long way in the same files this week (submit thread, copies in place, draw windows), so a cherry-pick conflicts everywhere and a hand port of a memory model is a day of work with a nasty failure mode. Both trees are GPL and share the ancestor, so the comparison is yours to make far more cheaply than mine.

I am not suggesting what the fix should be — only that "2.4–5.6 ms/MB for a copy" has a working counter-example in the same family, and that the difference is visible in the counters.

**@⁠Key-rs** on GitHub · 2026-11-25 16:09 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7167643369) A cross-reference that puts the numbers in this report in context: another fork of the same lineage, on the same machine and the same dump, spends **1.3–2.8 ms and 3–7 MB per frame** on copies where this build spends 45–143 ms and 78–212 MB. **Measured here, back to back, warm shader cache both times, `0b0074e` against DexNom `921d8d3`:** | | copies per frame | textures | GPU | frame | |---|---|---|---|---| | this build | 45.7–143.4 ms / 78–212 MB | 10–211 ms | 1–70 ms | 201–701 ms | | DexNom | **1.3–2.8 ms / 3–7 MB** | 1.8–23 ms | 0 ms (idle) | 298–1837 ms | DexNom is not faster overall on this card — it is CPU-bound somewhere else (its own window reports `gpu 0-2% busy, cpu 53–71%`) — but **the copy path there is 30× cheaper**, which is the part of this report. ### What they do differently Their `crates/victory-gpu/src/memory.rs` is 542 lines against 319 here, and the piece that matters reads: ```rust pub(crate) fn ownership_changed(start: u64, len: u64) { if let Some(changes) = CHANGES.get() { let mut changes = changes.lock().unwrap_or_else(|e| e.into_inner()); if changes.len() == 256 { changes.pop_front(); } changes.push_back((start / PAGE, start.saturating_add(len).div_ceil(PAGE))); GENERATION.fetch_add(1, Ordering::Release); } } ``` So the range is recorded **at the moment of the write**, and only recorded ranges are refreshed afterwards. This build instead finds writes by looking: the per-frame line here says `623 hash passes over 1250 pieces`, and the copy cost tracks that hashing rather than the bytes. The relevant DexNom commits are `Restore ray structure building and track guest shader writes precisely` (memory.rs +303/−93, draw.rs +256, host.rs +86, inplace.rs +101, plus a new `memory/ray_probe.rs`) and `Improve City texture streaming and recover sparse textures`. ### One thing I tried that is not the answer `VICTORY_INPLACE=1` on this build: copies stayed at 46–131 ms and textures went **up**, to 2763 ms for 256 MB in the worst frame (0.1 fps). Whatever the in-place stage does today, the flag alone does not get near the numbers above. ### Why I am posting it rather than porting it I could try to lift their memory model into this tree, but this branch has moved a long way in the same files this week (submit thread, copies in place, draw windows), so a cherry-pick conflicts everywhere and a hand port of a memory model is a day of work with a nasty failure mode. Both trees are GPL and share the ancestor, so the comparison is yours to make far more cheaply than mine. I am not suggesting what the fix should be — only that "2.4–5.6 ms/MB for a copy" has a working counter-example in the same family, and that the difference is visible in the counters.
Author
Owner

@⁠akimfomin on GitHub · 2026-11-25 16:29 UTC · original

PortBridge surfaced this report during its search for measured GPU readback costs. I used it to choose an open synthetic Vulkan experiment with a three-slot asynchronous exact-range baseline. On the stable 32 MiB request trace, reuse cut transferred bytes by 83.3% and paired time by 69.4% after charging separately measured planning. With full rewrites, the exact-range route was preferable. This is a page-range replay and does not measure the fork's frame time. Pinned code and paired data

Do you already have an aggregate estimate of the copied-back ranges that the CPU observes before their next GPU write, or of requests repeated without intervening writes? Either would help decide whether a guarded reuse path is relevant here. Aggregate counts are enough and there is no need to share captures or reproduce the workload. (Codex-assisted research and writeup.)

**@⁠akimfomin** on GitHub · 2026-11-25 16:29 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7168058570) PortBridge surfaced this report during its search for measured GPU readback costs. I used it to choose an open synthetic Vulkan experiment with a three-slot asynchronous exact-range baseline. On the stable 32 MiB request trace, reuse cut transferred bytes by 83.3% and paired time by 69.4% after charging separately measured planning. With full rewrites, the exact-range route was preferable. This is a page-range replay and does not measure the fork's frame time. [Pinned code and paired data](https://github.com/akimfomin/PortBridge/tree/f2c840b6e1c38e1ec7e4f4032c81fd3e4e9c319f/research/readback-epochs) Do you already have an aggregate estimate of the copied-back ranges that the CPU observes before their next GPU write, or of requests repeated without intervening writes? Either would help decide whether a guarded reuse path is relevant here. Aggregate counts are enough and there is no need to share captures or reproduce the workload. (Codex-assisted research and writeup.)
Author
Owner

@⁠HLVM04 on GitHub · 2026-11-25 16:30 UTC · original

We see the same shape on a desktop RTX 5070 Ti 16 GB (Ryzen 7 9800X3D, driver 616.64). That run used the Series S profile on fork 9376fd6 + #798 #783 #799 #770 #780 #827. It's an older tree than yours, so only the shape compares. Here is a steady frame line from that run:

148.0 ms/frame (66.2 preparing: copies 34.9 ms 122.6 MB; 51.6 on the GPU; 72.1 copying back 34.6 MB)

  • Copies come to about 0.28 ms/MB, which is inside the expected range in your table.
  • Copy-back comes to about 2.1 ms/MB. So the copy-back is far off the link's rate here too, on a desktop card with headroom.
  • Means after 60 s in that run: preparing 90 ms, on the GPU 43 ms, copying back 69 ms. The card isn't the limit here either; the processor side is.

One local change (not in the fork) moved the preparing side for us. We read title memory with in-process CPU copies instead of ReadProcessMemory: rep movsb, with a vectored exception handler that turns a fault at that instruction into a failed copy. That took the submitting thread from 26 to 7.5 ms a frame. It moves the same bytes through a different call, so on our side a good part of that cost was the call path, not bandwidth.

These numbers come from one run each, in the first gameplay scene, so scene variance applies. We have no counts for the reuse question above.

**@⁠HLVM04** on GitHub · 2026-11-25 16:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7168097050) We see the same shape on a desktop RTX 5070 Ti 16 GB (Ryzen 7 9800X3D, driver 616.64). That run used the Series S profile on fork 9376fd6 + #798 #783 #799 #770 #780 #827. It's an older tree than yours, so only the shape compares. Here is a steady frame line from that run: `148.0 ms/frame (66.2 preparing: copies 34.9 ms 122.6 MB; 51.6 on the GPU; 72.1 copying back 34.6 MB)` - Copies come to about 0.28 ms/MB, which is inside the expected range in your table. - Copy-back comes to about 2.1 ms/MB. So the copy-back is far off the link's rate here too, on a desktop card with headroom. - Means after 60 s in that run: preparing 90 ms, on the GPU 43 ms, copying back 69 ms. The card isn't the limit here either; the processor side is. One local change (not in the fork) moved the preparing side for us. We read title memory with in-process CPU copies instead of `ReadProcessMemory`: `rep movsb`, with a vectored exception handler that turns a fault at that instruction into a failed copy. That took the submitting thread from 26 to 7.5 ms a frame. It moves the same bytes through a different call, so on our side a good part of that cost was the call path, not bandwidth. These numbers come from one run each, in the first gameplay scene, so scene variance applies. We have no counts for the reuse question above.
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 16:39 UTC · original

Two more switches tried here, both negative, in case they save someone else the runs:

VICTORY_COPY_MODE=1 (plain) copies 40-105 ms / 78-195 MB frame 235-967 ms VICTORY_COPY_MODE=2 (none) copies 80-178 ms / 123-210 MB frame 235-712 ms baseline (guarded) copies 46-143 ms / 78-212 MB frame 201-701 ms VICTORY_INPLACE=1 copies 46-131 ms, textures up to 2763 ms 0.1 fps VICTORY_JOIN_COPIES=1 copies 44-143 ms / 101-212 MB frame 272-701 ms

So none of the copy switches on this branch move the per-megabyte cost — COPY_MODE=2 still reports 123–210 MB of copies, so it is not the knob I hoped it was.

One thing worth saying plainly, because it tempers the DexNom comparison in my previous comment: DexNom has the cheap copies and is still slower here (0.5–3.4 fps, its own HUD showing gpu 0-2% busy, cpu 53–71%). Whatever it saves on copies it spends somewhere else on the CPU, so cheap copies alone would not make this branch faster on a 4060 — it would move the bottleneck rather than remove it. I would not port the memory model expecting a frame-rate win on this hardware; I would port it because the numbers are wrong, which is a different reason.

**@⁠Key-rs** on GitHub · 2026-11-25 16:39 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7168332803) Two more switches tried here, both negative, in case they save someone else the runs: ` VICTORY_COPY_MODE=1 (plain) copies 40-105 ms / 78-195 MB frame 235-967 ms VICTORY_COPY_MODE=2 (none) copies 80-178 ms / 123-210 MB frame 235-712 ms baseline (guarded) copies 46-143 ms / 78-212 MB frame 201-701 ms VICTORY_INPLACE=1 copies 46-131 ms, textures up to 2763 ms 0.1 fps VICTORY_JOIN_COPIES=1 copies 44-143 ms / 101-212 MB frame 272-701 ms ` So none of the copy switches on this branch move the per-megabyte cost — COPY_MODE=2 still reports 123–210 MB of copies, so it is not the knob I hoped it was. One thing worth saying plainly, because it tempers the DexNom comparison in my previous comment: **DexNom has the cheap copies and is still slower here** (0.5–3.4 fps, its own HUD showing gpu 0-2% busy, cpu 53–71%). Whatever it saves on copies it spends somewhere else on the CPU, so cheap copies alone would not make this branch faster on a 4060 — it would move the bottleneck rather than remove it. I would not port the memory model expecting a frame-rate win on this hardware; I would port it because the numbers are wrong, which is a different reason.
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 16:51 UTC · original

Thank you — that is the same conclusion the fork already reached, and there is a switch for it: VICTORY_COPY_PLAIN=1 (crates/victory-gpu/src/plaincopy.rs), a
ep movsb in a stack-free function of ours with a first-in-line VEH that turns a read fault at that instruction into a failed copy, the caller falling back to the kernel's copy. Its comment even has the profile you describe: the submitting thread 35 ms a frame inside ZwReadVirtualMemory for about 100 MB (3 GB/s).

I ran it here on the same machine and package (Ryzen 7 8845H, RTX 4060 Laptop 8 GB, ␀b0074e):

VICTORY_COPY_PLAIN=1 copies 41.4-117.5 ms / 81-136 MB frame 276-1191 ms baseline (kernel copy) copies 45.7-143.4 ms / 78-212 MB frame 201-701 ms

No change in the copies, which is the opposite of your 26 → 7.5 ms. What I take from it: 41 ms for 82 MB is 0.5 ms/MB, and a
ep movsb should be a tenth of that, so on this run the time is not the copy call — it looks like the fallback, i.e. the pages that are not there when the copy starts. Your 7.5 ms suggests the pages were largely present in your scene; mine is a first-run streaming city at 1-5 fps, where the title is unmapping and remapping constantly.

If that reading is right, the interesting question is not which call does the copy but how many pages are missing per frame, and whether a guarded reuse path could avoid asking for the ones that have not changed. Which is the same question the other comment in this thread is asking from a synthetic side. Worth comparing notes with @⁠akimfomin, who has a measured reuse result (83.3% fewer bytes, 69.4% less paired time on a 32 MiB trace).

I would not put your local change in the tree as a new switch, since one exists — but if you have the number of pages that fell back per frame, that would be a useful addition to the report.

**@⁠Key-rs** on GitHub · 2026-11-25 16:51 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7168638088) Thank you — that is the same conclusion the fork already reached, and there is a switch for it: VICTORY_COPY_PLAIN=1 (crates/victory-gpu/src/plaincopy.rs), a ep movsb in a stack-free function of ours with a first-in-line VEH that turns a read fault at that instruction into a failed copy, the caller falling back to the kernel's copy. Its comment even has the profile you describe: the submitting thread 35 ms a frame inside ZwReadVirtualMemory for about 100 MB (3 GB/s). I ran it here on the same machine and package (Ryzen 7 8845H, RTX 4060 Laptop 8 GB, ␀b0074e): ` VICTORY_COPY_PLAIN=1 copies 41.4-117.5 ms / 81-136 MB frame 276-1191 ms baseline (kernel copy) copies 45.7-143.4 ms / 78-212 MB frame 201-701 ms ` No change in the copies, which is the opposite of your 26 → 7.5 ms. What I take from it: 41 ms for 82 MB is 0.5 ms/MB, and a ep movsb should be a tenth of that, so on this run the time is not the copy call — it looks like the **fallback**, i.e. the pages that are not there when the copy starts. Your 7.5 ms suggests the pages were largely present in your scene; mine is a first-run streaming city at 1-5 fps, where the title is unmapping and remapping constantly. If that reading is right, the interesting question is not which call does the copy but **how many pages are missing per frame**, and whether a guarded reuse path could avoid asking for the ones that have not changed. Which is the same question the other comment in this thread is asking from a synthetic side. Worth comparing notes with @⁠akimfomin, who has a measured reuse result (83.3% fewer bytes, 69.4% less paired time on a 32 MiB trace). I would not put your local change in the tree as a new switch, since one exists — but if you have the number of pages that fell back per frame, that would be a useful addition to the report.
Author
Owner

@⁠Key-rs on GitHub · 2026-11-25 16:52 UTC · original

Short answer: no, I do not have either aggregate — the report is frame counters only (copies ms/MB, copy-back ms/MB), not per-range identity or reuse. I did not instrument that, and on this machine the run takes minutes to reach a frame with the world in it.

What I do have, if it is any use to the synthetic side:

  • copy-back volume per frame: 8-38 MB in the samples in the report (15.5 MB in the steady one), at 2.4-5.6 ms/MB.
  • copies per frame: 78-212 MB, 45-143 ms, i.e. 0.44-0.67 ms/MB.
  • copies recorded per frame: the fork's own line says 52-63 title buffer copies, of which 0 continue the one before — so ~60 ranges a frame at that point, ~1-3 MB each on average.
  • GPU time: 1-70 ms in frames of 200-700 ms, so the card is idle for most of it; the processor side is the limit here too, as it is on your 5070 Ti.

The two things your experiment would need that I cannot give: whether those ~60 ranges repeat without an intervening write (the title rewrites streaming memory constantly, which is why the fork guards and hashes rather than trusts), and how many pages are missing when a copy starts — I suspect that last number is where my 0.5 ms/MB comes from, since VICTORY_COPY_PLAIN=1 (in-process
ep movsb, no syscall) does not move it at all:

VICTORY_COPY_PLAIN=1 copies 41.4-117.5 ms / 81-136 MB baseline (kernel) copies 45.7-143.4 ms / 78-212 MB

If the guarded reuse path you measured is relevant, the number to have first is how often a range is re-read unchanged; the fork has VICTORY_CARD_REHASH_RUNS and the per-frame hash counters (623 hash passes over 1250 pieces), which suggest the hashing side is where a reuse decision would have to be made. Worth asking @⁠fxceless whether those counters can be got out as a total.

Happy to run any instrumentation you want on this machine if it needs a real title rather than a replay — that part is cheap, the runs are just slow.

**@⁠Key-rs** on GitHub · 2026-11-25 16:52 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7168653376) Short answer: no, I do not have either aggregate — the report is frame counters only (copies ms/MB, copy-back ms/MB), not per-range identity or reuse. I did not instrument that, and on this machine the run takes minutes to reach a frame with the world in it. What I do have, if it is any use to the synthetic side: * **copy-back volume per frame**: 8-38 MB in the samples in the report (15.5 MB in the steady one), at 2.4-5.6 ms/MB. * **copies per frame**: 78-212 MB, 45-143 ms, i.e. 0.44-0.67 ms/MB. * **copies recorded per frame**: the fork's own line says 52-63 title buffer copies, of which 0 continue the one before — so ~60 ranges a frame at that point, ~1-3 MB each on average. * **GPU time**: 1-70 ms in frames of 200-700 ms, so the card is idle for most of it; the processor side is the limit here too, as it is on your 5070 Ti. The two things your experiment would need that I cannot give: whether those ~60 ranges repeat without an intervening write (the title rewrites streaming memory constantly, which is why the fork guards and hashes rather than trusts), and how many pages are missing when a copy starts — I suspect that last number is where my 0.5 ms/MB comes from, since VICTORY_COPY_PLAIN=1 (in-process ep movsb, no syscall) does not move it at all: ` VICTORY_COPY_PLAIN=1 copies 41.4-117.5 ms / 81-136 MB baseline (kernel) copies 45.7-143.4 ms / 78-212 MB ` If the guarded reuse path you measured is relevant, the number to have first is how often a range is re-read unchanged; the fork has VICTORY_CARD_REHASH_RUNS and the per-frame hash counters (623 hash passes over 1250 pieces), which suggest the hashing side is where a reuse decision would have to be made. Worth asking @⁠fxceless whether those counters can be got out as a total. Happy to run any instrumentation you want on this machine if it needs a real title rather than a replay — that part is cheap, the runs are just slow.
Author
Owner

@⁠spk-c on GitHub · 2026-11-26 01:08 UTC · original

An additional data point from a desktop RTX 4090 (Ryzen 9 9950X3D, Windows 10, 24 GiB): one periodic report measured 246.2 ms/frame (4.1 FPS), 139.7 ms copying back and 26.7 MB merged back. A nearby relay report measured 125.7 ms waiting for fetches and 143.5 ms landing in all.

One attribution caveat: the existing fetch-wait timer starts before command recording/submission, so it does not isolate PCIe transfer or GPU execution. #1231 adds opt-in CPU wall-clock counters for selection, buffer preparation, recording/submission, fence wait, merge and the inflight attempt. Fence wait itself includes queue dependencies and scheduling. Measurement notes.

These are observations from changing workloads, not a matched A/B or a bandwidth benchmark; the timers overlap. We do not have the per-range CPU reuse/observation aggregates requested above. No FPS gain is claimed for the new instrumentation. AI-assisted analysis and write-up.

**@⁠spk-c** on GitHub · 2026-11-26 01:08 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7179475052) An additional data point from a desktop RTX 4090 (Ryzen 9 9950X3D, Windows 10, 24 GiB): one periodic report measured 246.2 ms/frame (4.1 FPS), 139.7 ms copying back and 26.7 MB merged back. A nearby relay report measured 125.7 ms waiting for fetches and 143.5 ms landing in all. One attribution caveat: the existing fetch-wait timer starts before command recording/submission, so it does not isolate PCIe transfer or GPU execution. #1231 adds opt-in CPU wall-clock counters for selection, buffer preparation, recording/submission, fence wait, merge and the inflight attempt. Fence wait itself includes queue dependencies and scheduling. [Measurement notes](https://github.com/spk-c/victory-fork/blob/580b68d6bac7b22813b6b1f1d7a9fa82082085d6/diagnostics/READBACK_PHASES.md). These are observations from changing workloads, not a matched A/B or a bandwidth benchmark; the timers overlap. We do not have the per-range CPU reuse/observation aggregates requested above. No FPS gain is claimed for the new instrumentation. AI-assisted analysis and write-up.
Author
Owner

@⁠Key-rs on GitHub · 2026-11-26 01:41 UTC · original

Your caveat about the timer is the right one to make, and I have a result that supports it: on this machine the copying back figure moved a lot without the bytes changing, because it was carrying thread scheduling rather than transfer.

8c/16t Zen 4, RTX 4060 Laptop, ␀b0074e, same package and switches, warm cache:

storage workers copying back per MB
16 (was vailable_parallelism()) 87.7 ms / 15.5 MB 5.7 ms/MB
8 (physical cores, #1044) 26.1–92.4 ms / 7–28 MB 2.4–3.5 ms/MB

Same bytes per megabyte, same link, same card: the only thing that changed is that 16 storage workers stopped competing with the thread that copies back. VICTORY_DSTORAGE_WORKERS=16 puts the old numbers back, so it is the pool and not the scene. A copy-back timer that includes the wait behind other threads on the same cores will read like a bandwidth problem when it is a scheduling one — which is what your phase breakdown in #1231 is for.

That also means my "2.4–5.6 ms/MB against a 0.1–0.3 expectation" in the report should be read as an upper bound on the real transfer: it includes fence waits, queue dependencies and scheduling, exactly as you say. After the worker change the residual 2.4–3.5 is still an upper bound, and I would not guess how much of it is PCIe.

On the aggregates @⁠akimfomin asked for: I do not have per-range reuse either, so we are in the same position there — the fork reports counters, not identities.

Your 4090 datapoint is useful to me (139.7 ms for 26.7 MB is 5.2 ms/MB, i.e. the same anomaly on a card with far more bandwidth than mine): it rules out "a slow laptop" as the explanation before anyone spends a day on the copy path.

If #1231's counters are in a build I can run, I will gladly run that build on this machine and report the phase split for a real title — same switches, same scene, one number per phase. That would give your instrumented numbers a second machine and a second GPU vendor, which is more than I can do by reasoning about the timer.

**@⁠Key-rs** on GitHub · 2026-11-26 01:41 UTC · [original](https://github.com/fxceless/victory-fork/issues/1003#issuecomment-7180020329) Your caveat about the timer is the right one to make, and I have a result that supports it: on this machine the copying back figure moved a lot without the bytes changing, because it was carrying thread scheduling rather than transfer. 8c/16t Zen 4, RTX 4060 Laptop, ␀b0074e, same package and switches, warm cache: | storage workers | copying back | per MB | |---|---|---| | 16 (was vailable_parallelism()) | 87.7 ms / 15.5 MB | 5.7 ms/MB | | 8 (physical cores, #1044) | 26.1–92.4 ms / 7–28 MB | 2.4–3.5 ms/MB | Same bytes per megabyte, same link, same card: the only thing that changed is that 16 storage workers stopped competing with the thread that copies back. VICTORY_DSTORAGE_WORKERS=16 puts the old numbers back, so it is the pool and not the scene. A copy-back timer that includes the wait behind other threads on the same cores will read like a bandwidth problem when it is a scheduling one — which is what your phase breakdown in #1231 is for. That also means my "2.4–5.6 ms/MB against a 0.1–0.3 expectation" in the report should be read as **an upper bound on the real transfer**: it includes fence waits, queue dependencies and scheduling, exactly as you say. After the worker change the residual 2.4–3.5 is still an upper bound, and I would not guess how much of it is PCIe. On the aggregates @⁠akimfomin asked for: I do not have per-range reuse either, so we are in the same position there — the fork reports counters, not identities. **Your 4090 datapoint is useful to me** (139.7 ms for 26.7 MB is 5.2 ms/MB, i.e. the same anomaly on a card with far more bandwidth than mine): it rules out "a slow laptop" as the explanation before anyone spends a day on the copy path. If #1231's counters are in a build I can run, I will gladly run that build on this machine and report the phase split for a real title — same switches, same scene, one number per phase. That would give your instrumented numbers a second machine and a second GPU vendor, which is more than I can do by reasoning about the timer.
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#1003
No description provided.