gpu(pool,resource): gate new texture blocks under the VRAM line with 8 GiB scaling #48

Closed
github-bot wants to merge 1 commit from gh-pr/48/head into gh-pr/48/base
Owner

@⁠Androtim on GitHub · 2026-11-28 13:57 UTC · original
Androtim:feat/iter62-texture-pool-vram-gate → main · +726 −63 · 6 files · 1 commits · closed without merging

Summary

Ports fxceless/victory-fork@2eade68 ("The card stays under its memory budget: no new texture block past the texture line") with MiniVI's 8 GiB VRAM scaling and Told::Held wake-up adaptations so new 64 MiB texture blocks stay within the GPU's memory line without stalling texture streaming on constrained 8 GiB budgets:

  • pool.rs: Add VICTORY_POOL_GATE (1 default), VICTORY_POOL_FULLEST (0 default in play.rs), Pool::no_fit / Block::no_fit fast-skip cache, waiting / waits thread-local gate, BLOCKS counters, fill() diagnostics, freed / freed_since() rested-piece wake tracking, and 2 unit tests.
  • resource.rs: Add block_room / block_fits, weighed / blocks_full, by_address_room(budget, used, len, pct) / by_address_fits, targets_to_come / targets_to_come_bytes (settling with targets_room_kept on <= 9 GiB cards while keeping full most - targets on >= 12 GiB cards), !crate::pool::waits() guards in hosted and host_texture_as, 9-term room_terms, and 3 unit tests.
  • draw.rs: Add HEAP_TEXTURES_NO_PLACE counters, hold no_place slots under Told::Held(frame + most) capped at 1024 refusals/pass, and wake held slots when room returns or pool::freed_since() reports freed pool space.
  • host.rs: Log the 9-term texture-queue room breakdown and texture blocks: telemetry in Meter.
  • shadow.rs: Pass pct from memory_card_budget into crate::resource::by_address_room.

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 (Build 26300) / NVIDIA Driver 32.0.16.2124

Run Settings & Profile

  • Build & Commit SHA: release & diagnostics release builds @ 0a46bbe (CARGO_TARGET_DIR=D:\victory-build\minivi, RUSTFLAGS="-C link-self-contained=yes")
  • Console Profile & Internal Resolution / Scale: series-s — 720p
  • Ray Tracing: off (ambient_specular_active=true)
  • Upscaling: DLSS quality
  • Frame Generation: off
  • Launcher Command / Preset & Extra VICTORY_* Overrides: D:\victory-build\verify-tools\verify-world.ps1 (matching apps/victory/src/play.rs SETTINGS + VICTORY_POOL_FULLEST=0, VICTORY_D3D12_DRED=light, VICTORY_CARD_ACCOUNTING=1, VICTORY_CAPTURE_WORLD=1)
  • Scene / Area & Session Length: Opening balcony / open world (max_draws=11295, world_windows=15), 75 seconds in-world capture (D:\victory-data\verify-runs\pr48-texture-pool-vram-gate-v3)

Measurements & Verification

  • Base FPS (without Frame Gen): 11.0 fps median (9.7 fps mean, 0.7 fps min, 90.8 ms median frame time; +2.10 fps vs baseline-main 8.9 fps)
  • Frame-Gen FPS (if enabled): off
  • VRAM / RAM Usage: 5681 MB median / 5707 MB peak VRAM against 6606 MB min DXGI budget (0 MB over budget; -157 MB peak vs baseline-main 5864 MB; 46 pool blocks = 2944 MB, 231–241 MB free in blocks, room_false=13.3%); texture queue 47355 uploaded, 3790 final waiting (-3331 vs baseline-main 7121), 2426 no_place looks
  • Visuals (24 captured PNGs): 19/24 lit, median luma 104.11 (+0.91 vs baseline-main 103.2), edge energy 7.2 (+0.09 vs 7.11), 0.0% near-black / magenta / cyan (inspected frame-6889.png & frame-7827.png)
  • Residency & Crashes / DRED Resets: 0 crashes, 0 no_host_texture errors, mapped() rate 37.44 ms/world_sec (38400 calls, 3470.6 ms, max 11.0 ms), all 11/11 verify-world gates PASS
  • Automated Checks:
    • 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 --workspace --all-targets --features diagnostics -- -D warnings (0 warnings)
    • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1 (453 passed; 0 failed; 36 ignored)
    • cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release + objdump -p (0 non-system MinGW DLLs) & --features diagnostics --release
**@⁠Androtim** on GitHub · 2026-11-28 13:57 UTC · [original](https://github.com/Androtim/MiniVI/pull/48) `Androtim:feat/iter62-texture-pool-vram-gate` → `main` · +726 −63 · 6 files · 1 commits · closed without merging ## Summary Ports `fxceless/victory-fork@2eade68` (*"The card stays under its memory budget: no new texture block past the texture line"*) with MiniVI's `8 GiB` VRAM scaling and `Told::Held` wake-up adaptations so new 64 MiB texture blocks stay within the GPU's memory line without stalling texture streaming on constrained 8 GiB budgets: - **[`pool.rs`](file:///crates/victory-gpu/src/pool.rs)**: Add `VICTORY_POOL_GATE` (`1` default), `VICTORY_POOL_FULLEST` (`0` default in [`play.rs`](file:///apps/victory/src/play.rs)), `Pool::no_fit` / `Block::no_fit` fast-skip cache, `waiting` / `waits` thread-local gate, `BLOCKS` counters, `fill()` diagnostics, `freed` / `freed_since()` rested-piece wake tracking, and 2 unit tests. - **[`resource.rs`](file:///crates/victory-gpu/src/resource.rs)**: Add `block_room` / `block_fits`, `weighed` / `blocks_full`, `by_address_room(budget, used, len, pct)` / `by_address_fits`, `targets_to_come` / `targets_to_come_bytes` (settling with `targets_room_kept` on `<= 9 GiB` cards while keeping full `most - targets` on `>= 12 GiB` cards), `!crate::pool::waits()` guards in `hosted` and `host_texture_as`, 9-term `room_terms`, and 3 unit tests. - **[`draw.rs`](file:///crates/victory-gpu/src/draw.rs)**: Add `HEAP_TEXTURES_NO_PLACE` counters, hold `no_place` slots under `Told::Held(frame + most)` capped at 1024 refusals/pass, and wake held slots when room returns or `pool::freed_since()` reports freed pool space. - **[`host.rs`](file:///crates/victory-gpu/src/host.rs)**: Log the 9-term texture-queue room breakdown and `texture blocks:` telemetry in `Meter`. - **[`shadow.rs`](file:///crates/victory-gpu/src/shadow.rs)**: Pass `pct` from `memory_card_budget` into `crate::resource::by_address_room`. ## 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 (Build 26300) / NVIDIA Driver `32.0.16.2124` ## Run Settings & Profile - **Build & Commit SHA:** `release` & `diagnostics` release builds @ `0a46bbe` (`CARGO_TARGET_DIR=D:\victory-build\minivi`, `RUSTFLAGS="-C link-self-contained=yes"`) - **Console Profile & Internal Resolution / Scale:** `series-s` — `720p` - **Ray Tracing:** `off` (`ambient_specular_active=true`) - **Upscaling:** `DLSS quality` - **Frame Generation:** `off` - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** `D:\victory-build\verify-tools\verify-world.ps1` (matching `apps/victory/src/play.rs` `SETTINGS` + `VICTORY_POOL_FULLEST=0`, `VICTORY_D3D12_DRED=light`, `VICTORY_CARD_ACCOUNTING=1`, `VICTORY_CAPTURE_WORLD=1`) - **Scene / Area & Session Length:** Opening balcony / open world (`max_draws=11295`, `world_windows=15`), 75 seconds in-world capture (`D:\victory-data\verify-runs\pr48-texture-pool-vram-gate-v3`) ## Measurements & Verification - **Base FPS (without Frame Gen):** `11.0 fps` median (`9.7 fps` mean, `0.7 fps` min, `90.8 ms` median frame time; `+2.10 fps` vs `baseline-main` `8.9 fps`) - **Frame-Gen FPS (if enabled):** off - **VRAM / RAM Usage:** `5681 MB` median / `5707 MB` peak VRAM against `6606 MB` min DXGI budget (`0 MB` over budget; `-157 MB` peak vs `baseline-main` `5864 MB`; `46` pool blocks = `2944 MB`, `231–241 MB` free in blocks, `room_false=13.3%`); texture queue `47355` uploaded, `3790` final waiting (`-3331` vs `baseline-main` `7121`), `2426` `no_place` looks - **Visuals (24 captured PNGs):** `19/24` lit, median luma `104.11` (`+0.91` vs `baseline-main` `103.2`), edge energy `7.2` (`+0.09` vs `7.11`), `0.0%` near-black / magenta / cyan (inspected `frame-6889.png` & `frame-7827.png`) - **Residency & Crashes / DRED Resets:** `0` crashes, `0` `no_host_texture` errors, `mapped()` rate `37.44 ms/world_sec` (`38400` calls, `3470.6 ms`, max `11.0 ms`), all `11/11` `verify-world` gates **PASS** - **Automated Checks:** - [x] `cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- 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 diagnostics -- -D warnings` (`0` warnings) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu --lib -- --test-threads=1` (`453 passed; 0 failed; 36 ignored`) - [x] `cargo +1.98.1-x86_64-pc-windows-gnu build -p victory --release` + `objdump -p` (`0` non-system MinGW DLLs) & `--features diagnostics --release`
Ports fxceless/victory-fork@2eade68 with MiniVI 8 GiB VRAM scaling and Held wake-up adaptations:
- pool.rs: add block gate (VICTORY_POOL_GATE=1), fullest-block option (VICTORY_POOL_FULLEST=0), no_fit cache, waiting/waits thread-locals, freed_since() wake tracking, fill() stats, and 2 unit tests.
- resource.rs: add block_room/block_fits, weighed/blocks_full, by_address_room(..., pct), targets_to_come_bytes settling via targets_room_kept on <= 9 GiB cards, waits() guards in hosted/host_texture_as, 9-term room_terms, and 3 unit tests.
- draw.rs: hold no_place textures under Told::Held(frame + most) capped at 1024 refusals/pass and wake on room return or pool::freed_since().
- host.rs: log 9-term room breakdown and texture blocks summary in Meter.
- shadow.rs: pass scaled pct from memory_card_budget into resource::by_address_room.
- play.rs: default VICTORY_POOL_FULLEST=0.

Verified locally (policy, xtask 6/6, clippy default/diagnostics, victory-gpu 453/453, release+diag builds) and live 75s open-world run (11/11 gates PASS).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:04:39 +00:00
github-bot closed this pull request 2026-12-01 20:04:39 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 18:48 UTC · original

Automated triage for the maintainers (not an approval).

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

Review Summary

PR #48 cleanly ports texture-pool VRAM gating with 8 GiB budget scaling and Told::Held wake-up handling across pool.rs, resource.rs, draw.rs, host.rs, shadow.rs, and play.rs. CI is passing and unit test coverage is solid.

Verified Changes

  • crates/victory-gpu/src/pool.rs: Adds VICTORY_POOL_GATE (default on) and VICTORY_POOL_FULLEST (default on in pool.rs, explicitly set to 0 in apps/victory/src/play.rs), Pool::no_fit / Block::no_fit fast-skip caching (reset on add() and reclaim()), thread-local waiting() / waits() signaling, freed_since() rested-piece wake tracking, BLOCKS counters, and fill() diagnostics. block.room accounting stays consistent with Ranges::take and Ranges::give.
  • crates/victory-gpu/src/resource.rs & crates/victory-gpu/src/shadow.rs: Adds block_room() / block_fits(), weighed() / blocks_full(), targets_to_come() / targets_to_come_bytes() (settling via targets_room_kept on <= 9 GiB budgets while retaining most - targets on >= 12 GiB budgets), and by_address_room() (wired into shadow::by_address). Guards hosted() and host_texture_as() with crate::pool::waits() so deferred textures do not fall back to committed allocations or get permanently marked refused.
  • crates/victory-gpu/src/draw.rs & crates/victory-gpu/src/host.rs: Holds deferred no_place slots in State::heap_textures under Told::Held(frame + most) (capped at 1024 refusals/pass), wakes held slots when room returns or pool::freed_since() reports freed pool space, and logs the 9-term room_terms and texture blocks: breakdown in Meter.

Minor Non-Blocking Observations

  • pool::may_grow() caches block_room() for 100 ms (now() / 100 + 1); during a burst of texture allocations within a single 100 ms window, multiple 64 MiB blocks could be allocated before the cache refreshes.
  • resource::block_fits() uses used + kept + POOL_BLOCK <= line rather than saturating_add (unlike by_address_fits()), though realistic VRAM values will not overflow u64.

Next Step

Logic and unit tests look sound; because this changes VRAM budget gating, texture pool allocation, and play.rs defaults, a local real-GPU smoke test is warranted before merging.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-11-28 18:48 UTC · [original](https://github.com/Androtim/MiniVI/pull/48#issuecomment-7244066986) <!-- minivi-triage v1 head=0a46bbe56748f0986f1f6e41eec935659f0c4cb5 verdict=needs-gpu-test ci=passing at=2026-11-28T18:48:45Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-gpu-test` · **CI (`check`):** `passing` ### Review Summary PR #48 cleanly ports texture-pool VRAM gating with 8 GiB budget scaling and `Told::Held` wake-up handling across `pool.rs`, `resource.rs`, `draw.rs`, `host.rs`, `shadow.rs`, and `play.rs`. CI is passing and unit test coverage is solid. ### Verified Changes - **`crates/victory-gpu/src/pool.rs`**: Adds `VICTORY_POOL_GATE` (default on) and `VICTORY_POOL_FULLEST` (default on in `pool.rs`, explicitly set to `0` in `apps/victory/src/play.rs`), `Pool::no_fit` / `Block::no_fit` fast-skip caching (reset on `add()` and `reclaim()`), thread-local `waiting()` / `waits()` signaling, `freed_since()` rested-piece wake tracking, `BLOCKS` counters, and `fill()` diagnostics. `block.room` accounting stays consistent with `Ranges::take` and `Ranges::give`. - **`crates/victory-gpu/src/resource.rs` & `crates/victory-gpu/src/shadow.rs`**: Adds `block_room()` / `block_fits()`, `weighed()` / `blocks_full()`, `targets_to_come()` / `targets_to_come_bytes()` (settling via `targets_room_kept` on `<= 9 GiB` budgets while retaining `most - targets` on `>= 12 GiB` budgets), and `by_address_room()` (wired into `shadow::by_address`). Guards `hosted()` and `host_texture_as()` with `crate::pool::waits()` so deferred textures do not fall back to committed allocations or get permanently marked `refused`. - **`crates/victory-gpu/src/draw.rs` & `crates/victory-gpu/src/host.rs`**: Holds deferred `no_place` slots in `State::heap_textures` under `Told::Held(frame + most)` (capped at 1024 refusals/pass), wakes held slots when room returns or `pool::freed_since()` reports freed pool space, and logs the 9-term `room_terms` and `texture blocks:` breakdown in `Meter`. ### Minor Non-Blocking Observations - `pool::may_grow()` caches `block_room()` for 100 ms (`now() / 100 + 1`); during a burst of texture allocations within a single 100 ms window, multiple 64 MiB blocks could be allocated before the cache refreshes. - `resource::block_fits()` uses `used + kept + POOL_BLOCK <= line` rather than `saturating_add` (unlike `by_address_fits()`), though realistic VRAM values will not overflow `u64`. ### Next Step Logic and unit tests look sound; because this changes VRAM budget gating, texture pool allocation, and `play.rs` defaults, a local real-GPU smoke test is warranted before merging. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-11-28 21:18 UTC · original

Closing as superseded duplicate of merged PR #2.

**@⁠Androtim** on GitHub · 2026-11-28 21:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/48#issuecomment-7245920986) Closing as superseded duplicate of merged PR #2.

Pull request closed

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!48
No description provided.