Copy-back pull requests measured together on 0b0074e (RTX 4070) #1064

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

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

Ten open pull requests change the copy-back or its neighbours. This measures the ones that apply to 0b0074e, each alone and some combined, on one card. It also gives a base run on 465b94f, with and without its opt-in switches. Only measured facts below.

Setup

  • Windows 11 (build 26200), RTX 4070 12 GB, driver 32.0.16.2101, i7-14700KF, 32 GB.
  • Diagnostics builds; 9-minute runs from the same cell save, default mode, each in a fresh process.
  • Each tree has its own copy of one warm shader and pipeline cache. None of these pull requests changes the translator.
  • VICTORY_MERGE_RACE=1 is on in every run, for the correctness column. It costs time: two earlier runs of the same 0b0074e build without it measured 156–169 ms copying back and 97–100 GPU ms, against 200–209 and 129–137 for the base rows here. All rows below have it on.
  • Figures are medians of the frame lines after the first three minutes in the world.
  • Two builds ran on the same machine during the first two minutes of two runs (base, start, run 1; #925 run 2), before the part measured.

In 0b0074e's default mode the late wait and the relay (stage 2) are on, so the copy-back runs on the relay's thread, through relay_merge and card_merge_relay.

Which pull requests apply to 0b0074e

PR What it changes Switch On 0b0074e
#255 first/last changed byte searched 32 bytes at a time (used by relay_merge and card_merge_relay) none applies
#448 relay flight ranges indexed in a BTreeMap none applies
#857 runs closer than 64 bytes written as one (back_piece, the synchronous copy-back) VICTORY_BACK_RUN_GAP, 64 applies; conflicts with #925
#925 run vectors reused in merge_under_writes none applies; conflicts with #857
#786 only the card's changed byte runs written back in relay_merge, card_merge, card_merge_relay none conflicts in shadow.rs (three hunks); rebased locally for this measure only
#240 copy-back scratch sized to the stretch none conflicts in shadow.rs; the zeroed 64 KiB scratch it removes is already gone from main since 8dd30ab
#783 sync_heaps skips pages whose bytes did not change none conflicts in descriptor.rs; its fingerprint part is in main since 9376fd6
#665 parallel card_merge_relay VICTORY_WIDE_MERGE=1 conflicts in host.rs (not measured)
#772 title memory opened in place, hot memory kept on the card VICTORY_INPLACE=3/4, VICTORY_INPLACE_POOL=1 conflicts in host.rs, lib.rs (not measured)
#824 guards, alias mapping, texture waits, relay copy-back several conflicts in host.rs, watch.rs (not measured)

#255, #448, #857 and #925 also apply to 465b94f as they are, #786 with the same local rebase. On today's d510ee4, #857 conflicts in shadow.rs (with ca8829f); #255, #448 and #925 still apply.

Results (0b0074e unless said)

Tree Runs ms/frame preparing ms (copies: ms, MB) GPU ms copying back Merge race: put back / both changed
base, start 2 255, 258 88–90 (47–49 ms, 160 MB) 132–137 208–209 ms, 63–64 MB 0 / 0
base, end 2 252, 254 88 (47 ms, 160 MB) 129–133 200–203 ms, 62–63 MB 0 / 0
#255 2 255, 256 88–89 128–138 202–214 ms 0 / 0
#448 2 256, 257 86–89 136–137 203–211 ms 0 / 0
#857 2 256, 258 90–92 133–135 209–210 ms 0 / 0
#925 2 259, 263 93 128–140 204–216 ms 0 / 0
#255 + #448 + #925 2 254, 255 90–91 129–130 199–202 ms 0 / 0
#786 (local rebase) 2 1,612, 2,192 122–126 1,321–1,850 1,558–2,121 ms, 38–42 MB 0 / 0
465b94f, default 1 256 90 (48 ms, 164 MB) 129 202 ms, 63 MB 0 / 0
465b94f, VICTORY_BACK_OWN_VIEW=1 VICTORY_JOIN_PARTS=1 1 211 78 (35 ms, 118 MB) 94 164 ms, 63 MB 0 / 0
  • Adds up: nothing measurable. #255, #448, #857 and #925, alone or with #255 + #448 + #925 together, stay inside the spread of the four base runs: 252–258 ms a frame, 200–209 ms copying back.
    • #857 changes the synchronous copy-back, which found 0 differing pieces in every frame of these runs (back_piece is not reached).
    • #925 changes merge_under_writes, which looked at about 150 pages and 300 changed runs a frame here, under 0.01 MB.
    • #255 and #448 are on the active path, but their cost is not the part that dominates here.
  • Costs: #786 rebased onto 0b0074e makes the frame 6–8 times slower. It writes every changed byte run with its own write_mapped call (write_changed_runs); the per-run write is what #857 joins runs to avoid. The calls were not counted.
    • The rebase is mine (three hunks: main added shaders_write and put_back_own where #786 rewrites the store), so the author may want to rebase it.
    • #786 together with #857 was not measured.
  • Conflicts: #857 and #925 with each other. #786, #240, #783, #665, #772 and #824 with 0b0074e.
  • Correctness: VICTORY_MERGE_RACE reported no title byte put back and no byte both changed in any run, no run lost the device or crashed, and the cell-window shot at +240 and +480 differs from a base run no more than two base runs differ from each other.
  • The new main: 465b94f in its default mode measures the same as 0b0074e. With its two opt-in switches the frame is about 18 % shorter (256 → 211 ms) and copying back about 19 % (202 → 164 ms); preparing copies fall from 164 to 118 MB and GPU time from 129 to 94 ms. That is in line with the 6 % and 9 % given for them in 3973179, and more than any of the pull requests above, alone or together.

Not measured: #1053 and #1058, opened after these runs, and ca8829f's VICTORY_COPY_CHANGED=1 (off by default).

Related: #1003 (Key-rs, RTX 4060 Laptop, 0b0074e) measures copy and copy-back at 2.4–5.6 ms/MB a frame with the GPU idle; not checked here.

**@⁠SantannaCarlos** on GitHub · 2026-11-25 18:11 UTC · [original](https://github.com/fxceless/victory-fork/issues/1064) Ten open pull requests change the copy-back or its neighbours. This measures the ones that apply to `0b0074e`, each alone and some combined, on one card. It also gives a base run on `465b94f`, with and without its opt-in switches. Only measured facts below. ## Setup - Windows 11 (build 26200), RTX 4070 12 GB, driver 32.0.16.2101, i7-14700KF, 32 GB. - Diagnostics builds; 9-minute runs from the same cell save, default mode, each in a fresh process. - Each tree has its own copy of one warm shader and pipeline cache. None of these pull requests changes the translator. - `VICTORY_MERGE_RACE=1` is on in every run, for the correctness column. It costs time: two earlier runs of the same `0b0074e` build without it measured 156–169 ms copying back and 97–100 GPU ms, against 200–209 and 129–137 for the base rows here. All rows below have it on. - Figures are medians of the frame lines after the first three minutes in the world. - Two builds ran on the same machine during the first two minutes of two runs (base, start, run 1; #925 run 2), before the part measured. In `0b0074e`'s default mode the late wait and the relay (stage 2) are on, so the copy-back runs on the relay's thread, through `relay_merge` and `card_merge_relay`. ## Which pull requests apply to 0b0074e | PR | What it changes | Switch | On 0b0074e | |---|---|---|---| | #255 | first/last changed byte searched 32 bytes at a time (used by `relay_merge` and `card_merge_relay`) | none | applies | | #448 | relay flight ranges indexed in a `BTreeMap` | none | applies | | #857 | runs closer than 64 bytes written as one (`back_piece`, the synchronous copy-back) | `VICTORY_BACK_RUN_GAP`, 64 | applies; conflicts with #925 | | #925 | run vectors reused in `merge_under_writes` | none | applies; conflicts with #857 | | #786 | only the card's changed byte runs written back in `relay_merge`, `card_merge`, `card_merge_relay` | none | conflicts in `shadow.rs` (three hunks); rebased locally for this measure only | | #240 | copy-back scratch sized to the stretch | none | conflicts in `shadow.rs`; the zeroed 64 KiB scratch it removes is already gone from main since `8dd30ab` | | #783 | `sync_heaps` skips pages whose bytes did not change | none | conflicts in `descriptor.rs`; its fingerprint part is in main since `9376fd6` | | #665 | parallel `card_merge_relay` | `VICTORY_WIDE_MERGE=1` | conflicts in `host.rs` (not measured) | | #772 | title memory opened in place, hot memory kept on the card | `VICTORY_INPLACE=3/4`, `VICTORY_INPLACE_POOL=1` | conflicts in `host.rs`, `lib.rs` (not measured) | | #824 | guards, alias mapping, texture waits, relay copy-back | several | conflicts in `host.rs`, `watch.rs` (not measured) | #255, #448, #857 and #925 also apply to `465b94f` as they are, #786 with the same local rebase. On today's `d510ee4`, #857 conflicts in `shadow.rs` (with `ca8829f`); #255, #448 and #925 still apply. ## Results (0b0074e unless said) | Tree | Runs | ms/frame | preparing ms (copies: ms, MB) | GPU ms | copying back | Merge race: put back / both changed | |---|---:|---|---|---|---|---| | base, start | 2 | 255, 258 | 88–90 (47–49 ms, 160 MB) | 132–137 | 208–209 ms, 63–64 MB | 0 / 0 | | base, end | 2 | 252, 254 | 88 (47 ms, 160 MB) | 129–133 | 200–203 ms, 62–63 MB | 0 / 0 | | #255 | 2 | 255, 256 | 88–89 | 128–138 | 202–214 ms | 0 / 0 | | #448 | 2 | 256, 257 | 86–89 | 136–137 | 203–211 ms | 0 / 0 | | #857 | 2 | 256, 258 | 90–92 | 133–135 | 209–210 ms | 0 / 0 | | #925 | 2 | 259, 263 | 93 | 128–140 | 204–216 ms | 0 / 0 | | #255 + #448 + #925 | 2 | 254, 255 | 90–91 | 129–130 | 199–202 ms | 0 / 0 | | #786 (local rebase) | 2 | **1,612, 2,192** | 122–126 | 1,321–1,850 | **1,558–2,121 ms, 38–42 MB** | 0 / 0 | | `465b94f`, default | 1 | 256 | 90 (48 ms, 164 MB) | 129 | 202 ms, 63 MB | 0 / 0 | | `465b94f`, `VICTORY_BACK_OWN_VIEW=1 VICTORY_JOIN_PARTS=1` | 1 | **211** | 78 (35 ms, 118 MB) | 94 | **164 ms**, 63 MB | 0 / 0 | - **Adds up:** nothing measurable. #255, #448, #857 and #925, alone or with #255 + #448 + #925 together, stay inside the spread of the four base runs: 252–258 ms a frame, 200–209 ms copying back. - #857 changes the synchronous copy-back, which found 0 differing pieces in every frame of these runs (`back_piece` is not reached). - #925 changes `merge_under_writes`, which looked at about 150 pages and 300 changed runs a frame here, under 0.01 MB. - #255 and #448 are on the active path, but their cost is not the part that dominates here. - **Costs:** #786 rebased onto `0b0074e` makes the frame 6–8 times slower. It writes every changed byte run with its own `write_mapped` call (`write_changed_runs`); the per-run write is what #857 joins runs to avoid. The calls were not counted. - The rebase is mine (three hunks: main added `shaders_write` and `put_back_own` where #786 rewrites the store), so the author may want to rebase it. - #786 together with #857 was not measured. - **Conflicts:** #857 and #925 with each other. #786, #240, #783, #665, #772 and #824 with `0b0074e`. - **Correctness:** `VICTORY_MERGE_RACE` reported no title byte put back and no byte both changed in any run, no run lost the device or crashed, and the cell-window shot at +240 and +480 differs from a base run no more than two base runs differ from each other. - **The new main:** `465b94f` in its default mode measures the same as `0b0074e`. With its two opt-in switches the frame is about 18 % shorter (256 → 211 ms) and copying back about 19 % (202 → 164 ms); preparing copies fall from 164 to 118 MB and GPU time from 129 to 94 ms. That is in line with the 6 % and 9 % given for them in `3973179`, and more than any of the pull requests above, alone or together. Not measured: #1053 and #1058, opened after these runs, and `ca8829f`'s `VICTORY_COPY_CHANGED=1` (off by default). Related: #1003 (Key-rs, RTX 4060 Laptop, `0b0074e`) measures copy and copy-back at 2.4–5.6 ms/MB a frame with the GPU idle; not checked here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:55 +00:00
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#1064
No description provided.