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

Closed
wike1701 wants to merge 2 commits from upstream-pr/83 into main
wike1701 commented 2026-11-27 17:24:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by wike1701 on 2026-11-27T17:24:47Z.


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
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5530619009 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/83). Originally posted by [wike1701](https://github.com/wike1701) on 2026-11-27T17:24:47Z. --- ## 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**
trustno1-coder commented 2026-11-28 19:02:01 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-11-28T19:02:01Z.


Thanks for this. I'm closing it without merging: it conflicts with #48, merged now, which changed how the dynamic descriptor slots are sized in descriptor/host.rs. If you'd still like VICTORY_DYNAMIC_WAIT and VICTORY_THIN_GATE in, please rebase on the current main and open a new pull request.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7244237806 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/83#issuecomment-7244237806). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-11-28T19:02:01Z. --- Thanks for this. I'm closing it without merging: it conflicts with #48, merged now, which changed how the dynamic descriptor slots are sized in descriptor/host.rs. If you'd still like VICTORY_DYNAMIC_WAIT and VICTORY_THIN_GATE in, please rebase on the current main and open a new pull request.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!83
No description provided.