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

Manually merged
github merged 5 commits from github-bot/gh-408 into gh-pr/408/base 2026-12-03 23:19:40 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-03 20:19 UTC · original
Androtim:perf/placed-fill-card-and-list-fronts → main · +1490 −30 · 5 files · 5 commits · merged 2026-12-03 23:15 UTC

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** on GitHub · 2026-12-03 20:19 UTC · [original](https://github.com/Androtim/MiniVI/pull/408) `Androtim:perf/placed-fill-card-and-list-fronts` → `main` · +1490 −30 · 5 files · 5 commits · merged 2026-12-03 23:15 UTC ## 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**.
- Port VICTORY_PLACED_FILL_CARD (plus VICTORY_PLACED_FILL_MULTI,
  VICTORY_PLACED_ORDER_AWARE, and VICTORY_PLACED_STALE_FIX) from
  vi-rdna4/VIctory-9070XT (7b47335, GPL-3.0):
  - When a constant-buffer fill rereads the destination of an in-place
    GPU copy kept out of title memory by in-flight submissions, repoint
    its dedicated descriptor slot to the destination host copy on the GPU
    instead of blocking the submitting thread for card completion.
  - Skip false waits for CPU readers standing strictly ahead of a kept
    in-place copy (when no in-flight write overlaps the read) and guard
    card_steps against leaving placed copies read stale on the CPU.
- Port VICTORY_LIST_FRONTS (FrontAcc / ListFront / join_fronts) from
  ReTerryDavis/ReVIctory (ad297b1, GPL-3.0), adapted to MiniVI's
  disjoint-run span_envelope / span_gap splitting:
  - Incrementally fold per-list pre-write refresh spans, whole refresh
    spans, GPU writes, and staged textures during command-list recording
    instead of rescanning all deferred steps multiple times on
    victory-submit.
  - Preserve exactness across heap_order::take_into and
    HostList::take_coming refresh splices.
- Add comprehensive unit tests for both host::place and host::front
  (including 6,000 randomized envelope and disjoint-run equivalence runs).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 20:20:40 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-03 20:32 UTC · original

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.
**@⁠Androtim** on GitHub · 2026-12-03 20:32 UTC · [original](https://github.com/Androtim/MiniVI/pull/408#issuecomment-7391407048) 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.
github-bot changed target branch from main to gh-pr/408/base 2026-12-03 23:19:39 +00:00
github manually merged commit c0d1e40381 into gh-pr/408/base 2026-12-03 23:19:40 +00:00
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/Androtim--MiniVI!408
No description provided.