Iter 27: Fix VICTORY_LEVELS_ON_DEMAND bypassed by texture pool (2.6 GB VRAM leak) and tile eviction accounting #12

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

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


Summary

Fixes a critical bug where VICTORY_LEVELS_ON_DEMAND=1 created 0 reserved/tiled textures when VICTORY_TEXTURE_POOL=1 (the default), wasting 2.5–2.6 GB VRAM on unmapped mip levels and causing double allocation of full-size textures.

Root Cause & Diagnosis

In a 6+ minute interactive open-world playtest on an 8 GiB RTX 4060 Ti (playtest-20261128-043800.err.log, combined PRs #2–#10 build, VICTORY_TEXTURE_POOL=1, VICTORY_LEVELS_ON_DEMAND=1, VICTORY_LEVELS_ALL=1, VICTORY_LEVELS_MAX_DIM=2048):

  • VRAM sat at 7,979–8,026 MB against a 6,840–6,926 MB budget (5.9–7.3 fps, 78–102 ms on GPU).
  • card accounting reported 7,629 alive host copies (3,455 MB), of which 2,540–2,622 MB were unmapped mip levels, and 0 copies made level by level (0 MB of tiles).
  • In crates/victory-gpu/src/resource.rs::host_texture_as(..., reserved), the crate::pool::texture(...) fast path ran without checking !reserved:
    1. hosted() requested host_texture_as(..., true) expecting a CreateReservedResource texture.
    2. host_texture_as allocated a full-size placed texture from a 64 MiB pool block instead.
    3. Tiled::make() rejected that non-reserved texture (GetResourceTiling returned total == 0).
    4. hosted() discarded the pool allocation and immediately called host_texture(..., false) to allocate the same full-size texture a second time (base = 0, because held_only() is false when tiles::wanted() is true).

Changes

  • crates/victory-gpu/src/resource.rs:
    • Extracted use_texture_pool(reserved, filled, sample_count, has_clear, readable_layout) so reserved == true always bypasses crate::pool::texture and creates a CreateReservedResource texture.
    • Added HostTexture::card_bytes() (tiled.given_bytes() when tiled, else self.bytes) so let_go_idle and slot_evict count tiled VRAM accurately against sweep/eviction caps instead of treating every tiled texture as 0 bytes. (Keeps HostTexture::bytes == 0 for HOST_TEXTURES[1] / KINDS[1] / room() so KINDS[1] + tiles::given_total() never double-counts.)
    • Added unit tests reserved_textures_bypass_texture_pool and reserved_host_texture_is_tiled_even_with_texture_pool.
  • crates/victory-gpu/src/tiles.rs:
    • Created 64 MiB levels-on-demand heaps in take() with crate::host::not_resident(), crate::residency::allocation_error, crate::host::resident(), and crate::host::mapped() on the live host() device (matching pool.rs) so newly mapped tile heaps are VA-mapped before UpdateTileMappings.

Rig Specs Tested On

  • CPU: Intel Core i7-13700F
  • GPU & VRAM: NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM)
  • System RAM: 32 GiB
  • OS & GPU Driver: Windows 11 Home 10.0.26300 / Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release + diag @ fc23fb3612b0866da92f77f309e6dbdeb6c71740
  • Console Profile & Internal Resolution / Scale: series-s (unit + D3D12 device/WARP verification; full-game live smoke deferred while user's active playtest PID 33604 is occupying the RTX 4060 Ti)
  • Ray Tracing: N/A (deferred live smoke)
  • Upscaling: N/A (deferred live smoke)
  • Frame Generation: N/A (deferred live smoke)
  • Launcher Command / Preset & Extra VICTORY_* Overrides: Targeted victory-gpu live device test reserved_host_texture_is_tiled_even_with_texture_pool (with default VICTORY_TEXTURE_POOL=1) + levels_on_demand WARP D3D12 debug-layer test
  • Scene / Area & Session Length: Unit + D3D12 verification suite (real playtest diagnosis baseline from playtest-20261128-043800.err.log, 6m+ interactive open world)

Measurements & Verification

  • Base FPS (without Frame Gen): Full-game live smoke deferred while user's interactive playtest (PID 33604) is running on the GPU; baseline combined PRs #2–#10 open-world playtest telemetry was 5.9–7.3 fps with 2.5–2.6 GB unmapped mips and 0 tiled textures.
  • Frame-Gen FPS (if enabled): off
  • VRAM / RAM Usage: Baseline playtest 7,979–8,026 MB / 6,904 MB; live tiled smoke verification will be appended as a PR comment once the GPU is free.
  • Crashes / DRED Resets: 0 across all D3D12 device & WARP tests (D3D12 debug layer on WARP reported 0 errors).
  • 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 -p victory-gpu --features diagnostics --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, including reserved_textures_bypass_texture_pool and reserved_host_texture_is_tiled_even_with_texture_pool on RTX 4060 Ti)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --ignored levels_on_demand --nocapture (1 passed; 0 failed on WARP TiledResourcesTier 3, 47 UpdateTileMappings calls in 596 us)
    • Standalone release & diag (--features diagnostics) builds (non_system_mingw_dlls=0 via objdump -p)
<!-- greyfinch-sync:Androtim/MiniVI:issue:5536504331 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/12). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T04:06:11Z. --- ## Summary Fixes a critical bug where `VICTORY_LEVELS_ON_DEMAND=1` created **0** reserved/tiled textures when `VICTORY_TEXTURE_POOL=1` (the default), wasting **2.5–2.6 GB VRAM** on unmapped mip levels and causing double allocation of full-size textures. ### Root Cause & Diagnosis In a 6+ minute interactive open-world playtest on an 8 GiB RTX 4060 Ti (`playtest-20261128-043800.err.log`, combined PRs #2–#10 build, `VICTORY_TEXTURE_POOL=1`, `VICTORY_LEVELS_ON_DEMAND=1`, `VICTORY_LEVELS_ALL=1`, `VICTORY_LEVELS_MAX_DIM=2048`): - VRAM sat at **7,979–8,026 MB** against a **6,840–6,926 MB** budget (`5.9–7.3 fps`, `78–102 ms` on GPU). - `card accounting` reported **7,629 alive host copies (3,455 MB), of which 2,540–2,622 MB were unmapped mip levels**, and **`0` copies made level by level (`0 MB` of tiles)**. - In `crates/victory-gpu/src/resource.rs::host_texture_as(..., reserved)`, the `crate::pool::texture(...)` fast path ran without checking `!reserved`: 1. `hosted()` requested `host_texture_as(..., true)` expecting a `CreateReservedResource` texture. 2. `host_texture_as` allocated a **full-size placed texture** from a 64 MiB pool block instead. 3. `Tiled::make()` rejected that non-reserved texture (`GetResourceTiling` returned `total == 0`). 4. `hosted()` discarded the pool allocation and immediately called `host_texture(..., false)` to allocate the **same full-size texture a second time** (`base = 0`, because `held_only()` is `false` when `tiles::wanted()` is `true`). ### Changes - **`crates/victory-gpu/src/resource.rs`**: - Extracted `use_texture_pool(reserved, filled, sample_count, has_clear, readable_layout)` so `reserved == true` always bypasses `crate::pool::texture` and creates a `CreateReservedResource` texture. - Added `HostTexture::card_bytes()` (`tiled.given_bytes()` when tiled, else `self.bytes`) so `let_go_idle` and `slot_evict` count tiled VRAM accurately against sweep/eviction caps instead of treating every tiled texture as `0` bytes. (Keeps `HostTexture::bytes == 0` for `HOST_TEXTURES[1]` / `KINDS[1]` / `room()` so `KINDS[1] + tiles::given_total()` never double-counts.) - Added unit tests `reserved_textures_bypass_texture_pool` and `reserved_host_texture_is_tiled_even_with_texture_pool`. - **`crates/victory-gpu/src/tiles.rs`**: - Created 64 MiB levels-on-demand heaps in `take()` with `crate::host::not_resident()`, `crate::residency::allocation_error`, `crate::host::resident()`, and `crate::host::mapped()` on the live `host()` device (matching `pool.rs`) so newly mapped tile heaps are VA-mapped before `UpdateTileMappings`. ## Rig Specs Tested On - **CPU:** Intel Core i7-13700F - **GPU & VRAM:** NVIDIA GeForce RTX 4060 Ti (8 GiB VRAM) - **System RAM:** 32 GiB - **OS & GPU Driver:** Windows 11 Home `10.0.26300` / Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `release` + `diag` @ `fc23fb3612b0866da92f77f309e6dbdeb6c71740` - **Console Profile & Internal Resolution / Scale:** `series-s` (unit + D3D12 device/WARP verification; full-game live smoke deferred while user's active playtest PID 33604 is occupying the RTX 4060 Ti) - **Ray Tracing:** N/A (deferred live smoke) - **Upscaling:** N/A (deferred live smoke) - **Frame Generation:** N/A (deferred live smoke) - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** Targeted `victory-gpu` live device test `reserved_host_texture_is_tiled_even_with_texture_pool` (with default `VICTORY_TEXTURE_POOL=1`) + `levels_on_demand` WARP D3D12 debug-layer test - **Scene / Area & Session Length:** Unit + D3D12 verification suite (real playtest diagnosis baseline from `playtest-20261128-043800.err.log`, 6m+ interactive open world) ## Measurements & Verification - **Base FPS (without Frame Gen):** Full-game live smoke deferred while user's interactive playtest (`PID 33604`) is running on the GPU; baseline combined PRs #2–#10 open-world playtest telemetry was `5.9–7.3 fps` with `2.5–2.6 GB` unmapped mips and `0` tiled textures. - **Frame-Gen FPS (if enabled):** `off` - **VRAM / RAM Usage:** Baseline playtest `7,979–8,026 MB / 6,904 MB`; live tiled smoke verification will be appended as a PR comment once the GPU is free. - **Crashes / DRED Resets:** `0` across all D3D12 device & WARP tests (D3D12 debug layer on WARP reported 0 errors). - **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 -p victory-gpu --features diagnostics --all-targets -- -D warnings` (`0 warnings`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --test-threads=1` (`450 passed; 0 failed; 36 ignored`, including `reserved_textures_bypass_texture_pool` and `reserved_host_texture_is_tiled_even_with_texture_pool` on RTX 4060 Ti) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --ignored levels_on_demand --nocapture` (`1 passed; 0 failed` on WARP `TiledResourcesTier 3`, 47 `UpdateTileMappings` calls in `596 us`) - [x] Standalone `release` & `diag` (`--features diagnostics`) builds (`non_system_mingw_dlls=0` via `objdump -p`)
Androtim commented 2026-11-28 04:11:49 +00:00 (Migrated from github.com)

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


Verification summary for @fc23fb3 (feat/iter27-levels-on-demand-pool-fix):

  • GitHub Actions CI (46105962803): success in 5m14s (Clippy, Clippy, diagnostics build, Tests)
  • Open PR Mergeability (Androtim/MiniVI): PRs #1–#12 all report MERGEABLE
  • Local Verification (i7-13700F, RTX 4060 Ti 8 GiB, 32 GiB RAM, Win11 10.0.26300, Driver 32.0.16.2124):
    • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- 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 -p victory-gpu --features diagnostics --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 (including reserved_textures_bypass_texture_pool and live RTX 4060 Ti reserved_host_texture_is_tiled_even_with_texture_pool)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --ignored levels_on_demand --nocapture: 1 passed; 0 failed on WARP (TiledResourcesTier 3, debug layer on, 47 UpdateTileMappings in 596 us)
    • Standalone release & diag (--features diagnostics) builds: non_system_mingw_dlls=0 (objdump.exe -p)
    • Full-game verify-live.ps1 deferred because the user's active playtest (PID 33604) is currently running on the GPU.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7233793399 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/12#issuecomment-7233793399). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T04:11:49Z. --- Verification summary for `@fc23fb3` (`feat/iter27-levels-on-demand-pool-fix`): - **GitHub Actions CI (`46105962803`):** `success` in 5m14s (`Clippy`, `Clippy, diagnostics build`, `Tests`) - **Open PR Mergeability (`Androtim/MiniVI`):** PRs `#1`–`#12` all report `MERGEABLE` - **Local Verification (`i7-13700F`, `RTX 4060 Ti 8 GiB`, `32 GiB RAM`, Win11 `10.0.26300`, Driver `32.0.16.2124`):** - `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- 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 -p victory-gpu --features diagnostics --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` (including `reserved_textures_bypass_texture_pool` and live RTX 4060 Ti `reserved_host_texture_is_tiled_even_with_texture_pool`) - `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu -- --ignored levels_on_demand --nocapture`: `1 passed; 0 failed` on WARP (`TiledResourcesTier 3`, debug layer on, 47 `UpdateTileMappings` in `596 us`) - Standalone `release` & `diag` (`--features diagnostics`) builds: `non_system_mingw_dlls=0` (`objdump.exe -p`) - Full-game `verify-live.ps1` deferred because the user's active playtest (`PID 33604`) is currently running on the GPU.
Androtim commented 2026-11-28 04:46:36 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-11-28T04:46:36Z.


## Real In-World A/B Verification (origin/main vs PR #12 on RTX 4060 Ti 8 GiB, Mission-1 Golden Save)

Tested diagnostics builds (main-diag.exe vs pr12-diag.exe) unattended through the Mission-1 dock/balcony 3D world (~11,024 draws/frame).

What PR #12 Fixed

  • Tiled creation with VICTORY_TEXTURE_POOL=1 now works in-world: levels_on_demand_alive went from 0 (prior pre-PR12 bug where pool allocation bypassed Tiled) to 7,799 tiled textures holding 1,024 MB of card tiles (room_false dropped 33.3% -> 0.0%, unmapped_mips median dropped 486.5 -> 120.0 MB, mapped() stall rate dropped 26.99 -> 14.26 ms/world_sec).
  • Stability & Visuals: 0 crashes, 0 no host texture errors, 15/24 lit frames cleanly textured (median luma 103.25, 0.0% near-black, edge_energy 13.58).

Observed Finding with VICTORY_LEVELS_ON_DEMAND=1 + VICTORY_LEVELS_ALL=1

  • Under play.rs defaults (VICTORY_LEVELS_ON_DEMAND=0), baseline-main ran the 11k-draw dock scene at 6.1-7.2 fps (8.9 fps overall median across dock + balcony).
  • Enabling VICTORY_LEVELS_ON_DEMAND=1 + VICTORY_LEVELS_ALL=1 dropped the same 11k-draw dock scene to 2.9 fps (26,190 waiting textures vs 7,121), inflated memory in blocks staging buffers from 384 MB to 2,816 MB, and inflated total uploads from 1,778 MB to 11,337 MB (crates/victory-gpu/src/texture.rs::staging() still stages full mip chains from first=0 and pins on_demand staging buffers because once = once() && !on_demand).
  • Keeping VICTORY_LEVELS_ON_DEMAND=0 as the default in apps/victory/src/play.rs avoids that regression while PR #12 safely fixes the use_texture_pool / HostTexture::card_bytes() / tiles::take accounting bugs; on_demand staging bloat will be addressed in a separate follow-up PR.
<!-- greyfinch-sync:Androtim/MiniVI:comment:7234251995 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/12#issuecomment-7234251995). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T04:46:36Z. --- ## Real In-World A/B Verification (`origin/main` vs PR #12 on RTX 4060 Ti 8 GiB, Mission-1 Golden Save) Tested `diagnostics` builds (`main-diag.exe` vs `pr12-diag.exe`) unattended through the Mission-1 dock/balcony 3D world (`~11,024` draws/frame). ### What PR #12 Fixed - **Tiled creation with `VICTORY_TEXTURE_POOL=1` now works in-world:** `levels_on_demand_alive` went from `0` (prior pre-PR12 bug where pool allocation bypassed `Tiled`) to `7,799` tiled textures holding `1,024 MB` of card tiles (`room_false` dropped `33.3% -> 0.0%`, `unmapped_mips` median dropped `486.5 -> 120.0 MB`, `mapped()` stall rate dropped `26.99 -> 14.26 ms/world_sec`). - **Stability & Visuals:** `0` crashes, `0` `no host texture` errors, `15/24` lit frames cleanly textured (`median luma 103.25`, `0.0%` near-black, `edge_energy 13.58`). ### Observed Finding with `VICTORY_LEVELS_ON_DEMAND=1` + `VICTORY_LEVELS_ALL=1` - Under `play.rs` defaults (`VICTORY_LEVELS_ON_DEMAND=0`), `baseline-main` ran the `11k`-draw dock scene at `6.1-7.2 fps` (`8.9 fps` overall median across dock + balcony). - Enabling `VICTORY_LEVELS_ON_DEMAND=1` + `VICTORY_LEVELS_ALL=1` dropped the same `11k`-draw dock scene to `2.9 fps` (`26,190` waiting textures vs `7,121`), inflated `memory in blocks` staging buffers from `384 MB` to `2,816 MB`, and inflated total uploads from `1,778 MB` to `11,337 MB` (`crates/victory-gpu/src/texture.rs::staging()` still stages full mip chains from `first=0` and pins `on_demand` staging buffers because `once = once() && !on_demand`). - Keeping `VICTORY_LEVELS_ON_DEMAND=0` as the default in `apps/victory/src/play.rs` avoids that regression while PR #12 safely fixes the `use_texture_pool` / `HostTexture::card_bytes()` / `tiles::take` accounting bugs; `on_demand` staging bloat will be addressed in a separate follow-up PR.
Androtim commented 2026-11-28 05:03:08 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers (not an approval).

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

Automated Review Summary

Verdict: needs-gpu-test — CI is passing, the root-cause fix and tile eviction accounting look sound, and full-game live GPU verification is still needed (and noted as deferred in the PR description) since this activates CreateReservedResource + 64 MiB tile heap allocation under default VICTORY_TEXTURE_POOL=1.

Verified Changes

  • crates/victory-gpu/src/resource.rs (use_texture_pool, host_texture_as):
    • Previously, host_texture_as(..., reserved) entered crate::pool::texture(...) without checking !reserved, returning a placed non-reserved texture that Tiled::make rejected and causing a fallback full-size allocation.
    • Extracting use_texture_pool(reserved, filled, sample_count, has_clear, readable_layout) with !reserved cleanly bypasses the texture pool for reserved textures while preserving existing pool conditions.
    • Unit tests reserved_textures_bypass_texture_pool and reserved_host_texture_is_tiled_even_with_texture_pool cover the predicate and live D3D12 Tiled::make path. (Minor note: assert!(crate::pool::on(), ...) in the latter test will fail if cargo test is run with VICTORY_TEXTURE_POOL=0 in the environment.)
  • crates/victory-gpu/src/resource.rs (HostTexture::card_bytes, let_go_idle, slot_evict):
    • HostTexture::new_tiled keeps bytes: 0 to avoid double-counting against HOST_TEXTURES[1] / tiles::STATS[2]. Using HostTexture::card_bytes() (tiled.given_bytes() when tiled, else self.bytes) in let_go_idle and slot_evict fixes oldest_covering(copies, need) so tiled textures count toward the eviction byte cap rather than contributing 0 bytes and over-evicting.
  • crates/victory-gpu/src/tiles.rs (take):
    • Creates 64 MiB tile heaps with D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES | crate::host::not_resident(), reports CreateHeap failures to crate::residency::allocation_error, and ensures crate::host::resident + crate::host::mapped (when matching host().device) succeed before inserting the heap into POOL or incrementing STATS[3].

Local GPU Smoke Test Needed

Because VICTORY_LEVELS_ON_DEMAND=1 was previously a no-op with VICTORY_TEXTURE_POOL=1, this change exercises reserved textures, UpdateTileMappings, and POOL-locked CreateHeap/resident/mapped calls in real gameplay for the first time:

  1. Run an open-world session on an 8 GiB GPU with VICTORY_TEXTURE_POOL=1 (default) and VICTORY_LEVELS_ON_DEMAND=1 (plus VICTORY_LEVELS_ALL=1 / VICTORY_LEVELS_MAX_DIM=2048 if matching the baseline).
  2. Confirm in diagnostic accounting that reserved/tiled textures are > 0, tile bytes are non-zero, and unmapped-mip VRAM overhead drops significantly compared to the 2.5–2.6 GB baseline.
  3. Verify no device removal/DRED, no stalls or lock contention around tiles::take, no black/missing mip visuals, and clean eviction under VICTORY_SLOT_EVICT=1.

(This is an automated triage review, not formal maintainer approval.)


Generated with Antigravity CLI (agy).

<!-- greyfinch-sync:Androtim/MiniVI:comment:7234424212 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/12#issuecomment-7234424212). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T05:03:08Z. --- <!-- minivi-triage v1 head=fc23fb3612b0866da92f77f309e6dbdeb6c71740 verdict=needs-gpu-test ci=passing at=2026-11-28T05:03:35Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Automated Review Summary **Verdict: `needs-gpu-test`** — CI is passing, the root-cause fix and tile eviction accounting look sound, and full-game live GPU verification is still needed (and noted as deferred in the PR description) since this activates `CreateReservedResource` + 64 MiB tile heap allocation under default `VICTORY_TEXTURE_POOL=1`. #### Verified Changes - **`crates/victory-gpu/src/resource.rs` (`use_texture_pool`, `host_texture_as`)**: - Previously, `host_texture_as(..., reserved)` entered `crate::pool::texture(...)` without checking `!reserved`, returning a placed non-reserved texture that `Tiled::make` rejected and causing a fallback full-size allocation. - Extracting `use_texture_pool(reserved, filled, sample_count, has_clear, readable_layout)` with `!reserved` cleanly bypasses the texture pool for reserved textures while preserving existing pool conditions. - Unit tests `reserved_textures_bypass_texture_pool` and `reserved_host_texture_is_tiled_even_with_texture_pool` cover the predicate and live D3D12 `Tiled::make` path. *(Minor note: `assert!(crate::pool::on(), ...)` in the latter test will fail if `cargo test` is run with `VICTORY_TEXTURE_POOL=0` in the environment.)* - **`crates/victory-gpu/src/resource.rs` (`HostTexture::card_bytes`, `let_go_idle`, `slot_evict`)**: - `HostTexture::new_tiled` keeps `bytes: 0` to avoid double-counting against `HOST_TEXTURES[1]` / `tiles::STATS[2]`. Using `HostTexture::card_bytes()` (`tiled.given_bytes()` when tiled, else `self.bytes`) in `let_go_idle` and `slot_evict` fixes `oldest_covering(copies, need)` so tiled textures count toward the eviction byte cap rather than contributing `0` bytes and over-evicting. - **`crates/victory-gpu/src/tiles.rs` (`take`)**: - Creates 64 MiB tile heaps with `D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES | crate::host::not_resident()`, reports `CreateHeap` failures to `crate::residency::allocation_error`, and ensures `crate::host::resident` + `crate::host::mapped` (when matching `host().device`) succeed before inserting the heap into `POOL` or incrementing `STATS[3]`. #### Local GPU Smoke Test Needed Because `VICTORY_LEVELS_ON_DEMAND=1` was previously a no-op with `VICTORY_TEXTURE_POOL=1`, this change exercises reserved textures, `UpdateTileMappings`, and `POOL`-locked `CreateHeap`/`resident`/`mapped` calls in real gameplay for the first time: 1. Run an open-world session on an 8 GiB GPU with `VICTORY_TEXTURE_POOL=1` (default) and `VICTORY_LEVELS_ON_DEMAND=1` (plus `VICTORY_LEVELS_ALL=1` / `VICTORY_LEVELS_MAX_DIM=2048` if matching the baseline). 2. Confirm in diagnostic accounting that reserved/tiled textures are > 0, tile bytes are non-zero, and unmapped-mip VRAM overhead drops significantly compared to the 2.5–2.6 GB baseline. 3. Verify no device removal/DRED, no stalls or lock contention around `tiles::take`, no black/missing mip visuals, and clean eviction under `VICTORY_SLOT_EVICT=1`. *(This is an automated triage review, not formal maintainer approval.)* --- _Generated with Antigravity CLI (`agy`)._
Androtim commented 2026-11-28 21:11:11 +00:00 (Migrated from github.com)

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


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:7245834117 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/12#issuecomment-7245834117). Originally posted by [Androtim](https://github.com/Androtim) on 2026-11-28T21:11:11Z. --- ### 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!12
No description provided.