GPU: a submission refreshes a copy's ranges disjoint, not their span #2426

Open
borosf wants to merge 9 commits from upstream-pr/2428 into main
borosf commented 2026-11-25 13:20:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T13:20:51Z.


Summary

  • Batch merged every refresh of a buffer copy across a submission into one [min, max] span, so lists asking for distant small parts of one copy (constant buffers through the bindless hulls, heap table ranges, recorded Step::Refreshes) copied everything between them out of title memory. The dossier counts this line as most of preparing (~860 ms of a ~1,900 ms Series S world frame; copies ~270 MB ≈ 440 ms).
  • Refreshes are now kept as disjoint ranges per copy: a request merges only with what it overlaps or lies within a page (64 KiB) of; distant ranges are copied apart. The coverage bookkeeping (current) is a disjoint set too, so ranges already brought up to date are skipped more often than before.
  • The merge is one pass over the ranges kept in address order (push_joined, fed by push_range for what to copy and push_copied for what was copied): a push costs O(n) moves of 16-byte pairs, where the first version removed each range it took in and re-sorted — O(n²) per push, O(n³) per copy per submission. Why n stays small per copy is written down at push_joined.
  • Tests: the coalescing/bridging rules have their unit tests, and a new pure-coalescer fuzz holds the merge to a brute-force reference over random submissions. Three of the new tests build a host copy and need a host GPU; they return on a runner without one (no GPU-less runner runs them, which is why the fuzz below covers the rules instead).

Numbers

Model (no game data; per-frame equivalents of the submission pattern the dossier describes):

  • scattered 16 KiB views in 64 MiB copies (80 copies × 40 requests): union 5,108 MB → disjoint 56.6 MB (90×)
  • dense 64 KiB × 200 requests: 1,333 MB → 255 MB (5.2×)
    Real-world confirmation needs the diagnostics frame log (preparing MB/ms before/after) on hardware that runs the game.

Verification

  • cargo test -p victory-gpu --lib, this machine (Windows, a host D3D12 adapter is present, so the copy tests do run here; not the Arc B580): 199 passed, 2 failed, 1 ignored. The two failures are the known heap-cap assertions (descriptor::host::tests::dynamic_slots_are_held_until_released, memory::tests::lists_share_a_table_and_copies_keep_their_views), and pristine main fails the same two here (229 passed, 2 failed, 1 ignored on 63bcca4).
  • New host::batch::the_coalescers_match_a_brute_force_coalescer_over_random_submissions — no GPU needed, so it runs where the copy tests return: 4,096 random submissions × 64 operations (≈131,000 requests) over a 32-page window, asserting after every step that
    • pending is exactly the brute-force closure of what was asked for since the last title write (sorted, disjoint, nothing dropped, nothing merged across more than a page — no span between two distant requests);
    • both coalescers leave what a slow reference (a range at a time, removed from the middle, sorted after) leaves, on every push;
    • what current claims by covering a request was copied: every byte at least once, and every page inside it by a flush whose range covered that page whole (otherwise the skip would lose a refresh — the split page of #2473);
    • a request a flush covered whole is still claimed when asked for again, so it is not copied twice; and a flush's own ranges are disjoint.
  • The three copy tests that need a host GPU: distant_refreshes_of_a_copy_are_copied_apart, a_page_copied_in_two_halves_is_refreshed_whole, a_page_between_flushed_ranges_is_refreshed_when_asked_for. Each calls shadow::find and returns when it gives None — on a GPU-less runner they pass without copying anything.
  • No game data used.

claiming: PREPARING-DISJOINT-RANGES (the dirty-range half of H-2.1; per the ledger the adjacent lanes NEW-48 / NEW-53 / GPU-SNAPSHOT-COST are correctness or copy-back redesign, not this).

<!-- greyfinch-sync:Marvisak/VIctory:issue:5492135432 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T13:20:51Z. --- ## Summary - `Batch` merged every refresh of a buffer copy across a submission into one `[min, max]` span, so lists asking for distant small parts of one copy (constant buffers through the bindless hulls, heap table ranges, recorded `Step::Refresh`es) copied everything between them out of title memory. The dossier counts this line as most of `preparing` (~860 ms of a ~1,900 ms Series S world frame; copies ~270 MB ≈ 440 ms). - Refreshes are now kept as disjoint ranges per copy: a request merges only with what it overlaps or lies within a page (64 KiB) of; distant ranges are copied apart. The coverage bookkeeping (`current`) is a disjoint set too, so ranges already brought up to date are skipped more often than before. - The merge is one pass over the ranges kept in address order (`push_joined`, fed by `push_range` for what to copy and `push_copied` for what was copied): a push costs O(n) moves of 16-byte pairs, where the first version removed each range it took in and re-sorted — O(n²) per push, O(n³) per copy per submission. Why `n` stays small per copy is written down at `push_joined`. - Tests: the coalescing/bridging rules have their unit tests, and a new pure-coalescer fuzz holds the merge to a brute-force reference over random submissions. Three of the new tests build a host copy and need a host GPU; they return on a runner without one (no GPU-less runner runs them, which is why the fuzz below covers the rules instead). ## Numbers Model (no game data; per-frame equivalents of the submission pattern the dossier describes): - scattered 16 KiB views in 64 MiB copies (80 copies × 40 requests): union 5,108 MB → disjoint 56.6 MB (**90×**) - dense 64 KiB × 200 requests: 1,333 MB → 255 MB (**5.2×**) Real-world confirmation needs the diagnostics frame log (`preparing` MB/ms before/after) on hardware that runs the game. ## Verification - `cargo test -p victory-gpu --lib`, this machine (Windows, a host D3D12 adapter is present, so the copy tests do run here; not the Arc B580): **199 passed, 2 failed, 1 ignored**. The two failures are the known heap-cap assertions (`descriptor::host::tests::dynamic_slots_are_held_until_released`, `memory::tests::lists_share_a_table_and_copies_keep_their_views`), and pristine `main` fails the same two here (229 passed, 2 failed, 1 ignored on `63bcca4`). - New `host::batch::the_coalescers_match_a_brute_force_coalescer_over_random_submissions` — no GPU needed, so it runs where the copy tests return: 4,096 random submissions × 64 operations (≈131,000 requests) over a 32-page window, asserting after every step that - `pending` is exactly the brute-force closure of what was asked for since the last title write (sorted, disjoint, nothing dropped, nothing merged across more than a page — no span between two distant requests); - both coalescers leave what a slow reference (a range at a time, removed from the middle, sorted after) leaves, on every push; - what `current` claims by covering a request was copied: every byte at least once, and every page inside it by a flush whose range covered that page whole (otherwise the skip would lose a refresh — the split page of #2473); - a request a flush covered whole is still claimed when asked for again, so it is not copied twice; and a flush's own ranges are disjoint. - The three copy tests that need a host GPU: `distant_refreshes_of_a_copy_are_copied_apart`, `a_page_copied_in_two_halves_is_refreshed_whole`, `a_page_between_flushed_ranges_is_refreshed_when_asked_for`. Each calls `shadow::find` and returns when it gives `None` — on a GPU-less runner they pass without copying anything. - No game data used. claiming: PREPARING-DISJOINT-RANGES (the dirty-range half of H-2.1; per the ledger the adjacent lanes NEW-48 / NEW-53 / GPU-SNAPSHOT-COST are correctness or copy-back redesign, not this).
DrDarkDK commented 2026-11-25 13:23:14 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-25T13:23:14Z.

Review: CHANGES_REQUESTED


I reproduced a missed refresh at 6ce364e on native Windows with an RTX 4070 Ti and WARP. In one Batch, I requested and flushed pages 0, 2, and 1 separately, in that order.

  • Parent 940d32f: each flush copied 65,536 bytes.
  • 6ce364e: the flushes copied 65,536, 65,536, and 0 bytes. A direct Shadow::update of page 1 then copied all 65,536 bytes, confirming it was still dirty.

flush() uses the same one-page gap coalescing for current as for pending. After the first two flushes, current covers page 1 even though neither flush copied it. Could current merge only overlapping or touching ranges, while pending keeps the one-page coalescing?

Synthetic test only. No game data used.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058404984 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#pullrequestreview-6058404984). Originally posted by [DrDarkDK](https://github.com/DrDarkDK) on 2026-11-25T13:23:14Z. **Review:** CHANGES_REQUESTED --- I reproduced a missed refresh at `6ce364e` on native Windows with an RTX 4070 Ti and WARP. In one `Batch`, I requested and flushed pages 0, 2, and 1 separately, in that order. - Parent `940d32f`: each flush copied 65,536 bytes. - `6ce364e`: the flushes copied 65,536, 65,536, and 0 bytes. A direct `Shadow::update` of page 1 then copied all 65,536 bytes, confirming it was still dirty. `flush()` uses the same one-page gap coalescing for `current` as for `pending`. After the first two flushes, `current` covers page 1 even though neither flush copied it. Could `current` merge only overlapping or touching ranges, while `pending` keeps the one-page coalescing? Synthetic test only. No game data used. *AI-assisted with Codex.*
DrDarkDK commented 2026-11-25 13:38:57 +00:00 (Migrated from github.com)

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

Review: APPROVED


Rechecked 2b30d3e on native Windows with the RTX 4070 Ti (driver 621.01) and WARP. Flushing pages 0, 2, and 1 separately copied 65,536 bytes each time on both adapters. In my original review of 6ce364e, the third flush copied 0 bytes.

The batch tests returned 7 passed and 1 benchmark ignored on each adapter. I also reran the regression with a required D3D12 buffer and verified the expected bytes on page 1 after the third flush. This resolves my earlier changes request. The test used synthetic data and covered refresh correctness.

AI-assisted with Codex.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058636017 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#pullrequestreview-6058636017). Originally posted by [DrDarkDK](https://github.com/DrDarkDK) on 2026-11-25T13:38:57Z. **Review:** APPROVED --- Rechecked `2b30d3e` on native Windows with the RTX 4070 Ti (driver 621.01) and WARP. Flushing pages 0, 2, and 1 separately copied 65,536 bytes each time on both adapters. In my original review of `6ce364e`, the third flush copied 0 bytes. The batch tests returned 7 passed and 1 benchmark ignored on each adapter. I also reran the regression with a required D3D12 buffer and verified the expected bytes on page 1 after the third flush. This resolves my earlier changes request. The test used synthetic data and covered refresh correctness. *AI-assisted with Codex.*
borosf commented 2026-11-25 14:07:21 +00:00 (Migrated from github.com)

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


Confirmed and fixed in 2b30d3e — exactly as you diagnosed: flush() was feeding current through the same one-page coalescing as pending, so two flushed ranges a page apart covered the gap between them and a later request inside it was wrongly skipped. push_range now takes the merge gap as a parameter: pending keeps the page's coalescing, current merges only where flushed ranges touch, so coverage never claims a byte no flush copied. Otherwise the numbers are unchanged.

Your pages-0-2-1 sequence is now the regression test a_page_between_flushed_ranges_is_refreshed_when_asked_for (each flush copies its page), alongside a pure one for the touching-vs-gap rule (the_gap_between_copied_ranges_is_not_covered). Good catch — the fuzzing asserted range-set structure, not the copied-versus-coverage split, so this was beyond what the model could reach.

CI is green on 2b30d3e, and verified after the fix on Arc B580: cargo test -p victory-gpu --lib — 145 passed with only the two known Intel heap-cap failures pristine main also has.

@DrDarkDK Can you recheck on your local machine?

<!-- greyfinch-sync:Marvisak/VIctory:comment:7163880866 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7163880866). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T13:30:39Z. --- Confirmed and fixed in 2b30d3e — exactly as you diagnosed: `flush()` was feeding `current` through the same one-page coalescing as `pending`, so two flushed ranges a page apart covered the gap between them and a later request inside it was wrongly skipped. `push_range` now takes the merge gap as a parameter: `pending` keeps the page's coalescing, `current` merges only where flushed ranges touch, so coverage never claims a byte no flush copied. Otherwise the numbers are unchanged. Your pages-0-2-1 sequence is now the regression test `a_page_between_flushed_ranges_is_refreshed_when_asked_for` (each flush copies its page), alongside a pure one for the touching-vs-gap rule (`the_gap_between_copied_ranges_is_not_covered`). Good catch — the fuzzing asserted range-set structure, not the copied-versus-coverage split, so this was beyond what the model could reach. CI is green on 2b30d3e, and verified after the fix on Arc B580: `cargo test -p victory-gpu --lib` — 145 passed with only the two known Intel heap-cap failures pristine main also has. @DrDarkDK Can you recheck on your local machine?
kotekompotek commented 2026-11-25 14:07:33 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:01:40Z.


Reviewed — the disjoint/pending split is right and fixes the reported miss:

  • pending coalesces with a one-page gap (COALESCE), current merges only touching ranges — so coverage can no longer claim bytes no flush copied. That is exactly the pages-0-2-then-1 failure: the old span merge made current cover page 1 after copying only 0 and 2.
  • covered requires the request inside ONE range, so a request spanning two adjacent copied ranges still flushes — conservative, correct.
  • Keeping all disjoint ranges in current (instead of union-if-touching-else-larger) claims strictly more coverage, which is now precise; title_written still clears both maps wholesale, so the invalidation contract is unchanged.
  • add pushing into pending via push_range also handles the request-inside-pending case by overlap merge — same as the old span merge.

The two pure tests pin both invariants, and the pool tests exercise the reported ordering on a host. CI green.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7164645540 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7164645540). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T14:01:40Z. --- Reviewed — the disjoint/pending split is right and fixes the reported miss: - `pending` coalesces with a one-page gap (`COALESCE`), `current` merges only touching ranges — so coverage can no longer claim bytes no flush copied. That is exactly the pages-0-2-then-1 failure: the old span merge made `current` cover page 1 after copying only 0 and 2. - `covered` requires the request inside ONE range, so a request spanning two adjacent copied ranges still flushes — conservative, correct. - Keeping all disjoint ranges in `current` (instead of union-if-touching-else-larger) claims strictly more coverage, which is now precise; `title_written` still clears both maps wholesale, so the invalidation contract is unchanged. - `add` pushing into `pending` via `push_range` also handles the request-inside-pending case by overlap merge — same as the old span merge. The two pure tests pin both invariants, and the pool tests exercise the reported ordering on a host. CI green.
catminou4 commented 2026-11-25 14:11:10 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T14:11:10Z.

Review: COMMENTED


Third duplicate of the disjoint-refresh rewrite: identical comment text as #2419, which itself duplicates #2349. Whichever merges first wins; suggest closing two of the three. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6059174707 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#pullrequestreview-6059174707). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T14:11:10Z. **Review:** COMMENTED --- **Third duplicate** of the disjoint-refresh rewrite: identical comment text as #2419, which itself duplicates #2349. Whichever merges first wins; suggest closing two of the three. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
kotekompotek commented 2026-11-25 15:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T14:28:41Z.


Follow-up from #2473/#2474: this PR's push_range(ranges, 0, ...) merges touching ranges in current, which keeps the same hole #2473 describes — two partial flushes of one page ([p, p+4K) + [p+4K, p+64K)) merge into full-page coverage, so a later whole-page refresh is skipped and the page is never taken/guarded (marked writes then drop in copy_back_marked). #2474's fix applies here too: merge only when the intersection of the ranges contains a whole page (max(a,from).div_ceil(PAGE) <= min(b,to)/PAGE), so no union claims a page neither refresh covered whole.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165338883 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7165338883). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-25T14:28:41Z. --- Follow-up from #2473/#2474: this PR's `push_range(ranges, 0, ...)` merges *touching* ranges in `current`, which keeps the same hole #2473 describes — two partial flushes of one page ([p, p+4K) + [p+4K, p+64K)) merge into full-page coverage, so a later whole-page refresh is skipped and the page is never `take`n/guarded (marked writes then drop in `copy_back_marked`). #2474's fix applies here too: merge only when the *intersection* of the ranges contains a whole page (`max(a,from).div_ceil(PAGE) <= min(b,to)/PAGE`), so no union claims a page neither refresh covered whole.
BastienRodz commented 2026-11-25 15:04:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T14:28:53Z.


A heads-up from #2473 / #2474. In current, two refreshes that each cover part of one 64 KiB page (e.g. [p, p + 4 KiB) and then [p + 4 KiB, p + 64 KiB)) leave the page changed and unguarded, because Tracked::take takes only pages it covers whole. On main, Batch::flush still joins the two touching ranges, so a later whole-page refresh in the same submission is skipped as already current, and copy_back_marked drops the shaders' writes to that page. As kotekompotek noted on #2474, push_range(.., gap = 0, ..) here still joins touching ranges, so the same thing happens with this PR. #2474 makes ranges join only where they meet across a page boundary. Whichever of the two lands second should keep that rule. Happy to rebase mine onto yours if this goes in first.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7165344150 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7165344150). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T14:28:53Z. --- A heads-up from #2473 / #2474. In `current`, two refreshes that each cover part of one 64 KiB page (e.g. `[p, p + 4 KiB)` and then `[p + 4 KiB, p + 64 KiB)`) leave the page changed and unguarded, because `Tracked::take` takes only pages it covers whole. On `main`, `Batch::flush` still joins the two touching ranges, so a later whole-page refresh in the same submission is skipped as already current, and `copy_back_marked` drops the shaders' writes to that page. As kotekompotek noted on #2474, `push_range(.., gap = 0, ..)` here still joins touching ranges, so the same thing happens with this PR. #2474 makes ranges join only where they meet across a page boundary. Whichever of the two lands second should keep that rule. Happy to rebase mine onto yours if this goes in first.
Marvisak commented 2026-11-25 16:09:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:33:07Z.


Automated triage for the maintainers.

host.rs Batch now keeps each copy's pending refreshes as disjoint ranges (push_range, which joins ranges within a page), instead of one [min, max] span. Coverage (current) is kept as disjoint ranges too, joined by push_copied only where the intersection of two ranges contains a page boundary. I checked that rule: every whole page inside a joined range was covered whole by one flushed range, so a later whole-page request is never skipped for a page that Shadow::update did not guard. That also fixes the split-page case of #2473. covered requires the request to fit inside one range, and title_written still clears everything. CI (check) passes, but the three host-copy tests return early without a GPU, so CI does not run them (the author reports a run on Arc B580).

Notes for the maintainer:

  • This overlaps #1818 and #2349 (also disjoint refresh ranges) and #2474 (the narrow #2473 fix with the same join rule), so pick one.
  • Pages in the gaps between requested ranges are no longer refreshed by chance. They are refreshed only when a list asks for them.
  • The push_copied doc says "intersection contains a whole page", but the condition tests for a page boundary.
  • The performance numbers come from a model, not a frame measurement.

Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7167018385 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7167018385). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:33:07Z. --- <!-- victory-triage v1 head=3a2279fd23828944b863a7f3411d857135da3975 verdict=merge-candidate at=2026-11-25T18:28:45Z --> Automated triage for the maintainers. `host.rs` `Batch` now keeps each copy's pending refreshes as disjoint ranges (`push_range`, which joins ranges within a page), instead of one `[min, max]` span. Coverage (`current`) is kept as disjoint ranges too, joined by `push_copied` only where the intersection of two ranges contains a page boundary. I checked that rule: every whole page inside a joined range was covered whole by one flushed range, so a later whole-page request is never skipped for a page that `Shadow::update` did not guard. That also fixes the split-page case of #2473. `covered` requires the request to fit inside one range, and `title_written` still clears everything. CI (`check`) passes, but the three host-copy tests return early without a GPU, so CI does not run them (the author reports a run on Arc B580). Notes for the maintainer: - This overlaps #1818 and #2349 (also disjoint refresh ranges) and #2474 (the narrow #2473 fix with the same join rule), so pick one. - Pages in the gaps between requested ranges are no longer refreshed by chance. They are refreshed only when a list asks for them. - The `push_copied` doc says "intersection contains a whole page", but the condition tests for a page boundary. - The performance numbers come from a model, not a frame measurement. --- _Generated by [Claude Code](https://claude.ai/code)_
borosf commented 2026-11-25 18:02:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T17:15:33Z.


Rebased as a merge of current main plus a re-application, since main moved the whole Batch area (texture uploads left the batch, the shadow.clean() gate landed). The disjoint-range change now sits on main's current shape: their clean-shadow shortcut stays first, and everything behind it — pending ranges coalescing within a page, coverage merging only where flushes meet — is unchanged from the reviewed semantics, with all four tests back in place (the pages-0-2-1 ordering test included). CI green on the merge head.

Re-verified after the re-application on the same Intel Arc B580 (the card that caught the coverage bug): the full victory-gpu suite passes — 197 passed, the only two failures being the known (#1744 / #1943) heap-cap tests that pristine main also fails on this card, and every one of the batch tests including the reviewer-reported ordering case green on hardware.

@Marvisak Please check it out when you have the time :)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169239374 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7169239374). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T17:15:33Z. --- Rebased as a merge of current main plus a re-application, since main moved the whole Batch area (texture uploads left the batch, the shadow.clean() gate landed). The disjoint-range change now sits on main's current shape: their clean-shadow shortcut stays first, and everything behind it — pending ranges coalescing within a page, coverage merging only where flushes meet — is unchanged from the reviewed semantics, with all four tests back in place (the pages-0-2-1 ordering test included). CI green on the merge head. Re-verified after the re-application on the same Intel Arc B580 (the card that caught the coverage bug): the full victory-gpu suite passes — 197 passed, the only two failures being the known (#1744 / #1943) heap-cap tests that pristine main also fails on this card, and every one of the batch tests including the reviewer-reported ordering case green on hardware. @Marvisak Please check it out when you have the time :)
borosf commented 2026-11-25 19:06:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-25T18:07:31Z.


Implemented at 3a2279f: current joins only where the ranges' intersection contains a whole page — max(a, from).div_ceil(PAGE) <= min(b, to) / PAGE, exactly as @kotekompotek wrote on #2474. My first take joined at any page-boundary touch but still merged overlaps whose intersection held no whole page, which could union two page-flanking flushes into a whole-page claim — this rules that out too. push_range(.., 0, ..) is gone from flush in favor of a separate push_copied.

The pure test now pins all four cases — a page apart, meeting inside a page, overlapping without a whole page, and meeting across a boundary / overlapping by a whole page — and a_page_copied_in_two_halves_is_refreshed_whole runs the #2473 ordering on a host: the halves each copy their bytes, neither guards the page, and a later whole-page request in the same submission still refreshes. CI green on 3a2279f.

Happy for #2474 to rebase onto this if it lands first — with both sides on the same rule the rebase should be a no-op for the join logic.

@BastienRodz

<!-- greyfinch-sync:Marvisak/VIctory:comment:7170473723 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7170473723). Originally posted by [borosf](https://github.com/borosf) on 2026-11-25T18:07:31Z. --- Implemented at 3a2279f: current joins only where the ranges' intersection contains a whole page — max(a, from).div_ceil(PAGE) <= min(b, to) / PAGE, exactly as @kotekompotek wrote on #2474. My first take joined at any page-boundary touch but still merged overlaps whose intersection held no whole page, which could union two page-flanking flushes into a whole-page claim — this rules that out too. push_range(.., 0, ..) is gone from flush in favor of a separate push_copied. The pure test now pins all four cases — a page apart, meeting inside a page, overlapping without a whole page, and meeting across a boundary / overlapping by a whole page — and a_page_copied_in_two_halves_is_refreshed_whole runs the #2473 ordering on a host: the halves each copy their bytes, neither guards the page, and a later whole-page request in the same submission still refreshes. CI green on 3a2279f. Happy for #2474 to rebase onto this if it lands first — with both sides on the same rule the rebase should be a no-op for the join logic. @BastienRodz
ntgata1-dotcom commented 2026-11-26 08:03:23 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-26T07:46:23Z.


Measured in the title: preparing 255 → 221 ms a frame (AMD RDNA4 under Wine)

Setup: RX 9070 XT (RDNA4), RADV / Mesa 26.3, Wine 11.22 with vkd3d-proton 3.1-83 from GE-Proton11-14. Diag builds on main 63bcca4, with and without this PR. Warm shader and pipeline cache, scripted input, the first mission's opening, 5-minute runs. The numbers are means over the 5-second frame lines with 1,000 draws or more (37 and 42 per run).

without with this PR
ms per frame, median 482 455
ms per frame at 1,000–2,500 / 2,500–4,000 / 4,000+ draws 361 / 513 / 794 349 / 502 / 564
preparing (its copies) 255 (132) ms 221 (112) ms
on the GPU / copying back 201 / 74 ms 172 / 66 ms

No fault, device loss or kernel message in either run. The heavy band is only a few lines per run, so read its drop loosely. The preparing and copies drops held across the run.

Both runs had the same local changes: queues on a worker thread (local, opt-in), #3071, and a wineserver that keeps memory views in a tree. Merged for Wine: #2913, #2919, #2723, #2977, #2703, #1722, #2101, #2249; and #2644 and #454, their switches on. The "with" run also had #2705 merged, switched off.

AI-assisted (Claude Code); numbers from my own runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7185818174 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7185818174). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-26T07:46:23Z. --- **Measured in the title: preparing 255 → 221 ms a frame (AMD RDNA4 under Wine)** **Setup:** RX 9070 XT (RDNA4), RADV / Mesa 26.3, Wine 11.22 with vkd3d-proton 3.1-83 from GE-Proton11-14. Diag builds on `main` `63bcca4`, with and without this PR. Warm shader and pipeline cache, scripted input, the first mission's opening, 5-minute runs. The numbers are means over the 5-second frame lines with 1,000 draws or more (37 and 42 per run). | | without | with this PR | |---|---|---| | ms per frame, median | 482 | 455 | | ms per frame at 1,000–2,500 / 2,500–4,000 / 4,000+ draws | 361 / 513 / 794 | 349 / 502 / 564 | | preparing (its copies) | 255 (132) ms | 221 (112) ms | | on the GPU / copying back | 201 / 74 ms | 172 / 66 ms | No fault, device loss or kernel message in either run. The heavy band is only a few lines per run, so read its drop loosely. The preparing and copies drops held across the run. Both runs had the same local changes: queues on a worker thread (local, opt-in), #3071, and a wineserver that keeps memory views in a tree. Merged for Wine: #2913, #2919, #2723, #2977, #2703, #1722, #2101, #2249; and #2644 and #454, their switches on. The "with" run also had #2705 merged, switched off. AI-assisted (Claude Code); numbers from my own runs.
fuzeofficlal commented 2026-11-26 12:21:20 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T12:21:20Z.

Review: APPROVED


Reviewed and verified at head 3a2279fd and merged onto origin/main (63bcca43) on Windows 11 (RTX 5090 + WARP, VICTORY_D3D12_DEBUG=1):

  • Design & correctness:
    • Batch::add / flush / title_written (crates/victory-gpu/src/host.rs:2381-2434) cleanly separate pending coalescing (push_range with COALESCE = PAGE, :2438-2461) from flushed coverage (push_copied, :2475-2489). Because pending stays sorted with pairwise gaps > COALESCE, a single left-to-right sweep in push_range never misses transitive merges.
    • push_copied's join predicate lo.div_ceil(PAGE) <= hi / PAGE holds iff the intersection contains a page boundary, guaranteeing that every whole 64 KiB page inside a joined current range was covered whole by a single Shadow::update and therefore guarded—closing both the pages-0-2-1 gap bug and the #2473 split-page hole. covered (:2464-2466) conservatively requires containment within one range, title_written() still flushes and clears current, and coalescing up to one page across pending interacts safely with Shadow::update / shadow.pending (strictly narrower than main's [min, max] span).
    • Minor non-blocking doc nit: the comment on push_copied (host.rs:2474) says "intersection contains a whole page", whereas the condition tests for a page boundary (which is the exact necessary and sufficient condition).
  • Verification:
    • Clean git merge-tree against origin/main (63bcca43); cargo xtask policy (184 files ok); cargo clippy -p victory-gpu --all-targets -- -D warnings clean with default features and --all-features (both at 3a2279fd and merged onto 63bcca43).
    • At 3a2279fd: RTX 5090 (default) batch:: 6/6 passed; RTX 5090 + VICTORY_D3D12_DEBUG=1 batch:: + draw::tests 17/17 passed; WARP (VICTORY_D3D12_WARP=1) + VICTORY_D3D12_DEBUG=1 batch:: + memory::tests + draw::tests 22/22 passed.
    • Merged onto origin/main (63bcca43) with VICTORY_D3D12_DEBUG=1: RTX 5090 batch:: + draw::tests 26/26 passed; WARP batch:: + memory::tests 14/14 passed.

LGTM.

<!-- greyfinch-sync:Marvisak/VIctory:review:6074035139 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#pullrequestreview-6074035139). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T12:21:20Z. **Review:** APPROVED --- Reviewed and verified at head `3a2279fd` and merged onto `origin/main` (`63bcca43`) on Windows 11 (RTX 5090 + WARP, `VICTORY_D3D12_DEBUG=1`): - **Design & correctness**: - `Batch::add` / `flush` / `title_written` (`crates/victory-gpu/src/host.rs:2381-2434`) cleanly separate pending coalescing (`push_range` with `COALESCE = PAGE`, `:2438-2461`) from flushed coverage (`push_copied`, `:2475-2489`). Because `pending` stays sorted with pairwise gaps `> COALESCE`, a single left-to-right sweep in `push_range` never misses transitive merges. - `push_copied`'s join predicate `lo.div_ceil(PAGE) <= hi / PAGE` holds iff the intersection contains a page boundary, guaranteeing that every whole 64 KiB page inside a joined `current` range was covered whole by a single `Shadow::update` and therefore guarded—closing both the pages-0-2-1 gap bug and the `#2473` split-page hole. `covered` (`:2464-2466`) conservatively requires containment within one range, `title_written()` still flushes and clears `current`, and coalescing up to one page across `pending` interacts safely with `Shadow::update` / `shadow.pending` (strictly narrower than `main`'s `[min, max]` span). - Minor non-blocking doc nit: the comment on `push_copied` (`host.rs:2474`) says "intersection contains a whole page", whereas the condition tests for a page boundary (which is the exact necessary and sufficient condition). - **Verification**: - Clean `git merge-tree` against `origin/main` (`63bcca43`); `cargo xtask policy` (`184 files ok`); `cargo clippy -p victory-gpu --all-targets -- -D warnings` clean with default features and `--all-features` (both at `3a2279fd` and merged onto `63bcca43`). - At `3a2279fd`: RTX 5090 (default) `batch::` **6/6** passed; RTX 5090 + `VICTORY_D3D12_DEBUG=1` `batch::` + `draw::tests` **17/17** passed; WARP (`VICTORY_D3D12_WARP=1`) + `VICTORY_D3D12_DEBUG=1` `batch::` + `memory::tests` + `draw::tests` **22/22** passed. - Merged onto `origin/main` (`63bcca43`) with `VICTORY_D3D12_DEBUG=1`: RTX 5090 `batch::` + `draw::tests` **26/26** passed; WARP `batch::` + `memory::tests` **14/14** passed. LGTM.
slauko commented 2026-11-26 16:05:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slauko on 2026-11-26T15:39:57Z.


Porting the disjoint half to a Linux/Wine line (RTX 3080 Ti, vkd3d-proton ec20719, uiliannn's base) and measuring the other half, because they are two changes and not one: a copy's ranges that touch are one pass.

This line had the span, and Batch::flush then called Shadow::update once per recorded range anyway. At ~5,000 draws a frame that was 34,282 watch::writes calls a frame (18,887 answered from the journal, 16,395 by the kernel), 40.6–41.2 ms, and the same pages copied several times a submission where the title names overlapping views of one buffer — 166–173 MB a frame at 9.7 GB/s, though 83–85% of the sampled words were already equal.

Sorting a copy's ranges and updating each run where the ranges touch (m66, same build otherwise):

per frame before after
writes calls 34,282 8,965
the asking 40.6–41.2 ms 5.9–6.4 ms
the copies 166–173 MB / 17 ms 52–57 MB / 5.9 ms
preparing 100–110 ms 57–63 ms

Two notes for porters:

  • The pages' times are per page, so a wider range changes which pages are copied, not whether: pages between two ranges are copied only if the journal names them. Merging touching ranges is therefore free; splitting distant ones (your change) is what keeps the range from taking in the gap.
  • The per-call journal walk was the cost, not the span: 18,887 journal answers for 77,890 pages plus 16,395 kernel calls. Cutting the number of calls bought four times what the span did.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7196582301 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7196582301). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T15:39:57Z. --- Porting the disjoint half to a Linux/Wine line (RTX 3080 Ti, vkd3d-proton `ec20719`, uiliannn's base) and measuring the *other* half, because they are two changes and not one: **a copy's ranges that touch are one pass**. This line had the span, and `Batch::flush` then called `Shadow::update` once per recorded range anyway. At ~5,000 draws a frame that was **34,282 `watch::writes` calls a frame** (18,887 answered from the journal, 16,395 by the kernel), 40.6–41.2 ms, and the same pages copied several times a submission where the title names overlapping views of one buffer — 166–173 MB a frame at 9.7 GB/s, though 83–85% of the sampled words were already equal. Sorting a copy's ranges and updating each run where the ranges touch (`m66`, same build otherwise): | per frame | before | after | |---|---:|---:| | `writes` calls | 34,282 | **8,965** | | the asking | 40.6–41.2 ms | **5.9–6.4 ms** | | the copies | 166–173 MB / 17 ms | **52–57 MB / 5.9 ms** | | preparing | 100–110 ms | **57–63 ms** | Two notes for porters: - The pages' times are per page, so a wider range changes *which* pages are copied, not whether: pages between two ranges are copied only if the journal names them. Merging touching ranges is therefore free; splitting distant ones (your change) is what keeps the range from taking in the gap. - The per-call journal walk was the cost, not the span: 18,887 journal answers for 77,890 pages plus 16,395 kernel calls. Cutting the *number* of calls bought four times what the span did.
slauko commented 2026-11-26 17:05:09 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slauko on 2026-11-26T17:05:09Z.


A correction to my numbers above: the merged run I measured (m66: 8,965 calls, 5.9-6.4 ms asking, 52-57 MB copied, preparing 57-63 ms) was a prologue frame, and with that change in, the title never reached the cell again.

  • m66-m79: the title sits on the prologue's card, 3,000-3,100 draws, 121-137 ms, draw count never rising.
  • The pre-merge binary reaches the cell (m76: 4,976 draws, 209.8-214.8 ms); sorted, in recording order and capped at 4 MiB all do not (m77, m78), VICTORY_REFRESH_SCAN=0 does not either (m79).
  • With the merge out and the rest kept: cell 205.1 ms median (m80, 4,968-5,000 draws), the asking 34.3-34.6 ms at ~34,000 writes calls.

What still holds: cutting the number of calls is the lever (the per-call journal walk dominates), and the disjoint-ranges half of this PR is untouched by the above — it was in the tree on both sides of that comparison. What does not hold is "merge touching ranges into one pass and be done": on this line it changed what the intro's transition needs, and I could not get the cell back with it in any variant.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7198475962 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7198475962). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T17:05:09Z. --- A correction to my numbers above: the merged run I measured (`m66`: 8,965 calls, 5.9-6.4 ms asking, 52-57 MB copied, preparing 57-63 ms) was a **prologue frame**, and with that change in, the title never reached the cell again. - `m66`-`m79`: the title sits on the prologue's card, 3,000-3,100 draws, 121-137 ms, draw count never rising. - The **pre-merge binary reaches the cell** (`m76`: 4,976 draws, 209.8-214.8 ms); sorted, in recording order and capped at 4 MiB all do not (`m77`, `m78`), `VICTORY_REFRESH_SCAN=0` does not either (`m79`). - With the merge out and the rest kept: cell **205.1 ms** median (`m80`, 4,968-5,000 draws), the asking 34.3-34.6 ms at ~34,000 `writes` calls. What still holds: cutting the number of calls is the lever (the per-call journal walk dominates), and the disjoint-ranges half of this PR is untouched by the above — it was in the tree on both sides of that comparison. What does not hold is "merge touching ranges into one pass and be done": on this line it changed what the intro's transition needs, and I could not get the cell back with it in any variant.
slauko commented 2026-11-26 18:03:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by slauko on 2026-11-26T18:03:29Z.


The follow-up to my earlier numbers, and it closes the coalescing question on this line: one asking per copy per submission is 193.7/200.3 ms against 205.1 (m80) and breaks the picture.

The shape: one GetWriteWatch per copy for everything the submission refreshes, each range's update served from that answer, update order unchanged. The copies fall from 55-60 ms for 170-180 MB to 20-22 ms for 156-167 MB, the cell to 193.7 (m87) and 200.3 ms (m88) — and m88, same build, is visibly broken (floating polygons, garbage geometry, black clipping on the character). The answer is taken before the lists run; pages the title writes after it are lost for that submission.

Reverted (0360aad5). Together with the merged-range variant (34 ms of asking saved, title stays on its prologue card) the conclusion for this stack is: the asking stays per range, and the coalescing has to come from something that does not widen or pre-date the asking — which I have not found yet.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200003776 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7200003776). Originally posted by [slauko](https://github.com/slauko) on 2026-11-26T18:03:29Z. --- The follow-up to my earlier numbers, and it closes the coalescing question on this line: **one asking per copy per submission is 193.7/200.3 ms against 205.1 (`m80`) and breaks the picture.** The shape: one `GetWriteWatch` per copy for everything the submission refreshes, each range's update served from that answer, update order unchanged. The copies fall from 55-60 ms for 170-180 MB to **20-22 ms for 156-167 MB**, the cell to 193.7 (`m87`) and 200.3 ms (`m88`) — and `m88`, same build, is visibly broken (floating polygons, garbage geometry, black clipping on the character). The answer is taken before the lists run; pages the title writes after it are lost for that submission. Reverted (`0360aad5`). Together with the merged-range variant (34 ms of asking saved, title stays on its prologue card) the conclusion for this stack is: the asking stays per range, and the coalescing has to come from something that does not widen or pre-date the asking — which I have not found yet.
borosf commented 2026-11-26 18:39:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-26T18:39:29Z.


@slauko thanks for the measurements — noted on the coalescing variants: per-range asking stays, and anything that widens or pre-dates the GetWriteWatch answer loses pages the title writes after it (your m87/m88 breakage). The disjoint-ranges half of this PR (head 3a2279f) is untouched by all of that, as you say — it only changes which ranges of one copy get refreshed, not when the asking happens. Keeping it as is.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7200708628 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7200708628). Originally posted by [borosf](https://github.com/borosf) on 2026-11-26T18:39:29Z. --- @slauko thanks for the measurements — noted on the coalescing variants: per-range asking stays, and anything that widens or pre-dates the `GetWriteWatch` answer loses pages the title writes after it (your m87/m88 breakage). The disjoint-ranges half of this PR (head `3a2279f`) is untouched by all of that, as you say — it only changes which ranges of one copy get refreshed, not when the asking happens. Keeping it as is.
rpmaster2 commented 2026-11-27 18:20:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-27T18:20:54Z.


RDNA4 (RX 9070 XT, 32 GB): no regression seen; the world renders, but this machine cannot measure the PR's effect.

Setup: RX 9070 XT 16 GB, Adrenalin 26.11.2 (32.0.32029.2010), Ryzen 5 5600, 32 GB DDR4-3600, Windows 11 10.0.26100.9974. This PR at 8f61b6d (base 67e8ae1, which is older than the control below), cargo build --locked --profile diag -p victory --features diagnostics, 27 s. --console series-x, VICTORY_PRESENT_TARGET=1x1:1, scripted keys, the same dump and save, warm shader and pipeline caches, empty driver cache after a reboot.

One 300 s run, private bytes and page file sampled every 20 s:

0.3-0.9 fps, 1,067-3,031 ms/frame
draws a frame 2,756-6,144
copies 320-379 ms / 700-750 MB
copy-back 157-179 ms
on the GPU 207-242 ms
private 16.0 -> 28.0 GB, page file up to 3.3 GB
black frames 2, no exception
the process ended on its own at 200 s

Control on the same machine, main 63bcca4: 0.5-1.2 fps, 810-2,126 ms, 2,004-7,195 draws, copies 137-492 ms / 465-994 MB, private 26.2-27.6 GB, and it also ended on its own (220 s) with no exception in the log.

So: same ballpark, the world draws, nothing crashes — but at half a frame a second on this card both builds spend one to three seconds a frame in copies and page-file traffic (28 GB of private memory on 32 GB), and the copy figures swing with the camera by much more than any difference the PR could make. I cannot honestly claim a gain or a loss from this run.

Two options for a better measurement, if it is worth your time:

  • I can run both builds with --console series-s, where the same save uses visibly less memory and copies, and take the copy counters (MB and ms) rather than the frame time;
  • or run the copy-heavy spot twice per build and compare medians of the copies counter only, which is what the PR changes, instead of the full frame.

I have the machine and the caches warm, so either is about 20 minutes.

AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; counts and versions only, no game files or paths.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225393834 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7225393834). Originally posted by [rpmaster2](https://github.com/rpmaster2) on 2026-11-27T18:20:54Z. --- **RDNA4 (RX 9070 XT, 32 GB): no regression seen; the world renders, but this machine cannot measure the PR's effect.** Setup: RX 9070 XT 16 GB, Adrenalin 26.11.2 (32.0.32029.2010), Ryzen 5 5600, 32 GB DDR4-3600, Windows 11 10.0.26100.9974. This PR at `8f61b6d` (base `67e8ae1`, which is older than the control below), `cargo build --locked --profile diag -p victory --features diagnostics`, 27 s. `--console series-x`, `VICTORY_PRESENT_TARGET=1x1:1`, scripted keys, the same dump and save, warm shader and pipeline caches, empty driver cache after a reboot. One 300 s run, private bytes and page file sampled every 20 s: ``` 0.3-0.9 fps, 1,067-3,031 ms/frame draws a frame 2,756-6,144 copies 320-379 ms / 700-750 MB copy-back 157-179 ms on the GPU 207-242 ms private 16.0 -> 28.0 GB, page file up to 3.3 GB black frames 2, no exception the process ended on its own at 200 s ``` Control on the same machine, `main` `63bcca4`: 0.5-1.2 fps, 810-2,126 ms, 2,004-7,195 draws, copies 137-492 ms / 465-994 MB, private 26.2-27.6 GB, and it also ended on its own (220 s) with no exception in the log. So: same ballpark, the world draws, nothing crashes — but at half a frame a second on this card both builds spend one to three seconds a frame in copies and page-file traffic (28 GB of private memory on 32 GB), and the copy figures swing with the camera by much more than any difference the PR could make. I cannot honestly claim a gain or a loss from this run. Two options for a better measurement, if it is worth your time: - I can run both builds with `--console series-s`, where the same save uses visibly less memory and copies, and take the copy counters (MB and ms) rather than the frame time; - or run the copy-heavy spot twice per build and compare medians of the `copies` counter only, which is what the PR changes, instead of the full frame. I have the machine and the caches warm, so either is about 20 minutes. AI-assisted: written by DeepSeek (OpenCode harness) from my run logs; counts and versions only, no game files or paths.
rpmaster2 commented 2026-11-27 18:22:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by rpmaster2 on 2026-11-27T18:22:06Z.


Correction to my comment above, from the person at the screen: the world never became visible in that run.

What I called "reached the world" was the draw counter — 2,756-6,144 draws a frame. On screen it was a flickering set of frames with audio (the load and the intro sequence playing), and no playable picture at any point in the 200 s. So the honest reading of my run is: the PR does not crash and does not stop the title, the layer keeps drawing thousands of draws a frame, but nothing stable reaches the screen on this card, exactly as with main in the same state.

That also means my comparison with the control is weaker than it looked: main on the same save shows the same flicker plus audio for minutes, and I should not use the draw counts as evidence that either build is "in the world". What is solid is only this: copies 320-379 ms / 700-750 MB a frame, copy-back 157-179 ms, private 16 -> 28 GB, page file to 3.3 GB, 2 black frames, no exception, self-exit at 200 s.

To measure what this PR actually changes, the run has to be one where the picture is up: for me that is either --console series-s (less memory, less copying, the picture comes up on this machine where series-x does not) or a copy-counter-only comparison at a fixed spot. I would rather withdraw the "no regression" sentence than leave it standing on a draw counter.

AI-assisted: written by DeepSeek (OpenCode harness).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225414908 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7225414908). Originally posted by [rpmaster2](https://github.com/rpmaster2) on 2026-11-27T18:22:06Z. --- Correction to my comment above, from the person at the screen: **the world never became visible in that run.** What I called "reached the world" was the draw counter — 2,756-6,144 draws a frame. On screen it was a flickering set of frames with audio (the load and the intro sequence playing), and no playable picture at any point in the 200 s. So the honest reading of my run is: the PR does not crash and does not stop the title, the layer keeps drawing thousands of draws a frame, but nothing stable reaches the screen on this card, exactly as with `main` in the same state. That also means my comparison with the control is weaker than it looked: `main` on the same save shows the same flicker plus audio for minutes, and I should not use the draw counts as evidence that either build is "in the world". What is solid is only this: copies 320-379 ms / 700-750 MB a frame, copy-back 157-179 ms, private 16 -> 28 GB, page file to 3.3 GB, 2 black frames, no exception, self-exit at 200 s. To measure what this PR actually changes, the run has to be one where the picture is up: for me that is either `--console series-s` (less memory, less copying, the picture comes up on this machine where series-x does not) or a copy-counter-only comparison at a fixed spot. I would rather withdraw the "no regression" sentence than leave it standing on a draw counter. AI-assisted: written by DeepSeek (OpenCode harness).
dux14 commented 2026-11-29 05:39:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by dux14 on 2026-11-29T05:39:47Z.


The #2473 fix here is the same join rule as #2474, so this PR is not the minimal fix for that issue. Suggest keeping this one scoped to the performance rework and rebasing after #2474 lands. Two things in the tests and docs: a_page_between_flushed_ranges_is_refreshed_when_asked_for also passes on main, and the push_copied doc says "whole page" while the code tests a page boundary.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7251385739 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2428#issuecomment-7251385739). Originally posted by [dux14](https://github.com/dux14) on 2026-11-29T05:39:47Z. --- The #2473 fix here is the same join rule as #2474, so this PR is not the minimal fix for that issue. Suggest keeping this one scoped to the performance rework and rebasing after #2474 lands. Two things in the tests and docs: `a_page_between_flushed_ranges_is_refreshed_when_asked_for` also passes on main, and the `push_copied` doc says "whole page" while the code tests a page boundary.
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/2428:upstream-pr/2428'
git switch 'upstream-pr/2428'

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