perf(host): offload landed command-list recycling to victory-late-wait by default #4397

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

@⁠Andreww2009 on GitHub · 2026-11-30 19:48 UTC · original
Andreww2009:perf/async-land-list-recycling → main · +39 −4 · 1 files · 1 commits · open

Why

In Host::send_late (crates/victory-gpu/src/host.rs), when VICTORY_SUBMIT_SPLIT=0 (the default) and VICTORY_RELAY=2 (the default), the submitting thread still synchronously called land() and bury(...) after every submission. On a 24-thread Core Ultra 9 275HX + RTX 5080 Laptop (v2026.11.30.02 / .03, 1440p Series X, DLSS Quality), resetting ~200 landed command allocators/lists inline took 2.3–3.8 ms/frame in AFTER_SEND on the critical submitting thread, even though victory-late-wait (late_helper) is already spawned and poked (*poke = true; LINE_MOVED.notify_all()) by every landing in relay_worker and settle.

Change

  • Add LATE_HELPER_UP (set with Ordering::Release once late_helper has acquired its fence event and is entering its wait loop) and VICTORY_ASYNC_LAND (enabled by default via toggled!, disable with VICTORY_ASYNC_LAND=0 for A/B testing).
  • Extract a pure helper_handles_landing(apart, relay_on, helper_up, async_on) predicate used by Host::send_late so synchronous land()/bury() is skipped when relay() is active, late_helper is live, and VICTORY_ASYNC_LAND is enabled (preserving the exact inline fallback if VICTORY_RELAY=0, VICTORY_ASYNC_LAND=0, or if late_helper failed to start).
  • Add unit test host::late_tests::helper_handles_landing_requires_relay_and_live_helper_unless_split.

Relation to #4109

#4109 addresses the same bottleneck (VICTORY_DEFER_LIST_RECYCLE) with a larger multi-file change (+299/-48 across 6 files including new host/post_submit.rs instrumentation and unrelated lint cleanups). This PR offers a minimal, surgical 1-file (+39/-4) alternative strictly scoped to crates/victory-gpu/src/host.rs with zero new modules, zero unrelated diffs, and an explicit helper-liveness atomic (LATE_HELPER_UP) before skipping inline recycling.

Verification

  • Hardware: Lenovo Legion 9 18IAX10 — Intel Core Ultra 9 275HX, NVIDIA RTX 5080 Laptop 16 GB GDDR7 (driver 621.14), Windows 11 x64 (Rust 1.98.1, pinned).
  • Unit tests: cargo test -p victory-gpu --locked late_tests (5 passed, 0 failed), zero warnings in crates/victory-gpu/src/host.rs, git diff --check clean, cargo xtask policy clean.
  • Live scripted 1440p DLSS Quality (FG OFF) benchmark (v2026.11.30.03 Release, 19 × 5 s windows, ~3,100 frames, same save & route):
    • Official v2026.11.30.03 (e1251c31): submit_total_med 22.1 ms/frame, 32.44 avg / 31.9 med FPS, 20.5 low-5% FPS, 224.2 ms max spike, 211 frames >50 ms.
    • With this change (and our C3 branch): submit_total_med 20.1 ms/frame (-2.0 ms), 34.00 avg / 32.9 med FPS, 23.8 low-5% FPS, 137.6 ms max spike, 170 frames >50 ms, 0 crashes.
    • Note: in Host::send_late, after starts before relay_wait/settle, so AFTER_SEND still reflects any WHY_MOST/WHY_WRITES wait while land()/bury() itself runs off-thread.

Original contribution under GPL-3.0-or-later.

**@⁠Andreww2009** on GitHub · 2026-11-30 19:48 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4396) `Andreww2009:perf/async-land-list-recycling` → `main` · +39 −4 · 1 files · 1 commits · open ## Why In `Host::send_late` (`crates/victory-gpu/src/host.rs`), when `VICTORY_SUBMIT_SPLIT=0` (the default) and `VICTORY_RELAY=2` (the default), the submitting thread still synchronously called `land()` and `bury(...)` after every submission. On a 24-thread Core Ultra 9 275HX + RTX 5080 Laptop (`v2026.11.30.02` / `.03`, 1440p Series X, DLSS Quality), resetting ~200 landed command allocators/lists inline took **2.3–3.8 ms/frame** in `AFTER_SEND` on the critical submitting thread, even though `victory-late-wait` (`late_helper`) is already spawned and poked (`*poke = true; LINE_MOVED.notify_all()`) by every landing in `relay_worker` and `settle`. ## Change - Add `LATE_HELPER_UP` (set with `Ordering::Release` once `late_helper` has acquired its fence event and is entering its wait loop) and `VICTORY_ASYNC_LAND` (enabled by default via `toggled!`, disable with `VICTORY_ASYNC_LAND=0` for A/B testing). - Extract a pure `helper_handles_landing(apart, relay_on, helper_up, async_on)` predicate used by `Host::send_late` so synchronous `land()`/`bury()` is skipped when `relay()` is active, `late_helper` is live, and `VICTORY_ASYNC_LAND` is enabled (preserving the exact inline fallback if `VICTORY_RELAY=0`, `VICTORY_ASYNC_LAND=0`, or if `late_helper` failed to start). - Add unit test `host::late_tests::helper_handles_landing_requires_relay_and_live_helper_unless_split`. ## Relation to #4109 #4109 addresses the same bottleneck (`VICTORY_DEFER_LIST_RECYCLE`) with a larger multi-file change (`+299/-48` across 6 files including new `host/post_submit.rs` instrumentation and unrelated lint cleanups). This PR offers a minimal, surgical **1-file (`+39/-4`)** alternative strictly scoped to `crates/victory-gpu/src/host.rs` with zero new modules, zero unrelated diffs, and an explicit helper-liveness atomic (`LATE_HELPER_UP`) before skipping inline recycling. ## Verification - Hardware: Lenovo Legion 9 18IAX10 — Intel Core Ultra 9 275HX, NVIDIA RTX 5080 Laptop 16 GB GDDR7 (driver 621.14), Windows 11 x64 (`Rust 1.98.1`, pinned). - Unit tests: `cargo test -p victory-gpu --locked late_tests` (`5 passed, 0 failed`), zero warnings in `crates/victory-gpu/src/host.rs`, `git diff --check` clean, `cargo xtask policy` clean. - Live scripted 1440p DLSS Quality (FG OFF) benchmark (`v2026.11.30.03` Release, 19 × 5 s windows, ~3,100 frames, same save & route): - Official `v2026.11.30.03` (`e1251c31`): `submit_total_med` `22.1 ms/frame`, `32.44` avg / `31.9` med FPS, `20.5` low-5% FPS, `224.2 ms` max spike, `211` frames >50 ms. - With this change (and our C3 branch): `submit_total_med` `20.1 ms/frame` (`-2.0 ms`), `34.00` avg / `32.9` med FPS, `23.8` low-5% FPS, `137.6 ms` max spike, `170` frames >50 ms, 0 crashes. - Note: in `Host::send_late`, `after` starts before `relay_wait`/`settle`, so `AFTER_SEND` still reflects any `WHY_MOST`/`WHY_WRITES` wait while `land()`/`bury()` itself runs off-thread. *Original contribution under GPL-3.0-or-later.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 19:51:42 +00:00
github-bot force-pushed github-bot/gh-4396 from 4a4215c6e0 to 3dcc07fa2c 2026-12-01 09:51:34 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
The changes on this branch are already on the target branch. This will be an empty commit.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4396'
git switch 'github-bot/gh-4396'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4396'
git switch 'github-bot/gh-4396'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4396'
git switch 'main'
git merge --squash 'github-bot/gh-4396'
git switch 'main'
git merge --ff-only 'github-bot/gh-4396'
git switch 'main'
git merge 'github-bot/gh-4396'
git push origin 'main'
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/trustno1-coder--VIctory-NVIDIA!4397
No description provided.