Plan a submission's card steps once #322

Open
github-bot wants to merge 1 commit from github-bot/gh-322 into main AGit
Owner

@⁠PetrSeifert on GitHub · 2026-11-27 16:38 UTC · original
PetrSeifert:perf/card-steps-preplan → main · +101 −39 · 2 files · 1 commits · open

Summary

Split out from #284 per review feedback as a standalone single-change PR on origin/main (38c4cf9).

With VICTORY_PLACED_ORDER=1, Host::execute_parts called card_steps::cut_for(&runs) to gather a submission's steps and plan them just to check whether a cut was needed, and Host::card_steps then gathered and planned the exact same submission a second time under the submission lock.

This change replaces cut_for with cut_or_plan: when no cut is needed, it passes the gathered steps and plan (Preplan) into send_late → submit → card_steps, which reuses them directly if the active flights' shader-written ranges are unchanged and falls back to re-planning otherwise. The cut and split-error paths pass None.

Merge-order note: This PR and #285 (perf/placed-fill-read-through) both touch cut_for / take_steps and Preplan.chosen (Vec<(usize, u32)> here vs Vec<Planned> in #285); whichever merges second will need a small mechanical rebase.

Verification

Automated checks

  • cargo xtask policy --staged — passed
  • git diff --check — clean
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics) — passed
  • cargo test --locked -p victory-gpu --lib -- --test-threads=1 (default and --features diagnostics) — passed (single-threaded due to the pre-existing parallel flake in host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes on unmodified main)

Real-title comparison (GTA VI, Series S, standard -Machine 4070 diag build)

  • Hardware: Windows 11, AMD Ryzen 5 7600 (6C/12T), 63.1 GB RAM, NVIDIA GeForce RTX 4070 12 GB
  • Methodology: Single warm-cache run per build (target\diag\victory.exe shared path). Diner comparisons use the exact contiguous being_made = 0 diner window (n=11 five-second samples, excluding initial scene-load spike and final transition), plus whole-diner submit time.
  • Control: Unmodified origin/main (38c4cf9, SHA-256 F3DF678E..., base38-r3, being_made = 0 from +8s; plus settled cell tail from base38-r2)
  • PR build: ee7eb38 (SHA-256 B2702CC5..., preplan-r2, being_made = 0 from +7s)
  • Flags: Same route and VICTORY_* settings (scripts/play.ps1 -Console series-s -Machine 4070 -Build diag + VICTORY_PIPELINE_WORKERS=8, VICTORY_FULLSCREEN=1, VICTORY_PANEL=1)
Window (being_made = 0, single run each) base38-r3 (38c4cf9) preplan-r2 (ee7eb38) Delta
Contiguous diner FPS (n=11 5s samples) 14.50 FPS (med 15.40, 69.81 ms) 16.27 FPS (med 16.50, 62.62 ms) +1.77 FPS (−7.19 ms)
Contiguous diner submitting thread (n=51 1s samples) 60.82 ms 57.85 ms −2.97 ms
Whole diner submitting thread (incl. load transient) 61.72 ms 60.51 ms −1.21 ms
Early Prologue cell FPS (first 15s, ~4,650 draws) 18.80 FPS (53.23 ms) 19.63 FPS (50.97 ms) +0.83 FPS (flat vs base38-r2 settled tail 19.80 FPS)
Early Prologue cell submitting thread 49.41 ms 48.10 ms −1.31 ms
Early Prologue cell planning steps done on the card 3.13 ms 2.85 ms −0.28 ms

(Note: because cut_or_plan runs outside the submission lock and outside the planning steps done on the card timer, the cell FPS delta is within single-run spread relative to the settled base38-r2 tail 19.80 FPS, while the contiguous diner window showed the clearest submit-thread reduction.)

Full-video visual review

  • Reviewed full 1080p30 captures of base38-r3 (140.8s) and preplan-r2 (149.2s) via start-to-finish contact sheets and full-resolution diner/cell frames: 0 errors, 0 DRED. Clean diner waitress and Prologue cell rendering throughout (one brief Lucia eye-texture streaming miss in one diner shot under VICTORY_TEXTURE_NO_WAIT=1, clearing on the next cut).
**@⁠PetrSeifert** on GitHub · 2026-11-27 16:38 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/322) `PetrSeifert:perf/card-steps-preplan` → `main` · +101 −39 · 2 files · 1 commits · open ## Summary Split out from #284 per review feedback as a standalone single-change PR on `origin/main` (`38c4cf9`). With `VICTORY_PLACED_ORDER=1`, `Host::execute_parts` called `card_steps::cut_for(&runs)` to gather a submission's steps and plan them just to check whether a cut was needed, and `Host::card_steps` then gathered and planned the exact same submission a second time under the submission lock. This change replaces `cut_for` with `cut_or_plan`: when no cut is needed, it passes the gathered steps and plan (`Preplan`) into `send_late` → `submit` → `card_steps`, which reuses them directly if the active flights' shader-written ranges are unchanged and falls back to re-planning otherwise. The cut and `split`-error paths pass `None`. > **Merge-order note:** This PR and #285 (`perf/placed-fill-read-through`) both touch `cut_for` / `take_steps` and `Preplan.chosen` (`Vec<(usize, u32)>` here vs `Vec<Planned>` in #285); whichever merges second will need a small mechanical rebase. ## Verification ### Automated checks - `cargo xtask policy --staged` — passed - `git diff --check` — clean - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`) — passed - `cargo test --locked -p victory-gpu --lib -- --test-threads=1` (default and `--features diagnostics`) — passed (single-threaded due to the pre-existing parallel flake in `host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes` on unmodified `main`) ### Real-title comparison (GTA VI, Series S, standard `-Machine 4070` `diag` build) - **Hardware**: Windows 11, AMD Ryzen 5 7600 (6C/12T), 63.1 GB RAM, NVIDIA GeForce RTX 4070 12 GB - **Methodology**: Single warm-cache run per build (`target\diag\victory.exe` shared path). Diner comparisons use the exact contiguous `being_made = 0` diner window (`n=11` five-second samples, excluding initial scene-load spike and final transition), plus whole-diner submit time. - **Control**: Unmodified `origin/main` (`38c4cf9`, SHA-256 `F3DF678E...`, `base38-r3`, `being_made = 0` from `+8s`; plus settled cell tail from `base38-r2`) - **PR build**: `ee7eb38` (SHA-256 `B2702CC5...`, `preplan-r2`, `being_made = 0` from `+7s`) - **Flags**: Same route and `VICTORY_*` settings (`scripts/play.ps1 -Console series-s -Machine 4070 -Build diag` + `VICTORY_PIPELINE_WORKERS=8`, `VICTORY_FULLSCREEN=1`, `VICTORY_PANEL=1`) | Window (`being_made = 0`, single run each) | `base38-r3` (`38c4cf9`) | `preplan-r2` (`ee7eb38`) | Delta | |---|---:|---:|---:| | Contiguous diner FPS (`n=11` 5s samples) | 14.50 FPS (med 15.40, 69.81 ms) | **16.27 FPS (med 16.50, 62.62 ms)** | **+1.77 FPS (−7.19 ms)** | | Contiguous diner submitting thread (`n=51` 1s samples) | 60.82 ms | **57.85 ms** | **−2.97 ms** | | Whole diner submitting thread (incl. load transient) | 61.72 ms | **60.51 ms** | **−1.21 ms** | | Early Prologue cell FPS (first 15s, ~4,650 draws) | 18.80 FPS (53.23 ms) | 19.63 FPS (50.97 ms) | +0.83 FPS *(flat vs `base38-r2` settled tail 19.80 FPS)* | | Early Prologue cell submitting thread | 49.41 ms | **48.10 ms** | −1.31 ms | | Early Prologue cell `planning steps done on the card` | 3.13 ms | **2.85 ms** | −0.28 ms | *(Note: because `cut_or_plan` runs outside the submission lock and outside the `planning steps done on the card` timer, the cell FPS delta is within single-run spread relative to the settled `base38-r2` tail `19.80 FPS`, while the contiguous diner window showed the clearest submit-thread reduction.)* ### Full-video visual review - Reviewed full 1080p30 captures of `base38-r3` (`140.8s`) and `preplan-r2` (`149.2s`) via start-to-finish contact sheets and full-resolution diner/cell frames: **0 errors, 0 DRED**. Clean diner waitress and Prologue cell rendering throughout (one brief Lucia eye-texture streaming miss in one diner shot under `VICTORY_TEXTURE_NO_WAIT=1`, clearing on the next cut).
With `VICTORY_PLACED_ORDER=1`, `cut_for` listed the steps of a submission
that has a copy at its place and planned them to see whether it must be
cut, and `Host::card_steps` then did both again under the submission
lock.

`cut_or_plan` hands the steps and the plan of a submission it does not
cut to `card_steps` (`Preplan`), which takes them if the flights still
write the same ranges and works them out again if not.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 16:44:33 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/host/card_steps.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/322/head:github-bot/gh-322'
git switch 'github-bot/gh-322'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'github-bot/gh-322'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-322'
git switch 'main'
git merge --squash 'github-bot/gh-322'
git switch 'main'
git merge --ff-only 'github-bot/gh-322'
git switch 'main'
git merge 'github-bot/gh-322'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.