Skip to content

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

Closed
borosf wants to merge 1 commit into
Marvisak:mainfrom
borosf:vibe/disjoint-refresh-ranges-842ca5
Closed

borosf wants to merge 1 commit into
Marvisak:mainfrom
borosf:vibe/disjoint-refresh-ranges-842ca5

Conversation

@borosf

@borosf borosf commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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 a small pure function (push_range), model-checked against a brute-force coalescer over thousands of random range sequences; unit tests cover the coalescing/bridging rules, and an integration test shows two distant refreshes of one watched copy stay apart.

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 on Intel Arc B580: 143 passed, 2 failed with only the two known Intel heap-cap failures pristine main also has, 2 benchmarks ignored. Includes the new ranges_of_a_copy_stay_disjoint, distant_refreshes_of_a_copy_are_copied_apart, and the existing refresh-semantics tests unchanged.
  • The merge algorithm fuzz-matches a reference coalescer (8,000 random operations).
  • 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).

Co-authored-by: borosf <borosf@users.noreply.github.com>
@borosf borosf closed this Nov 25, 2026
@borosf
borosf deleted the vibe/disjoint-refresh-ranges-842ca5 branch November 25, 2026 13:12

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A submission refreshes a copy's ranges disjoint — duplicates #2349 (same disjoint-coalescing rewrite of the same host.rs section, nearly identical comment text). Whichever merges second conflicts; suggest closing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants