perf(gpu): port placed-fill-on-card readback avoidance and incremental list fronts #408

Merged
Androtim merged 5 commits from upstream-pr/408 into main 2026-12-03 23:15:08 +00:00
Androtim commented 2026-12-03 20:19:22 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T20:19:22Z.


Summary

Ports two verified GPL-3.0 GPU/CPU submission optimizations into \ ictory-gpu:

  1. In-Place Card Fill Readback Avoidance (\VICTORY_PLACED_FILL_CARD) — ported from \ i-rdna4/VIctory-9070XT\ (\7b47335, GPL-3.0, license verified via GitHub API):

    • When a constant-buffer fill rereads bytes written by one or more in-place GPU copies (\Step::Placed) that in-flight submissions keep out of title memory, repoint its dedicated descriptor slot (\card_steps::FillTo::Slot) directly to the destination host copy via \descriptor::constant_slot\ instead of blocking the submitting thread for card completion.
    • Includes \VICTORY_PLACED_FILL_MULTI\ (multi-copy coverage into a single host copy), \VICTORY_PLACED_ORDER_AWARE\ (skip false waits when a CPU reader stands strictly ahead of a kept placed copy and does not overlap in-flight writes), and \VICTORY_PLACED_STALE_FIX\ (refuse \card_steps\ if a placed copy would be read stale on the CPU). All default on with =0\ opt-out, latched once per submission under the submission lock via \place::fill_card_latch().
    • Adapted cleanly to MiniVI's \Deferred::steps(), \Step::GpuTexture, and \card_steps::take_steps_full.
  2. Incremental Per-List Front Folding (\VICTORY_LIST_FRONTS\ / \FrontAcc) — ported from \ReTerryDavis/ReVIctory\ (\d297b1, GPL-3.0, license verified via GitHub API):

    • Adds \crates/victory-gpu/src/host/front.rs\ with \FrontAcc, \ListFront, \join_keys_with, and \join_fronts, adapted to preserve MiniVI's disjoint-run \span_envelope\ / \span_gap\ splitting.
    • Incrementally folds per-list pre-write refresh spans, whole refresh spans, GPU writes, and staged textures during parallel command-list recording instead of rescanning every deferred step multiple times on \ ictory-submit.
    • Keeps \FrontAcc\ exact across \heap_order::take_into\ and \HostList::take_coming\ refresh splices (with automatic \dirty\ fallback if a splice occurs after a \GpuWrite).

Verification

  • \cargo test -p victory-gpu -- host::place::tests host::front::tests: 15 passed, 0 failed (1 ignored benchmark), including 6,000 randomized envelope + disjoint-run equivalence trials.
  • \cargo test -p victory-gpu --lib -- host::: 260 passed, 0 failed (17 ignored).
  • \cargo clippy --workspace --all-targets -- -D warnings: 0 warnings.
  • \cargo xtask policy: 358 files ok.
<!-- greyfinch-sync:Androtim/MiniVI:issue:5634244603 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/408). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T20:19:22Z. --- ## Summary Ports two verified GPL-3.0 GPU/CPU submission optimizations into \ ictory-gpu\: 1. **In-Place Card Fill Readback Avoidance (\VICTORY_PLACED_FILL_CARD\)** — ported from \ i-rdna4/VIctory-9070XT\ (\7b47335\, **GPL-3.0**, license verified via GitHub API): - When a constant-buffer fill rereads bytes written by one or more in-place GPU copies (\Step::Placed\) that in-flight submissions keep out of title memory, repoint its dedicated descriptor slot (\card_steps::FillTo::Slot\) directly to the destination host copy via \descriptor::constant_slot\ instead of blocking the submitting thread for card completion. - Includes \VICTORY_PLACED_FILL_MULTI\ (multi-copy coverage into a single host copy), \VICTORY_PLACED_ORDER_AWARE\ (skip false waits when a CPU reader stands strictly ahead of a kept placed copy and does not overlap in-flight writes), and \VICTORY_PLACED_STALE_FIX\ (refuse \card_steps\ if a placed copy would be read stale on the CPU). All default on with \=0\ opt-out, latched once per submission under the submission lock via \place::fill_card_latch()\. - Adapted cleanly to MiniVI's \Deferred::steps()\, \Step::GpuTexture\, and \card_steps::take_steps_full\. 2. **Incremental Per-List Front Folding (\VICTORY_LIST_FRONTS\ / \FrontAcc\)** — ported from \ReTerryDavis/ReVIctory\ (\d297b1\, **GPL-3.0**, license verified via GitHub API): - Adds \crates/victory-gpu/src/host/front.rs\ with \FrontAcc\, \ListFront\, \join_keys_with\, and \join_fronts\, adapted to preserve MiniVI's disjoint-run \span_envelope\ / \span_gap\ splitting. - Incrementally folds per-list pre-write refresh spans, whole refresh spans, GPU writes, and staged textures during parallel command-list recording instead of rescanning every deferred step multiple times on \ ictory-submit\. - Keeps \FrontAcc\ exact across \heap_order::take_into\ and \HostList::take_coming\ refresh splices (with automatic \dirty\ fallback if a splice occurs after a \GpuWrite\). ## Verification - \cargo test -p victory-gpu -- host::place::tests host::front::tests\: **15 passed, 0 failed** (1 ignored benchmark), including 6,000 randomized envelope + disjoint-run equivalence trials. - \cargo test -p victory-gpu --lib -- host::\: **260 passed, 0 failed** (17 ignored). - \cargo clippy --workspace --all-targets -- -D warnings\: **0 warnings**. - \cargo xtask policy\: **358 files ok**.
Androtim commented 2026-12-03 20:32:50 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T20:32:50Z.


Triage (b69ec4f7, CI check PASS):

  • Clean, 100% title-neutral 2-part submission optimization (+1,513/-30, 5 files: host.rs, card_steps.rs, front.rs, heap_order.rs, place.rs) with zero opt-in toggles (VICTORY_PLACED_FILL_CARD, VICTORY_PLACED_FILL_MULTI, VICTORY_PLACED_ORDER_AWARE, VICTORY_PLACED_STALE_FIX, VICTORY_LIST_FRONTS are all default-on with =0 kill-switches).
  • Holding auto-merge for Gate 2 Deep Reasoning Audit (#282) (specifically checking Step::Placed slot repointing / stale-read refusal & FrontAcc splice-dirtying invariants) + Gate 3 live plain---release 1440p/4K A/B vs main (565c8c15) + --features diagnostics visual verification.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7391407048 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/408#issuecomment-7391407048). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T20:32:50Z. --- Triage (`b69ec4f7`, **CI `check` PASS**): - Clean, 100% title-neutral 2-part submission optimization (`+1,513/-30`, 5 files: `host.rs`, `card_steps.rs`, `front.rs`, `heap_order.rs`, `place.rs`) with **zero opt-in toggles** (`VICTORY_PLACED_FILL_CARD`, `VICTORY_PLACED_FILL_MULTI`, `VICTORY_PLACED_ORDER_AWARE`, `VICTORY_PLACED_STALE_FIX`, `VICTORY_LIST_FRONTS` are all default-on with `=0` kill-switches). - Holding auto-merge for **Gate 2 Deep Reasoning Audit (`#282`)** (specifically checking `Step::Placed` slot repointing / stale-read refusal & `FrontAcc` splice-dirtying invariants) + **Gate 3 live plain-`--release` 1440p/4K A/B** vs `main` (`565c8c15`) + `--features diagnostics` visual verification.
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!408
No description provided.