GPU: preserve disjoint shadow refresh ranges #1816

Open
aycow wants to merge 6 commits from upstream-pr/1818 into main
aycow commented 2026-11-24 22:58:50 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by aycow on 2026-11-24T22:58:50Z.


What changed

Keep the union of requested refresh ranges through the pending and completed parts of a submission batch. The previous bounding range copied 192 KiB for two 64 KiB requests and consumed the dirty page in the gap before its reader. The fixture now copies 128 KiB for the two requests and 64 KiB when the gap is requested later. The common one-range case retains inline storage.

Thanks to @pablogonz12 for the original reproduction in #185. This carries the narrow range correction onto the current unified journal. It preserves the ranges supplied to the batch. Callers that pass a bounding range still request all of it. #1472 changes when the batch flushes around a GPU write. This PR retains the requested ranges without altering those flush points. Original report · Related flush work

Verification

All four disjoint refresh regressions passed on AMD Radeon Graphics and WARP at 4a191d8 with native device creation required. The cases cover the gap's later reader, repeated reads after a physical alias write, decommit and remap at the same address, and partial refreshes of declared UAV writes. The last case exercises #1322's preparation contract and confirms copyback preserves a later CPU write to a neighboring byte. Strict diagnostics Clippy passed. The updated fixture also verifies that zeroing an unmapped page leaves the copied-byte count at zero.

$env:VICTORY_TEST_SHADOW_DISJOINT_REQUIRE_GPU = '1'
cargo test -p victory-gpu --features diagnostics --locked --lib disjoint -- --nocapture --test-threads=1
$env:VICTORY_D3D12_WARP = '1'
cargo test -p victory-gpu --features diagnostics --locked --lib disjoint -- --nocapture --test-threads=1

The copied-byte results are from the synthetic fixture. Title preparation and frame-time effects remain unverified.

AI-assisted using Codex. Generated test data only.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6593109747 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818). Originally posted by [aycow](https://github.com/aycow) on 2026-11-24T22:58:50Z. --- ## What changed Keep the union of requested refresh ranges through the pending and completed parts of a submission batch. The previous bounding range copied 192 KiB for two 64 KiB requests and consumed the dirty page in the gap before its reader. The fixture now copies 128 KiB for the two requests and 64 KiB when the gap is requested later. The common one-range case retains inline storage. Thanks to @pablogonz12 for the original reproduction in #185. This carries the narrow range correction onto the current unified journal. It preserves the ranges supplied to the batch. Callers that pass a bounding range still request all of it. #1472 changes when the batch flushes around a GPU write. This PR retains the requested ranges without altering those flush points. [Original report](https://github.com/Marvisak/VIctory/pull/185#issuecomment-7138450289) · [Related flush work](https://github.com/Marvisak/VIctory/pull/1472) ## Verification All four disjoint refresh regressions passed on AMD Radeon Graphics and WARP at `4a191d8` with native device creation required. The cases cover the gap's later reader, repeated reads after a physical alias write, decommit and remap at the same address, and partial refreshes of declared UAV writes. The last case exercises #1322's preparation contract and confirms copyback preserves a later CPU write to a neighboring byte. Strict diagnostics Clippy passed. The updated fixture also verifies that zeroing an unmapped page leaves the copied-byte count at zero. ```powershell $env:VICTORY_TEST_SHADOW_DISJOINT_REQUIRE_GPU = '1' cargo test -p victory-gpu --features diagnostics --locked --lib disjoint -- --nocapture --test-threads=1 $env:VICTORY_D3D12_WARP = '1' cargo test -p victory-gpu --features diagnostics --locked --lib disjoint -- --nocapture --test-threads=1 ``` The copied-byte results are from the synthetic fixture. Title preparation and frame-time effects remain unverified. AI-assisted using Codex. Generated test data only.
catminou4 commented 2026-11-24 23:05:39 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T23:03:28Z.

Review: COMMENTED


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

Disjoint shadow refresh ranges preserved: 18K gpu diff on shadow/refresh range tracking. Windows-only.

<!-- greyfinch-sync:Marvisak/VIctory:review:6048801977 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6048801977). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T23:03:28Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Disjoint shadow refresh ranges preserved: 18K gpu diff on shadow/refresh range tracking. Windows-only.
Melow-code commented 2026-11-25 00:06:15 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-24T23:08:03Z.

Review: COMMENTED


Union logic is correct — half-open ranges, dedup_by in the right order, covers only called after merge. Two disjoint ranges in one page are safe because Tracked::take keeps a partly-copied page as changed.

Two points before merge:

  1. Each disjoint range is now a separate update() call with its own locks. A frame-time measurement from a world scene would show if this matters.
  2. PR #1555 also changes how refreshes combine (joining nearby ones). The two change the same code — only one approach should land.
<!-- greyfinch-sync:Marvisak/VIctory:review:6048848323 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6048848323). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-24T23:08:03Z. **Review:** COMMENTED --- Union logic is correct — half-open ranges, dedup_by in the right order, covers only called after merge. Two disjoint ranges in one page are safe because Tracked::take keeps a partly-copied page as changed. Two points before merge: 1. Each disjoint range is now a separate update() call with its own locks. A frame-time measurement from a world scene would show if this matters. 2. PR #1555 also changes how refreshes combine (joining nearby ones). The two change the same code — only one approach should land.
aycow commented 2026-11-25 00:06:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by aycow on 2026-11-24T23:22:12Z.


@ruipedro-pinheiro Agreed on comparing the per-range cost in a matched world run. Each disjoint span does call Shadow::update separately. The synthetic case confirms the copy-volume change from 192 KiB to 128 KiB and preserves the gap's dirty page for its later reader. It leaves world frame time unverified.

I checked @Texbirds’ #1555 at 9fb81e1. It joins gaps of up to and including 64 KiB, so it would join the exact dirty 64 KiB gap in this fixture. #1818 merges touching ranges and leaves that gap for its reader. These are alternative policies in the same batch code. I agree that we should pick one after comparing both.

@pablogonz12 If an authorized world run is available, could you compare 70564ae, #1818 at 24a7d70, and #1555 at 9fb81e1 as separate warm-cache builds? Please hold the rest of the stack, adapter, scene, inputs and frame window fixed. Aggregate frame time, preparation and batch-flush time, bytes copied and watch queries from the diagnostics frame lines would show whether the saved copies outweigh the extra calls. Draw and submission counts help check that the windows match. Review · #1555

AI-assisted using Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147321169 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7147321169). Originally posted by [aycow](https://github.com/aycow) on 2026-11-24T23:22:12Z. --- @ruipedro-pinheiro Agreed on comparing the per-range cost in a matched world run. Each disjoint span does call `Shadow::update` separately. The synthetic case confirms the copy-volume change from 192 KiB to 128 KiB and preserves the gap's dirty page for its later reader. It leaves world frame time unverified. I checked @Texbirds’ #1555 at `9fb81e1`. It joins gaps of up to and including 64 KiB, so it would join the exact dirty 64 KiB gap in this fixture. #1818 merges touching ranges and leaves that gap for its reader. These are alternative policies in the same batch code. I agree that we should pick one after comparing both. @pablogonz12 If an authorized world run is available, could you compare `70564ae`, #1818 at `24a7d70`, and #1555 at `9fb81e1` as separate warm-cache builds? Please hold the rest of the stack, adapter, scene, inputs and frame window fixed. Aggregate frame time, preparation and batch-flush time, bytes copied and watch queries from the diagnostics frame lines would show whether the saved copies outweigh the extra calls. Draw and submission counts help check that the windows match. [Review](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6048848323) · [#1555](https://github.com/Marvisak/VIctory/pull/1555) AI-assisted using Codex.
pablogonz12 commented 2026-11-25 00:06:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-24T23:31:49Z.


Noted. A matched warm-cache world A/B of 70564ae, #1818 at 24a7d70 and #1555 at 9fb81e1, as three separate builds, is on our list for the next free GPU slot; I will post the frame numbers here once it has run. Not tested yet, so no numbers today.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7147503335 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7147503335). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-24T23:31:49Z. --- Noted. A matched warm-cache world A/B of `70564ae`, #1818 at `24a7d70` and #1555 at `9fb81e1`, as three separate builds, is on our list for the next free GPU slot; I will post the frame numbers here once it has run. Not tested yet, so no numbers today.
Melow-code commented 2026-11-25 01:08:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-25T01:03:48Z.


Thanks — a matched warm-cache world A/B of main, #1818 and #1555 is exactly what the per-range question needs, and the synthetic case already shows the copy-volume change going the right way. I will read the frame numbers when they land. (Reply written with DeepSeek V4 Pro, OpenCode.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149167348 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7149167348). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-25T01:03:48Z. --- Thanks — a matched warm-cache world A/B of main, #1818 and #1555 is exactly what the per-range question needs, and the synthetic case already shows the copy-volume change going the right way. I will read the frame numbers when they land. (Reply written with DeepSeek V4 Pro, OpenCode.)
aycow commented 2026-11-25 02:06:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by aycow on 2026-11-25T01:26:43Z.


Updated this branch to ccfb029 at 254a67f. The disjoint-refresh implementation is unchanged by the follow-up. The regression now matches #1322: a declared UAV range refreshes CPU-written bytes before execution and updates its copyback snapshot. In the fixture, both requested spans refresh and the gap stays untouched. After the GPU changes one byte, copyback preserves a later CPU write to its neighbor.

All four disjoint tests passed with a required device on the default AMD adapter and WARP. The matched warm-cache comparison of main, #1818, and #1555 remains the evidence needed for the per-range performance question. The original comparison heads are still valid to reproduce the originally queued test.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7149553069 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7149553069). Originally posted by [aycow](https://github.com/aycow) on 2026-11-25T01:26:43Z. --- Updated this branch to `ccfb029` at `254a67f`. The disjoint-refresh implementation is unchanged by the follow-up. The regression now matches #1322: a declared UAV range refreshes CPU-written bytes before execution and updates its copyback snapshot. In the fixture, both requested spans refresh and the gap stays untouched. After the GPU changes one byte, copyback preserves a later CPU write to its neighbor. All four disjoint tests passed with a required device on the default AMD adapter and WARP. The matched warm-cache comparison of main, #1818, and #1555 remains the evidence needed for the per-range performance question. The original comparison heads are still valid to reproduce the originally queued test.
Marvisak commented 2026-11-25 07:03:18 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers.

Needs work (kept). The new head only merges current main (f3578e3) into the branch. The PR's own diff to crates/victory-gpu/src/host.rs (Batch, RefreshRanges) and watch.rs is identical to the one reviewed last time, and it merges cleanly.

The open points from the last review are still open:

  • Framing. Under main's Batch model ("what the title's threads write meanwhile is for later submissions"), the bounding range is not a correctness bug. The change is about copy volume, paid for with one Shadow::update per disjoint span.
  • Policy. #1555 does the opposite (it coalesces gaps up to 64 KiB). The matched warm-cache world comparison of main, this PR and #1555 on the same current baseline is still pending, and a maintainer needs those numbers to pick one.
  • Tests. About 230 lines of tests for a ~60-line change. Once a policy is chosen, keeping the gap-reader and declared-write cases would do.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7154864715 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7154864715). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:30:39Z. --- <!-- victory-triage v1 head=68f6115ea5d803d9fd85c5786d36e8fa27581962 verdict=needs-work at=2026-11-26T01:24:00Z --> Automated triage for the maintainers. **Needs work (kept).** The new head only merges current `main` (`f3578e3`) into the branch. The PR's own diff to `crates/victory-gpu/src/host.rs` (`Batch`, `RefreshRanges`) and `watch.rs` is identical to the one reviewed last time, and it merges cleanly. The open points from the last review are still open: - **Framing.** Under `main`'s `Batch` model ("what the title's threads write meanwhile is for later submissions"), the bounding range is not a correctness bug. The change is about copy volume, paid for with one `Shadow::update` per disjoint span. - **Policy.** #1555 does the opposite (it coalesces gaps up to 64 KiB). The matched warm-cache world comparison of `main`, this PR and #1555 on the same current baseline is still pending, and a maintainer needs those numbers to pick one. - **Tests.** About 230 lines of tests for a ~60-line change. Once a policy is chosen, keeping the gap-reader and declared-write cases would do. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Melow-code commented 2026-11-25 12:02:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-25T11:54:08Z.

Review: COMMENTED


I read the union logic against Shadow::update and Tracked::take on main (70564ae). I found no correctness bug.

  • RefreshRanges::add and merge treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart.
  • The dedup_by closure gets the later element first, so previous.1 = max(...) extends the kept range.
  • covers needs sorted, disjoint ranges. Every path that writes current calls merge first, so this holds.
  • A debug_assert! on that order in covers would protect later callers.
  • Two disjoint ranges in one page are safe. Tracked::take keeps a page that it copies only in part as changed. So the second range still copies its bytes.

Two points to check before merge:

  1. Cost. Each disjoint range is now one update call, and each call takes the pending and changed locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters.
  2. Overlap with #1555. That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land.

The CloseHandle in the twin_views test helper is correct. The views keep the section alive.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057118033 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6057118033). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-25T11:54:08Z. **Review:** COMMENTED --- I read the union logic against `Shadow::update` and `Tracked::take` on main (70564ae). I found no correctness bug. - `RefreshRanges::add` and `merge` treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart. - The `dedup_by` closure gets the later element first, so `previous.1 = max(...)` extends the kept range. - `covers` needs sorted, disjoint ranges. Every path that writes `current` calls `merge` first, so this holds. - A `debug_assert!` on that order in `covers` would protect later callers. - Two disjoint ranges in one page are safe. `Tracked::take` keeps a page that it copies only in part as changed. So the second range still copies its bytes. Two points to check before merge: 1. **Cost.** Each disjoint range is now one `update` call, and each call takes the `pending` and `changed` locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters. 2. **Overlap with #1555.** That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land. The `CloseHandle` in the `twin_views` test helper is correct. The views keep the section alive.
Melow-code commented 2026-11-25 12:02:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-25T11:54:35Z.

Review: COMMENTED


I read the union logic against Shadow::update and Tracked::take on main (70564ae). I found no correctness bug.

  • RefreshRanges::add and merge treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart.
  • The dedup_by closure gets the later element first, so previous.1 = max(...) extends the kept range.
  • covers needs sorted, disjoint ranges. Every path that writes current calls merge first, so this holds.
  • A debug_assert! on that order in covers would protect later callers.
  • Two disjoint ranges in one page are safe. Tracked::take keeps a page that it copies only in part as changed. So the second range still copies its bytes.

Two points to check before merge:

  1. Cost. Each disjoint range is now one update call, and each call takes the pending and changed locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters.
  2. Overlap with #1555. That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land.

The CloseHandle in the twin_views test helper is correct. The views keep the section alive.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057124459 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6057124459). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-25T11:54:35Z. **Review:** COMMENTED --- I read the union logic against `Shadow::update` and `Tracked::take` on main (70564ae). I found no correctness bug. - `RefreshRanges::add` and `merge` treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart. - The `dedup_by` closure gets the later element first, so `previous.1 = max(...)` extends the kept range. - `covers` needs sorted, disjoint ranges. Every path that writes `current` calls `merge` first, so this holds. - A `debug_assert!` on that order in `covers` would protect later callers. - Two disjoint ranges in one page are safe. `Tracked::take` keeps a page that it copies only in part as changed. So the second range still copies its bytes. Two points to check before merge: 1. **Cost.** Each disjoint range is now one `update` call, and each call takes the `pending` and `changed` locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters. 2. **Overlap with #1555.** That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land. The `CloseHandle` in the `twin_views` test helper is correct. The views keep the section alive.
Melow-code commented 2026-11-25 12:02:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Melow-code on 2026-11-25T11:54:44Z.

Review: COMMENTED


I read the union logic against Shadow::update and Tracked::take on main (70564ae). I found no correctness bug.

  • RefreshRanges::add and merge treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart.
  • The dedup_by closure gets the later element first, so previous.1 = max(...) extends the kept range.
  • covers needs sorted, disjoint ranges. Every path that writes current calls merge first, so this holds.
  • A debug_assert! on that order in covers would protect later callers.
  • Two disjoint ranges in one page are safe. Tracked::take keeps a page that it copies only in part as changed. So the second range still copies its bytes.

Two points to check before merge:

  1. Cost. Each disjoint range is now one update call, and each call takes the pending and changed locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters.
  2. Overlap with #1555. That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land.

The CloseHandle in the twin_views test helper is correct. The views keep the section alive.

<!-- greyfinch-sync:Marvisak/VIctory:review:6057126578 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#pullrequestreview-6057126578). Originally posted by [Melow-code](https://github.com/Melow-code) on 2026-11-25T11:54:44Z. **Review:** COMMENTED --- I read the union logic against `Shadow::update` and `Tracked::take` on main (70564ae). I found no correctness bug. - `RefreshRanges::add` and `merge` treat the ranges as half-open. They join ranges that touch and keep ranges with a gap apart. - The `dedup_by` closure gets the later element first, so `previous.1 = max(...)` extends the kept range. - `covers` needs sorted, disjoint ranges. Every path that writes `current` calls `merge` first, so this holds. - A `debug_assert!` on that order in `covers` would protect later callers. - Two disjoint ranges in one page are safe. `Tracked::take` keeps a page that it copies only in part as changed. So the second range still copies its bytes. Two points to check before merge: 1. **Cost.** Each disjoint range is now one `update` call, and each call takes the `pending` and `changed` locks and the guards. One copy with many small disjoint requests now makes many calls in place of one. A frame-time number from a world scene would show if this matters. 2. **Overlap with #1555.** That PR also changes how the batch combines refreshes (it joins nearby ones). The two change the same code, so only one approach should land. The `CloseHandle` in the `twin_views` test helper is correct. The views keep the section alive.
shortselow-byte commented 2026-11-25 14:07:26 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by shortselow-byte on 2026-11-25T13:35:55Z.


Merged onto current main (940d32f), this no longer compiles its tests, although GitHub shows it as mergeable. The branch is based on ccfb029, one commit before cd94d35 ("GPU: shaders mark the pages they write through views"), which gave Shadow::writing a third parameter:

error[E0061]: this method takes 3 arguments but 2 arguments were supplied
    --> crates\victory-gpu\src\host.rs:3223:14
     |
3223 |         copy.writing(busy, 4);
     |              ^^^^^^^--------- argument #3 of type `bool` is missing
note: method defined here
    --> crates\victory-gpu\src\shadow.rs:274:19
     |
 274 |     pub(crate) fn writing(&self, address: usize, len: usize, marked: bool) {

So cargo test -p victory-gpu (and clippy --all-targets) would fail on main after the merge. Checked locally on Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT, in an isolated target directory:

  • with copy.writing(busy, 4, false), disjoint_partial_refreshes_update_declared_write_snapshots passes;
  • with true, it fails at host.rs:3250.

So a rebase with false there looks like all it needs. I only ran that one test with the fix, not the whole workspace.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164010658 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7164010658). Originally posted by [shortselow-byte](https://github.com/shortselow-byte) on 2026-11-25T13:35:55Z. --- **Merged onto current `main` (`940d32f`), this no longer compiles its tests**, although GitHub shows it as mergeable. The branch is based on `ccfb029`, one commit before `cd94d35` ("GPU: shaders mark the pages they write through views"), which gave `Shadow::writing` a third parameter: ``` error[E0061]: this method takes 3 arguments but 2 arguments were supplied --> crates\victory-gpu\src\host.rs:3223:14 | 3223 | copy.writing(busy, 4); | ^^^^^^^--------- argument #3 of type `bool` is missing note: method defined here --> crates\victory-gpu\src\shadow.rs:274:19 | 274 | pub(crate) fn writing(&self, address: usize, len: usize, marked: bool) { ``` So `cargo test -p victory-gpu` (and clippy `--all-targets`) would fail on `main` after the merge. Checked locally on Windows 11, Rust 1.98.1 MSVC, AMD Radeon RX 6900 XT, in an isolated target directory: - with `copy.writing(busy, 4, false)`, `disjoint_partial_refreshes_update_declared_write_snapshots` passes; - with `true`, it fails at `host.rs:3250`. So a rebase with `false` there looks like all it needs. I only ran that one test with the fix, not the whole workspace.
Texbirds commented 2026-11-25 14:07:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Texbirds on 2026-11-25T13:38:27Z.


Thanks for the implementation and regression coverage. As the author of #1555, I think minimizing copied bytes and minimizing preparation time are two different objectives.

The 64 KiB coalescing threshold in #1555 intentionally reduces Shadow::update() calls, lock acquisitions and change-tracking overhead. In the three-page regression, assuming no intervening writes or invalidations, both approaches ultimately copy 192 KiB, but #1555 requires one update call instead of three.

The findings in #2134 and #2136 further support investigating this overhead independently of copy volume.

Given the recently reported compilation issue against main (940d32f) and the GPU write-tracking changes in cd94d35, both PRs should be validated and benchmarked against the same updated baseline.

I also see potential in combining #1818's exact range tracking with #1555's batching strategy through shared locking.

Ultimately, correctness, preparation time and actual frame time should determine which approach lands. Neither approach has demonstrated superior real-world performance yet.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164073457 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7164073457). Originally posted by [Texbirds](https://github.com/Texbirds) on 2026-11-25T13:38:27Z. --- Thanks for the implementation and regression coverage. As the author of #1555, I think minimizing copied bytes and minimizing preparation time are two different objectives. The 64 KiB coalescing threshold in #1555 intentionally reduces `Shadow::update()` calls, lock acquisitions and change-tracking overhead. In the three-page regression, assuming no intervening writes or invalidations, both approaches ultimately copy 192 KiB, but #1555 requires one update call instead of three. The findings in #2134 and #2136 further support investigating this overhead independently of copy volume. Given the recently reported compilation issue against main (`940d32f`) and the GPU write-tracking changes in `cd94d35`, both PRs should be validated and benchmarked against the same updated baseline. I also see potential in combining #1818's exact range tracking with #1555's batching strategy through shared locking. Ultimately, correctness, preparation time and actual frame time should determine which approach lands. Neither approach has demonstrated superior real-world performance yet.
aycow commented 2026-11-25 17:05:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by aycow on 2026-11-25T16:58:41Z.


@shortselow-byte Thanks for isolating the compile error and checking both values of the new parameter. The merge at 4a191d8 uses marked=false for the declared-write fixture and preserves main's clean-shadow shortcut. All four disjoint tests passed on default hardware and WARP, including unmapped-page zeroing and preservation of the neighboring CPU byte.

@Texbirds The current control measures copy volume at the first read. If the gap is eventually read with no intervening changes, both approaches can ultimately move the same number of bytes and the lock and query costs can decide the result. The matched title comparison on the same current-main baseline is still pending. This update makes no title frame-time claim.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7168816755 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1818#issuecomment-7168816755). Originally posted by [aycow](https://github.com/aycow) on 2026-11-25T16:58:41Z. --- @shortselow-byte Thanks for isolating the compile error and checking both values of the new parameter. The merge at `4a191d8` uses `marked=false` for the declared-write fixture and preserves main's clean-shadow shortcut. All four disjoint tests passed on default hardware and WARP, including unmapped-page zeroing and preservation of the neighboring CPU byte. @Texbirds The current control measures copy volume at the first read. If the gap is eventually read with no intervening changes, both approaches can ultimately move the same number of bytes and the lock and query costs can decide the result. The matched title comparison on the same current-main baseline is still pending. This update makes no title frame-time claim.
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/1818:upstream-pr/1818'
git switch 'upstream-pr/1818'

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/1818'
git switch 'upstream-pr/1818'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1818'
git switch 'upstream-pr/1818'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1818'
git switch 'main'
git merge --squash 'upstream-pr/1818'
git switch 'main'
git merge --ff-only 'upstream-pr/1818'
git switch 'main'
git merge 'upstream-pr/1818'
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!1816
No description provided.