Iter 21: Prevent dense-scene slot starvation (VICTORY_THIN_GATE) and dedup multi-stage tables #6

Merged
Androtim merged 1 commit from upstream-pr/6 into main 2026-11-28 21:17:04 +00:00
Androtim commented 2026-11-28 01:22:27 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T01:22:27Z.


Summary

Ports the core dynamic-descriptor-slot backpressure and deduplication breakthroughs from fxceless/victory-fork commit f299fba onto MiniVI:

  • VICTORY_THIN_GATE backpressure (list/thin.rs, queue.rs, queue/behind.rs, descriptor/host.rs): Pauses thin-list translation for future frames while free dynamic descriptor slots drop below 1/4 (or below 5/8 while submitted lists are still translating), ensuring submitted lists for the current frame always acquire slots instead of dropping draws in dense scenes. Unparks immediately on slot release, completed present, Recording::wait(), or the 250 ms HELD_BACK_MOST_US safety bound. Opt out via VICTORY_THIN_GATE=0.
  • Early slot release at landing (host.rs): Releases dynamic descriptor tables of completed GPU flights at the start of relay_land (right after fence completion, before CPU read-backs) and wakes LINE_LANDED / list::thin::moved().
  • Cross-stage & longest-prefix table deduplication (draw.rs): Computes max root-table reach across all stages of a multi-stage pipeline and caches fresh_longest per command list so shorter reads reuse an existing longer copy with matching records while still calling host.texture_slot_tabled / host.mirror_after once per stage.
  • Conflict-free: Verified zero merge conflicts alongside open PRs #1–#5.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F (13th Gen)
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB (33,304,932 KiB visible)
  • OS & GPU Driver: Windows 11 Home (10.0.26300), NVIDIA driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: diag / release @ cfa728a
  • Console Profile & Internal Resolution / Scale: series-s (unattended live smoke check via verify-live.ps1)
  • Ray Tracing: off (unattended boot/menu smoke verification)
  • Upscaling: DLSS quality
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: verify-live.ps1 defaults (VICTORY_THIN_GATE unset -> enabled)
  • Scene / Area & Session Length: Unit tests + standalone build + live boot/menu smoke verification

Measurements & Verification

  • Base FPS (without Frame Gen): N/A (automated unit suite + unattended boot smoke check; live + CI results posted below)
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: Saves dynamic descriptor slots via cross-stage/prefix table reuse and releases flight tables before CPU read-backs
  • Crashes / DRED Resets: 0
  • Automated Checks:
    • cargo clippy --workspace --all-targets -- -D warnings (0 warnings)
    • cargo clippy --workspace --all-targets --all-features -- -D warnings (0 warnings)
    • cargo test -p xtask (6 passed) + xtask policy (294 files ok)
    • cargo test -p victory-gpu -- --test-threads=1 (450 passed; 0 failed; 36 ignored, including the_gate_holds_back_all_but_the_lists_sent_next and a_recording_put_aside_is_taken_up_again)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5535326566 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/6). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T01:22:27Z. --- ## Summary Ports the core dynamic-descriptor-slot backpressure and deduplication breakthroughs from `fxceless/victory-fork` commit `f299fba` onto MiniVI: - **`VICTORY_THIN_GATE` backpressure ([list/thin.rs](crates/victory-gpu/src/list/thin.rs), [queue.rs](crates/victory-gpu/src/queue.rs), [queue/behind.rs](crates/victory-gpu/src/queue/behind.rs), [descriptor/host.rs](crates/victory-gpu/src/descriptor/host.rs)):** Pauses thin-list translation for future frames while free dynamic descriptor slots drop below 1/4 (or below 5/8 while submitted lists are still translating), ensuring submitted lists for the current frame always acquire slots instead of dropping draws in dense scenes. Unparks immediately on slot release, completed present, `Recording::wait()`, or the 250 ms `HELD_BACK_MOST_US` safety bound. Opt out via `VICTORY_THIN_GATE=0`. - **Early slot release at landing ([host.rs](crates/victory-gpu/src/host.rs)):** Releases dynamic descriptor tables of completed GPU flights at the start of `relay_land` (right after fence completion, before CPU read-backs) and wakes `LINE_LANDED` / `list::thin::moved()`. - **Cross-stage & longest-prefix table deduplication ([draw.rs](crates/victory-gpu/src/draw.rs)):** Computes max root-table reach across all stages of a multi-stage pipeline and caches `fresh_longest` per command list so shorter reads reuse an existing longer copy with matching records while still calling `host.texture_slot_tabled` / `host.mirror_after` once per stage. - **Conflict-free:** Verified zero merge conflicts alongside open PRs #1–#5. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F (13th Gen) - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB (`33,304,932` KiB visible) - **OS & GPU Driver:** Windows 11 Home (`10.0.26300`), NVIDIA driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `diag` / `release` @ `cfa728a` - **Console Profile & Internal Resolution / Scale:** `series-s` (unattended live smoke check via `verify-live.ps1`) - **Ray Tracing:** off (unattended boot/menu smoke verification) - **Upscaling:** `DLSS quality` - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `verify-live.ps1` defaults (`VICTORY_THIN_GATE` unset -> enabled) - **Scene / Area & Session Length:** Unit tests + standalone build + live boot/menu smoke verification ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A (automated unit suite + unattended boot smoke check; live + CI results posted below) - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** Saves dynamic descriptor slots via cross-stage/prefix table reuse and releases flight tables before CPU read-backs - **Crashes / DRED Resets:** `0` - **Automated Checks:** - [x] `cargo clippy --workspace --all-targets -- -D warnings` (0 warnings) - [x] `cargo clippy --workspace --all-targets --all-features -- -D warnings` (0 warnings) - [x] `cargo test -p xtask` (`6 passed`) + `xtask policy` (`294 files ok`) - [x] `cargo test -p victory-gpu -- --test-threads=1` (`450 passed; 0 failed; 36 ignored`, including `the_gate_holds_back_all_but_the_lists_sent_next` and `a_recording_put_aside_is_taken_up_again`)
Androtim commented 2026-11-28 01:28:14 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T01:28:14Z.


Verification summary for feat/iter21-thin-gate-and-table-dedup @ cfa728a:

  • GitHub Actions CI: Run 46092785176 completed with success.
  • Policy & Tests:
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy: asset policy: 294 files ok
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask: 6 passed; 0 failed
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings: 0 warnings
    • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-features --all-targets -- -D warnings: 0 warnings
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1: 450 passed; 0 failed; 36 ignored (all 6 list::thin::tests::* including the_gate_holds_back_all_but_the_lists_sent_next and a_recording_put_aside_is_taken_up_again passed)
  • Standalone Binaries: Built diag\victory.exe, diag\victory_sm.exe, and release\victory.exe into D:\victory-build\minivi with RUSTFLAGS='-C link-self-contained=yes' (non_system_mingw_dlls=0 on all 3).
  • Live Unattended Smoke (verify-live.ps1): 32s, 3 active windows (max_draws=11), 30.0 fps (33.3 ms/frame), dropped=0, 6/7 [PASS] (VICTORY_THIN 83 calls in 0.3 ms, zero stalls/deadlocks under VICTORY_THIN_GATE, watchdog applied=2, DLSS Quality clean, 0 crashes/DRED resets, 0 lingering processes).
    • The 1 failed check ($badWave64 list: untranslated_total=2, critical_fails=1) logged the pre-existing main (f3c0c33) wave64 shaders 6b82bc7d22016cb5 and 926c46bab3b86bd6 (waiting on open PR #1), unrelated to this PR.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7231687892 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/6#issuecomment-7231687892). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T01:28:14Z. --- Verification summary for `feat/iter21-thin-gate-and-table-dedup` @ `cfa728a`: - **GitHub Actions CI:** Run `46092785176` completed with `success`. - **Policy & Tests:** - `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy`: `asset policy: 294 files ok` - `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask`: `6 passed; 0 failed` - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings`: `0` warnings - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-features --all-targets -- -D warnings`: `0` warnings - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1`: `450 passed; 0 failed; 36 ignored` (all 6 `list::thin::tests::*` including `the_gate_holds_back_all_but_the_lists_sent_next` and `a_recording_put_aside_is_taken_up_again` passed) - **Standalone Binaries:** Built `diag\victory.exe`, `diag\victory_sm.exe`, and `release\victory.exe` into `D:\victory-build\minivi` with `RUSTFLAGS='-C link-self-contained=yes'` (`non_system_mingw_dlls=0` on all 3). - **Live Unattended Smoke (`verify-live.ps1`):** `32s`, 3 active windows (`max_draws=11`), `30.0 fps` (`33.3 ms/frame`), `dropped=0`, **6/7 `[PASS]`** (`VICTORY_THIN` `83 calls in 0.3 ms`, zero stalls/deadlocks under `VICTORY_THIN_GATE`, watchdog `applied=2`, DLSS Quality clean, `0` crashes/DRED resets, `0` lingering processes). - The 1 failed check (`$badWave64` list: `untranslated_total=2, critical_fails=1`) logged the pre-existing `main` (`f3c0c33`) wave64 shaders `6b82bc7d22016cb5` and `926c46bab3b86bd6` (waiting on open PR #1), unrelated to this PR.
Androtim commented 2026-11-28 02:03:23 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T02:03:23Z.


Automated triage for the maintainers (not an approval).

Verdict: needs-gpu-test · CI (check): passing

Automated Review — PR #6 (cfa728af3a5a)

Summary: Clean, well-scoped port of dynamic descriptor-slot backpressure (VICTORY_THIN_GATE), early flight table release at landing, and cross-stage / longest-prefix fresh-table deduplication. CI is passing and no security or correctness blockers were found in the diff.

Verified Changes

  • Dynamic slot room tracking (crates/victory-gpu/src/descriptor/host.rs): DYNAMIC_FREE + HostHeap::note_room() / dynamic_room() track free/total dynamic slots for the largest view heap under the existing self.next lock in HostHeap::dynamic and HostHeap::release, with lock-free Relaxed reads for the gate heuristic.
  • Early slot release (crates/victory-gpu/src/host.rs): Host::relay_land releases flight dynamic tables via detached.release_tables() immediately after fence completion (before CPU read-backs) and wakes LINE_LANDED + list::thin::moved(). Verified in origin/main that the later release_tables() call in relay_land is idempotent (State::tables_done drains self.dynamic and returns early once tables_gone && dynamic.is_empty()).
  • Cross-stage & longest-prefix table dedup (crates/victory-gpu/src/draw.rs): State::bind computes per-root-slot reach across multi-stage pipelines, State::tables widens copies within heap bounds and reuses longer matching copies via fresh_longest (verifying records_hash(table, longest) == hashed), and FreshTable::told ensures non-maker stages still call host.texture_slot_tabled and host.mirror_after once for their texture entries.
  • Thin-list translation gate (crates/victory-gpu/src/list/thin.rs, crates/victory-gpu/src/queue.rs, crates/victory-gpu/src/queue/behind.rs): PRESENTS_GONE tracks enqueued vs. completed presents so submitted lists for the next present are never gated (first == true), while future-frame lists yield when free slots fall below 1/4 (or 5/8 while PENDING > 0). Deadlock safety is covered by Recording::wait() setting wanted = true, the 250 ms HELD_BACK_MOST_US cap for submitted lists, PENDING cleanup on both close and Drop, and the 1 ms WORK.wait_timeout fallback while PARKED_N > 0.

Minor Notes (Non-Blocking)

  • FreshTable::told tracks up to 3 stage plans ([usize; 3]); if a pipeline ever has >3 stages reading distinct textures from the same table slot, the 4th+ stage will skip texture_slot_tabled/mirror_after on a cache hit. In practice D3D12 graphics pipelines rarely have >3 stages sharing one CBV table, so this is low risk.
  • Because VICTORY_THIN_GATE is enabled by default and this PR alters D3D12 host flight landing and descriptor-table deduplication, a local real-GPU dense-scene smoke test is recommended before merging.

Note: This is an automated technical triage review and does not constitute formal maintainer approval.


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7232099098 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/6#issuecomment-7232099098). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T02:03:23Z. --- <!-- minivi-triage v1 head=cfa728af3a5a6799db98bd723b1abaca12f4d96b verdict=needs-gpu-test ci=passing at=2026-11-28T02:03:50Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Automated Review — PR #6 (`cfa728af3a5a`) **Summary:** Clean, well-scoped port of dynamic descriptor-slot backpressure (`VICTORY_THIN_GATE`), early flight table release at landing, and cross-stage / longest-prefix fresh-table deduplication. CI is passing and no security or correctness blockers were found in the diff. #### Verified Changes - **Dynamic slot room tracking ([`crates/victory-gpu/src/descriptor/host.rs`](crates/victory-gpu/src/descriptor/host.rs)):** `DYNAMIC_FREE` + `HostHeap::note_room()` / `dynamic_room()` track free/total dynamic slots for the largest view heap under the existing `self.next` lock in `HostHeap::dynamic` and `HostHeap::release`, with lock-free `Relaxed` reads for the gate heuristic. - **Early slot release ([`crates/victory-gpu/src/host.rs`](crates/victory-gpu/src/host.rs)):** `Host::relay_land` releases flight dynamic tables via `detached.release_tables()` immediately after fence completion (before CPU read-backs) and wakes `LINE_LANDED` + `list::thin::moved()`. Verified in `origin/main` that the later `release_tables()` call in `relay_land` is idempotent (`State::tables_done` drains `self.dynamic` and returns early once `tables_gone && dynamic.is_empty()`). - **Cross-stage & longest-prefix table dedup ([`crates/victory-gpu/src/draw.rs`](crates/victory-gpu/src/draw.rs)):** `State::bind` computes per-root-slot `reach` across multi-stage pipelines, `State::tables` widens copies within heap bounds and reuses longer matching copies via `fresh_longest` (verifying `records_hash(table, longest) == hashed`), and `FreshTable::told` ensures non-maker stages still call `host.texture_slot_tabled` and `host.mirror_after` once for their texture entries. - **Thin-list translation gate ([`crates/victory-gpu/src/list/thin.rs`](crates/victory-gpu/src/list/thin.rs), [`crates/victory-gpu/src/queue.rs`](crates/victory-gpu/src/queue.rs), [`crates/victory-gpu/src/queue/behind.rs`](crates/victory-gpu/src/queue/behind.rs)):** `PRESENTS_GONE` tracks enqueued vs. completed presents so submitted lists for the next present are never gated (`first == true`), while future-frame lists yield when free slots fall below 1/4 (or 5/8 while `PENDING > 0`). Deadlock safety is covered by `Recording::wait()` setting `wanted = true`, the 250 ms `HELD_BACK_MOST_US` cap for submitted lists, `PENDING` cleanup on both close and `Drop`, and the 1 ms `WORK.wait_timeout` fallback while `PARKED_N > 0`. #### Minor Notes (Non-Blocking) - `FreshTable::told` tracks up to 3 stage plans (`[usize; 3]`); if a pipeline ever has >3 stages reading distinct textures from the same table slot, the 4th+ stage will skip `texture_slot_tabled`/`mirror_after` on a cache hit. In practice D3D12 graphics pipelines rarely have >3 stages sharing one CBV table, so this is low risk. - Because `VICTORY_THIN_GATE` is enabled by default and this PR alters D3D12 host flight landing and descriptor-table deduplication, a local real-GPU dense-scene smoke test is recommended before merging. *Note: This is an automated technical triage review and does not constitute formal maintainer approval.* --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-28 21:11:09 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T21:11:09Z.


Real-GPU Playtest Report (Combined Build 1 Stack — RT OFF)

Tested in combined Build 1 (origin/main + Build 1 PRs #2, #3, #4, #6, #7, #9, #10, #11, #12, #14, #15, #18, #19, #22, #25, #26, #27, #33, #34, #36, #40, #43, #44, #46) on NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (quality-720p, DLSS Quality):

  • Duration & Stability: 21-minute open-world session (1a-build1-world.log) — 0 crashes, 0 DRED resets, clean exit.
  • Performance: 28.2 fps (35.4 ms/frame) mid-run, 16.9 fps (59.3 ms/frame, 4,446 draws/frame) in heavy scene.
  • Key Subsystems Verified in Logs:
    • Swap chain / tearing: tearing=true, 0 refused presents.
    • Underwater compute (926c46bab3b86bd6): Translated and built host PSO cleanly.
    • Descriptor slots (VICTORY_THIN_GATE): Active (0 no free dynamic descriptor slots warnings).
    • VRAM & texture pool: Bounded at 6,934 MB in use (33 texture blocks = 2,112 MB, 1,036 MB free), 0 bogus POOL: errors.
    • DLSS: 16,577 upscalings (0 failed).
  • Visual observation during heavy initial streaming: Character top briefly appeared solid black while 8,802 textures were still queued / 206 non-RT draws dropped without a host pipeline; no D3D12 errors.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7245833732 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/6#issuecomment-7245833732). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T21:11:09Z. --- ### Real-GPU Playtest Report (Combined Build 1 Stack — RT OFF) Tested in combined Build 1 (`origin/main` + Build 1 PRs `#2, #3, #4, #6, #7, #9, #10, #11, #12, #14, #15, #18, #19, #22, #25, #26, #27, #33, #34, #36, #40, #43, #44, #46`) on **NVIDIA GeForce RTX 4060 Ti (8 GB), Windows, Series S (`quality-720p`, DLSS Quality)**: - **Duration & Stability:** **21-minute** open-world session (`1a-build1-world.log`) — **0 crashes, 0 DRED resets**, clean exit. - **Performance:** `28.2 fps` (`35.4 ms/frame`) mid-run, `16.9 fps` (`59.3 ms/frame`, `4,446` draws/frame) in heavy scene. - **Key Subsystems Verified in Logs:** - **Swap chain / tearing:** `tearing=true`, `0` refused presents. - **Underwater compute (`926c46bab3b86bd6`):** Translated and built host PSO cleanly. - **Descriptor slots (`VICTORY_THIN_GATE`):** Active (`0` `no free dynamic descriptor slots` warnings). - **VRAM & texture pool:** Bounded at `6,934 MB` in use (`33` texture blocks = `2,112 MB`, `1,036 MB` free), `0` bogus `POOL:` errors. - **DLSS:** `16,577` upscalings (`0` failed). - **Visual observation during heavy initial streaming:** Character top briefly appeared solid black while `8,802` textures were still queued / `206` non-RT draws dropped without a host pipeline; no D3D12 errors.
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
Androtim/MiniVI!6
No description provided.