gpu/shadow: opt-in VEH lazy GPU-to-CPU copy-back (4/4 of #51, stable-amd) #190

Open
Vladimir-Human wants to merge 1 commit from upstream-pr/190 into stable-amd
Vladimir-Human commented 2026-11-28 18:39:48 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Vladimir-Human on 2026-11-28T18:39:48Z.


Clean port of #59 (part 4/4 of #51) onto origin/stable-amd (75022ba, Cargo.lock untouched).

Supersedes #59.

Verification (clean port on 75022ba)

  • cargo check --workspace --tests --locked — passed
  • cargo check -p victory-gpu --tests --locked --features diagnostics — passed
  • HW cargo test --locked -p victory-gpu --lib shadow — 55 passed, 0 failed, 2 ignored
  • HW cargo test --locked -p victory-gpu --lib watch — 42 passed, 0 failed
  • WARP (VICTORY_D3D12_WARP=1) shadow & watch — all passed
<!-- greyfinch-sync:PastiiJay/klbf-lab:issue:5543406446 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190). Originally posted by [Vladimir-Human](https://github.com/Vladimir-Human) on 2026-11-28T18:39:48Z. --- Clean port of #59 (part 4/4 of #51) onto origin/stable-amd (75022ba, Cargo.lock untouched). Supersedes #59. ### Verification (clean port on 75022ba) - cargo check --workspace --tests --locked — passed - cargo check -p victory-gpu --tests --locked --features diagnostics — passed - HW cargo test --locked -p victory-gpu --lib shadow — 55 passed, 0 failed, 2 ignored - HW cargo test --locked -p victory-gpu --lib watch — 42 passed, 0 failed - WARP (VICTORY_D3D12_WARP=1) shadow & watch — all passed
HandshakeHackin commented 2026-11-28 19:16:02 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-28T19:16:02Z.


I ran the same readback and queue-wait counters in both arms, following the A/B request in #51. The existing 64 MiB compute workload ran for 5 warmup frames and 30 measured frames per arm on Windows WARP. Each wait below is an actual CPU wait on a copy-back fence.

CPU reads Eager readback / waits Lazy readback / waits Total time inside those waits, eager / lazy
None 1,920 MiB / 30 0 MiB / 0 865.8 / 0 ms
20 pages per frame (~2%) 1,920 MiB / 30 37.5 MiB / 600 867.0 / 52.5 ms

The sparse workload made 20 times as many, smaller waits in lazy mode. Both arms returned the expected CPU-visible checksum of 191,900. The measured byte counts are D3D12 copy sizes. Physical PCIe traffic, hardware wait times and in-game FPS still need the card A/B.

The test-only patch on this head also prints the actual adapter name so testers can distinguish software and hardware captures. Complete four-arm Windows run.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7244415794 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7244415794). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-28T19:16:02Z. --- I ran the same readback and queue-wait counters in both arms, following the [A/B request in #51](https://github.com/PastiiJay/klbf-lab/pull/51#issuecomment-7217988366). The existing 64 MiB compute workload ran for 5 warmup frames and 30 measured frames per arm on Windows WARP. Each wait below is an actual CPU wait on a copy-back fence. | CPU reads | Eager readback / waits | Lazy readback / waits | Total time inside those waits, eager / lazy | |---|---:|---:|---:| | None | 1,920 MiB / 30 | 0 MiB / 0 | 865.8 / 0 ms | | 20 pages per frame (~2%) | 1,920 MiB / 30 | 37.5 MiB / 600 | 867.0 / 52.5 ms | The sparse workload made 20 times as many, smaller waits in lazy mode. Both arms returned the expected CPU-visible checksum of **191,900**. The measured byte counts are D3D12 copy sizes. Physical PCIe traffic, hardware wait times and in-game FPS still need the card A/B. The [test-only patch on this head](https://github.com/HandshakeHackin/klbf-lab/commit/e2303c350819af52d00b14fa8f496b992aa25fd9) also prints the actual adapter name so testers can distinguish software and hardware captures. [Complete four-arm Windows run](https://github.com/HandshakeHackin/klbf-lab/actions/runs/46179692759/job/141086223892).
Habluer commented 2026-11-29 00:03:16 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Habluer on 2026-11-29T00:03:16Z.


Tested bf931f3 with VICTORY_LAZY_COPYBACK=1 on my machine, results below in case they help.

Ryzen 5 8500G (6C/12T) + RX 6750 XT, 32 GB RAM, Win 11, --console series-s, no FG. Base is v26.11.6 with PR #26, 4,096 shard locks, VICTORY_ABSENT_CACHE=1, Port 2 (6/6 offsets), VICTORY_LEAN_MATH=247 and the 8-prefix filter for the heavy GPU passes (RT, reflections, Strands). No THIN. Same scene (bm-v1), warm cache, 0 pipelines being made. I'm CPU-bound here, GPU is only 4.3–8.7 ms.

Cherry-pick only conflicted in two small spots in watch.rs (uncommitted_stale() and port_descriptors::faulted). No crashes in ~6 min, 0 view records missed on Port 2.

baseline PR #190
FPS 14.4–15.4 12.1–13.0
frametime 65.0–69.2 ms 77.1–82.5 ms
preparing 50.5–51.6 ms 55.9–61.2 ms
copies 16.6–17.7 ms 23.5–29.2 ms
copying back 17.7–19.7 ms (24.3–24.5 MB) 16.1–19.3 ms (24.0–24.3 MB)

Counters: 66 pages armed, 65.5–68.7 steady hits, 0.0 VEH faults, 0.00 MB read back, 22.3–26.5 self-bypassed.

So copying back basically didn't change and copies went up 7–11 ms, ended up ~2 FPS worse for me. What I don't get is why copy-back is still ~24 MB/frame with zero faults and nothing read back. Is that expected? Can grab more logs if you tell me what to look for.

Full breakdown of the setup and measurements: #219

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7247841295 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7247841295). Originally posted by [Habluer](https://github.com/Habluer) on 2026-11-29T00:03:16Z. --- Tested `bf931f3` with `VICTORY_LAZY_COPYBACK=1` on my machine, results below in case they help. Ryzen 5 8500G (6C/12T) + RX 6750 XT, 32 GB RAM, Win 11, `--console series-s`, no FG. Base is v26.11.6 with PR #26, 4,096 shard locks, `VICTORY_ABSENT_CACHE=1`, Port 2 (6/6 offsets), `VICTORY_LEAN_MATH=247` and the 8-prefix filter for the heavy GPU passes (RT, reflections, Strands). No THIN. Same scene (`bm-v1`), warm cache, 0 pipelines being made. I'm CPU-bound here, GPU is only 4.3–8.7 ms. Cherry-pick only conflicted in two small spots in `watch.rs` (`uncommitted_stale()` and `port_descriptors::faulted`). No crashes in ~6 min, 0 view records missed on Port 2. | | baseline | PR #190 | |---|---|---| | FPS | 14.4–15.4 | 12.1–13.0 | | frametime | 65.0–69.2 ms | 77.1–82.5 ms | | preparing | 50.5–51.6 ms | 55.9–61.2 ms | | copies | 16.6–17.7 ms | 23.5–29.2 ms | | copying back | 17.7–19.7 ms (24.3–24.5 MB) | 16.1–19.3 ms (24.0–24.3 MB) | Counters: 66 pages armed, 65.5–68.7 steady hits, 0.0 VEH faults, 0.00 MB read back, 22.3–26.5 self-bypassed. So copying back basically didn't change and copies went up 7–11 ms, ended up ~2 FPS worse for me. What I don't get is why copy-back is still ~24 MB/frame with zero faults and nothing read back. Is that expected? Can grab more logs if you tell me what to look for. Full breakdown of the setup and measurements: #219
HandshakeHackin commented 2026-11-29 01:49:33 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-29T01:49:33Z.


@Habluer Yes, those two readings can occur in the same frame. I instrumented this PR's existing mixed-page compute test at bf931f3 and read both counters before the CPU touched either deferred page. Two whole pages were eligible to defer. A pinned page and a half-page boundary were copied back immediately.

WARP shadow Frame-line copy-back bytes Lazy faults / bytes Eager card fetch bytes
Card memory 98,298 0 / 0 98,304
Shared memory 98,298 0 / 0 0

The existing readback checks then verified the contents of both eager ranges. The frame line counts bytes merged into title memory. That merge can come from a GPU fetch or an already CPU-visible mapping. The lazy line counts the separate on-demand path. Your zero on that line therefore leaves the ~24 MB on the frame line entirely possible.

For your existing diagnostics run, the most useful line from the same interval would be “host copies in the card's memory … pieces compared … fetched (… MB)”. Alongside the frame-line bytes, it would show how much data was fetched by that eager card path. These counters by themselves don't establish the source of the additional 7–11 ms. Instrumented test · Both Windows readbacks.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7249037682 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7249037682). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-29T01:49:33Z. --- @Habluer Yes, those two readings can occur in the same frame. I instrumented this PR's existing mixed-page compute test at `bf931f3` and read both counters before the CPU touched either deferred page. Two whole pages were eligible to defer. A pinned page and a half-page boundary were copied back immediately. | WARP shadow | Frame-line copy-back bytes | Lazy faults / bytes | Eager card fetch bytes | |---|---:|---:|---:| | Card memory | 98,298 | 0 / 0 | 98,304 | | Shared memory | 98,298 | 0 / 0 | 0 | The existing readback checks then verified the contents of both eager ranges. The frame line counts bytes merged into title memory. That merge can come from a GPU fetch or an already CPU-visible mapping. The lazy line counts the separate on-demand path. Your zero on that line therefore leaves the ~24 MB on the frame line entirely possible. For your existing diagnostics run, the most useful line from the same interval would be **“host copies in the card's memory … pieces compared … fetched (… MB)”**. Alongside the frame-line bytes, it would show how much data was fetched by that eager card path. These counters by themselves don't establish the source of the additional 7–11 ms. [Instrumented test](https://github.com/HandshakeHackin/klbf-lab/commit/5e0c3b461abadd72e24714f383c44a290eac0976) · [Both Windows readbacks](https://github.com/HandshakeHackin/klbf-lab/actions/runs/46212601861/job/141189436871).
Habluer commented 2026-11-29 02:08:07 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Habluer on 2026-11-29T02:08:07Z.


Thanks @HandshakeHackin, that table clears it up completely. Here are the exact lines from the same steady-state (0 being made) intervals in both runs:

PR #190 run (VICTORY_LAZY_COPYBACK=1, 23:19:15.153Z):

victory_gpu::host: host copies in the card's memory: 692 copies 592 MB, their bytes from before 0 MB; per frame: 22.5 MB sent up in 15291 ranges, 10562 pieces compared on the card, 132 of them fetched (2.6 MB) with 13.5 more waits for the card (10.3 ms)
victory_gpu::host: lazy copy-back per frame: 0.0 newly armed, 65.5 steady hits, 0.0 VEH read faults, 0.0 VEH write faults, 0.0 explicit flushes, 0.00 MB read back, 23.0 self-bypassed; 66 pages armed now
victory_gpu::host: 13.0 fps, 77.1 ms/frame (59.1 preparing: copies 27.1 ms 89.7 MB, textures 0.7 ms 19.0 MB; 4.1 on the GPU; 16.1 copying back 24.1 MB), 4124 draws/frame, dropped 401 without a host pipeline (0 being made) and 594 indirect

Diagnostics run without PR #190 (00:33:25.853Z):

victory_gpu::host: host copies in the card's memory: 757 copies 591 MB, their bytes from before 0 MB; per frame: 25.2 MB sent up in 5402 ranges, 10493 pieces compared on the card, 221 of them fetched (7.6 MB) with 12.1 more waits for the card (13.0 ms)
victory_gpu::host: 13.2 fps, 75.7 ms/frame (53.3 preparing: copies 19.7 ms 94.4 MB, textures 1.1 ms 19.4 MB; 17.3 on the GPU; 18.9 copying back 24.4 MB), 4183 draws/frame, dropped 417 without a host pipeline (0 being made) and 552 indirect

So your explanation matches the numbers: in the PR #190 run, eager card fetches were 2.6 MB per frame (vs. 7.6 MB in the diagnostics run), so most of the 24.1 MB on the frame line seems to come from the already CPU-visible merge path rather than card fetches.

One thing that stands out between the two: 15291 ranges sent up per frame with PR #190 vs. 5402 without. Not sure if that's related to the extra 7–11 ms in copies, but mentioning it in case it helps. (The second run is the diagnostics build, so it's not a perfectly clean A/B.)

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7249231684 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7249231684). Originally posted by [Habluer](https://github.com/Habluer) on 2026-11-29T02:08:07Z. --- Thanks @HandshakeHackin, that table clears it up completely. Here are the exact lines from the same steady-state (`0 being made`) intervals in both runs: **PR #190 run (`VICTORY_LAZY_COPYBACK=1`, `23:19:15.153Z`):** ```text victory_gpu::host: host copies in the card's memory: 692 copies 592 MB, their bytes from before 0 MB; per frame: 22.5 MB sent up in 15291 ranges, 10562 pieces compared on the card, 132 of them fetched (2.6 MB) with 13.5 more waits for the card (10.3 ms) victory_gpu::host: lazy copy-back per frame: 0.0 newly armed, 65.5 steady hits, 0.0 VEH read faults, 0.0 VEH write faults, 0.0 explicit flushes, 0.00 MB read back, 23.0 self-bypassed; 66 pages armed now victory_gpu::host: 13.0 fps, 77.1 ms/frame (59.1 preparing: copies 27.1 ms 89.7 MB, textures 0.7 ms 19.0 MB; 4.1 on the GPU; 16.1 copying back 24.1 MB), 4124 draws/frame, dropped 401 without a host pipeline (0 being made) and 594 indirect ``` **Diagnostics run without PR #190 (`00:33:25.853Z`):** ```text victory_gpu::host: host copies in the card's memory: 757 copies 591 MB, their bytes from before 0 MB; per frame: 25.2 MB sent up in 5402 ranges, 10493 pieces compared on the card, 221 of them fetched (7.6 MB) with 12.1 more waits for the card (13.0 ms) victory_gpu::host: 13.2 fps, 75.7 ms/frame (53.3 preparing: copies 19.7 ms 94.4 MB, textures 1.1 ms 19.4 MB; 17.3 on the GPU; 18.9 copying back 24.4 MB), 4183 draws/frame, dropped 417 without a host pipeline (0 being made) and 552 indirect ``` So your explanation matches the numbers: in the PR #190 run, eager card fetches were **2.6 MB** per frame (vs. **7.6 MB** in the diagnostics run), so most of the `24.1 MB` on the frame line seems to come from the already CPU-visible merge path rather than card fetches. One thing that stands out between the two: `15291` ranges sent up per frame with PR #190 vs. `5402` without. Not sure if that's related to the extra 7–11 ms in `copies`, but mentioning it in case it helps. (The second run is the diagnostics build, so it's not a perfectly clean A/B.)
HandshakeHackin commented 2026-11-29 02:15:39 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-29T02:15:39Z.


@Habluer, the upload pattern changed quite a bit in those samples: 22.5 MB across 15,291 ranges averages about 1.47 kB per range on #190, versus 4.66 kB for 25.2 MB across 5,402. The 2.6 MB eager fetch also confirms how little went through that specific readback path in the first sample.

I checked what the upload range count means on this exact PR head. On Windows WARP I staged an identical 4,096-byte payload size two ways. A contiguous range produced one buffer-copy run. Splitting it into 1,024 aligned four-byte writes produced zero buffer-copy runs and 1,024 scatter words. The test verified every staged offset and value. Short aligned runs can share a compute dispatch, so 15,291 input ranges alone doesn’t tell us how many native copy commands ran. Test and readbacks

On this head the submission thread takes and records these sends in card_before (split 4). The frame line’s copies timer is charged separately during list preparation. To distinguish extra range-packing work from the extra time in copies, the two lines I’d look for in your existing captures are “bytes of submissions’ own sent up per frame” (copy runs, scatter words, CPU packing time) and, where diagnostics are available, “copies in the card’s memory per frame, the submitting thread” (gathering, packing and recording times). The different builds still leave the cause of the 7–11 ms open. Upload accounting · Submission phases

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7249313304 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7249313304). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-29T02:15:39Z. --- @Habluer, the upload pattern changed quite a bit in those samples: 22.5 MB across 15,291 ranges averages about **1.47 kB per range** on #190, versus **4.66 kB** for 25.2 MB across 5,402. The 2.6 MB eager fetch also confirms how little went through that specific readback path in the first sample. I checked what the upload range count means on this exact PR head. On Windows WARP I staged an identical 4,096-byte payload size two ways. A contiguous range produced **one buffer-copy run**. Splitting it into 1,024 aligned four-byte writes produced **zero buffer-copy runs and 1,024 scatter words**. The test verified every staged offset and value. Short aligned runs can share a compute dispatch, so 15,291 input ranges alone doesn’t tell us how many native copy commands ran. [Test and readbacks](https://github.com/HandshakeHackin/klbf-lab/actions/runs/46214522731/job/141195451316) On this head the submission thread takes and records these sends in `card_before` (split 4). The frame line’s `copies` timer is charged separately during list preparation. To distinguish extra range-packing work from the extra time in `copies`, the two lines I’d look for in your existing captures are **“bytes of submissions’ own sent up per frame”** (copy runs, scatter words, CPU packing time) and, where diagnostics are available, **“copies in the card’s memory per frame, the submitting thread”** (gathering, packing and recording times). The different builds still leave the cause of the 7–11 ms open. [Upload accounting](https://github.com/PastiiJay/klbf-lab/blob/bf931f392ef71019e8a8eb5b7e7f604bfbfd0d14/crates/victory-gpu/src/host.rs#L4237) · [Submission phases](https://github.com/PastiiJay/klbf-lab/blob/bf931f392ef71019e8a8eb5b7e7f604bfbfd0d14/crates/victory-gpu/src/host.rs#L6360)
Habluer commented 2026-11-29 02:28:46 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Habluer on 2026-11-29T02:28:46Z.


@HandshakeHackin, here are the exact lines from those two existing captures, plus the exact 25 s steady-state window ending at each cited tick (all 0 being made). VICTORY_SEND_OWN logs every ~1 s; the host copies and frame/copies summary lines log every ~5 s, so sample counts are noted.

1. PR #190 build (201321, built without --features diagnostics, so the submitting thread breakdown line is absent)

Exact tick (13.0 fps, 77.1 ms/frame, preparing: 59.1 ms, copies: 27.1 ms 89.7 MB):

bytes of submissions' own sent up per frame (VICTORY_SEND_OWN): 21.2 MB in 243 runs, 47653 words in scatters; 1.29 ms taking them out of the CPU sides
host copies in the card's memory: 692 copies 592 MB, their bytes from before 0 MB; per frame: 22.5 MB sent up in 15291 ranges, 10562 pieces compared on the card, 132 of them fetched (2.6 MB) with 13.5 more waits for the card (10.3 ms)

25 s window ending at that tick (23:18:50–23:19:15Z):

  • VICTORY_SEND_OWN (n=24, 1 s lines): 234–272 runs, 44,051–91,015 scatter words, 1.23–1.90 ms CPU packing
  • host copies ranges (n=5, ~5 s lines): 15,291–24,534 ranges
  • preparing: copies (n=5, ~5 s lines): 23.5–29.2 ms

2. Diagnostics build (212623, without PR #190, built with --features diagnostics)

Exact tick (13.2 fps, 75.7 ms/frame, preparing: 53.3 ms, copies: 19.7 ms 94.4 MB):

bytes of submissions' own sent up per frame (VICTORY_SEND_OWN): 23.9 MB in 260 runs, 15384 words in scatters; 1.47 ms taking them out of the CPU sides
copies in the card's memory per frame, the submitting thread: 18 calls, 92 copies with changes, 5402 ranges; gathered 0.94 ms, twins made 0.01, bytes taken 1.48, sends and hash passes recorded 1.06, compare planned and recorded 0.62
host copies in the card's memory: 757 copies 591 MB, their bytes from before 0 MB; per frame: 25.2 MB sent up in 5402 ranges, 10493 pieces compared on the card, 221 of them fetched (7.6 MB) with 12.1 more waits for the card (13.0 ms)

25 s window ending at that tick (00:33:00–00:33:25Z):

  • VICTORY_SEND_OWN (n=25, 1 s lines): 255–279 runs, 3,506–41,573 scatter words, 1.45–2.50 ms CPU packing
  • host copies ranges (n=5, ~5 s lines): 2,937–8,084 ranges (the 1 s submitting thread line across n=25 spans 1,634–14,793 ranges)
  • preparing: copies (n=5, ~5 s lines): 18.0–22.0 ms

Summary

Across both 25 s windows, VICTORY_SEND_OWN CPU packing did not increase on the #190 run (1.23–1.90 ms vs 1.45–2.50 ms), copy runs stayed in the same band (234–272 vs 255–279), and the extra time showed up in copies during list preparation (23.5–29.2 ms vs 18.0–22.0 ms). The caveat stands that these are two different builds, and the #190 build had no diagnostics enabled. Let me know if you want a matched A/B on the same build with diagnostics on.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7249452829 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7249452829). Originally posted by [Habluer](https://github.com/Habluer) on 2026-11-29T02:28:46Z. --- @HandshakeHackin, here are the exact lines from those two existing captures, plus the exact 25 s steady-state window ending at each cited tick (all `0 being made`). `VICTORY_SEND_OWN` logs every ~1 s; the `host copies` and frame/`copies` summary lines log every ~5 s, so sample counts are noted. ### 1. PR #190 build (`201321`, built without `--features diagnostics`, so the `submitting thread` breakdown line is absent) Exact tick (`13.0 fps, 77.1 ms/frame`, `preparing: 59.1 ms`, `copies: 27.1 ms 89.7 MB`): ```text bytes of submissions' own sent up per frame (VICTORY_SEND_OWN): 21.2 MB in 243 runs, 47653 words in scatters; 1.29 ms taking them out of the CPU sides host copies in the card's memory: 692 copies 592 MB, their bytes from before 0 MB; per frame: 22.5 MB sent up in 15291 ranges, 10562 pieces compared on the card, 132 of them fetched (2.6 MB) with 13.5 more waits for the card (10.3 ms) ``` 25 s window ending at that tick (23:18:50–23:19:15Z): - `VICTORY_SEND_OWN` (n=24, 1 s lines): 234–272 runs, 44,051–91,015 scatter words, 1.23–1.90 ms CPU packing - `host copies` ranges (n=5, ~5 s lines): 15,291–24,534 ranges - `preparing: copies` (n=5, ~5 s lines): 23.5–29.2 ms ### 2. Diagnostics build (`212623`, without PR #190, built with `--features diagnostics`) Exact tick (`13.2 fps, 75.7 ms/frame`, `preparing: 53.3 ms`, `copies: 19.7 ms 94.4 MB`): ```text bytes of submissions' own sent up per frame (VICTORY_SEND_OWN): 23.9 MB in 260 runs, 15384 words in scatters; 1.47 ms taking them out of the CPU sides copies in the card's memory per frame, the submitting thread: 18 calls, 92 copies with changes, 5402 ranges; gathered 0.94 ms, twins made 0.01, bytes taken 1.48, sends and hash passes recorded 1.06, compare planned and recorded 0.62 host copies in the card's memory: 757 copies 591 MB, their bytes from before 0 MB; per frame: 25.2 MB sent up in 5402 ranges, 10493 pieces compared on the card, 221 of them fetched (7.6 MB) with 12.1 more waits for the card (13.0 ms) ``` 25 s window ending at that tick (00:33:00–00:33:25Z): - `VICTORY_SEND_OWN` (n=25, 1 s lines): 255–279 runs, 3,506–41,573 scatter words, 1.45–2.50 ms CPU packing - `host copies` ranges (n=5, ~5 s lines): 2,937–8,084 ranges (the 1 s `submitting thread` line across n=25 spans 1,634–14,793 ranges) - `preparing: copies` (n=5, ~5 s lines): 18.0–22.0 ms ### Summary Across both 25 s windows, `VICTORY_SEND_OWN` CPU packing did not increase on the #190 run (1.23–1.90 ms vs 1.45–2.50 ms), copy runs stayed in the same band (234–272 vs 255–279), and the extra time showed up in `copies` during list preparation (23.5–29.2 ms vs 18.0–22.0 ms). The caveat stands that these are two different builds, and the #190 build had no diagnostics enabled. Let me know if you want a matched A/B on the same build with diagnostics on.
HandshakeHackin commented 2026-11-29 02:45:14 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by HandshakeHackin on 2026-11-29T02:45:14Z.


@Habluer, yes, the matched A/B would help. At the cited ticks, the #190 build packed 47,653 scatter words in 1.29 ms and the comparison build packed 15,384 in 1.47 ms. The extra 7.4 ms on the frame line was in list preparation. Your two 25-second windows also have overlapping packing times and no overlap in the five preparing: copies samples. A same-binary comparison can now test whether toggling lazy copy-back changes that separate cost.

I built the unchanged PR head bf931f3 with diagnostics. Two separate Windows test processes on that source observed lazy copy-back off at 0 and on at 1. Exact build and switch checks · Windows executable and checksum. The victory.exe SHA-256 is 722917941CA4016246FBBDBA6B3785EAB78F81A945C0FDA1978885C85B8F779A. Your own diagnostics build of that head also works if you already have one.

Use the same executable, warm shader cache, save, camera position and settings for both runs. Restart the process between VICTORY_LAZY_COPYBACK=0 and =1, keeping VICTORY_SEND_OWN and any other switches identical. One comparable 25-second interval with 0 being made from each log is enough to start. The most helpful extra line this time is “preparing per frame, the submitting thread” for the refreshes, copies and fills, alongside the main frame and lazy copy-back counters. The two run logs are enough; I can line up the intervals.

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7249625643 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7249625643). Originally posted by [HandshakeHackin](https://github.com/HandshakeHackin) on 2026-11-29T02:45:14Z. --- @Habluer, yes, the matched A/B would help. At the cited ticks, the #190 build packed 47,653 scatter words in 1.29 ms and the comparison build packed 15,384 in 1.47 ms. The extra 7.4 ms on the frame line was in list preparation. Your two 25-second windows also have overlapping packing times and no overlap in the five `preparing: copies` samples. A same-binary comparison can now test whether toggling lazy copy-back changes that separate cost. I built the **unchanged PR head `bf931f3`** with diagnostics. Two separate Windows test processes on that source observed lazy copy-back off at `0` and on at `1`. [Exact build and switch checks](https://github.com/HandshakeHackin/klbf-lab/actions/runs/46216528335/job/141201800181) · [Windows executable and checksum](https://github.com/HandshakeHackin/klbf-lab/actions/runs/46216528335/artifacts/15291973496). The `victory.exe` SHA-256 is `722917941CA4016246FBBDBA6B3785EAB78F81A945C0FDA1978885C85B8F779A`. Your own diagnostics build of that head also works if you already have one. Use the same executable, warm shader cache, save, camera position and settings for both runs. Restart the process between `VICTORY_LAZY_COPYBACK=0` and `=1`, keeping `VICTORY_SEND_OWN` and any other switches identical. One comparable 25-second interval with `0 being made` from each log is enough to start. The most helpful extra line this time is **“preparing per frame, the submitting thread”** for the refreshes, copies and fills, alongside the main frame and lazy copy-back counters. The two run logs are enough; I can line up the intervals.
PastiiJay commented 2026-11-29 08:24:47 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by PastiiJay on 2026-11-29T08:24:47Z.


@Habluer thanks for the careful numbers, and @HandshakeHackin for the same-binary build. for now lazy copy-back stays out of our line: on your 6750 XT it came out about 2 fps lower and nothing has shown it faster yet. thanks @Vladimir-Human for the port all the same, the PR stays open while this is measured.

Habluer, when you do the matched run (same exe, VICTORY_LAZY_COPYBACK=0 then =1), drop the two run logs here and we'll read them too

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7253088400 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7253088400). Originally posted by [PastiiJay](https://github.com/PastiiJay) on 2026-11-29T08:24:47Z. --- @Habluer thanks for the careful numbers, and @HandshakeHackin for the same-binary build. for now lazy copy-back stays out of our line: on your 6750 XT it came out about 2 fps lower and nothing has shown it faster yet. thanks @Vladimir-Human for the port all the same, the PR stays open while this is measured. Habluer, when you do the matched run (same exe, `VICTORY_LAZY_COPYBACK=0` then `=1`), drop the two run logs here and we'll read them too
Habluer commented 2026-11-29 18:14:03 +00:00 (Migrated from github.com)

Imported from PastiiJay/klbf-lab. Originally posted by Habluer on 2026-11-29T18:14:03Z.


Thanks for the patience on this one. I reran the A/B cleanly on a single binary, so this replaces my earlier numbers.

Setup: same executable for both arms, same warmed cache (25717 shaders / 3797 early / 8073 warm), isolated save with an identical hash before and after, same input script. VICTORY_LAZY_COPYBACK=0 (A) vs =1 (B). In both runs the auto input was never interrupted (AUTO_INPUT_CANCELLED=False, 0 hits), and view records missed stayed at 0.

Method: I only counted blocks after KLBF Lab Bench BM-v1: measuring ... from the first world frame that report 0 being made. This drops the menu/loading blocks that would otherwise pull the medians down. That leaves 13 blocks for A and 14 for B.

A (LAZY=0) B (LAZY=1)
copying back (ms), median (range) 15.2 (12.1–20.5) 19.05 (17.2–21.8)
copying back (MB/frame), median 23.5 24.0
preparing (ms), median 47.7 54.5

Lazy copy-back counters (B): the mechanism is active (median ~91 pages armed, ~34 steady hits per frame), but the VEH path is almost idle: median 0 read/write faults and 0.005 MB read back per frame, with 0 explicit flushes. So in this scenario the copy-back itself still moves ~24 MB per frame in both arms, and I don't see a reduction in copying back time.

I'm not drawing any FPS conclusion from this run. Arm A has a few multi-hundred-millisecond stalls near the end of the window and I can't explain them, and A ran before B.

Hardware: Windows 11, Ryzen 5 8500G, RX 6750 XT 12 GB.

Based on this, I don't think #190 gives a measurable gain here, so I'd leave it as is. Happy to rerun with the arm order swapped if that would help.

Attachments: the two run logs (A: LAZY=0, B: LAZY=1). No in-game screenshots.

a9v2-arma-20261129-145127.stderr.log

a9v2-armb-20261129-145411.stderr.log

<!-- greyfinch-sync:PastiiJay/klbf-lab:comment:7260319510 --> Imported from [PastiiJay/klbf-lab](https://github.com/PastiiJay/klbf-lab/pull/190#issuecomment-7260319510). Originally posted by [Habluer](https://github.com/Habluer) on 2026-11-29T18:14:03Z. --- Thanks for the patience on this one. I reran the A/B cleanly on a single binary, so this replaces my earlier numbers. **Setup:** same executable for both arms, same warmed cache (25717 shaders / 3797 early / 8073 warm), isolated save with an identical hash before and after, same input script. `VICTORY_LAZY_COPYBACK=0` (A) vs `=1` (B). In both runs the auto input was never interrupted (`AUTO_INPUT_CANCELLED=False`, 0 hits), and `view records missed` stayed at 0. **Method:** I only counted blocks after `KLBF Lab Bench BM-v1: measuring ... from the first world frame` that report `0 being made`. This drops the menu/loading blocks that would otherwise pull the medians down. That leaves 13 blocks for A and 14 for B. | | A (`LAZY=0`) | B (`LAZY=1`) | |---|---|---| | copying back (ms), median (range) | 15.2 (12.1–20.5) | 19.05 (17.2–21.8) | | copying back (MB/frame), median | 23.5 | 24.0 | | preparing (ms), median | 47.7 | 54.5 | **Lazy copy-back counters (B):** the mechanism is active (median ~91 pages armed, ~34 steady hits per frame), but the VEH path is almost idle: median 0 read/write faults and 0.005 MB read back per frame, with 0 explicit flushes. So in this scenario the copy-back itself still moves ~24 MB per frame in both arms, and I don't see a reduction in `copying back` time. I'm not drawing any FPS conclusion from this run. Arm A has a few multi-hundred-millisecond stalls near the end of the window and I can't explain them, and A ran before B. Hardware: Windows 11, Ryzen 5 8500G, RX 6750 XT 12 GB. Based on this, I don't think #190 gives a measurable gain here, so I'd leave it as is. Happy to rerun with the arm order swapped if that would help. Attachments: the two run logs (A: `LAZY=0`, B: `LAZY=1`). No in-game screenshots. [a9v2-arma-20261129-145127.stderr.log](https://github.com/user-attachments/files/35579518/a9v2-arma-20261129-145127.stderr.log) [a9v2-armb-20261129-145411.stderr.log](https://github.com/user-attachments/files/35579552/a9v2-armb-20261129-145411.stderr.log)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/190:upstream-pr/190'
git switch 'upstream-pr/190'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'stable-amd'
git merge --no-ff 'upstream-pr/190'
git switch 'upstream-pr/190'
git rebase 'stable-amd'
git switch 'stable-amd'
git merge --ff-only 'upstream-pr/190'
git switch 'upstream-pr/190'
git rebase 'stable-amd'
git switch 'stable-amd'
git merge --no-ff 'upstream-pr/190'
git switch 'stable-amd'
git merge --squash 'upstream-pr/190'
git switch 'stable-amd'
git merge --ff-only 'upstream-pr/190'
git switch 'stable-amd'
git merge 'upstream-pr/190'
git push origin 'stable-amd'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
PastiiJay/klbf-lab!190
No description provided.