gpu: shrink texture pool blocks and tighten host-pressure VRAM eviction #4891

Closed
github-bot wants to merge 2 commits from github-bot/gh-4890 into main AGit
Owner

@⁠topangag on GitHub · 2026-12-01 13:03 UTC · original
topangag:pr/vram-pressure-and-texture-blocks → main · +183 −30 · 4 files · 2 commits · closed without merging

What it changes

Reduces steady-state VRAM footprint, texture-pool internal fragmentation, shared GPU spillover, and host-commit pressure on 16 GB RAM / 12 GB VRAM systems without sacrificing frame rate:

  1. Configurable texture pool block size (crates/victory-gpu/src/pool.rs):
    • Adds VICTORY_TEXTURE_BLOCK_MB (4..=64 MiB; defaults to 16 MiB when small_host_ram() is active and 8 MiB for the SMALL pool, preserving 64 MiB elsewhere).
    • Uses actual per-block size in cut(), take_from_with_growth(), texture(), Pool::bytes(), and Census.bytes while keeping texture_spares() anchored to BLOCK so spare counts do not multiply on 16 GB hosts.
    • Tightens spare retention under memory pressure (host_spares = (0, 1)) and clamps texture_limit to 1 when (pressure || host_low) && ahead() == 0.
  2. Host-commit pressure coupling & idle floor in sampled texture eviction (crates/victory-gpu/src/resource.rs, crates/victory-gpu/src/sampled.rs):
    • Couples host-memory pressure into slot_evict() thresholds (host_pressured caps high/low watermarks at 70%/60%; host_critical caps at 60%/50% with a 512 MiB eviction step) so VRAM spillover does not stall host commit recovery.
    • Adds VICTORY_SAMPLED_IDLE_MS (default 20_000 ms, range 4_000..=120_000) to protect recently active scene textures from premature thrashing.
    • Sweeps held textures every 2 frames (HELD_SWEEP_EVERY = 2) and ensures on_present wakes whenever any_held_textures() || EVICTED_ANY.
  3. BAR percentage tuning & read-lock fast path (crates/victory-gpu/src/shadow.rs):
    • Wires VICTORY_WINDOWS_BAR_PERCENT (50..=92, default 80) into window_mapped_for().
    • Uses a shared LOOSE.read() fast path for tails() / any && fine() lookups before taking the write lock.

How it was tested

  • PC Hardware:
    • CPU: AMD Ryzen 9 9955HX3D
    • RAM: 16 GB physical RAM (15,544.2 MiB usable, system-managed C:\pagefile.sys)
    • GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB VRAM (12,227 MiB total, Resizable BAR, Tiled Resources Tier 4)
    • OS: Windows 11
  • Game & Profile (isolated 210s A/B on 5fabb46e vs af7e50c0, identical cache & fixed input replay):
    • Profile: Xbox Series X, 1080to1440, DLSS Quality, Frame Generation Off, Ray Tracing Off (VICTORY_HW_RT=0), 30 FPS cap, DualSense input profile
    • Switches (identical on both A and B): VICTORY_WINDOW_GROW=1, VICTORY_WINDOWS_BAR_MB=1024, VICTORY_WINDOWS_BAR_PERCENT=80, VICTORY_CARD_WINDOWS_MB=0, VICTORY_PHYSICAL_FILE=1, VICTORY_CARD_CPU_FILE=1, VICTORY_PROCESS_MEMORY=0, VICTORY_TEXTURE_BLOCK_MB=16, VICTORY_RIPE_BLOCKS=0, VICTORY_SPARE_BLOCKS=2, VICTORY_LIST_LAZY=1, VICTORY_LIST_POOL_IDLE_S=15, VICTORY_ALLOCATOR_TRIM=1, VICTORY_ALLOCATOR_TRIM_S=45, VICTORY_POOL_STATS=1, VICTORY_SAMPLED_EVICT=1, VICTORY_SAMPLED_IDLE_MS=20000, VICTORY_SLOT_EVICT_PERCENT=70, VICTORY_SLOT_EVICT_LOW_PERCENT=60, VICTORY_SLOT_EVICT_MB=512, VICTORY_SHADER_CODE_ON_DISK=1, VICTORY_LIBRARY_KEEP_MB=0, VICTORY_DSTORAGE_BUFFER_BUDGET=96
  • Before (origin/main 5fabb46e, 210s run, duration reached):
    • Regular texture pool (TEXTURES, VICTORY_POOL_STATS=1, with VICTORY_POOL_SMALL off so SMALL held 0 blocks; see #3766 for combined census across both pools): 3,200 MB (50 × 64 MiB), 1,459 MB free fragmentation
    • Dedicated VRAM: Peak 8,170.7 MiB, Steady avg (≥120s) 8,073.9 MiB, End 8,150.2 MiB
    • Shared GPU memory: Peak 5,435.0 MiB, Steady avg 3,144.4 MiB, End 3,120.4 MiB (Total GPU steady avg 11,218.3 MiB)
    • Process private commit: Peak 23,538.2 MiB, End 22,770.0 MiB; System commit delta +30,718.7 MiB; Lowest available physical RAM 64 MiB
    • Eviction churn: 2,767 textures recreated (out of 27,932 evicted)
    • Steady-state FPS (last 6 intervals): 15.1–17.4 fps (avg 16.2 fps)
  • After (af7e50c0, 210s run, duration reached):
    • Regular texture pool (TEXTURES, VICTORY_POOL_STATS=1, with VICTORY_POOL_SMALL off / 0 SMALL blocks): 2,720 MB (170 × 16 MiB, -480 MB / -15.0%), 1,105 MB free fragmentation (-354 MB / -24.3%)
    • Dedicated VRAM: Peak 7,708.6 MiB (-462.1 MiB), Steady avg 7,605.6 MiB (-468.3 MiB), End 7,673.9 MiB (-476.3 MiB)
    • Shared GPU memory: Peak 4,946.0 MiB (-489.0 MiB), Steady avg 3,013.2 MiB (-131.2 MiB), Total GPU steady avg 10,618.8 MiB (-599.5 MiB)
    • Process private commit: Peak 22,855.8 MiB (-682.4 MiB), End 22,240.8 MiB (-529.2 MiB); System commit delta +30,218.3 MiB (-500.4 MiB); Lowest available physical RAM 138 MiB (+74 MiB)
    • Eviction churn: 2,038 textures recreated (out of 26,677 evicted, -26.3%)
    • Steady-state FPS (last 6 intervals): 16.5–17.4 fps (avg 17.0 fps, +0.8 fps)
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes)
  • cargo test passed for the crates it touches: yes
    • Local on fa740fd3: cargo test --locked -p victory-gpu --lib -- pool:: sampled:: window_mapped_default slot_plan_for_queue → 39 passed, 0 failed (including smaller_texture_blocks_cut_and_count_actual_bytes and sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain).
    • Local Clippy (default & --all-features) on fa740fd3: 0 warnings/errors in the 4 touched files.
    • Full Windows GitHub Actions CI (check = Clippy, Clippy --all-features, full workspace cargo test) verified green (7m54s) in fork PR topangag/VIctory-NVIDIA#2 on af7e50c0 and re-triggered on fa740fd3, on top of upstream CI baseline fixes (#4708 Clippy fixes + #4143 victory-hle alias validation fix).

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3454, #4581, #4582, #3128 (none duplicate configurable VICTORY_TEXTURE_BLOCK_MB pool blocks, host-commit pressure coupling in slot_evict, VICTORY_SAMPLED_IDLE_MS, or VICTORY_WINDOWS_BAR_PERCENT).
**@⁠topangag** on GitHub · 2026-12-01 13:03 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890) `topangag:pr/vram-pressure-and-texture-blocks` → `main` · +183 −30 · 4 files · 2 commits · closed without merging ## What it changes Reduces steady-state VRAM footprint, texture-pool internal fragmentation, shared GPU spillover, and host-commit pressure on 16 GB RAM / 12 GB VRAM systems without sacrificing frame rate: 1. **Configurable texture pool block size (`crates/victory-gpu/src/pool.rs`)**: - Adds `VICTORY_TEXTURE_BLOCK_MB` (`4..=64` MiB; defaults to `16 MiB` when `small_host_ram()` is active and `8 MiB` for the `SMALL` pool, preserving `64 MiB` elsewhere). - Uses actual per-block size in `cut()`, `take_from_with_growth()`, `texture()`, `Pool::bytes()`, and `Census.bytes` while keeping `texture_spares()` anchored to `BLOCK` so spare counts do not multiply on 16 GB hosts. - Tightens spare retention under memory pressure (`host_spares = (0, 1)`) and clamps `texture_limit` to `1` when `(pressure || host_low) && ahead() == 0`. 2. **Host-commit pressure coupling & idle floor in sampled texture eviction (`crates/victory-gpu/src/resource.rs`, `crates/victory-gpu/src/sampled.rs`)**: - Couples host-memory pressure into `slot_evict()` thresholds (`host_pressured` caps high/low watermarks at `70%/60%`; `host_critical` caps at `60%/50%` with a `512 MiB` eviction step) so VRAM spillover does not stall host commit recovery. - Adds `VICTORY_SAMPLED_IDLE_MS` (default `20_000` ms, range `4_000..=120_000`) to protect recently active scene textures from premature thrashing. - Sweeps held textures every 2 frames (`HELD_SWEEP_EVERY = 2`) and ensures `on_present` wakes whenever `any_held_textures() || EVICTED_ANY`. 3. **BAR percentage tuning & read-lock fast path (`crates/victory-gpu/src/shadow.rs`)**: - Wires `VICTORY_WINDOWS_BAR_PERCENT` (`50..=92`, default `80`) into `window_mapped_for()`. - Uses a shared `LOOSE.read()` fast path for `tails()` / `any && fine()` lookups before taking the write lock. ## How it was tested - **PC Hardware**: - CPU: AMD Ryzen 9 9955HX3D - RAM: 16 GB physical RAM (`15,544.2 MiB` usable, system-managed `C:\pagefile.sys`) - GPU: NVIDIA GeForce RTX 5070 Ti Laptop GPU, 12 GB VRAM (`12,227 MiB` total, Resizable BAR, Tiled Resources Tier 4) - OS: Windows 11 - **Game & Profile (isolated 210s A/B on `5fabb46e` vs `af7e50c0`, identical cache & fixed input replay)**: - Profile: Xbox Series X, `1080to1440`, DLSS Quality, Frame Generation Off, Ray Tracing Off (`VICTORY_HW_RT=0`), 30 FPS cap, DualSense input profile - Switches (identical on both A and B): `VICTORY_WINDOW_GROW=1`, `VICTORY_WINDOWS_BAR_MB=1024`, `VICTORY_WINDOWS_BAR_PERCENT=80`, `VICTORY_CARD_WINDOWS_MB=0`, `VICTORY_PHYSICAL_FILE=1`, `VICTORY_CARD_CPU_FILE=1`, `VICTORY_PROCESS_MEMORY=0`, `VICTORY_TEXTURE_BLOCK_MB=16`, `VICTORY_RIPE_BLOCKS=0`, `VICTORY_SPARE_BLOCKS=2`, `VICTORY_LIST_LAZY=1`, `VICTORY_LIST_POOL_IDLE_S=15`, `VICTORY_ALLOCATOR_TRIM=1`, `VICTORY_ALLOCATOR_TRIM_S=45`, `VICTORY_POOL_STATS=1`, `VICTORY_SAMPLED_EVICT=1`, `VICTORY_SAMPLED_IDLE_MS=20000`, `VICTORY_SLOT_EVICT_PERCENT=70`, `VICTORY_SLOT_EVICT_LOW_PERCENT=60`, `VICTORY_SLOT_EVICT_MB=512`, `VICTORY_SHADER_CODE_ON_DISK=1`, `VICTORY_LIBRARY_KEEP_MB=0`, `VICTORY_DSTORAGE_BUFFER_BUDGET=96` - **Before (`origin/main` `5fabb46e`, 210s run, `duration reached`)**: - Regular texture pool (`TEXTURES`, `VICTORY_POOL_STATS=1`, with `VICTORY_POOL_SMALL` off so `SMALL` held 0 blocks; see #3766 for combined census across both pools): `3,200 MB` (50 × 64 MiB), `1,459 MB` free fragmentation - Dedicated VRAM: Peak `8,170.7 MiB`, Steady avg (≥120s) `8,073.9 MiB`, End `8,150.2 MiB` - Shared GPU memory: Peak `5,435.0 MiB`, Steady avg `3,144.4 MiB`, End `3,120.4 MiB` (Total GPU steady avg `11,218.3 MiB`) - Process private commit: Peak `23,538.2 MiB`, End `22,770.0 MiB`; System commit delta `+30,718.7 MiB`; Lowest available physical RAM `64 MiB` - Eviction churn: `2,767` textures recreated (out of `27,932` evicted) - Steady-state FPS (last 6 intervals): `15.1–17.4 fps` (avg `16.2 fps`) - **After (`af7e50c0`, 210s run, `duration reached`)**: - Regular texture pool (`TEXTURES`, `VICTORY_POOL_STATS=1`, with `VICTORY_POOL_SMALL` off / 0 `SMALL` blocks): **`2,720 MB`** (170 × 16 MiB, **`-480 MB` / -15.0%**), **`1,105 MB`** free fragmentation (**`-354 MB` / -24.3%**) - Dedicated VRAM: Peak **`7,708.6 MiB`** (**`-462.1 MiB`**), Steady avg **`7,605.6 MiB`** (**`-468.3 MiB`**), End **`7,673.9 MiB`** (**`-476.3 MiB`**) - Shared GPU memory: Peak **`4,946.0 MiB`** (**`-489.0 MiB`**), Steady avg **`3,013.2 MiB`** (**`-131.2 MiB`**), Total GPU steady avg **`10,618.8 MiB`** (**`-599.5 MiB`**) - Process private commit: Peak **`22,855.8 MiB`** (**`-682.4 MiB`**), End **`22,240.8 MiB`** (**`-529.2 MiB`**); System commit delta **`+30,218.3 MiB`** (**`-500.4 MiB`**); Lowest available physical RAM **`138 MiB`** (**`+74 MiB`**) - Eviction churn: **`2,038`** textures recreated (out of `26,677` evicted, **`-26.3%`**) - Steady-state FPS (last 6 intervals): **`16.5–17.4 fps`** (avg **`17.0 fps`**, **`+0.8 fps`**) - For shader changes, the wave sizes tested (32 and/or 64 lanes): N/A (no shader changes) - `cargo test` passed for the crates it touches: **yes** - Local on `fa740fd3`: `cargo test --locked -p victory-gpu --lib -- pool:: sampled:: window_mapped_default slot_plan_for_queue` → **39 passed, 0 failed** (including `smaller_texture_blocks_cut_and_count_actual_bytes` and `sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain`). - Local Clippy (default & `--all-features`) on `fa740fd3`: 0 warnings/errors in the 4 touched files. - Full Windows GitHub Actions CI (`check` = Clippy, Clippy `--all-features`, full workspace `cargo test`) verified green (`7m54s`) in fork PR [topangag/VIctory-NVIDIA#2](https://github.com/topangag/VIctory-NVIDIA/pull/2) on `af7e50c0` and re-triggered on `fa740fd3`, on top of upstream CI baseline fixes (#4708 Clippy fixes + #4143 `victory-hle` alias validation fix). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3454, #4581, #4582, #3128 (none duplicate configurable `VICTORY_TEXTURE_BLOCK_MB` pool blocks, host-commit pressure coupling in `slot_evict`, `VICTORY_SAMPLED_IDLE_MS`, or `VICTORY_WINDOWS_BAR_PERCENT`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 13:04:55 +00:00
Author
Owner

@⁠Aniseto on GitHub · 2026-12-01 13:08 UTC · original

Ran the pool:: / sampled:: / window_mapped_default / slot_plan_for_queue selection at af7e50c0 on an NVIDIA Blackwell desktop part with 16 GB of VRAM.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q --locked -p victory-gpu --lib -- pool:: sampled:: window_mapped_default slot_plan_for_queue --test-threads=1
38 passed; 0 failed; 3 ignored; 1121 filtered out      (exit 0)

All 38 executed tests pass here, including smaller_texture_blocks_cut_and_count_actual_bytes. The wider selection also picks up three ignored tests; the description's 38/0 used the same filter. This adapter has 16 GB of VRAM and 64 GB of host RAM, but the 16 GB RAM / 12 GB VRAM scenario the PR targets was not reproduced, and no title run was done.

Not tested: the full workspace suite, a retail title, VRAM spillover or host-commit measurements, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-12-01 13:08 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7312158171) Ran the `pool::` / `sampled::` / `window_mapped_default` / `slot_plan_for_queue` selection at `af7e50c0` on an NVIDIA Blackwell desktop part with 16 GB of VRAM. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q --locked -p victory-gpu --lib -- pool:: sampled:: window_mapped_default slot_plan_for_queue --test-threads=1 38 passed; 0 failed; 3 ignored; 1121 filtered out (exit 0) ``` All 38 executed tests pass here, including `smaller_texture_blocks_cut_and_count_actual_bytes`. The wider selection also picks up three ignored tests; the description's 38/0 used the same filter. This adapter has 16 GB of VRAM and 64 GB of host RAM, but the 16 GB RAM / 12 GB VRAM scenario the PR targets was not reproduced, and no title run was done. Not tested: the full workspace suite, a retail title, VRAM spillover or host-commit measurements, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-12-01 13:13 UTC · original

One readback-cadence case on af7e50c0. EVICTED_ANY is cleared only when consume_readback removes the last entry from EVICTED. If even one evicted slot belongs to a scene the player never revisits, it stays in the map. Then on_present keeps selecting the two-frame cadence even when any_held_textures() is false and no new slots are evicted. Each sweep reads the marks back and clears the GPU buffer. The usual cadence in that case was 30 frames.

Could we keep the faster cadence tied to recent evictions or held textures and leave the normal sweep to discover cold slots if they are sampled much later? A short check that the cadence returns to 30 with one evicted slot left unread would cover the case.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-12-01 13:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7312302939) One readback-cadence case on `af7e50c0`. `EVICTED_ANY` is cleared only when `consume_readback` removes the last entry from `EVICTED`. If even one evicted slot belongs to a scene the player never revisits, it stays in the map. Then `on_present` keeps selecting the two-frame cadence even when `any_held_textures()` is false and no new slots are evicted. Each sweep reads the marks back and clears the GPU buffer. The usual cadence in that case was 30 frames. Could we keep the faster cadence tied to recent evictions or held textures and leave the normal sweep to discover cold slots if they are sampled much later? A short check that the cadence returns to 30 with one evicted slot left unread would cover the case.
@ -812,3 +848,3 @@
they hold {} MB",
c.blocks,
mb(c.blocks * BLOCK),
mb(c.bytes),
Author
Owner

@⁠tyr0nsur on GitHub · 2026-12-01 13:17 UTC · original

This improves the byte count for the regular pool, but the benchmark's VICTORY_POOL_STATS line still takes c.blocks, c.bytes and c.free from TEXTURES alone (line 839). The patch also changes SMALL to 8 MiB blocks, so some of the pool-size and fragmentation change is outside that line.

On Windows at af7e50c0, a synthetic placement with VICTORY_TEXTURE_BLOCK_MB=16, small alignment enabled and no ahead blocks produced one regular block and one small block. The census used here increased by 16 MiB. memory()[0], which sums both pools, increased by 24 MiB overall.

Could the 3,200 → 2,720 MiB row say “regular texture pool”, or include both pools' block bytes and free bytes? The dedicated/shared DXGI figures remain separate measurements. #3766 is relevant to the combined census.

**@⁠tyr0nsur** on GitHub · 2026-12-01 13:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#discussion_r4754664885) This improves the byte count for the regular pool, but the benchmark's `VICTORY_POOL_STATS` line still takes `c.blocks`, `c.bytes` and `c.free` from `TEXTURES` alone (line 839). The patch also changes `SMALL` to 8 MiB blocks, so some of the pool-size and fragmentation change is outside that line. On Windows at `af7e50c0`, a synthetic placement with `VICTORY_TEXTURE_BLOCK_MB=16`, small alignment enabled and no ahead blocks produced one regular block and one small block. The census used here increased by 16 MiB. `memory()[0]`, which sums both pools, increased by 24 MiB overall. Could the 3,200 → 2,720 MiB row say “regular texture pool”, or include both pools' block bytes and free bytes? The dedicated/shared DXGI figures remain separate measurements. #3766 is relevant to the combined census.
Author
Owner

@⁠topangag on GitHub · 2026-12-01 13:32 UTC · original

Thanks @⁠Aniseto for independently verifying the test suite on af7e50c0, and great catch @⁠andrewpozdnakov7-jpg!

You're right: pinning on_present to the 2-frame cadence whenever any cold entry remains in EVICTED would keep readbacks at 2 frames indefinitely if a previously evicted slot is never sampled again.

Updated in fa740fd3:

  • Track the last frame a slot was evicted (LAST_EVICTED_FRAME), and only use the 2-frame fast cadence while any_held_textures() is true or within a short recent-eviction window (60 frames) while EVICTED_ANY is set.
  • Once that window elapses with no held textures and no new evictions, on_present returns to the normal 30-frame SWEEP_EVERY cadence, which still discovers and wakes cold evicted slots if they are sampled later.
  • Added a unit test (sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain) verifying the cadence returns to 30 frames when one evicted slot remains unread past the recent-eviction window (39 passed; 0 failed locally; Fork CI re-running on topangag/VIctory-NVIDIA#2).
**@⁠topangag** on GitHub · 2026-12-01 13:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7312778936) Thanks @⁠Aniseto for independently verifying the test suite on `af7e50c0`, and great catch @⁠andrewpozdnakov7-jpg! You're right: pinning `on_present` to the 2-frame cadence whenever any cold entry remains in `EVICTED` would keep readbacks at 2 frames indefinitely if a previously evicted slot is never sampled again. Updated in `fa740fd3`: - Track the last frame a slot was evicted (`LAST_EVICTED_FRAME`), and only use the 2-frame fast cadence while `any_held_textures()` is true or within a short recent-eviction window (`60` frames) while `EVICTED_ANY` is set. - Once that window elapses with no held textures and no new evictions, `on_present` returns to the normal 30-frame `SWEEP_EVERY` cadence, which still discovers and wakes cold evicted slots if they are sampled later. - Added a unit test (`sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain`) verifying the cadence returns to 30 frames when one evicted slot remains unread past the recent-eviction window (`39 passed; 0 failed` locally; Fork CI re-running on `topangag/VIctory-NVIDIA#2`).
@ -812,3 +848,3 @@
they hold {} MB",
c.blocks,
mb(c.blocks * BLOCK),
mb(c.bytes),
Author
Owner

@⁠topangag on GitHub · 2026-12-01 13:32 UTC · original

Good catch, thank you! In our 210s A/B run VICTORY_POOL_SMALL was off (so SMALL held 0 blocks in both runs), which is why TEXTURES accounted for the full texture pool in that measurement, while the SMALL 8 MiB change only applies when small-alignment pooling is enabled.

I've updated the PR description to label the 3,200 MB -> 2,720 MB row explicitly as the regular texture pool (TEXTURES, VICTORY_POOL_STATS=1, with VICTORY_POOL_SMALL off) and noted #3766 for combined census reporting across both pools.

**@⁠topangag** on GitHub · 2026-12-01 13:32 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#discussion_r4754869700) Good catch, thank you! In our 210s A/B run `VICTORY_POOL_SMALL` was off (so `SMALL` held 0 blocks in both runs), which is why `TEXTURES` accounted for the full texture pool in that measurement, while the `SMALL` 8 MiB change only applies when small-alignment pooling is enabled. I've updated the PR description to label the `3,200 MB -> 2,720 MB` row explicitly as the **regular texture pool (`TEXTURES`, `VICTORY_POOL_STATS=1`, with `VICTORY_POOL_SMALL` off)** and noted #3766 for combined census reporting across both pools.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-12-01 14:00 UTC · original

Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree.

Base 5fabb46eaf6ed8771321787f8871051abde69b9b, head fa740fd36f0d8d307227e02c0b660e4330ab1495, 4 files +183/-30 (pool.rs, resource.rs, sampled.rs, shadow.rs).

Both new test names are absent on the base:

git grep -F smaller_texture_blocks_cut_and_count_actual_bytes 5fabb46e -- .
git grep -F sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain 5fabb46e -- .

→ no match, exit 1 for each. (The other two tests in the diff, host_budget_survives_four_hundred_allocation_cycles and speculative_staging_deferral_leaves_required_growth_available, already exist on the base — those hunks only adjust the fixture budgets.)

git diff --check "5fabb46e..fa740fd3" → no output, exit 0.

$env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4890'
cargo test --locked -p victory-gpu --lib -- pool::tests::smaller_texture_blocks_cut_and_count_actual_bytes --exact --test-threads=1 --quiet
cargo test --locked -p victory-gpu --lib -- sampled::tests::sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain --exact --test-threads=1 --quiet

Result, each: running 1 test, test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out; finished in 0.00s.

Both drive Pool/sweep_cadence from local statics with synthetic sizes; no device opened, GPU/driver N/A. No game data.

**@⁠cloph-dsp** on GitHub · 2026-12-01 14:00 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7313548261) Verification (independent, AI-assisted: Hy4 flash). Windows, Rust 1.100.0 (Scoop rust-msvc), MSVC, commit-scoped shallow worktree. Base `5fabb46eaf6ed8771321787f8871051abde69b9b`, head `fa740fd36f0d8d307227e02c0b660e4330ab1495`, 4 files +183/-30 (pool.rs, resource.rs, sampled.rs, shadow.rs). Both new test names are absent on the base: ``` git grep -F smaller_texture_blocks_cut_and_count_actual_bytes 5fabb46e -- . git grep -F sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain 5fabb46e -- . ``` → no match, exit 1 for each. (The other two tests in the diff, `host_budget_survives_four_hundred_allocation_cycles` and `speculative_staging_deferral_leaves_required_growth_available`, already exist on the base — those hunks only adjust the fixture budgets.) `git diff --check "5fabb46e..fa740fd3"` → no output, exit 0. ``` $env:CARGO_TARGET_DIR='D:\Victory-Contrib\NVIDIA-Contrib\target-4890' cargo test --locked -p victory-gpu --lib -- pool::tests::smaller_texture_blocks_cut_and_count_actual_bytes --exact --test-threads=1 --quiet cargo test --locked -p victory-gpu --lib -- sampled::tests::sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain --exact --test-threads=1 --quiet ``` Result, each: `running 1 test`, `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1162 filtered out; finished in 0.00s`. Both drive `Pool`/`sweep_cadence` from local statics with synthetic sizes; no device opened, GPU/driver N/A. No game data.
Author
Owner

@⁠Aniseto on GitHub · 2026-12-01 17:15 UTC · original

This is a new response on the same thread as my report at af7e50c0 (#4891); the head moved to fa740fd3, so I am not editing that comment.

Ran the new cadence test and the texture-block test at fa740fd3 on an NVIDIA Blackwell desktop part with 16 GB of VRAM.

Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own CARGO_TARGET_DIR, no local patches.

cargo test -q --locked -p victory-gpu --lib sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain -- --test-threads=1
1 passed; 0 failed; 0 ignored; 1162 filtered out      (exit 0)

cargo test -q --locked -p victory-gpu --lib smaller_texture_blocks_cut_and_count_actual_bytes -- --test-threads=1
1 passed; 0 failed; 0 ignored; 1162 filtered out      (exit 0)

Both tests pass here: the new one that checks the 2-frame readback cadence returns to the normal 30 frames when only cold evicted slots remain, and the one from the earlier head for actual texture-block bytes. The description's 8 GB A/B and the title runs were not repeated; no title was run.

Not tested: the full workspace suite, a retail title, VRAM spill or readback cadence on this adapter, Wine, AMD adapters, release profile, game data.

AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

**@⁠Aniseto** on GitHub · 2026-12-01 17:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7319008297) This is a new response on the same thread as my report at `af7e50c0` (https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/4891); the head moved to `fa740fd3`, so I am not editing that comment. Ran the new cadence test and the texture-block test at `fa740fd3` on an NVIDIA Blackwell desktop part with 16 GB of VRAM. Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own `CARGO_TARGET_DIR`, no local patches. ``` cargo test -q --locked -p victory-gpu --lib sweep_cadence_returns_to_normal_when_only_cold_evicted_slots_remain -- --test-threads=1 1 passed; 0 failed; 0 ignored; 1162 filtered out (exit 0) cargo test -q --locked -p victory-gpu --lib smaller_texture_blocks_cut_and_count_actual_bytes -- --test-threads=1 1 passed; 0 failed; 0 ignored; 1162 filtered out (exit 0) ``` Both tests pass here: the new one that checks the 2-frame readback cadence returns to the normal 30 frames when only cold evicted slots remain, and the one from the earlier head for actual texture-block bytes. The description's 8 GB A/B and the title runs were not repeated; no title was run. Not tested: the full workspace suite, a retail title, VRAM spill or readback cadence on this adapter, Wine, AMD adapters, release profile, game data. AI-assisted (OpenCode), model: **MiMo-V2.6-Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
github-bot closed this pull request 2026-12-01 18:30:38 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:29 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4890#issuecomment-7321022845) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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/trustno1-coder--VIctory-NVIDIA!4891
No description provided.