Reduce serial CPU submission and command-preparation latency #1

Open
opened 2026-12-06 00:19:55 +00:00 by github-bot · 0 comments
Owner

@⁠VictoryX-dev on GitHub · 2026-12-03 02:57 UTC · original

Problem

The dedicated submitting lane (queue/behind.rs) is currently the single largest CPU throughput limiter in demanding Series S scenes. In a representative 25.7 ms frame (~40 FPS without Frame Generation), the submitting thread is busy for ~22.2 ms — leaving almost no headroom toward our 50–60 FPS Series S engineering target.

Known Evidence

  • Confirmed in gameplay (AMD Ryzen 9 9950X3D, RX 9070 XT 16 GB, 32 GB RAM, Windows 11, Series S profile, FSR Quality 720p→1080p, FG/RT/RR off):
    • Steady heavy-scene throughput: ~39.4–40.1 FPS (~5,080–5,670 draws/frame).
    • Representative 25.7 ms frame breakdown on the submitting lane (~22.2 ms total):
      • Preparation (~19.9 ms): front setup ~6.4 ms (including ~4.7 ms waiting on helper threads), per-step refresh walks ~4.5 ms, write-watch queries ~3.7 ms, card copies ~2.2 ms, late sync ~1.4 ms, descriptor heaps ~1.4 ms, tail ~0.3 ms.
      • Present: ~1.3 ms; Execute/send: ~0.6 ms.
    • Indirect batching + window clamping (VICTORY_INDIRECT_BATCH=2, VICTORY_INDIRECT_WINDOW=1) previously reduced heavy-scene mean frame time from 65–73 ms to 25.4–25.7 ms with zero proven stale reads.
  • Experimental / Synthetic fixtures (off by default, unmeasured in gameplay):
    • VICTORY_PREP_PIPELINE=1 (host/prep_pipeline.rs): parallelizes large refresh fronts (textures + buffers) across helper threads and folds close-time plans. Synthetic real-mix probe improved from 7.40 ms to 5.56 ms.
    • VICTORY_ASK_BETWEEN=1 (watch/between.rs): moves write-watch query resets onto a helper thread between submissions. Synthetic cost test improved from 5.8–6.0 ms to 4.0–4.1 ms.
  • Engineering target: 50–60 FPS without Frame Generation on Series S, and substantially lower serial submitting-lane time.

Approaches That Did Not Work

  • VICTORY_LIST_FOLD=1 standalone (kept off): Folding per-copy refresh steps at command-list close showed no standalone frame-time gain in gameplay A/B (24.8 ms vs 25.0 ms). Note that VICTORY_PREP_PIPELINE=1 reuses the fold summary internally.
  • VICTORY_TAKE_ONCE=1 (kept off): Skipping re-reads of stale pages copied after submit found only ~2% spare pages, and ~5% of those spare pages differed in content during audit.
  • VICTORY_GUARD_DIFF=1 (kept off): Page-diffing guarded 64 KiB view blocks cost 3–4× more CPU time per guarded MB than full copies.

Relevant Source Modules

  • runtime/crates/victory-gpu/src/queue/behind.rs
  • runtime/crates/victory-gpu/src/host.rs
  • runtime/crates/victory-gpu/src/host/prep_pipeline.rs
  • runtime/crates/victory-gpu/src/watch.rs
  • runtime/crates/victory-gpu/src/watch/between.rs
  • runtime/crates/victory-gpu/src/indirect.rs
  • runtime/crates/victory-gpu/src/list/thin.rs

Expected Contribution

  • Profile and validate VICTORY_PREP_PIPELINE=1 and VICTORY_ASK_BETWEEN=1 in matched gameplay runs (diagnostics A/B first, then release-package confirmation).
  • Identify and eliminate remaining serial bottlenecks on the submitting lane (helper wait stalls, repeated step walks, descriptor/heap sync overhead) without breaking submission ordering or resource visibility.
  • Gate any new optimization behind an off-by-default VICTORY_* switch wired into ab.rs.

Acceptance Criteria

  • No regressions in cargo test --workspace --locked, --all-features, or scripts/run-regression.ps1.
  • Zero new proven stale reads or synchronization/barrier violations under D3D12 debug layer fixtures.
  • Measurable reduction in submitting-lane preparation ms verified with release-package VICTORY_FRAME_METRICS=1 and VICTORY_XFER=1 logs (and clearly separated from synthetic micro-benchmark numbers).
**@⁠VictoryX-dev** on GitHub · 2026-12-03 02:57 UTC · [original](https://github.com/VictoryX-dev/VictoryX/issues/1) ## Problem The dedicated submitting lane (`queue/behind.rs`) is currently the single largest CPU throughput limiter in demanding Series S scenes. In a representative 25.7 ms frame (~40 FPS without Frame Generation), the submitting thread is busy for ~22.2 ms — leaving almost no headroom toward our 50–60 FPS Series S engineering target. ## Known Evidence - **Confirmed in gameplay** *(AMD Ryzen 9 9950X3D, RX 9070 XT 16 GB, 32 GB RAM, Windows 11, Series S profile, FSR Quality 720p→1080p, FG/RT/RR off)*: - Steady heavy-scene throughput: ~39.4–40.1 FPS (~5,080–5,670 draws/frame). - Representative 25.7 ms frame breakdown on the submitting lane (~22.2 ms total): - Preparation (~19.9 ms): front setup ~6.4 ms (including ~4.7 ms waiting on helper threads), per-step refresh walks ~4.5 ms, write-watch queries ~3.7 ms, card copies ~2.2 ms, late sync ~1.4 ms, descriptor heaps ~1.4 ms, tail ~0.3 ms. - Present: ~1.3 ms; Execute/send: ~0.6 ms. - Indirect batching + window clamping (`VICTORY_INDIRECT_BATCH=2`, `VICTORY_INDIRECT_WINDOW=1`) previously reduced heavy-scene mean frame time from `65–73 ms` to `25.4–25.7 ms` with zero proven stale reads. - **Experimental / Synthetic fixtures (off by default, unmeasured in gameplay)**: - `VICTORY_PREP_PIPELINE=1` (`host/prep_pipeline.rs`): parallelizes large refresh fronts (textures + buffers) across helper threads and folds close-time plans. Synthetic real-mix probe improved from `7.40 ms` to `5.56 ms`. - `VICTORY_ASK_BETWEEN=1` (`watch/between.rs`): moves write-watch query resets onto a helper thread between submissions. Synthetic cost test improved from `5.8–6.0 ms` to `4.0–4.1 ms`. - **Engineering target:** 50–60 FPS without Frame Generation on Series S, and substantially lower serial submitting-lane time. ## Approaches That Did Not Work - **`VICTORY_LIST_FOLD=1` standalone (kept off):** Folding per-copy refresh steps at command-list close showed no standalone frame-time gain in gameplay A/B (`24.8 ms` vs `25.0 ms`). Note that `VICTORY_PREP_PIPELINE=1` reuses the fold summary internally. - **`VICTORY_TAKE_ONCE=1` (kept off):** Skipping re-reads of stale pages copied after submit found only ~2% spare pages, and ~5% of those spare pages differed in content during audit. - **`VICTORY_GUARD_DIFF=1` (kept off):** Page-diffing guarded 64 KiB view blocks cost 3–4× more CPU time per guarded MB than full copies. ## Relevant Source Modules - `runtime/crates/victory-gpu/src/queue/behind.rs` - `runtime/crates/victory-gpu/src/host.rs` - `runtime/crates/victory-gpu/src/host/prep_pipeline.rs` - `runtime/crates/victory-gpu/src/watch.rs` - `runtime/crates/victory-gpu/src/watch/between.rs` - `runtime/crates/victory-gpu/src/indirect.rs` - `runtime/crates/victory-gpu/src/list/thin.rs` ## Expected Contribution - Profile and validate `VICTORY_PREP_PIPELINE=1` and `VICTORY_ASK_BETWEEN=1` in matched gameplay runs (diagnostics A/B first, then release-package confirmation). - Identify and eliminate remaining serial bottlenecks on the submitting lane (helper wait stalls, repeated step walks, descriptor/heap sync overhead) without breaking submission ordering or resource visibility. - Gate any new optimization behind an off-by-default `VICTORY_*` switch wired into `ab.rs`. ## Acceptance Criteria - [ ] No regressions in `cargo test --workspace --locked`, `--all-features`, or `scripts/run-regression.ps1`. - [ ] Zero new proven stale reads or synchronization/barrier violations under D3D12 debug layer fixtures. - [ ] Measurable reduction in submitting-lane preparation ms verified with release-package `VICTORY_FRAME_METRICS=1` and `VICTORY_XFER=1` logs (and clearly separated from synthetic micro-benchmark numbers).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-06 00:19:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
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/VictoryX-dev--VictoryX#1
No description provided.