gpu: fuse AVX2 shadow diff/update and merge passes (VICTORY_UNDER_FUSED) #188

Closed
Androtim wants to merge 0 commits from upstream-pr/188 into main
Androtim commented 2026-11-30 03:02:28 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-30T03:02:28Z.


Summary

  • Add word_runs_and_update / word_runs_and_update_avx2 to compare title memory against the host snapshot and copy differing 32-byte AVX2 chunks in a single pass, and use it in the SEND diff path and card-backed write-merge path.
  • Add merge_page_fused gated by VICTORY_UNDER_FUSED (enabled by default) so merge_page_under_writes compares and updates aligned card-backed pages in one pass whenever standalone-copy headroom covers the page bound (n / 260 + 1), returning unused copy credits afterward.
  • Replace per-page binary searches in stale_pages_in / stale_pages_in_atomic with a shared linear two-pointer scan (stale_pages_with) seeded once via partition_point.
  • Added unit tests merge_tests::word_runs_and_update_matches_word_runs_and_copies_exactly, merge_tests::a_page_merged_in_one_pass_is_the_page_merged_in_two, and land_tests::title_bytes_go_in_under_writes_the_same_in_one_pass_and_in_two, plus cursor-skip coverage in stale_tests::pages_never_taken_are_stale_written_or_not.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy (311 files ok)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu shadow:: -- --test-threads=1 (46 passed; 0 failed; 2 ignored)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings
  • Live 75s Series S verification (PlayParity): all 6 gates PASS, median 12.9 fps (preparing 34.5 ms), used_max=6409 MB / budget_min=6838 MB (over=0 MB, room_false=70.6%), final_waiting=1960, mapped_rate=8.25 ms/s, lit=19/24 (luma=104.7, near_black=0.0%, magenta=0.0%), 0 crashes; late captured PNGs visually verified crisp.
  • Live 75s Series X 1440p verification (PlayParity): median 10.5 fps (preparing 39.2 ms), min 5.5 fps, lit=18/24 (luma=105.47, near_black=0.0%, magenta=0.0%), 0 crashes; late captured PNGs visually verified crisp.
<!-- greyfinch-sync:Androtim/MiniVI:issue:5558199859 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/188). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-30T03:02:28Z. --- ## Summary - Add `word_runs_and_update` / `word_runs_and_update_avx2` to compare title memory against the host snapshot and copy differing 32-byte AVX2 chunks in a single pass, and use it in the `SEND` diff path and card-backed write-merge path. - Add `merge_page_fused` gated by `VICTORY_UNDER_FUSED` (enabled by default) so `merge_page_under_writes` compares and updates aligned card-backed pages in one pass whenever standalone-copy headroom covers the page bound (`n / 260 + 1`), returning unused copy credits afterward. - Replace per-page binary searches in `stale_pages_in` / `stale_pages_in_atomic` with a shared linear two-pointer scan (`stale_pages_with`) seeded once via `partition_point`. - Added unit tests `merge_tests::word_runs_and_update_matches_word_runs_and_copies_exactly`, `merge_tests::a_page_merged_in_one_pass_is_the_page_merged_in_two`, and `land_tests::title_bytes_go_in_under_writes_the_same_in_one_pass_and_in_two`, plus cursor-skip coverage in `stale_tests::pages_never_taken_are_stale_written_or_not`. ## Verification - `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`311 files ok`) - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu shadow:: -- --test-threads=1` (`46 passed; 0 failed; 2 ignored`) - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings` - Live 75s Series S verification (`PlayParity`): **all 6 gates PASS**, median `12.9 fps` (`preparing 34.5 ms`), `used_max=6409 MB / budget_min=6838 MB` (`over=0 MB`, `room_false=70.6%`), `final_waiting=1960`, `mapped_rate=8.25 ms/s`, `lit=19/24` (`luma=104.7`, `near_black=0.0%`, `magenta=0.0%`), `0` crashes; late captured PNGs visually verified crisp. - Live 75s Series X 1440p verification (`PlayParity`): median `10.5 fps` (`preparing 39.2 ms`), `min 5.5 fps`, `lit=18/24` (`luma=105.47`, `near_black=0.0%`, `magenta=0.0%`), `0` crashes; late captured PNGs visually verified crisp.
Androtim commented 2026-11-30 04:03:56 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-30T04:03:56Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-rebase · CI (check): passing

This PR no longer merges cleanly into main.

To change the verdict: Rebase onto current main and resolve conflicts; CI and triage will run again automatically.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7268436233 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/188#issuecomment-7268436233). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-30T04:03:56Z. --- <!-- minivi-triage v1 head=cab1cbfa8a8888f34d2cb012daa36d5ff756cc8a verdict=needs-rebase ci=passing at=2026-11-30T16:03:01Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `passing` This PR no longer merges cleanly into `main`. **To change the verdict:** Rebase onto current `main` and resolve conflicts; CI and triage will run again automatically. --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-30 08:41:03 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-30T08:41:03Z.


GitHub reports merge conflicts against current main after Wave 6 merged. Please rebase onto latest main.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7273213361 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/188#issuecomment-7273213361). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-30T08:41:03Z. --- GitHub reports merge conflicts against current `main` after Wave 6 merged. Please rebase onto latest `main`.
Androtim commented 2026-12-01 01:38:15 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-01T01:38:15Z.


Closing conflicting opt-in VICTORY_* toggle PR per #276 policy (replace flawed base paths with default-on replacements rather than stacking opt-in toggles).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7297725244 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/188#issuecomment-7297725244). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-01T01:38:15Z. --- Closing conflicting opt-in VICTORY_* toggle PR per #276 policy (replace flawed base paths with default-on replacements rather than stacking opt-in toggles).

Pull request closed

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
Androtim/MiniVI!188
No description provided.