gpu: reuse warm Deferred capacities on HostList::reset and skip empty give_chunks locks #29

Merged
Androtim merged 1 commit from upstream-pr/29 into main 2026-11-29 04:45:42 +00:00
Androtim commented 2026-11-28 09:05:58 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T09:05:58Z.


Summary

Reuse warm Deferred collection capacities on HostList::reset() and guard empty give_chunks calls in crates/victory-gpu/src/host.rs:

  • Adds Deferred::clear(&mut self) to clear all per-recording collections in place instead of replacing Deferred::default(), while shrinking outlier loading-screen spikes (shrink_to above per-field caps) so resident memory stays bounded.
  • Guards empty plane_uploads, uploads, and scratch.chunks paths in Deferred::clear(), Deferred::drop(), and HostList::reset() to skip unnecessary SPARE lock / atomic updates.
  • Adds unit test host::batch::deferred_clear_reuses_warm_capacity_and_clamps_spikes.

Rig Specs Tested On

  • CPU: 13th Gen Intel(R) Core(TM) i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Home (Build 26300), NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release / victory --features diagnostics @ f16107f
  • Console Profile & Internal Resolution / Scale: series-s (default verify-world.ps1 baseline profile)
  • Ray Tracing: off
  • Upscaling: DLSS quality (-DlssMode quality)
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: D:\victory-build\verify-tools\verify-world.ps1 -Exe 'D:\victory-build\verify-bins\pr29-diag.exe' -GoldenDataDir 'D:\victory-data\golden-data-minivi' -OutDir 'D:\victory-data\verify-runs\pr29-deferred-reuse' -WorldSeconds 75 -BaselineJson 'D:\victory-data\verify-runs\baseline-main\summary.json' -AutoNudgeMenu
  • Scene / Area & Session Length: Mission-1 autosave dock transition into balcony scene (draws >= 500, max 17214 draws/frame), 75s in-world

Measurements & Verification

  • Base FPS (without Frame Gen):
    • Raw 15-window verifier median: 3.0 fps (338.7 ms, min 0.1 fps on initial 17214-draw dock frame) while compiling remaining dock PSOs (836 -> 293 remaining).
    • Steady balcony scene (5601-5920 draws/frame, last 6 windows): 8.6-10.7 fps (93.0-116.1 ms/frame, preparing 51.4-57.4 ms); lists reset in 17.9-18.2 ms; final_waiting=4491 (vs baseline 7121).
    • Visuals: 24 PNGs sampled (lit=9/24, median luma 102.94, edge energy 7.02, 0.0% magenta); inspected frame-9035.png & frame-9043.png.
  • Frame-Gen FPS (if enabled): N/A (off)
  • VRAM / RAM Usage: copystat peak 6033 MB VRAM / 6969 MB budget (5475 MB shared PC RAM), passes that made none for lack of room: 0, private RAM 19728-19921 MB (17772-17971 MB resident)
  • Crashes / DRED Resets: 0 (crashes=0, no_host_texture_errors=0)
  • Automated Checks:
    • 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-targets --features victory-gpu/diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1 (449 passed; 0 failed; 36 ignored, including deferred_clear_reuses_warm_capacity_and_clamps_spikes)
    • Plain release & diagnostics --release builds (objdump -p: 0 non-system MinGW DLLs)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5538574320 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/29). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T09:05:58Z. --- ## Summary Reuse warm `Deferred` collection capacities on `HostList::reset()` and guard empty `give_chunks` calls in `crates/victory-gpu/src/host.rs`: - Adds `Deferred::clear(&mut self)` to clear all per-recording collections in place instead of replacing `Deferred::default()`, while shrinking outlier loading-screen spikes (`shrink_to` above per-field caps) so resident memory stays bounded. - Guards empty `plane_uploads`, `uploads`, and `scratch.chunks` paths in `Deferred::clear()`, `Deferred::drop()`, and `HostList::reset()` to skip unnecessary `SPARE` lock / atomic updates. - Adds unit test `host::batch::deferred_clear_reuses_warm_capacity_and_clamps_spikes`. ## Rig Specs Tested On - **CPU:** 13th Gen Intel(R) Core(TM) i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Home (Build 26300), NVIDIA Driver 32.0.16.2124 ## Run Settings & Profile - **Build & Commit SHA:** `release` / `victory --features diagnostics` @ `f16107f` - **Console Profile & Internal Resolution / Scale:** `series-s` (default `verify-world.ps1` baseline profile) - **Ray Tracing:** `off` - **Upscaling:** `DLSS quality` (`-DlssMode quality`) - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `D:\victory-build\verify-tools\verify-world.ps1 -Exe 'D:\victory-build\verify-bins\pr29-diag.exe' -GoldenDataDir 'D:\victory-data\golden-data-minivi' -OutDir 'D:\victory-data\verify-runs\pr29-deferred-reuse' -WorldSeconds 75 -BaselineJson 'D:\victory-data\verify-runs\baseline-main\summary.json' -AutoNudgeMenu` - **Scene / Area & Session Length:** Mission-1 autosave dock transition into balcony scene (`draws >= 500`, max `17214` draws/frame), `75s` in-world ## Measurements & Verification - **Base FPS (without Frame Gen):** - Raw 15-window verifier median: `3.0 fps` (`338.7 ms`, min `0.1 fps` on initial `17214`-draw dock frame) while compiling remaining dock PSOs (`836 -> 293` remaining). - Steady balcony scene (`5601-5920` draws/frame, last 6 windows): `8.6-10.7 fps` (`93.0-116.1 ms/frame`, `preparing 51.4-57.4 ms`); `lists reset in 17.9-18.2 ms`; `final_waiting=4491` (vs baseline `7121`). - Visuals: `24` PNGs sampled (`lit=9/24`, median luma `102.94`, edge energy `7.02`, `0.0%` magenta); inspected `frame-9035.png` & `frame-9043.png`. - **Frame-Gen FPS (if enabled):** N/A (`off`) - **VRAM / RAM Usage:** `copystat` peak `6033 MB` VRAM / `6969 MB` budget (`5475 MB` shared PC RAM), `passes that made none for lack of room: 0`, private RAM `19728-19921 MB` (`17772-17971 MB` resident) - **Crashes / DRED Resets:** `0` (`crashes=0`, `no_host_texture_errors=0`) - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy` (`asset policy: 294 files ok`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask` (`6 passed; 0 failed`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features victory-gpu/diagnostics -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1` (`449 passed; 0 failed; 36 ignored`, including `deferred_clear_reuses_warm_capacity_and_clamps_spikes`) - [x] Plain release & diagnostics `--release` builds (`objdump -p`: `0` non-system MinGW DLLs)
Androtim commented 2026-11-28 10:03:48 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers (not an approval).

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

Review Summary

  • Verdict: needs-gpu-test (CI passing; logic and resource accounting look clean, and the PR modifies the D3D12 host reset path in crates/victory-gpu/src/host.rs, with the PR body's test run recorded on an earlier SHA f16107f before the list_uploads rebase to 26ab4e278148).
  • Verified against origin/main:
    • Deferred::clear in crates/victory-gpu/src/host.rs clears and resets all 19 fields of struct Deferred (copies, uploads, plane_uploads, list_uploads, prelude_uploads, upload_bytes, list_upload_bytes, kept, bound, refreshed, gpu_written, filled, textures, writes, backs, back_wanted, texture_backs, budget_zeroed, indirect_readable), releasing COM/Arc references identically to *self.deferred() = Deferred::default() while preserving bounded warm capacities.
    • ALIVE[6]/ALIVE[7] accounting and give_chunks/give_list_uploads calls are guarded consistently across Deferred::clear, Deferred::drop, and HostList::reset, avoiding double-decrements on drop and skipping empty SPARE lock acquisitions.
    • New unit test batch::deferred_clear_reuses_warm_capacity_and_clamps_spikes covers both warm-capacity reuse and spike clamping.
  • Minor non-blocking suggestion: Destructuring let Self { ... } = self; in Deferred::clear would make the compiler enforce that any future fields added to Deferred are also reset.

(Automated technical triage review — not formal maintainer approval.)


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7237646293 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/29#issuecomment-7237646293). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T10:03:48Z. --- <!-- minivi-triage v1 head=26ab4e278148ff7339eea6cc79e99ade80796b06 verdict=needs-gpu-test ci=passing at=2026-11-29T01:03:26Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary - **Verdict:** `needs-gpu-test` (CI passing; logic and resource accounting look clean, and the PR modifies the D3D12 host reset path in `crates/victory-gpu/src/host.rs`, with the PR body's test run recorded on an earlier SHA `f16107f` before the `list_uploads` rebase to `26ab4e278148`). - **Verified against `origin/main`:** - `Deferred::clear` in `crates/victory-gpu/src/host.rs` clears and resets all 19 fields of `struct Deferred` (`copies`, `uploads`, `plane_uploads`, `list_uploads`, `prelude_uploads`, `upload_bytes`, `list_upload_bytes`, `kept`, `bound`, `refreshed`, `gpu_written`, `filled`, `textures`, `writes`, `backs`, `back_wanted`, `texture_backs`, `budget_zeroed`, `indirect_readable`), releasing COM/`Arc` references identically to `*self.deferred() = Deferred::default()` while preserving bounded warm capacities. - `ALIVE[6]`/`ALIVE[7]` accounting and `give_chunks`/`give_list_uploads` calls are guarded consistently across `Deferred::clear`, `Deferred::drop`, and `HostList::reset`, avoiding double-decrements on drop and skipping empty `SPARE` lock acquisitions. - New unit test `batch::deferred_clear_reuses_warm_capacity_and_clamps_spikes` covers both warm-capacity reuse and spike clamping. - **Minor non-blocking suggestion:** Destructuring `let Self { ... } = self;` in `Deferred::clear` would make the compiler enforce that any future fields added to `Deferred` are also reset. *(Automated technical triage review — not formal maintainer approval.)* --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-29 00:37:46 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T00:37:46Z.


Rebased onto origin/main (6e935d7 -> 26ab4e2):

Changes

  • Resolved crates/victory-gpu/src/host.rs Drop for Deferred conflict cleanly.
  • Updated Deferred::clear() and Drop to also account for main's list_uploads / list_upload_bytes (ALIVE[6]/ALIVE[7] + give_list_uploads(std::mem::take(&mut self.list_uploads))) so pooled list upload buffers are returned and tracked accurately on HostList::reset.

Verification (26ab4e2)

  • Policy & Lints: cargo run -p xtask -- policy (301 files ok), cargo test -p xtask (6 passed), clippy --workspace --all-targets -- -D warnings (0 warnings, both plain and --features diagnostics).
  • Unit Tests: victory-gpu --lib host:: (126 passed; 0 failed; 16 ignored).
  • Release Builds & DLL Check: plain --release (2m 09s, objdump -p confirmed Windows system DLLs only, zero non-system MinGW runtime DLLs) and --release --features diagnostics (3m 38s).
  • Live 75s Open-World GPU Run (pr29-rebased) — 11/11 gates PASS:
    • 10.7 fps median (93.7 ms/frame, baseline 8.9 fps), 12361 max draws across 15 world windows
    • 5685 MB max VRAM / 6325 MB min budget (0 MB over, baseline 5864 MB)
    • 42824 textures uploaded, 2606 final waiting (baseline 7121), 1–2 ms making host copies / 15–21 ms making slots' views in the final 5s windows
    • mapped() rate 26.64 ms/s (32000 calls, 2856.6 ms total, longest 44.3 ms), 0 crashes
    • 18/24 lit PNGs (104.09 median luma vs 103.2 baseline, 0.0% near-black, 7.12 edge energy, 0.0% magenta); visually verified clean exterior geometry, lighting, textures, foliage, water, and UI.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7248244236 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/29#issuecomment-7248244236). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T00:37:46Z. --- Rebased onto `origin/main` (`6e935d7` -> `26ab4e2`): ### Changes - Resolved `crates/victory-gpu/src/host.rs` `Drop for Deferred` conflict cleanly. - Updated `Deferred::clear()` and `Drop` to also account for `main`'s `list_uploads` / `list_upload_bytes` (`ALIVE[6]`/`ALIVE[7]` + `give_list_uploads(std::mem::take(&mut self.list_uploads))`) so pooled list upload buffers are returned and tracked accurately on `HostList::reset`. ### Verification (`26ab4e2`) - **Policy & Lints:** `cargo run -p xtask -- policy` (`301 files ok`), `cargo test -p xtask` (`6 passed`), `clippy --workspace --all-targets -- -D warnings` (`0` warnings, both plain and `--features diagnostics`). - **Unit Tests:** `victory-gpu --lib host::` (`126 passed; 0 failed; 16 ignored`). - **Release Builds & DLL Check:** plain `--release` (`2m 09s`, `objdump -p` confirmed Windows system DLLs only, zero non-system MinGW runtime DLLs) and `--release --features diagnostics` (`3m 38s`). - **Live 75s Open-World GPU Run (`pr29-rebased`) — 11/11 gates PASS:** - `10.7 fps` median (`93.7 ms/frame`, baseline `8.9 fps`), `12361` max draws across `15` world windows - `5685 MB` max VRAM / `6325 MB` min budget (`0 MB` over, baseline `5864 MB`) - `42824` textures uploaded, `2606` final waiting (baseline `7121`), `1–2 ms` making host copies / `15–21 ms` making slots' views in the final 5s windows - `mapped()` rate `26.64 ms/s` (`32000` calls, `2856.6 ms` total, longest `44.3 ms`), `0` crashes - `18/24` lit PNGs (`104.09` median luma vs `103.2` baseline, `0.0%` near-black, `7.12` edge energy, `0.0%` magenta); visually verified clean exterior geometry, lighting, textures, foliage, water, and UI.
Androtim commented 2026-11-29 04:45:38 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T04:45:38Z.


Automated RTX 4060 Ti 8 GB A/B hardware verification passed (playtest/wave2 vs origin/main 1ab5d84):

  • Hardware cargo test (RTX 4060 Ti): victory-shader lds_sub (1/1), emit::wave64_tests (14/14), victory-gpu (505/505) — 520 passed, 0 failed.
  • Automated 45s in-world A/B (scripts/verify-world.ps1, DLSS Quality + golden autosave):
    • FPS: 13.45 fps (77.25 ms) vs 3.20 fps (308.8 ms) baseline (+10.25 fps / 4.2x faster)
    • Draws: max_draws=3122 vs 2994
    • Stability: 0 crashes / 0 DRED
    • VRAM: 6174 / 6903 MB (-25 MB vs baseline, 0 MB over budget)
    • Texture backlog: final_waiting=7638 vs 12258 (-4620)
    • Visual check: Clean rendered frames (frame-7969.png, frame-8409.png), no regressions vs origin/main.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7250845270 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/29#issuecomment-7250845270). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T04:45:38Z. --- Automated RTX 4060 Ti 8 GB A/B hardware verification passed (`playtest/wave2` vs `origin/main` `1ab5d84`): - **Hardware `cargo test` (RTX 4060 Ti):** `victory-shader` `lds_sub` (1/1), `emit::wave64_tests` (14/14), `victory-gpu` (505/505) — **520 passed, 0 failed**. - **Automated 45s in-world A/B (`scripts/verify-world.ps1`, DLSS Quality + golden autosave):** - **FPS:** **13.45 fps** (`77.25 ms`) vs **3.20 fps** (`308.8 ms`) baseline (**+10.25 fps / 4.2x faster**) - **Draws:** `max_draws=3122` vs `2994` - **Stability:** `0` crashes / `0` DRED - **VRAM:** `6174 / 6903 MB` (`-25 MB` vs baseline, `0 MB` over budget) - **Texture backlog:** `final_waiting=7638` vs `12258` (`-4620`) - **Visual check:** Clean rendered frames (`frame-7969.png`, `frame-8409.png`), no regressions vs `origin/main`.
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!29
No description provided.