perf(gpu): fix dynamic descriptor slot stalls and VICTORY_THIN congestion (VICTORY_DYNAMIC_WAIT + VICTORY_THIN_GATE) #83

Open
github-bot wants to merge 2 commits from github-bot/gh-83 into main AGit
Owner

@⁠wike1701 on GitHub · 2026-11-27 17:24 UTC · original
wike1701:feat/dynamic-slot-wait → main · +736 −45 · 7 files · 2 commits · open

Summary

Ports the full dynamic descriptor slot exhaustion & congestion fix from fxceless/victory-fork commits 52dfd12 and f299fba (GPL-3.0).

Problem

In heavy open-world scenes (10k–12k draws/frame), two linked issues caused severe stalls (200–345 ms/frame, dropping to ~3 FPS) and dropped draws:

  1. When dynamic descriptor slots ran out, draw.rs called settle_for_fence() while holding the submission lock, stalling the submitting thread and starving the GPU (33–37 ms/frame in waiting for the submission lock).
  2. With VICTORY_THIN=1, worker threads translated future frames ahead of submission and hoarded all 262,144 dynamic slots (< 1,000 free), preventing the next-to-send frame from acquiring slots (241 ms/frame stalled waiting on untranslated VICTORY_THIN lists and 354 draws/frame going without slots).

Changes

  • VICTORY_DYNAMIC_WAIT=1 / alt (host.rs, draw.rs, descriptor/host.rs, queue/behind.rs): wait on LINE_LANDED without taking the submission lock when dynamic slots are exhausted; track DYNAMIC_LOW, slot_stats, and STOOD queue idle breakdown.
  • VICTORY_THIN_GATE (list/thin.rs, queue.rs, queue/behind.rs, descriptor/host.rs): pause translation of non-next-frame recordings when dynamic slots drop below 1/4 (or 5/8 while submitted lists are still translating), so the next frame always gets its slots and flies.
  • Table reuse by length (draw.rs): size multi-stage tables to the pipeline's widest read (reach) and reuse longer unchanged copies (fresh_longest) for shorter reads within the same list.
  • Early slot release (host.rs, list.rs): release dynamic descriptor slots at the start of relay_land() (before copy-back/merge) and notify LINE_LANDED immediately.

Verification

  • cargo test -p victory-gpu --lib -- list::thin:: descriptor::host:: draw:: queue::behind::: 68 passed, 0 failed, 1 ignored
  • cargo xtask policy: asset policy: 287 files ok
**@⁠wike1701** on GitHub · 2026-11-27 17:24 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/83) `wike1701:feat/dynamic-slot-wait` → `main` · +736 −45 · 7 files · 2 commits · open ## Summary Ports the full dynamic descriptor slot exhaustion & congestion fix from `fxceless/victory-fork` commits [`52dfd12`](https://github.com/fxceless/victory-fork/commit/52dfd12) and [`f299fba`](https://github.com/fxceless/victory-fork/commit/f299fba) (GPL-3.0). ### Problem In heavy open-world scenes (10k–12k draws/frame), two linked issues caused severe stalls (200–345 ms/frame, dropping to ~3 FPS) and dropped draws: 1. When dynamic descriptor slots ran out, `draw.rs` called `settle_for_fence()` while holding the submission lock, stalling the submitting thread and starving the GPU (`33–37 ms/frame` in `waiting for the submission lock`). 2. With `VICTORY_THIN=1`, worker threads translated future frames ahead of submission and hoarded all 262,144 dynamic slots (`< 1,000` free), preventing the next-to-send frame from acquiring slots (`241 ms/frame` stalled waiting on untranslated `VICTORY_THIN` lists and `354` draws/frame going without slots). ### Changes - **`VICTORY_DYNAMIC_WAIT=1` / `alt`** (`host.rs`, `draw.rs`, `descriptor/host.rs`, `queue/behind.rs`): wait on `LINE_LANDED` without taking the submission lock when dynamic slots are exhausted; track `DYNAMIC_LOW`, `slot_stats`, and `STOOD` queue idle breakdown. - **`VICTORY_THIN_GATE`** (`list/thin.rs`, `queue.rs`, `queue/behind.rs`, `descriptor/host.rs`): pause translation of non-next-frame recordings when dynamic slots drop below 1/4 (or 5/8 while submitted lists are still translating), so the next frame always gets its slots and flies. - **Table reuse by length** (`draw.rs`): size multi-stage tables to the pipeline's widest read (`reach`) and reuse longer unchanged copies (`fresh_longest`) for shorter reads within the same list. - **Early slot release** (`host.rs`, `list.rs`): release dynamic descriptor slots at the start of `relay_land()` (before copy-back/merge) and notify `LINE_LANDED` immediately. ## Verification - `cargo test -p victory-gpu --lib -- list::thin:: descriptor::host:: draw:: queue::behind::`: **68 passed, 0 failed, 1 ignored** - `cargo xtask policy`: **asset policy: 287 files ok**
Ports the dynamic descriptor slot wait fix and queue idle breakdown from fxceless/victory-fork commit 52dfd12 (GPL-3.0):

- crates/victory-gpu/src/host.rs: add wait_for_slots() behind VICTORY_DYNAMIC_WAIT=1 (opt-in) so a draw that finds no free dynamic descriptor slot waits for the next relay landing (LINE_LANDED) without holding the submission lock, instead of calling settle_for_fence() and stalling the submitting thread and GPU; add per-frame dynamic_wait_line() telemetry.
- crates/victory-gpu/src/draw.rs: route dynamic descriptor exhaustion in root_uav_table, root_srv_table, and fresh table allocation through crate::host::wait_for_slots().
- crates/victory-gpu/src/descriptor/host.rs: track DYNAMIC_LOW (lowest free dynamic slots per frame interval).
- crates/victory-gpu/src/queue/behind.rs: track and log STOOD breakdown (empty queue vs untranslated VICTORY_THIN lists vs waits).

Directly addresses 30-37 ms/frame 'waiting for the submission lock' stalls seen in heavy open-world scenes (10k-12k draws/frame).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:31:25 +00:00
github-bot changed title from perf(gpu): avoid submission-lock stall on dynamic descriptor exhaustion (VICTORY_DYNAMIC_WAIT) to perf(gpu): fix dynamic descriptor slot stalls and VICTORY_THIN congestion (VICTORY_DYNAMIC_WAIT + VICTORY_THIN_GATE) 2026-11-27 20:43:01 +00:00
github-bot force-pushed github-bot/gh-83 from 0a53dd43a1 to d238666923 2026-11-27 20:43:01 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/83/head:github-bot/gh-83'
git switch 'github-bot/gh-83'

Merge

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