play: default readback pool and NaN scrub, add 8 GiB VRAM tier and RT caps #74

Merged
Androtim merged 1 commit from upstream-pr/74 into main 2026-11-29 16:41:18 +00:00
Androtim commented 2026-11-29 03:32:54 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T03:32:54Z.


Summary

Addresses 8 GiB VRAM texture starvation, unpooled readback churn (54.1 s allocation overhead in 015834 playtest logs), and Series X 1440p / RT out-of-budget stalls when launching via victory play (including F1 menu restarts):

  1. Adapter dedicated VRAM helper (crates/victory-gpu/src/streamline.rs):
    • Adds adapter_vram_mb() -> Option<u64> backed by DXGI GetDesc1().DedicatedVideoMemory >> 20 (re-exported via victory_hle::streamline).
  2. Universal zero-loss defaults & 8 GiB VRAM tier (apps/victory/src/play.rs):
    • Enables VICTORY_READBACK_POOL=1 (VICTORY_READBACK_POOL_MB=64) and VICTORY_NAN_SCRUB=1 in SETTINGS, plus VICTORY_NO_WATCHDOG=1 by default (overridable via F1 menu / --set).
    • Keeps VICTORY_LEVELS_ON_DEMAND=0 (preserving VICTORY_HELD_LEVELS=1 in the unified pool; enabling tiled LEVELS_ON_DEMAND=1 allocated 1,088–1,152 MB of un-reclaimed 64 MiB tiled heaps and increased Series S peak VRAM by +969 MB).
    • On GPUs with <= 9216 MiB dedicated VRAM (LOW_VRAM_THRESHOLD_MB), applies bounded headroom guards:
      • VICTORY_CARD_WINDOWS_MB=256, VICTORY_CARD_ROOM_FOR_TARGETS_MB=512, VICTORY_DSTORAGE_STAGING_MB=64, and VICTORY_CARD_BUFFERS_MB=1024 (512 when RT is enabled, avoiding the 194.9 ms/s MakeResident thrash observed when capping Series X card buffers to 512 MB).
      • Enables VICTORY_TEXTURE_MIP_DROP=1 (VICTORY_TEXTURE_MIP_DROP_MIN_SIZE=1024) when running Series X (!series_s) or RT, leaving Series S non-RT on 100% native mips.
      • Coordinates RT memory bounds when VICTORY_BVH_BUILDER is set (VICTORY_RT_MEMORY_MB=768 on <= 9216 MiB, 1024 above, plus VICTORY_BVH_FAULTS_ALL=8192).
      • Tightens VICTORY_SLOT_EVICT_PERCENT=79 / LOW=75 when VICTORY_TEXTURE_ROOM_PERCENT <= 80 (FG active) so eviction stays aligned with the texture room line.
    • All defaults are applied before saved F1 menu and --set overrides.

Local Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu xtask policy: passed (301 files ok)
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask: 6/6 passed
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory: 29/29 unit tests + integration tests passed
  • 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 diagnostics -- -D warnings: 0 warnings
  • Plain --release build (53.8s, objdump -p Windows system DLLs only) and --features diagnostics --release build (1m19s): both succeeded

Live 75s GPU Verification (--features diagnostics, RTX 4060 Ti 8 GB)

  • Series S (pr74-series-s-final, 10/11 gates PASS):
    • 12.0 fps (83.5 ms, +3.10 fps vs 8.9 baseline), GPU 0.9 ms, copyback 12.7 ms, 0 crashes
    • mapped() rate 5.81 ms/s (1073.6 ms total, longest 16.8 ms)
    • Texture queue: 40649 uploaded, final_waiting=1787 (vs 7121 baseline)
    • VRAM: used_max=6182 MB vs budget_min=6668 MB (over=0 MB, room_false=8.3%; A/B VRAM gate +318 MB vs 5864 MB baseline due to 1024 MB card buffer headroom + 64 MB readback pool under 6668 MB DXGI budget)
    • Visuals: luma=104.4, near_black=0.0%, edge_energy=7.3, magenta=0.0%
  • Series X 1440p (pr74-sx-mipdrop1024-cb1024):
    • 9.95 fps (100.25 ms, +1.05 fps vs 8.9 Series S baseline), 0 crashes
    • mapped() rate 28.42 ms/s (longest 15.5 ms, vs 194.86 ms/s when CARD_BUFFERS_MB=512)
    • VRAM: used_max=6497 MB vs budget_min=6797 MB (over=0 MB, room_false=91.7% under full 1024 MB card buffers)
    • Visuals: luma=104.72, near_black=0.01%, edge_energy=8.13, magenta=0.0%
<!-- greyfinch-sync:Androtim/MiniVI:issue:5547210955 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/74). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T03:32:54Z. --- ### Summary Addresses 8 GiB VRAM texture starvation, unpooled readback churn (`54.1 s` allocation overhead in `015834` playtest logs), and Series X 1440p / RT out-of-budget stalls when launching via `victory play` (including F1 menu restarts): 1. **Adapter dedicated VRAM helper (`crates/victory-gpu/src/streamline.rs`):** - Adds `adapter_vram_mb() -> Option<u64>` backed by DXGI `GetDesc1().DedicatedVideoMemory >> 20` (re-exported via `victory_hle::streamline`). 2. **Universal zero-loss defaults & 8 GiB VRAM tier (`apps/victory/src/play.rs`):** - Enables `VICTORY_READBACK_POOL=1` (`VICTORY_READBACK_POOL_MB=64`) and `VICTORY_NAN_SCRUB=1` in `SETTINGS`, plus `VICTORY_NO_WATCHDOG=1` by default (overridable via F1 menu / `--set`). - Keeps `VICTORY_LEVELS_ON_DEMAND=0` (preserving `VICTORY_HELD_LEVELS=1` in the unified pool; enabling tiled `LEVELS_ON_DEMAND=1` allocated `1,088–1,152 MB` of un-reclaimed 64 MiB tiled heaps and increased Series S peak VRAM by `+969 MB`). - On GPUs with `<= 9216 MiB` dedicated VRAM (`LOW_VRAM_THRESHOLD_MB`), applies bounded headroom guards: - `VICTORY_CARD_WINDOWS_MB=256`, `VICTORY_CARD_ROOM_FOR_TARGETS_MB=512`, `VICTORY_DSTORAGE_STAGING_MB=64`, and `VICTORY_CARD_BUFFERS_MB=1024` (`512` when RT is enabled, avoiding the `194.9 ms/s` `MakeResident` thrash observed when capping Series X card buffers to `512 MB`). - Enables `VICTORY_TEXTURE_MIP_DROP=1` (`VICTORY_TEXTURE_MIP_DROP_MIN_SIZE=1024`) when running Series X (`!series_s`) or RT, leaving Series S non-RT on 100% native mips. - Coordinates RT memory bounds when `VICTORY_BVH_BUILDER` is set (`VICTORY_RT_MEMORY_MB=768` on `<= 9216 MiB`, `1024` above, plus `VICTORY_BVH_FAULTS_ALL=8192`). - Tightens `VICTORY_SLOT_EVICT_PERCENT=79` / `LOW=75` when `VICTORY_TEXTURE_ROOM_PERCENT <= 80` (FG active) so eviction stays aligned with the texture room line. - All defaults are applied before saved F1 menu and `--set` overrides. ### Local Verification - `cargo +1.98.1-x86_64-pc-windows-gnu xtask policy`: passed (`301 files ok`) - `cargo +1.98.1-x86_64-pc-windows-gnu test -p xtask`: `6/6` passed - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory`: `29/29` unit tests + integration tests passed - `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 diagnostics -- -D warnings`: `0` warnings - Plain `--release` build (`53.8s`, `objdump -p` Windows system DLLs only) and `--features diagnostics --release` build (`1m19s`): both succeeded ### Live 75s GPU Verification (`--features diagnostics`, RTX 4060 Ti 8 GB) - **Series S (`pr74-series-s-final`, 10/11 gates PASS):** - `12.0 fps` (`83.5 ms`, `+3.10 fps` vs `8.9` baseline), GPU `0.9 ms`, copyback `12.7 ms`, `0` crashes - `mapped()` rate `5.81 ms/s` (`1073.6 ms` total, longest `16.8 ms`) - Texture queue: `40649` uploaded, **`final_waiting=1787`** (vs `7121` baseline) - VRAM: `used_max=6182 MB` vs `budget_min=6668 MB` (`over=0 MB`, `room_false=8.3%`; A/B VRAM gate `+318 MB` vs `5864 MB` baseline due to `1024 MB` card buffer headroom + `64 MB` readback pool under `6668 MB` DXGI budget) - Visuals: `luma=104.4`, `near_black=0.0%`, `edge_energy=7.3`, `magenta=0.0%` - **Series X 1440p (`pr74-sx-mipdrop1024-cb1024`):** - `9.95 fps` (`100.25 ms`, `+1.05 fps` vs `8.9` Series S baseline), `0` crashes - `mapped()` rate **`28.42 ms/s`** (longest `15.5 ms`, vs `194.86 ms/s` when `CARD_BUFFERS_MB=512`) - VRAM: `used_max=6497 MB` vs `budget_min=6797 MB` (`over=0 MB`, `room_false=91.7%` under full `1024 MB` card buffers) - Visuals: `luma=104.72`, `near_black=0.01%`, `edge_energy=8.13`, `magenta=0.0%`
Androtim commented 2026-11-29 04:15:59 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers (not an approval).

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

Review Summary

Code, logic, and unit tests look clean and CI is passing. Because this PR changes victory play launcher defaults, adds DXGI dedicated VRAM detection, and introduces 8 GiB VRAM / RT memory caps, a local real-GPU smoke test is recommended before merging.

Verified Changes

  • crates/victory-gpu/src/streamline.rs: Refactors default_adapter() through default_adapter_desc() and exports adapter_vram_mb() -> Option<u64> using GetDesc1().DedicatedVideoMemory >> 20 on the selected hardware adapter (with EnumAdapters1(0) fallback). Safe and consistent with existing DXGI queries.
  • apps/victory/src/play.rs:
    • Adds VICTORY_READBACK_POOL=1, VICTORY_READBACK_POOL_MB=64, and VICTORY_NAN_SCRUB=1 to SETTINGS, plus VICTORY_NO_WATCHDOG=1 in settings_with_vram() (all applied before saved F1 menu and --set overrides).
    • Queries victory_hle::streamline::adapter_vram_mb() in prepare() and applies 8 GiB headroom guards when vram_mb <= LOW_VRAM_THRESHOLD_MB (9216 MiB): VICTORY_CARD_BUFFERS_MB (1024, or 512 with RT), VICTORY_CARD_WINDOWS_MB=256, VICTORY_CARD_ROOM_FOR_TARGETS_MB=512, VICTORY_DSTORAGE_STAGING_MB=64, and VICTORY_TEXTURE_MIP_DROP=1 (MIN_SIZE=1024) on Series X (!series_s) or RT.
    • Detects RT via VICTORY_BVH_BUILDER from --set (taking precedence over saved menu entries) and applies RT caps (VICTORY_RT_MEMORY_MB=768 on low VRAM / 1024 otherwise, VICTORY_BVH_FAULTS_ALL=8192).
    • Sets VICTORY_SLOT_EVICT_PERCENT=79 / VICTORY_SLOT_EVICT_LOW_PERCENT=75 when VICTORY_TEXTURE_ROOM_PERCENT <= 80 (framegen active).
    • Adds unit tests covering low-VRAM Series X + framegen, low-VRAM Series S vs RT, high-VRAM defaults, and --set overrides.

Notes for Testing / Follow-up

  • On high-VRAM GPUs (> 9216 MiB) with RT enabled, else if rt_on also caps VICTORY_CARD_BUFFERS_MB=512; worth confirming this does not cause unnecessary MakeResident churn on 12–24 GiB cards (though it remains overridable via --set).
  • VICTORY_NO_WATCHDOG=1 is set unconditionally in settings_with_vram() rather than in SETTINGS; functionally equivalent since it precedes menu/--set overrides, just slightly split from the other universal defaults.
  • Minor overlap with open PR #21 on defaulting VICTORY_READBACK_POOL=1 / 64 MiB (harmlessly redundant if both land).

Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7250548918 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/74#issuecomment-7250548918). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T04:15:59Z. --- <!-- minivi-triage v1 head=2e378b5bae79c3a06fb3ed18cb75ef826c81da8b verdict=needs-gpu-test ci=passing at=2026-11-29T04:16:31Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary Code, logic, and unit tests look clean and CI is passing. Because this PR changes `victory play` launcher defaults, adds DXGI dedicated VRAM detection, and introduces 8 GiB VRAM / RT memory caps, a local real-GPU smoke test is recommended before merging. ### Verified Changes - **`crates/victory-gpu/src/streamline.rs`**: Refactors `default_adapter()` through `default_adapter_desc()` and exports `adapter_vram_mb() -> Option<u64>` using `GetDesc1().DedicatedVideoMemory >> 20` on the selected hardware adapter (with `EnumAdapters1(0)` fallback). Safe and consistent with existing DXGI queries. - **`apps/victory/src/play.rs`**: - Adds `VICTORY_READBACK_POOL=1`, `VICTORY_READBACK_POOL_MB=64`, and `VICTORY_NAN_SCRUB=1` to `SETTINGS`, plus `VICTORY_NO_WATCHDOG=1` in `settings_with_vram()` (all applied before saved F1 menu and `--set` overrides). - Queries `victory_hle::streamline::adapter_vram_mb()` in `prepare()` and applies 8 GiB headroom guards when `vram_mb <= LOW_VRAM_THRESHOLD_MB` (`9216` MiB): `VICTORY_CARD_BUFFERS_MB` (`1024`, or `512` with RT), `VICTORY_CARD_WINDOWS_MB=256`, `VICTORY_CARD_ROOM_FOR_TARGETS_MB=512`, `VICTORY_DSTORAGE_STAGING_MB=64`, and `VICTORY_TEXTURE_MIP_DROP=1` (`MIN_SIZE=1024`) on Series X (`!series_s`) or RT. - Detects RT via `VICTORY_BVH_BUILDER` from `--set` (taking precedence over saved menu entries) and applies RT caps (`VICTORY_RT_MEMORY_MB=768` on low VRAM / `1024` otherwise, `VICTORY_BVH_FAULTS_ALL=8192`). - Sets `VICTORY_SLOT_EVICT_PERCENT=79` / `VICTORY_SLOT_EVICT_LOW_PERCENT=75` when `VICTORY_TEXTURE_ROOM_PERCENT <= 80` (framegen active). - Adds unit tests covering low-VRAM Series X + framegen, low-VRAM Series S vs RT, high-VRAM defaults, and `--set` overrides. ### Notes for Testing / Follow-up - On high-VRAM GPUs (`> 9216` MiB) with RT enabled, `else if rt_on` also caps `VICTORY_CARD_BUFFERS_MB=512`; worth confirming this does not cause unnecessary `MakeResident` churn on 12–24 GiB cards (though it remains overridable via `--set`). - `VICTORY_NO_WATCHDOG=1` is set unconditionally in `settings_with_vram()` rather than in `SETTINGS`; functionally equivalent since it precedes menu/`--set` overrides, just slightly split from the other universal defaults. - Minor overlap with open PR #21 on defaulting `VICTORY_READBACK_POOL=1` / `64 MiB` (harmlessly redundant if both land). --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-29 06:58:24 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T06:58:24Z.


Completed live 75s Series S and Series X 1440p GPU verification on 2e378b5 (RTX 4060 Ti 8 GiB):

  • Series S (pr74-series-s-final): reached 3D world (15 windows, max 12644 draws), 12.0 fps (83.5 ms, vs 8.9 fps baseline, +3.1 fps), max VRAM 6182 MB / 6668 MB budget (over=0 MB), waiting 1787 (vs 7121), mapped() 5.81 ms/s, crashes=0, no_host_texture_errors=0, untranslated=1, 24 captured frames (luma=104.4, edge_energy=7.3, 0.0% near-black/magenta; visually inspected frame-8619.png and frame-8771.png).
  • Series X 1440p (pr74-sx-mipdrop1024-cb1024): reached 3D world (14 windows, max 12827 draws), 9.95 fps (100.25 ms), max VRAM 6497 MB / 6797 MB budget (over=0 MB), waiting 8156, mapped() 28.42 ms/s, crashes=0, no_host_texture_errors=0, untranslated=1.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7252181052 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/74#issuecomment-7252181052). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T06:58:24Z. --- Completed live 75s Series S and Series X 1440p GPU verification on `2e378b5` (RTX 4060 Ti 8 GiB): - **Series S (`pr74-series-s-final`):** reached 3D world (`15` windows, max `12644` draws), `12.0 fps` (`83.5 ms`, vs `8.9 fps` baseline, `+3.1 fps`), max VRAM `6182 MB` / `6668 MB` budget (`over=0 MB`), waiting `1787` (vs `7121`), `mapped()` `5.81 ms/s`, `crashes=0`, `no_host_texture_errors=0`, `untranslated=1`, 24 captured frames (`luma=104.4`, `edge_energy=7.3`, `0.0%` near-black/magenta; visually inspected `frame-8619.png` and `frame-8771.png`). - **Series X 1440p (`pr74-sx-mipdrop1024-cb1024`):** reached 3D world (`14` windows, max `12827` draws), `9.95 fps` (`100.25 ms`), max VRAM `6497 MB` / `6797 MB` budget (`over=0 MB`), waiting `8156`, `mapped()` `28.42 ms/s`, `crashes=0`, `no_host_texture_errors=0`, `untranslated=1`.
Androtim commented 2026-11-29 16:41:15 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T16:41:15Z.


Automated RTX 4060 Ti 8 GB hardware verification PASSED (playtest/wave4-no141 vs origin/main 17a2f09 — 5/5 A/B gates PASS):

  • Hardware cargo test (RTX 4060 Ti): victory 39 passed, 0 failed; victory-gpu 552 passed, 0 failed (37 ignored).
  • Automated 45s in-world A/B (scripts/verify-world.ps1, DLSS Quality + golden autosave):
    • FPS: median 11.9 fps (84.15 ms) vs 11.2 fps (88.9 ms) baseline (+0.70 fps, min improved 7.0 vs 4.6, preparing 43.2 ms vs 45.1 ms)
    • Stability: 0 crashes / 0 DRED / 0 untranslated shaders
    • VRAM: max 5641 MB vs 5760 MB (-119 MB, 0 MB over budget)
    • Texture backlog: final_waiting=5924 vs 5753 (PASS)
    • Residency stalls: mapped_rate=8.69 ms/s vs 14.96 ms/s (-42%)
    • Visual check: Clean solid skin and lighting (frame-3923.png, frame-3955.png), luma 66.54, edge energy 2.1, magenta 0.0%.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7259098630 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/74#issuecomment-7259098630). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T16:41:15Z. --- Automated RTX 4060 Ti 8 GB hardware verification **PASSED** (`playtest/wave4-no141` vs `origin/main` `17a2f09` — **5/5 A/B gates PASS**): - **Hardware `cargo test` (RTX 4060 Ti):** `victory` **39 passed, 0 failed**; `victory-gpu` **552 passed, 0 failed** (37 ignored). - **Automated 45s in-world A/B (`scripts/verify-world.ps1`, DLSS Quality + golden autosave):** - **FPS:** median **`11.9 fps`** (`84.15 ms`) vs `11.2 fps` (`88.9 ms`) baseline (**+0.70 fps**, min improved **`7.0`** vs `4.6`, preparing **`43.2 ms`** vs `45.1 ms`) - **Stability:** **0** crashes / **0** DRED / **0** untranslated shaders - **VRAM:** max **`5641 MB`** vs `5760 MB` (**-119 MB**, `0 MB` over budget) - **Texture backlog:** `final_waiting=5924` vs `5753` (PASS) - **Residency stalls:** `mapped_rate=8.69 ms/s` vs `14.96 ms/s` (**-42%**) - **Visual check:** Clean solid skin and lighting (`frame-3923.png`, `frame-3955.png`), luma `66.54`, edge energy `2.1`, magenta `0.0%`.
Androtim commented 2026-11-29 17:07:06 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-29T17:07:06Z.


Follow-up from RTX 4060 Ti 8 GB interactive playtest with DLSS FG 2x (main de028c0): 5524–5690 MB used out of 6460–6628 MB DXGI budget (85.5%–85.8%) exceeds VICTORY_TEXTURE_ROOM_PERCENT=80, causing room() to starve new textures (no room for new ones so_far=92500 -> black/missing or delayed textures). Tracked in https://github.com/Androtim/MiniVI/issues/149.

<!-- greyfinch-sync:Androtim/MiniVI:comment:7259435912 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/74#issuecomment-7259435912). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-29T17:07:06Z. --- Follow-up from RTX 4060 Ti 8 GB interactive playtest with DLSS FG 2x (`main` `de028c0`): `5524–5690 MB` used out of `6460–6628 MB` DXGI budget (**85.5%–85.8%**) exceeds `VICTORY_TEXTURE_ROOM_PERCENT=80`, causing `room()` to starve new textures (`no room for new ones so_far=92500` -> black/missing or delayed textures). Tracked in https://github.com/Androtim/MiniVI/issues/149.
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!74
No description provided.