gpu(list): skip host list allocation for empty thin recordings #139

Manually merged
github merged 2 commits from gh-pr/139/head into gh-pr/139/base 2026-12-01 20:12:50 +00:00
Owner

@⁠Androtim on GitHub · 2026-11-29 14:41 UTC · original
Androtim:feat/iter140-thin-skip-empty-command-lists → main · +73 −2 · 1 files · 2 commits · merged 2026-11-29 21:26 UTC

Summary

Avoids allocating unused D3D12 host command lists and driver allocators for empty command recordings in crates/victory-gpu/src/list/thin.rs:

  • Adds VICTORY_EMPTY_NO_LIST (on by default, =0 disables) and is_empty_recording().
  • In Recording::run, when a recording has no prior host list or chunks (inner.back == 0 && inner.kept.is_empty() && inner.chunks.is_empty()) and contains only RESET(pipeline) + CLOSE, marks it closed and done immediately without calling back_list(), decrements PENDING if needed, recycles the chunk buffer, and logs the skipped total in thin::line().
  • Adds unit test empty_recording_detection_matches_only_reset_then_close.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy (303 files ok)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- list::thin:: (7 passed; 0 failed)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings (0 warnings)
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings (0 warnings)
**@⁠Androtim** on GitHub · 2026-11-29 14:41 UTC · [original](https://github.com/Androtim/MiniVI/pull/139) `Androtim:feat/iter140-thin-skip-empty-command-lists` → `main` · +73 −2 · 1 files · 2 commits · merged 2026-11-29 21:26 UTC ### Summary Avoids allocating unused D3D12 host command lists and driver allocators for empty command recordings in `crates/victory-gpu/src/list/thin.rs`: - Adds `VICTORY_EMPTY_NO_LIST` (on by default, `=0` disables) and `is_empty_recording()`. - In `Recording::run`, when a recording has no prior host list or chunks (`inner.back == 0 && inner.kept.is_empty() && inner.chunks.is_empty()`) and contains only `RESET(pipeline)` + `CLOSE`, marks it closed and done immediately without calling `back_list()`, decrements `PENDING` if needed, recycles the chunk buffer, and logs the skipped total in `thin::line()`. - Adds unit test `empty_recording_detection_matches_only_reset_then_close`. ### Verification - `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy` (`303 files ok`) - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- list::thin::` (`7 passed; 0 failed`) - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warnings` (0 warnings) - `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics --locked -- -D warnings` (0 warnings)
Add `VICTORY_EMPTY_NO_LIST` (default on, `=0` opts out) and `is_empty_recording` in `list::thin::Recording::run` so recordings containing only `Reset` + `Close` complete without allocating a host command list or driver allocator, decrementing `PENDING`, recycling the chunk buffer, and logging the skipped count.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:12:48 +00:00
github manually merged commit 438a5c3a7a into gh-pr/139/base 2026-12-01 20:12:50 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 16:03 UTC · original · edited 2026-11-29 18:03 UTC

Automated triage for the maintainers (not an approval).

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

Review Summary

The change in crates/victory-gpu/src/list/thin.rs is concise, well-scoped, and CI is passing.

  • Detection (is_empty_recording): Matches chunk.len() == 3 && chunk[0] == (RESET | (1 << 16)) && chunk[2] == CLOSE, which aligns with Front::begin (put(RESET, &[pipeline as u64])) followed immediately by Front::close (put(CLOSE, &[])).
  • State machine (Recording::run): Guarded by inner.back == 0 && inner.kept.is_empty() && inner.chunks.is_empty() and empty_takes_none() (VICTORY_EMPTY_NO_LIST, on by default, =0 disables). Properly mirrors the normal closed completion path: sets inner.closed = true, clears inner.scheduled = false (avoiding a stuck scheduled bit on early return), decrements PENDING if inner.pending was set, stores done with Release and calls moved.notify_all(), drops the lock before recycling chunk via give_back, increments STATS[2] and EMPTY, and notifies crate::queue::line_moved().
  • Tests & logging: Adds unit coverage for both is_empty_recording and Recording::run completion without a host list, and reports the cumulative EMPTY count in thin::line().

Why needs-gpu-test

Because VICTORY_EMPTY_NO_LIST is enabled by default on the VICTORY_THIN=1 D3D12 command-list translation/submission path and causes completed empty recordings to return a null Recording::back(), a quick local GPU smoke test is warranted to verify end-to-end submission handling and absence of queue stalls before merging.

(Automated triage review; not formal maintainer approval.)


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-29 16:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/139#issuecomment-7258576229) · edited 2026-11-29 18:03 UTC <!-- minivi-triage v1 head=438a5c3a7aa91db4a92dd61838937a4c44c1ecf0 verdict=needs-gpu-test ci=passing at=2026-11-29T18:03:40Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary The change in `crates/victory-gpu/src/list/thin.rs` is concise, well-scoped, and CI is passing. - **Detection (`is_empty_recording`)**: Matches `chunk.len() == 3 && chunk[0] == (RESET | (1 << 16)) && chunk[2] == CLOSE`, which aligns with `Front::begin` (`put(RESET, &[pipeline as u64])`) followed immediately by `Front::close` (`put(CLOSE, &[])`). - **State machine (`Recording::run`)**: Guarded by `inner.back == 0 && inner.kept.is_empty() && inner.chunks.is_empty()` and `empty_takes_none()` (`VICTORY_EMPTY_NO_LIST`, on by default, `=0` disables). Properly mirrors the normal `closed` completion path: sets `inner.closed = true`, clears `inner.scheduled = false` (avoiding a stuck scheduled bit on early return), decrements `PENDING` if `inner.pending` was set, stores `done` with `Release` and calls `moved.notify_all()`, drops the lock before recycling `chunk` via `give_back`, increments `STATS[2]` and `EMPTY`, and notifies `crate::queue::line_moved()`. - **Tests & logging**: Adds unit coverage for both `is_empty_recording` and `Recording::run` completion without a host list, and reports the cumulative `EMPTY` count in `thin::line()`. ### Why `needs-gpu-test` Because `VICTORY_EMPTY_NO_LIST` is enabled by default on the `VICTORY_THIN=1` D3D12 command-list translation/submission path and causes completed empty recordings to return a null `Recording::back()`, a quick local GPU smoke test is warranted to verify end-to-end submission handling and absence of queue stalls before merging. *(Automated triage review; not formal maintainer approval.)* --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 17:56 UTC · original

Rebased onto origin/main (9d8b3646, which includes the #140 card_steps CI flake fix) and addressed the triage notes at 438a5c3a:

  1. Clarified the cumulative metric label in thin::line() from empty skipped {} to empty skipped total {}.
  2. Added empty_recording_run_skips_host_list_and_completes_cleanly in crates/victory-gpu/src/list/thin.rs to exercise Recording::run on an empty [RESET, CLOSE] recording (asserting done(), back().is_null(), PENDING decrement, EMPTY increment, and closed/!scheduled/!pending state).

Local Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy: 305 files ok
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- list::thin::: 8 passed; 0 failed
  • Dual workspace clippy --all-targets -- -D warnings (default and --features diagnostics): 0 warnings
**@⁠Androtim** on GitHub · 2026-11-29 17:56 UTC · [original](https://github.com/Androtim/MiniVI/pull/139#issuecomment-7260077298) Rebased onto `origin/main` (`9d8b3646`, which includes the `#140` `card_steps` CI flake fix) and addressed the triage notes at `438a5c3a`: 1. Clarified the cumulative metric label in `thin::line()` from `empty skipped {}` to `empty skipped total {}`. 2. Added `empty_recording_run_skips_host_list_and_completes_cleanly` in `crates/victory-gpu/src/list/thin.rs` to exercise `Recording::run` on an empty `[RESET, CLOSE]` recording (asserting `done()`, `back().is_null()`, `PENDING` decrement, `EMPTY` increment, and `closed`/`!scheduled`/`!pending` state). ### Local Verification - `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy`: `305 files ok` - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --locked -- list::thin::`: `8 passed; 0 failed` - Dual workspace `clippy --all-targets -- -D warnings` (default and `--features diagnostics`): 0 warnings
Author
Owner

@⁠Androtim on GitHub · 2026-11-29 21:26 UTC · original

Automated RTX 4060 Ti 8 GB Open-World A/B hardware verification PASSED (playtest/wave5 vs origin/main b1b6dc1, VICTORY_LEVELS_ON_DEMAND=0 play-parity):

  • Hardware cargo test (RTX 4060 Ti): 645 passed, 0 failed (victory 39/39, victory-shader emit::wave64_tests 19/19 & lower 19/19, victory-gpu 568/568).
  • 45s Open-World A/B (scripts/verify-world.ps1, DLSS Quality + open-world save):
    • FPS: median 9.4 fps vs 7.5 fps (+1.90 fps / +25%), min 8.3 fps vs 0.8 fps, preparing 53.6 ms vs 60.0 ms
    • Stability: 0 crashes / 0 DRED / 0 untranslated shaders
    • VRAM / Issue #149: max 5760 MB vs 6005 MB (-245 MB, 0 MB over budget); no room for new ones halved (9,000 vs 18,000); max_waiting dropped (36,432 vs 41,431)
    • Decoration bakes / Issue #150: 0 mismatches (other_bytes=0, showed_another_view=0, failed=0 vs 5 and 2 on baseline)
    • Residency stalls: mapped_rate 1.63 ms/s vs 6.9 ms/s (-76%, max 12.9 vs 51.9 ms)
    • Visual check: Clean open-world safehouse frames (frame-5975.png, frame-5983.png), edge_energy=4.69 vs 3.88, near_black=0.02%, magenta=0.0% (and #141 2bf6800 showed zero visual artifacts).
**@⁠Androtim** on GitHub · 2026-11-29 21:26 UTC · [original](https://github.com/Androtim/MiniVI/pull/139#issuecomment-7262878829) Automated RTX 4060 Ti 8 GB **Open-World** A/B hardware verification **PASSED** (`playtest/wave5` vs `origin/main` `b1b6dc1`, `VICTORY_LEVELS_ON_DEMAND=0` play-parity): - **Hardware `cargo test` (RTX 4060 Ti):** **645 passed, 0 failed** (`victory` 39/39, `victory-shader` `emit::wave64_tests` 19/19 & `lower` 19/19, `victory-gpu` 568/568). - **45s Open-World A/B (`scripts/verify-world.ps1`, DLSS Quality + open-world save):** - **FPS:** median **`9.4 fps`** vs `7.5 fps` (**+1.90 fps / +25%**), min **`8.3 fps`** vs **`0.8 fps`**, preparing `53.6 ms` vs `60.0 ms` - **Stability:** **0** crashes / **0** DRED / **0** untranslated shaders - **VRAM / Issue #149:** max **`5760 MB`** vs `6005 MB` (**-245 MB**, `0 MB` over budget); `no room for new ones` halved (**`9,000`** vs `18,000`); `max_waiting` dropped (`36,432` vs `41,431`) - **Decoration bakes / Issue #150:** **`0` mismatches** (`other_bytes=0, showed_another_view=0, failed=0` vs `5` and `2` on baseline) - **Residency stalls:** `mapped_rate` **`1.63 ms/s`** vs `6.9 ms/s` (**-76%**, max `12.9` vs `51.9 ms`) - **Visual check:** Clean open-world safehouse frames (`frame-5975.png`, `frame-5983.png`), `edge_energy=4.69` vs `3.88`, `near_black=0.02%`, `magenta=0.0%` (and `#141` `2bf6800` showed zero visual artifacts).
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/Androtim--MiniVI!139
No description provided.