GPU: the skipped host copies are counted, and the last tracker of twin mappings opens both #2134

Open
r4tedx wants to merge 3 commits from upstream-pr/2136 into main
r4tedx commented 2026-11-25 05:49:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T05:49:51Z.


Scope changed with the merge of main 63bcca43 (adf58010). main now skips a host copy nothing wrote on its own (19533398f, Shadow::clean), and has two of the three watch.rs alias fixes this PR carried (136e39d09, 384b0c0b9). What is left against main is two small things:

1. The skipped counters count again

main's copies per frame line prints skipped, but nothing on main increments C::Skipped or C::SkippedBytes, so a run on main always shows 0 skipped even though Batch::add returns early for every clean copy. This PR counts each early return (diagnostics only) and adds the test a_copy_nothing_wrote_is_not_asked_for (host.rs, mod batch), which checks that a clean copy is left out and that a guarded write or a reported write brings back only the page written.

2. The last tracker of twin mappings opens both

Tracked::drop on main keeps mapping a guarded while another mapping b of the same memory still has a tracker. When b's tracker then goes, only b is opened, and a stays in the guard set with no holder. That breaks the rule that the guard set never names memory that was freed and allocated again. The fix makes drop also consider the other mappings of each page it frees, and opens each one that nobody holds on any mapping. open already does nothing for a page that is not guarded. Test: the_last_tracker_of_twin_mappings_opens_both (watch.rs). The test was not run against main.

Diff against main: host.rs +46, watch.rs +33/−6.

Checked (synthetic only, no title data)

On adf58010, Windows 11, WARP, one test thread:

  • cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 248 passed, 0 failed, 1 ignored.
  • cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

The earlier preparing-time figures in this PR's history (225.1 → 100.8 ms in the #2134 benchmark, and the in-game counters) measured the skip that main now has. They no longer describe what this PR changes against main.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6598150689 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T05:49:51Z. --- **Scope changed with the merge of `main` `63bcca43` (`adf58010`).** `main` now skips a host copy nothing wrote on its own (19533398f, `Shadow::clean`), and has two of the three `watch.rs` alias fixes this PR carried (136e39d09, 384b0c0b9). What is left against `main` is two small things: ## 1. The `skipped` counters count again `main`'s `copies per frame` line prints `skipped`, but nothing on `main` increments `C::Skipped` or `C::SkippedBytes`, so a run on `main` always shows 0 skipped even though `Batch::add` returns early for every clean copy. This PR counts each early return (`diagnostics` only) and adds the test `a_copy_nothing_wrote_is_not_asked_for` (`host.rs`, `mod batch`), which checks that a clean copy is left out and that a guarded write or a reported write brings back only the page written. ## 2. The last tracker of twin mappings opens both `Tracked::drop` on `main` keeps mapping `a` guarded while another mapping `b` of the same memory still has a tracker. When `b`'s tracker then goes, only `b` is opened, and `a` stays in the guard set with no holder. That breaks the rule that the guard set never names memory that was freed and allocated again. The fix makes `drop` also consider the other mappings of each page it frees, and opens each one that nobody holds on any mapping. `open` already does nothing for a page that is not guarded. Test: `the_last_tracker_of_twin_mappings_opens_both` (`watch.rs`). The test was not run against `main`. Diff against `main`: `host.rs` +46, `watch.rs` +33/−6. ## Checked (synthetic only, no title data) On `adf58010`, Windows 11, WARP, one test thread: - `cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1`: 248 passed, 0 failed, 1 ignored. - `cargo clippy --locked -p victory-gpu --features diagnostics --all-targets -- -D warnings`: clean. - `cargo xtask policy`: 191 files ok. The earlier preparing-time figures in this PR's history (225.1 → 100.8 ms in the #2134 benchmark, and the in-game counters) measured the skip that `main` now has. They no longer describe what this PR changes against `main`. AI-assisted.
DenRakEiw commented 2026-11-25 07:02:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T06:02:52Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib a_copy_nothing_wrote_is_not_asked_for — passed on RTX 5090
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean unchanged() fast-path skipping submission refresh copies when nothing wrote to the tracked range. Looks great.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6052604155 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#pullrequestreview-6052604155). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T06:02:52Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib a_copy_nothing_wrote_is_not_asked_for` — passed on RTX 5090 - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean `unchanged()` fast-path skipping submission refresh copies when nothing wrote to the tracked range. Looks great. AI-assisted (Gemini 4 Neon).
catminou4 commented 2026-11-25 07:02:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T06:33:02Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Host copies nothing wrote not requested at submission — avoids redundant copies; check the dirty-tracking covers all write paths (#1963's write-scope tracking related).

<!-- greyfinch-sync:Marvisak/VIctory:review:6052888350 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#pullrequestreview-6052888350). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T06:33:02Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Host copies nothing wrote not requested at submission — avoids redundant copies; check the dirty-tracking covers all write paths (#1963's write-scope tracking related).
yualk commented 2026-11-25 07:03:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by yualk on 2026-11-25T06:13:39Z.


Independent locked MSVC diag comparison of 940d32f69 vs 937f329a4 on Windows / RTX 5070 Ti 10de:2c05 and WARP 1414:008c. An owned production Host::execute control records actual GPU buffer-to-readback copies: cold partial + later full refresh, untouched, watched CPU store, ordered deferred title copy followed by refresh, and rearmed CPU store all return the exact expected words on both pins and both adapters; the independent same-shaped decoy is unchanged. In the untouched arm the two watches drop to zero with two skips.

With the exact #2134 workload and the same test-only counters in both trees, 2 warm-up + 5 scored frames/process in A–B–B–A order: RTX paired preparing medians 147.6→51.1 ms and 123.6→46.2 ms; explicit WARP 129.2→55.5 and 133.7→53.4 ms. Median checks 274,094→1,325 in both adapters. At each scored frame the checked-minus-unchanged bytes, requested bytes/count, guard/protect/open counts, snapshot bytes, marked pages/returned bytes, and title-copy count were equal. Same-pin RTX drift was visible, so these are directional synthetic results, not a precise speedup estimate or gameplay FPS. No title, textures, real shader workload or title threads writing concurrently with preparation in this replay.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154573111 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7154573111). Originally posted by [yualk](https://github.com/yualk) on 2026-11-25T06:13:39Z. --- Independent locked MSVC `diag` comparison of `940d32f69` vs `937f329a4` on Windows / RTX 5070 Ti `10de:2c05` and WARP `1414:008c`. An owned production `Host::execute` control records actual GPU buffer-to-readback copies: cold partial + later full refresh, untouched, watched CPU store, ordered deferred title copy followed by refresh, and rearmed CPU store all return the exact expected words on both pins and both adapters; the independent same-shaped decoy is unchanged. In the untouched arm the two watches drop to zero with two skips. With the exact #2134 workload and the same test-only counters in both trees, 2 warm-up + 5 scored frames/process in A–B–B–A order: RTX paired preparing medians **147.6→51.1 ms** and **123.6→46.2 ms**; explicit WARP **129.2→55.5** and **133.7→53.4 ms**. Median checks **274,094→1,325** in both adapters. At each scored frame the checked-minus-unchanged bytes, requested bytes/count, guard/protect/open counts, snapshot bytes, marked pages/returned bytes, and title-copy count were equal. Same-pin RTX drift was visible, so these are directional synthetic results, not a precise speedup estimate or gameplay FPS. No title, textures, real shader workload or title threads writing concurrently with preparation in this replay.
r4tedx commented 2026-11-25 07:03:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T06:35:02Z.


@catminou4 on whether the tracking covers every write path: the skip reads the same thing the refresh read. Tracked::unchanged is the size of the very set Tracked::take takes its pages from, kept under that set's lock, so a copy is left out exactly when its refresh would have found no page to copy. A write the trackers do not see (one that neither faults into the guard handler nor is reported through writing / title_memory_remapped) was not copied before this change either; this PR neither widens nor narrows that. Memory that is not tracked is never skipped.

#1963 is the other direction (what shaders wrote going back into title memory); it does not change which title writes a refresh sees.

Thanks to @yualk for the independent run above: its read-back control (cold, untouched, a watched CPU store, a title copy followed by a refresh, a re-armed store returning the expected words on both builds) is a check I did not have, and its counters match mine (274,094 → 1,325 checks, everything else equal).

Nothing new was run for this comment. The title was not used in these tests.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154942933 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7154942933). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T06:35:02Z. --- @catminou4 on whether the tracking covers every write path: the skip reads the same thing the refresh read. `Tracked::unchanged` is the size of the very set `Tracked::take` takes its pages from, kept under that set's lock, so a copy is left out exactly when its refresh would have found no page to copy. A write the trackers do not see (one that neither faults into the guard handler nor is reported through `writing` / `title_memory_remapped`) was not copied before this change either; this PR neither widens nor narrows that. Memory that is not tracked is never skipped. #1963 is the other direction (what shaders wrote going back into title memory); it does not change which title writes a refresh sees. Thanks to @yualk for the independent run above: its read-back control (cold, untouched, a watched CPU store, a title copy followed by a refresh, a re-armed store returning the expected words on both builds) is a check I did not have, and its counters match mine (274,094 → 1,325 checks, everything else equal). Nothing new was run for this comment. The title was not used in these tests. AI-assisted
nathanbzrr commented 2026-11-25 09:06:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by nathanbzrr on 2026-11-25T08:40:45Z.


Verified head 937f329a4987918f38890ff9fe010c40710e6437 merged with #2134 (efb35b56) onto main (940d32f69b) on Windows 11 x64 / AMD Radeon RX 7600:

Hardware Benchmark (world_frame_preparing, 2 trials/config)

Variant preparing, ms (T1 / T2) copying back, ms (T1 / T2) change checks checked, MB changed (copied), MB Unchanged check (batch)
940d32f + #2134 (RX 7600) 244.1 / 227.2 181.9 / 173.3 274,094 102,722.0 159.1 437 ns
940d32f + #2134 + #2136 (RX 7600) 126.9 / 108.8 208.4 / 179.7 1,325 3,510.1 159.1 9–10 ns
940d32f + #2134 + #2136 + #2147 (RX 7600) 125.5 / 112.1 304.7 / 285.1 1,325 3,510.1 159.1 9 ns
940d32f + #2134 + #2136 + #2147 (WARP) 104.2 240.9 1,325 3,510.1 159.1 10 ns

All 145 victory-gpu lib tests pass (--test-threads=1). PR #2136's own AtomicUsize count + RAII Drop update is sound (Pages::drop updates AtomicUsize with Release while MutexGuard is still held).

Pre-Existing watch.rs Alias Bugs Exposed / Amplified by unchanged()

Two live synthetic repros against 940d32f + #2136 fail as predicted:

  1. Tracked::drop strips PAGE_READONLY from live sibling aliases (watch.rs:255-275): Dropping tracker ta over view a sees empty holders[a] and opens a to PAGE_READWRITE, ignoring live alias tracker tb over b. Writes via a stop faulting -> tb.unchanged() == true and tb.take(b) == [] (repro dropping_one_alias_tracker_keeps_live_alias_guarded panicked).
  2. writing(a) vs tb.take(b) marks b clean (watch.rs:199-202, 323-335): guard_aliases ignores protect failure when a is busy, and tb.take(b) still clears b -> tb.changed(b/PAGE) == false and tb.unchanged() == true while a stays unguarded (repro taking_alias_while_other_mapping_is_busy_keeps_page_changed panicked).
  3. (Source-level) changed_here (watch.rs:480-492) calls open() (PAGE_READWRITE) before c.pages().insert(page) (which updates Changed.2) and c.save(page), leaving a concurrency window where another CPU thread writes without faulting while unchanged() reads 0.

(Proposed / uncompiled fix direction:) keep a guarded in Tracked::drop whenever any alias still has holders; propagate protect success from aliases to Changed; mark dirty & save before open() in changed_here.

AI-assisted; synthetic tests only, no game files, dumps, or captures used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157335406 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7157335406). Originally posted by [nathanbzrr](https://github.com/nathanbzrr) on 2026-11-25T08:40:45Z. --- Verified head `937f329a4987918f38890ff9fe010c40710e6437` merged with #2134 (`efb35b56`) onto `main` (`940d32f69b`) on Windows 11 x64 / **AMD Radeon RX 7600**: ### Hardware Benchmark (`world_frame_preparing`, 2 trials/config) | Variant | `preparing, ms` (T1 / T2) | `copying back, ms` (T1 / T2) | `change checks` | `checked, MB` | `changed (copied), MB` | Unchanged check (batch) | |---|---:|---:|---:|---:|---:|---:| | `940d32f + #2134` (RX 7600) | 244.1 / 227.2 | 181.9 / 173.3 | 274,094 | 102,722.0 | 159.1 | 437 ns | | **`940d32f + #2134 + #2136` (RX 7600)** | **126.9 / 108.8** | 208.4 / 179.7 | **1,325** | **3,510.1** | 159.1 | **9–10 ns** | | `940d32f + #2134 + #2136 + #2147` (RX 7600) | 125.5 / 112.1 | 304.7 / 285.1 | 1,325 | 3,510.1 | 159.1 | 9 ns | | `940d32f + #2134 + #2136 + #2147` (WARP) | 104.2 | 240.9 | 1,325 | 3,510.1 | 159.1 | 10 ns | All 145 `victory-gpu` lib tests pass (`--test-threads=1`). PR #2136's own `AtomicUsize` count + RAII `Drop` update is sound (`Pages::drop` updates `AtomicUsize` with `Release` while `MutexGuard` is still held). ### Pre-Existing `watch.rs` Alias Bugs Exposed / Amplified by `unchanged()` Two live synthetic repros against `940d32f + #2136` fail as predicted: 1. **`Tracked::drop` strips `PAGE_READONLY` from live sibling aliases (`watch.rs:255-275`):** Dropping tracker `ta` over view `a` sees empty `holders[a]` and opens `a` to `PAGE_READWRITE`, ignoring live alias tracker `tb` over `b`. Writes via `a` stop faulting -> **`tb.unchanged() == true` and `tb.take(b) == []`** (repro `dropping_one_alias_tracker_keeps_live_alias_guarded` panicked). 2. **`writing(a)` vs `tb.take(b)` marks `b` clean (`watch.rs:199-202, 323-335`):** `guard_aliases` ignores `protect` failure when `a` is `busy`, and `tb.take(b)` still clears `b` -> **`tb.changed(b/PAGE) == false` and `tb.unchanged() == true`** while `a` stays unguarded (repro `taking_alias_while_other_mapping_is_busy_keeps_page_changed` panicked). 3. *(Source-level)* **`changed_here` (`watch.rs:480-492`) calls `open()` (`PAGE_READWRITE`) *before* `c.pages().insert(page)` (which updates `Changed.2`) and `c.save(page)`**, leaving a concurrency window where another CPU thread writes without faulting while `unchanged()` reads `0`. *(Proposed / uncompiled fix direction:)* keep `a` guarded in `Tracked::drop` whenever any alias still has holders; propagate `protect` success from aliases to `Changed`; mark dirty & save before `open()` in `changed_here`. AI-assisted; synthetic tests only, no game files, dumps, or captures used.
r4tedx commented 2026-11-25 09:06:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T09:02:39Z.


@nathanbzrr thank you, all three findings hold. Pushed as f85763e0 on top of 937f329 (fast-forward, no rebase). Only crates/victory-gpu/src/watch.rs changes.

Bugs 1 and 2 are already on main 940d32f. #2136's unchanged() makes them easier to see but did not cause them. On 940d32f, with only the unchanged() asserts removed, both of your repros still fail at tb.changed(b / PAGE).

  1. Tracked::drop: a page is opened only when no tracker holds it on its own mapping or on any other mapping of the same memory. When the last tracker is gone, all the mappings are opened.
  2. guard_aliases: it now returns the pages whose other mapping could not be guarded (busy, or protect failed). take() and taken() leave those pages changed, as they already did for a busy page on the tracker's own mapping.
  3. changed(): every tracker, including trackers of the other mappings, is marked and its bytes are saved while the pages are still read-only. Only then are the pages opened. The marking moved into a new helper mark(), which replaces changed_here. Lock order is unchanged.

Both of your repros are now tests (dropping_one_alias_tracker_keeps_live_alias_guarded, which also checks that both mappings are opened at the end, and taking_alias_while_other_mapping_is_busy_keeps_page_changed). They fail on 937f329 and pass on f85763e0. There is no test for the ordering in 3, because a single-threaded test can't hit that race.

Verified:

  • cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1 on WARP: 150 passed, 0 failed, 2 ignored.
  • Clippy on victory-gpu, all targets: no warnings.
  • A separate review of the diff found no deadlock, no page left guarded without a holder, and no page opened while a tracker still needs it.

Still open, not new in this PR: alias links are one hop only. A third mapping linked only to a would not be marked by a write through b. This assumes the runtime reports every other mapping, which is what it does today.

AI-assisted; synthetic tests only, no game files, dumps, or captures used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7157797942 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7157797942). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T09:02:39Z. --- @nathanbzrr thank you, all three findings hold. Pushed as `f85763e0` on top of `937f329` (fast-forward, no rebase). Only `crates/victory-gpu/src/watch.rs` changes. **Bugs 1 and 2 are already on `main` 940d32f.** #2136's `unchanged()` makes them easier to see but did not cause them. On 940d32f, with only the `unchanged()` asserts removed, both of your repros still fail at `tb.changed(b / PAGE)`. 1. **`Tracked::drop`:** a page is opened only when no tracker holds it on its own mapping or on any other mapping of the same memory. When the last tracker is gone, all the mappings are opened. 2. **`guard_aliases`:** it now returns the pages whose other mapping could not be guarded (busy, or protect failed). `take()` and `taken()` leave those pages changed, as they already did for a busy page on the tracker's own mapping. 3. **`changed()`:** every tracker, including trackers of the other mappings, is marked and its bytes are saved while the pages are still read-only. Only then are the pages opened. The marking moved into a new helper `mark()`, which replaces `changed_here`. Lock order is unchanged. Both of your repros are now tests (`dropping_one_alias_tracker_keeps_live_alias_guarded`, which also checks that both mappings are opened at the end, and `taking_alias_while_other_mapping_is_busy_keeps_page_changed`). They fail on 937f329 and pass on f85763e0. There is no test for the ordering in 3, because a single-threaded test can't hit that race. Verified: - `cargo test -p victory-gpu --features diagnostics --lib -- --test-threads=1` on WARP: 150 passed, 0 failed, 2 ignored. - Clippy on victory-gpu, all targets: no warnings. - A separate review of the diff found no deadlock, no page left guarded without a holder, and no page opened while a tracker still needs it. Still open, not new in this PR: alias links are one hop only. A third mapping linked only to `a` would not be marked by a write through `b`. This assumes the runtime reports every other mapping, which is what it does today. AI-assisted; synthetic tests only, no game files, dumps, or captures used.
r4tedx commented 2026-11-25 10:07:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-25T09:59:02Z.


In-game counters from one PC: RTX 5070 (driver 616.92), Ryzen 7 7800X3D (max processor state 99 %), Windows 11, diagnostics builds, VICTORY_LOG=info VICTORY_D3D12_DRED=1. The title was run locally from my own copy. Only counts and timings are given here; no logs or title data are shared.

This is not a same-frame A/B:

  • Before: main 940d32f + #1763 (needed to boot on NVIDIA).
  • After: an integration build carrying this PR's head f85763e0 together with about 25 other PRs, among them #2147 f2ca0868, #1819, #2118 and the wave64 stack.

The scenes are different moments of the opening. Only the counters this PR controls mean much; the frame times can't be attributed to it.

copies per frame:, a late world frame of each run:

before after, run A after, run B
refreshes skipped 0 281,414 (163,786 MB) 404,892
watches 129,062 (36.3 ms) 2,689 (11.6 ms) 4,474 (18.2 ms)
MB checked (unchanged) 48,020 (47,703) 4,229 (4,122) 4,860
refreshes made 4,730 (6,246 MB) 10,084 (12,192 MB) 27,767 (18,299 MB)
page faults 108,501 9,842 830
  • Skips and checks: as the PR intends, unchanged host copies are skipped in large numbers (0 on main), and watch work and MB checked fall by about 10-50x.
  • Refreshes made went up in both "after" runs, along with the draw count (about 1,000-1,900 before, 2,100-4,300 after). I can't separate the scene from the build there.
  • Preparing, as the whole build's frame line reports it: 300-700 ms before, 74-270 ms after.

AI-assisted

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159064836 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7159064836). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-25T09:59:02Z. --- In-game counters from one PC: RTX 5070 (driver 616.92), Ryzen 7 7800X3D (max processor state 99 %), Windows 11, diagnostics builds, `VICTORY_LOG=info VICTORY_D3D12_DRED=1`. The title was run locally from my own copy. Only counts and timings are given here; no logs or title data are shared. This is **not a same-frame A/B**: - **Before:** `main` `940d32f` + #1763 (needed to boot on NVIDIA). - **After:** an integration build carrying this PR's head `f85763e0` together with about 25 other PRs, among them #2147 `f2ca0868`, #1819, #2118 and the wave64 stack. The scenes are different moments of the opening. Only the counters this PR controls mean much; the frame times can't be attributed to it. `copies per frame:`, a late world frame of each run: | | before | after, run A | after, run B | |---|---|---|---| | refreshes skipped | 0 | 281,414 (163,786 MB) | 404,892 | | watches | 129,062 (36.3 ms) | 2,689 (11.6 ms) | 4,474 (18.2 ms) | | MB checked (unchanged) | 48,020 (47,703) | 4,229 (4,122) | 4,860 | | refreshes made | 4,730 (6,246 MB) | 10,084 (12,192 MB) | 27,767 (18,299 MB) | | page faults | 108,501 | 9,842 | 830 | - **Skips and checks:** as the PR intends, unchanged host copies are skipped in large numbers (0 on `main`), and watch work and MB checked fall by about 10-50x. - **Refreshes made went up** in both "after" runs, along with the draw count (about 1,000-1,900 before, 2,100-4,300 after). I can't separate the scene from the build there. - **Preparing**, as the whole build's frame line reports it: 300-700 ms before, 74-270 ms after. AI-assisted
Marvisak commented 2026-11-25 11:05:37 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:50:41Z.


Automated triage for the maintainers.

This pull request no longer merges cleanly into main (conflicts in crates/victory-gpu/src/host.rs, crates/victory-gpu/src/shadow.rs, crates/victory-gpu/src/watch.rs). It will be reviewed once it is rebased onto the current main. The earlier verdict (merge-candidate) was for an older state of main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7160248165 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7160248165). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:50:41Z. --- <!-- victory-triage v1 head=f85763e003e1065a1336bf1959c2281062b965c6 verdict=needs-rebase at=2026-11-25T16:04:00Z --> Automated triage for the maintainers. This pull request no longer merges cleanly into `main` (conflicts in `crates/victory-gpu/src/host.rs`, `crates/victory-gpu/src/shadow.rs`, `crates/victory-gpu/src/watch.rs`). It will be reviewed once it is rebased onto the current `main`. The earlier verdict (merge-candidate) was for an older state of `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync changed title from [PR #2136] GPU: a host copy nothing wrote is not asked for at submission to [PR #2136] GPU: the skipped host copies are counted, and the last tracker of twin mappings opens both 2026-11-26 11:03:17 +00:00
r4tedx commented 2026-11-26 11:03:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by r4tedx on 2026-11-26T10:18:16Z.


Merged main 63bcca43 in as adf58010, pushed as a fast-forward with no rebase or force-push. That answers the needs-rebase triage.

Conflicts in shadow.rs, host.rs and watch.rs were resolved in favour of main. main already skips host copies nothing wrote (19533398f), so this PR's own skip and Shadow::unchanged are gone. The two alias fixes main already has (136e39d09, 384b0c0b9) were dropped too. Left against main: the skipped counters, which main prints but never increments, and Tracked::drop opening both twin mappings once neither has a tracker. Each has a test. I rewrote the title and description to match.

Checked on WARP, Windows 11, one test thread: victory-gpu --features diagnostics --lib 248 passed, 0 failed, 1 ignored; clippy -D warnings clean; cargo xtask policy 191 files ok. Synthetic tests only, no title data.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7189185889 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2136#issuecomment-7189185889). Originally posted by [r4tedx](https://github.com/r4tedx) on 2026-11-26T10:18:16Z. --- Merged `main` `63bcca43` in as `adf58010`, pushed as a fast-forward with no rebase or force-push. That answers the needs-rebase triage. Conflicts in `shadow.rs`, `host.rs` and `watch.rs` were resolved in favour of `main`. `main` already skips host copies nothing wrote (19533398f), so this PR's own skip and `Shadow::unchanged` are gone. The two alias fixes `main` already has (136e39d09, 384b0c0b9) were dropped too. Left against `main`: the `skipped` counters, which `main` prints but never increments, and `Tracked::drop` opening both twin mappings once neither has a tracker. Each has a test. I rewrote the title and description to match. Checked on WARP, Windows 11, one test thread: victory-gpu `--features diagnostics --lib` 248 passed, 0 failed, 1 ignored; clippy `-D warnings` clean; `cargo xtask policy` 191 files ok. Synthetic tests only, no title data. AI-assisted.
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/2136:upstream-pr/2136'
git switch 'upstream-pr/2136'

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 'main'
git merge --no-ff 'upstream-pr/2136'
git switch 'upstream-pr/2136'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2136'
git switch 'upstream-pr/2136'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2136'
git switch 'main'
git merge --squash 'upstream-pr/2136'
git switch 'main'
git merge --ff-only 'upstream-pr/2136'
git switch 'main'
git merge 'upstream-pr/2136'
git push origin 'main'
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
Marvisak/VIctory!2134
No description provided.