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

Closed
github-bot wants to merge 1 commit from gh-pr/2419/head into gh-pr/2419/base
Owner

@⁠borosf on GitHub · 2026-11-25 13:10 UTC · original
borosf:vibe/disjoint-refresh-ranges-842ca5 → main · +126 −42 · 1 files · 1 commits · closed without merging

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).

**@⁠borosf** on GitHub · 2026-11-25 13:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/2419) `borosf:vibe/disjoint-refresh-ranges-842ca5` → `main` · +126 −42 · 1 files · 1 commits · closed without merging ## 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 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).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:05:16 +00:00
github-bot closed this pull request 2026-11-26 05:05:16 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2419
No description provided.