perf(gpu/mem): add <=18 GiB host RAM tier and sweep PRELUDES/HWRT pools under pressure (#276) #386

Merged
Androtim merged 2 commits from upstream-pr/386 into main 2026-12-03 12:01:21 +00:00
Androtim commented 2026-12-03 11:40:47 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T11:40:47Z.


Summary

Adds a dedicated <= 18 GiB (16 GB) host RAM tier and wires previously unswept PRELUDES and hwrt spare pools into host/sweep.rs pressure trimming to prevent 16 GB RAM PCs from falling into Windows paging stalls and reclaim idle commit on all systems under pressure.

Changes

  • crates/victory-gpu/src/residency.rs: Added tiny_host_ram() (<= 18 GiB total physical RAM) and earlier pressure hysteresis (<= 4 GiB physical / <= 6 GiB commit enter, >= 5.5 GiB / >= 8 GiB clear) for <= 18 GiB hosts; 32 GiB+ hosts keep existing thresholds unchanged.
  • crates/victory-gpu/src/host.rs & host/sweep.rs: Added preludes_kept() (64 on <= 18 GiB vs 256) and trim_preludes_on_pressure(critical) (keeps 16 under pressure, 0 when critical, accurately updating PRELUDES_ALIVE and dropping off-thread via drop_aside), wired into sweep_once().
  • crates/victory-gpu/src/list.rs: Added tiny_ram cap (default_idle_most = 128, pressure_idle_cap = 96 / 64).
  • crates/victory-gpu/src/ahead.rs: Gated ahead_limits() on both VRAM budget AND tiny_host_ram() so 16 GiB RAM systems paired with 12–16 GiB VRAM cards do not pre-allocate 512 MiB of startup buffers.
  • crates/victory-gpu/src/hwrt.rs & hwrt/budget.rs: Added LeasePool::drain_all() and hwrt::trim_on_pressure(critical) (drains idle leases, readbacks, and under critical commit as_pool, dropping off-thread via drop_aside), wired into sweep_once().

Verification

  • cargo test -p victory-gpu --lib residency::tests / ahead_limits / pressure_idle_cap
  • cargo clippy -p victory-gpu --all-targets -- -D warnings (clean)
  • Gate 1: GitHub CI check
  • Gate 2: Read-only Reasoning Audit (#282)
  • Gate 3: Live RTX 4060 Ti gameplay verification

Related: #276

<!-- greyfinch-sync:Androtim/MiniVI:issue:5625735280 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/386). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T11:40:47Z. --- ## Summary Adds a dedicated `<= 18 GiB` (16 GB) host RAM tier and wires previously unswept `PRELUDES` and `hwrt` spare pools into `host/sweep.rs` pressure trimming to prevent 16 GB RAM PCs from falling into Windows paging stalls and reclaim idle commit on all systems under pressure. ## Changes - **`crates/victory-gpu/src/residency.rs`:** Added `tiny_host_ram()` (`<= 18 GiB` total physical RAM) and earlier pressure hysteresis (`<= 4 GiB` physical / `<= 6 GiB` commit enter, `>= 5.5 GiB` / `>= 8 GiB` clear) for `<= 18 GiB` hosts; 32 GiB+ hosts keep existing thresholds unchanged. - **`crates/victory-gpu/src/host.rs` & `host/sweep.rs`:** Added `preludes_kept()` (`64` on `<= 18 GiB` vs `256`) and `trim_preludes_on_pressure(critical)` (keeps `16` under pressure, `0` when critical, accurately updating `PRELUDES_ALIVE` and dropping off-thread via `drop_aside`), wired into `sweep_once()`. - **`crates/victory-gpu/src/list.rs`:** Added `tiny_ram` cap (`default_idle_most = 128`, `pressure_idle_cap = 96 / 64`). - **`crates/victory-gpu/src/ahead.rs`:** Gated `ahead_limits()` on both VRAM budget AND `tiny_host_ram()` so 16 GiB RAM systems paired with 12–16 GiB VRAM cards do not pre-allocate 512 MiB of startup buffers. - **`crates/victory-gpu/src/hwrt.rs` & `hwrt/budget.rs`:** Added `LeasePool::drain_all()` and `hwrt::trim_on_pressure(critical)` (drains idle `leases`, `readbacks`, and under critical commit `as_pool`, dropping off-thread via `drop_aside`), wired into `sweep_once()`. ## Verification - [x] `cargo test -p victory-gpu --lib residency::tests` / `ahead_limits` / `pressure_idle_cap` - [x] `cargo clippy -p victory-gpu --all-targets -- -D warnings` (clean) - [ ] Gate 1: GitHub CI `check` - [ ] Gate 2: Read-only Reasoning Audit (`#282`) - [ ] Gate 3: Live RTX 4060 Ti gameplay verification Related: #276
Androtim commented 2026-12-03 11:56:15 +00:00 (Migrated from github.com)

Imported from Androtim/MiniVI. Originally posted by Androtim on 2026-12-03T11:56:15Z.


3-Gate Verification Summary (head \dd0fb48)

  • Gate 1 (GitHub CI \check): PASS (\4m0s)
  • Gate 2 (Read-only Reasoning Audit): VERIFIED CLEAN (0 P0, 0 P1, 0 P2) — logged on #282 (Pass #14). Follow-up \dd0fb48\ resolved all 4 Pass 1 findings (\hwrt::MGR\ lifted to module scope using \OnceLock::get(), non-critical HW-RT trim drains host
    eadbacks\ only while \leases/\s_pool\ require \critical, \HostList::give_prelude\ caps to \prelude_pressure_keep\ while pressured, and \ iny\ physical recovery lowered to \4.5 GiB\ with \3.0 GiB\ enter / \6–8 GiB\ commit hysteresis).
  • Gate 3 (Live RTX 4060 Ti 8G): PASS (\1440\ DLSS Quality, \VRAM 5540 / 6737 MiB, \DRAWS 9662, \SUBMIT BUSY 22.2 ms, crisp render, \
<!-- greyfinch-sync:Androtim/MiniVI:comment:7377378350 --> Imported from [Androtim/MiniVI](https://github.com/Androtim/MiniVI/pull/386#issuecomment-7377378350). Originally posted by [Androtim](https://github.com/Androtim) on 2026-12-03T11:56:15Z. --- ### 3-Gate Verification Summary (head \dd0fb48\) - **Gate 1 (GitHub CI \check\):** PASS (\4m0s\) - **Gate 2 (Read-only Reasoning Audit):** **VERIFIED CLEAN (0 P0, 0 P1, 0 P2)** — logged on #282 (Pass #14). Follow-up \dd0fb48\ resolved all 4 Pass 1 findings (\hwrt::MGR\ lifted to module scope using \OnceLock::get()\, non-critical HW-RT trim drains host \ eadbacks\ only while \leases\/\s_pool\ require \critical\, \HostList::give_prelude\ caps to \prelude_pressure_keep\ while pressured, and \ iny\ physical recovery lowered to \4.5 GiB\ with \3.0 GiB\ enter / \6–8 GiB\ commit hysteresis). - **Gate 3 (Live RTX 4060 Ti 8G):** PASS (\1440\ DLSS Quality, \VRAM 5540 / 6737 MiB\, \DRAWS 9662\, \SUBMIT BUSY 22.2 ms\, crisp render, \
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!386
No description provided.