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

Manually merged
github merged 2 commits from github-bot/gh-386 into gh-pr/386/base 2026-12-03 12:06:11 +00:00 AGit
Owner

@⁠Androtim on GitHub · 2026-12-03 11:40 UTC · original
Androtim:perf/low-ram-tier-and-pressure-sweeps → main · +133 −31 · 7 files · 2 commits · merged 2026-12-03 12:01 UTC

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

**@⁠Androtim** on GitHub · 2026-12-03 11:40 UTC · [original](https://github.com/Androtim/MiniVI/pull/386) `Androtim:perf/low-ram-tier-and-pressure-sweeps` → `main` · +133 −31 · 7 files · 2 commits · merged 2026-12-03 12:01 UTC ## 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
- Adds residency::tiny_host_ram() (<= 18 GiB total physical RAM) so 16 GiB PCs trigger memory pressure earlier (4 GiB phys / 6 GiB commit) and avoid Windows paging cliffs.
- Caps list::IDLE_MOST (128), host::PRELUDES_KEPT (64), and ahead startup pre-allocation (1024/256 even on >=12 GiB VRAM GPUs) on <=18 GiB hosts.
- Wires host::trim_preludes_on_pressure and hwrt::trim_on_pressure into host/sweep.rs under residency::pressured() to reclaim idle prelude command allocators and HW-RT spare pools off-thread.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-03 11:43:57 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-03 11:56 UTC · original

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, \
**@⁠Androtim** on GitHub · 2026-12-03 11:56 UTC · [original](https://github.com/Androtim/MiniVI/pull/386#issuecomment-7377378350) ### 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, \
github-bot changed target branch from main to gh-pr/386/base 2026-12-03 12:06:10 +00:00
github manually merged commit dd0fb48845 into gh-pr/386/base 2026-12-03 12:06:11 +00:00
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!386
No description provided.