pool: narrow 16 MiB buffer blocks to tight RAM/VRAM, latch peak VRAM budget, and harden pool growth #4737

Closed
nidea1 wants to merge 5 commits from upstream-pr/4737 into main
nidea1 commented 2026-12-01 04:25:33 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T04:25:33Z.


What it changes

Four targeted crates/victory-gpu/src/pool.rs memory-efficiency and robustness improvements (strictly scoped away from texture block sizing in #1562/#1968 and Pool::cut indexing in #3561/#4082/#4219):

  1. Tight-memory-gated 16 MiB CPU-visible buffer pool blocks (VICTORY_BUFFER_BLOCK_MB): UPLOADS and SHARED CPU buffer pools currently always allocate 64 MiB blocks, trapping up to 64 MiB of pinned L0 shared memory per sparse block. Default buffer blocks to 16 MiB only when residency::small_host_ram() (< 24 GiB RAM, e.g. 16 GiB hosts with VICTORY_BUFFER_POOL=1) or residency::limited_host_ram() (<= 32 GiB RAM) paired with a <= 9 GiB latched DXGI local VRAM budget (6–8 GiB GPUs). Systems with 32 GiB RAM + 12–16+ GiB VRAM (such as @POMXARK's RTX 5080 16 GB Series X rig, where 16 MiB blocks regressed prep_ms and Commit), > 32 GiB RAM, or an unavailable DXGI budget stay on 64 MiB blocks. If cpu_buffer runs before the first 1 Hz room() tick, current_vram_budget() probes made_host().video_memory() at most once and shares the peak-latched VRAM_BUDGET (fetch_max), so transient startup lows on 12+ GiB cards still recover to 64 MiB. Explicit VICTORY_BUFFER_BLOCK_MB overrides remain available everywhere (clamped to [8, 64] MiB so block / 2 >= BUFFER_MOST of 4 MiB).
  2. Peak-latched VRAM budget for automatic VICTORY_SPARE_SCALE on <= 9 GiB VRAM: Latches the peak non-zero DXGI local budget via fetch_max (so transient low startup budgets on 10–12+ GiB GPUs recover cleanly while later mid-run dips across 9 GiB cannot oscillate tiers) and defaults VICTORY_SPARE_SCALE on for <= 9 GiB VRAM budgets so empty texture blocks do not hoard up to SPARE_KEPT = 64 (4 GiB) when VRAM drops below 85%. Keeps > 9 GiB GPUs opt-in (=1), treats empty env strings ("") as unset, and preserves explicit =0 opt-out everywhere.
  3. Concurrent-growth reuse & post-growth Ripe refresh in take_from_with_limit: Previously, when multiple threads concurrently missed Pool::cut, allocated blocks outside the pool mutex, and reacquired the lock, every thread unconditionally called add_and_cut on its own newly made block — immediately pinning duplicate sparse blocks with a single piece each (amplified 4x with smaller blocks). take_from_with_limit now refreshes the ripe() snapshot after unlocked growth (so blocks that ripened while waiting on MakeResident are recognized and lowered SPARES budgets from room() take effect immediately), re-checks Pool::cut so concurrent growers pack into existing blocks, keeps duplicate blocks empty only up to the spare/ahead budget, and drops any surplus, undersized, or zero-size block outside the pool mutex.
  4. Invalid/oversized request guards in Pool::add_and_cut and take_from_with_limit: Rejects len == 0, align == 0, or len > size before inserting an unused block into self.blocks (avoiding empty-block leaks and next_multiple_of(0) panics), rejects size == 0 ahead blocks (avoiding divide-by-zero in census/fullness), and short-circuits invalid/oversized requests in take_from_with_limit before acquiring the pool mutex or calling make.

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing):
    • Headless D3D12 unit, acceptance, diagnostics replay, and full workspace tests on RTX 3060 Ti 8 GB / 32 GB RAM (Windows 11) on head b34c3740.
    • Earlier live matched A/B on RTX 3060 Ti 8 GB / 32 GB RAM (Series S, DLSS Quality, FSR 3 FG; see comment below) showed -950..-1,231 MB Shared GPU RAM, -637..-1,056 MB PrivateBytes, and -159..-424 MB VRAM with 16 MiB blocks + auto spare scaling.
    • @POMXARK's paired same-binary A/B on RTX 5080 16 GB / 32 GB RAM (Series X 1440p, DLSS Quality; see comment below) caught a regression when 16 MiB blocks auto-enabled on 32 GB RAM + 16 GB VRAM (+4.40 ms prep_ms, +700 MB Shared GPU, +948 MB Commit), motivating cff7e115/b34c3740's narrowed gating and concurrent-growth hardening.
  • Before (468a183c / main): main always used 64 MiB CPU buffer blocks, kept VICTORY_SPARE_SCALE off on 8 GB GPUs, lacked add_and_cut guards, and pinned duplicate sparse blocks on concurrent growth; 468a183c gated auto-16 MiB too broadly on <= 32 GiB RAM alone.
  • After (b34c3740):
    • cargo test -j 4 --locked -p victory-gpu --lib -- pool:: — 36 passed, 0 failed, 3 ignored (auto-16 MiB verified via ID3D12Heap::GetDesc().SizeInBytes + VRAM_BUDGET latch on 32 GB / 8 GB VRAM host; Upload 61.9x faster, Shared 39.0x faster).
    • VICTORY_BUFFER_BLOCK_MB=8 buffer tests — 3 passed, 0 failed (live 8 MiB D3D12 heaps verified; Upload 41.6x, Shared 38.7x).
    • VICTORY_BUFFER_BLOCK_MB=64 buffer tests — 3 passed, 0 failed (live 64 MiB D3D12 heaps verified; Upload 74.6x, Shared 90.5x).
    • cargo test -j 4 --locked -p victory-gpu --lib -- --test-threads=1 — 1101 passed, 0 failed, 66 ignored.
    • cargo test -j 4 --locked -p victory-gpu --lib (parallel) — 1101 passed, 0 failed, 66 ignored.
    • cargo test -j 4 --locked -p victory-gpu --features diagnostics --test replay --test replay_big — 1 passed, 0 failed, 1 ignored.
    • cargo test -j 4 --workspace --locked — all crates passed, 0 failed.
    • cargo clippy -j 4 -p victory-gpu --all-targets --locked and --all-features: 0 warnings/errors in pool.rs (origin/main 5fabb46e currently has 5 pre-existing #4634 warnings in host/{font,menu,panel}.rs, tracked in #4707).
    • cargo xtask policy: 464 files ok.
    • git merge-tree --write-tree clean against origin/main (5fabb46e) and #4713 (04f1c6b8), and merged #4737 + #4713 compiled and passed pool:: tests (39 passed, 0 failed, 3 ignored).
  • For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (not a shader change).
  • cargo test passed for the crates it touches: yes (full cargo test --workspace --locked, victory-gpu --lib single-threaded and parallel, and --features diagnostics replay; cfg(not(windows)) not run).

Checked for overlap

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5578992954 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737). Originally posted by [nidea1](https://github.com/nidea1) on 2026-12-01T04:25:33Z. --- ## What it changes Four targeted `crates/victory-gpu/src/pool.rs` memory-efficiency and robustness improvements (strictly scoped away from texture block sizing in `#1562`/`#1968` and `Pool::cut` indexing in `#3561`/`#4082`/`#4219`): 1. **Tight-memory-gated 16 MiB CPU-visible buffer pool blocks (`VICTORY_BUFFER_BLOCK_MB`):** `UPLOADS` and `SHARED` CPU buffer pools currently always allocate 64 MiB blocks, trapping up to 64 MiB of pinned L0 shared memory per sparse block. Default buffer blocks to 16 MiB only when `residency::small_host_ram()` (`< 24 GiB` RAM, e.g. 16 GiB hosts with `VICTORY_BUFFER_POOL=1`) or `residency::limited_host_ram()` (`<= 32 GiB` RAM) paired with a `<= 9 GiB` latched DXGI local VRAM budget (6–8 GiB GPUs). Systems with `32 GiB` RAM + `12–16+ GiB` VRAM (such as @POMXARK's RTX 5080 16 GB Series X rig, where 16 MiB blocks regressed `prep_ms` and Commit), `> 32 GiB` RAM, or an unavailable DXGI budget stay on 64 MiB blocks. If `cpu_buffer` runs before the first 1 Hz `room()` tick, `current_vram_budget()` probes `made_host().video_memory()` at most once and shares the peak-latched `VRAM_BUDGET` (`fetch_max`), so transient startup lows on 12+ GiB cards still recover to 64 MiB. Explicit `VICTORY_BUFFER_BLOCK_MB` overrides remain available everywhere (clamped to `[8, 64]` MiB so `block / 2 >= BUFFER_MOST` of 4 MiB). 2. **Peak-latched VRAM budget for automatic `VICTORY_SPARE_SCALE` on `<= 9 GiB` VRAM:** Latches the peak non-zero DXGI local budget via `fetch_max` (so transient low startup budgets on 10–12+ GiB GPUs recover cleanly while later mid-run dips across 9 GiB cannot oscillate tiers) and defaults `VICTORY_SPARE_SCALE` on for `<= 9 GiB` VRAM budgets so empty texture blocks do not hoard up to `SPARE_KEPT = 64` (4 GiB) when VRAM drops below 85%. Keeps `> 9 GiB` GPUs opt-in (`=1`), treats empty env strings (`""`) as unset, and preserves explicit `=0` opt-out everywhere. 3. **Concurrent-growth reuse & post-growth `Ripe` refresh in `take_from_with_limit`:** Previously, when multiple threads concurrently missed `Pool::cut`, allocated blocks outside the pool mutex, and reacquired the lock, every thread unconditionally called `add_and_cut` on its own newly made block — immediately pinning duplicate sparse blocks with a single piece each (amplified 4x with smaller blocks). `take_from_with_limit` now refreshes the `ripe()` snapshot after unlocked growth (so blocks that ripened while waiting on `MakeResident` are recognized and lowered `SPARES` budgets from `room()` take effect immediately), re-checks `Pool::cut` so concurrent growers pack into existing blocks, keeps duplicate blocks empty only up to the spare/ahead budget, and drops any surplus, undersized, or zero-size block outside the pool mutex. 4. **Invalid/oversized request guards in `Pool::add_and_cut` and `take_from_with_limit`:** Rejects `len == 0`, `align == 0`, or `len > size` before inserting an unused block into `self.blocks` (avoiding empty-block leaks and `next_multiple_of(0)` panics), rejects `size == 0` ahead blocks (avoiding divide-by-zero in `census`/`fullness`), and short-circuits invalid/oversized requests in `take_from_with_limit` before acquiring the pool mutex or calling `make`. ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): - Headless D3D12 unit, acceptance, diagnostics replay, and full workspace tests on RTX 3060 Ti 8 GB / 32 GB RAM (Windows 11) on head `b34c3740`. - Earlier live matched A/B on RTX 3060 Ti 8 GB / 32 GB RAM (Series S, DLSS Quality, FSR 3 FG; see comment below) showed `-950..-1,231 MB` Shared GPU RAM, `-637..-1,056 MB` PrivateBytes, and `-159..-424 MB` VRAM with 16 MiB blocks + auto spare scaling. - @POMXARK's paired same-binary A/B on RTX 5080 16 GB / 32 GB RAM (Series X 1440p, DLSS Quality; see comment below) caught a regression when 16 MiB blocks auto-enabled on 32 GB RAM + 16 GB VRAM (`+4.40 ms` `prep_ms`, `+700 MB` Shared GPU, `+948 MB` Commit), motivating `cff7e115`/`b34c3740`'s narrowed gating and concurrent-growth hardening. - Before (`468a183c` / `main`): `main` always used 64 MiB CPU buffer blocks, kept `VICTORY_SPARE_SCALE` off on 8 GB GPUs, lacked `add_and_cut` guards, and pinned duplicate sparse blocks on concurrent growth; `468a183c` gated auto-16 MiB too broadly on `<= 32 GiB` RAM alone. - After (`b34c3740`): - `cargo test -j 4 --locked -p victory-gpu --lib -- pool::` — **36 passed, 0 failed, 3 ignored** (auto-16 MiB verified via `ID3D12Heap::GetDesc().SizeInBytes` + `VRAM_BUDGET` latch on 32 GB / 8 GB VRAM host; Upload 61.9x faster, Shared 39.0x faster). - `VICTORY_BUFFER_BLOCK_MB=8` buffer tests — **3 passed, 0 failed** (live 8 MiB D3D12 heaps verified; Upload 41.6x, Shared 38.7x). - `VICTORY_BUFFER_BLOCK_MB=64` buffer tests — **3 passed, 0 failed** (live 64 MiB D3D12 heaps verified; Upload 74.6x, Shared 90.5x). - `cargo test -j 4 --locked -p victory-gpu --lib -- --test-threads=1` — **1101 passed, 0 failed, 66 ignored**. - `cargo test -j 4 --locked -p victory-gpu --lib` (parallel) — **1101 passed, 0 failed, 66 ignored**. - `cargo test -j 4 --locked -p victory-gpu --features diagnostics --test replay --test replay_big` — **1 passed, 0 failed, 1 ignored**. - `cargo test -j 4 --workspace --locked` — **all crates passed, 0 failed**. - `cargo clippy -j 4 -p victory-gpu --all-targets --locked` and `--all-features`: **0 warnings/errors in `pool.rs`** (`origin/main` `5fabb46e` currently has 5 pre-existing `#4634` warnings in `host/{font,menu,panel}.rs`, tracked in `#4707`). - `cargo xtask policy`: 464 files ok. - `git merge-tree --write-tree` clean against `origin/main` (`5fabb46e`) and `#4713` (`04f1c6b8`), and merged `#4737 + #4713` compiled and passed `pool::` tests (**39 passed, 0 failed, 3 ignored**). - For shader changes, the wave sizes tested (32 and/or 64 lanes): n/a (not a shader change). - `cargo test` passed for the crates it touches: yes (full `cargo test --workspace --locked`, `victory-gpu --lib` single-threaded and parallel, and `--features diagnostics` replay; `cfg(not(windows))` not run). ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1562, #1968, #2038, #4288, #4462, #4713, #4707
nidea1 commented 2026-12-01 05:33:06 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T05:33:06Z.


Live A/B test update on RTX 3060 Ti 8 GB / 32 GB RAM (Windows 11, Series S, DLSS Quality, FSR 3 FG, VICTORY_SAMPLED_EVICT=1, VICTORY_WINDOW_GROW=1, VICTORY_POOL_SMALL=0, VICTORY_RIPE_BLOCKS=12, combined with our other open PRs on 5fabb46eaf):

Matched in-world timestamps comparing default VICTORY_BUFFER_BLOCK_MB=16 + auto VICTORY_SPARE_SCALE (ON, Run 2) vs VICTORY_BUFFER_BLOCK_MB=64 + VICTORY_SPARE_SCALE=0 (OFF, control run on the same binary):

Timestamp Shared GPU RAM (16 MiB vs 64 MiB) Process PrivateBytes (16 MiB vs 64 MiB) Log VRAM (16 MiB vs 64 MiB) Free Physical RAM FPS / CardMeter GPU
t=78s 6,685 vs 7,635 MB (-950 MB) 23,351 vs 24,407 MB (-1,056 MB) 6,817 vs 6,976 MB (-159 MB) 895 vs 433 MB 24.6 / 29.9 ms vs 25.1 / 43.1 ms
t=109s 6,137 vs 7,368 MB (-1,231 MB) 23,788 vs 24,682 MB (-894 MB) 6,814 vs 6,974 MB (-160 MB) 678 vs 892 MB 23.3 / 37.9 ms vs 20.5 / 38.9 ms
t=140s 6,128 vs 7,101 MB (-973 MB) 23,195 vs 23,832 MB (-637 MB) 6,435 vs 6,859 MB (-424 MB) 763 vs 1,569 MB 24.4 / 35.5 ms vs 23.3 / 37.2 ms
t=263s 5,864 MB 22,207 MB 6,459 / 6,992 MB 1,608 MB 24.5 / 35.9 ms

Caveat / open check to disclose transparently:

  • Both 16 MiB runs on this host ended early with DXGI_ERROR_DEVICE_HUNG (0x887A0006) (t=162s and t=268s, nvlddmkm Event 153), and the 64 MiB control run ended at t=155s due to a pre-existing host OS BugCheck 0x3b (not a GPU fault, 0 nvlddmkm events) while Free RAM dipped to 363–433 MB. Because this test host has pre-existing intermittent nvlddmkm Event 153 / OS instability, a longer clean-host soak with VICTORY_BUFFER_BLOCK_MB=16 vs =64 is still worth running to confirm 0x887A0006 is unrelated to smaller CPU buffer pool blocks.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7301889189 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7301889189). Originally posted by [nidea1](https://github.com/nidea1) on 2026-12-01T05:33:06Z. --- Live A/B test update on RTX 3060 Ti 8 GB / 32 GB RAM (Windows 11, Series S, DLSS Quality, FSR 3 FG, `VICTORY_SAMPLED_EVICT=1`, `VICTORY_WINDOW_GROW=1`, `VICTORY_POOL_SMALL=0`, `VICTORY_RIPE_BLOCKS=12`, combined with our other open PRs on `5fabb46eaf`): Matched in-world timestamps comparing default `VICTORY_BUFFER_BLOCK_MB=16` + auto `VICTORY_SPARE_SCALE` (**ON**, Run 2) vs `VICTORY_BUFFER_BLOCK_MB=64` + `VICTORY_SPARE_SCALE=0` (**OFF**, control run on the same binary): | Timestamp | Shared GPU RAM (16 MiB vs 64 MiB) | Process PrivateBytes (16 MiB vs 64 MiB) | Log VRAM (16 MiB vs 64 MiB) | Free Physical RAM | FPS / CardMeter GPU | |---|---:|---:|---:|---:|---:| | `t=78s` | **6,685** vs 7,635 MB (**-950 MB**) | **23,351** vs 24,407 MB (**-1,056 MB**) | **6,817** vs 6,976 MB (-159 MB) | **895** vs 433 MB | 24.6 / **29.9 ms** vs 25.1 / 43.1 ms | | `t=109s` | **6,137** vs 7,368 MB (**-1,231 MB**) | **23,788** vs 24,682 MB (**-894 MB**) | **6,814** vs 6,974 MB (-160 MB) | 678 vs 892 MB | **23.3** / **37.9 ms** vs 20.5 / 38.9 ms | | `t=140s` | **6,128** vs 7,101 MB (**-973 MB**) | **23,195** vs 23,832 MB (**-637 MB**) | **6,435** vs 6,859 MB (**-424 MB**) | 763 vs 1,569 MB | **24.4** / **35.5 ms** vs 23.3 / 37.2 ms | | `t=263s` | **5,864 MB** | **22,207 MB** | **6,459 / 6,992 MB** | 1,608 MB | **24.5** / **35.9 ms** | Caveat / open check to disclose transparently: - Both 16 MiB runs on this host ended early with `DXGI_ERROR_DEVICE_HUNG (0x887A0006)` (`t=162s` and `t=268s`, `nvlddmkm` Event 153), and the 64 MiB control run ended at `t=155s` due to a pre-existing host OS BugCheck `0x3b` (not a GPU fault, `0` `nvlddmkm` events) while `Free RAM` dipped to `363–433 MB`. Because this test host has pre-existing intermittent `nvlddmkm` Event 153 / OS instability, a longer clean-host soak with `VICTORY_BUFFER_BLOCK_MB=16` vs `=64` is still worth running to confirm `0x887A0006` is unrelated to smaller CPU buffer pool blocks.
Dukestar69 commented 2026-12-01 12:05:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-12-01T12:05:55Z.

Review: APPROVED


Reviewed crates/victory-gpu/src/pool.rs: latching the peak non-zero DXGI local VRAM budget via etch_max prevents 1 Hz budget dips from flapping spare_scale on 10–12+ GiB GPUs while defaulting idle spare scaling on for <=9 GiB budgets; sizing upload/shared CPU buffer blocks to 16 MiB on <=32 GiB hosts (clamped 8–64 MiB via VICTORY_BUFFER_BLOCK_MB) cuts sparse L0 shared-memory retention 4x; and guarding zero/oversized requests in dd_and_cut and ake_from_with_limit avoids wasted block allocations. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib pool::tests -- --test-threads=1 (34 passed, 0 failed).

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:review:6130935203 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#pullrequestreview-6130935203). Originally posted by [Dukestar69](https://github.com/Dukestar69) on 2026-12-01T12:05:55Z. **Review:** APPROVED --- Reviewed crates/victory-gpu/src/pool.rs: latching the peak non-zero DXGI local VRAM budget via etch_max prevents 1 Hz budget dips from flapping spare_scale on 10–12+ GiB GPUs while defaulting idle spare scaling on for <=9 GiB budgets; sizing upload/shared CPU buffer blocks to 16 MiB on <=32 GiB hosts (clamped 8–64 MiB via VICTORY_BUFFER_BLOCK_MB) cuts sparse L0 shared-memory retention 4x; and guarding zero/oversized requests in dd_and_cut and ake_from_with_limit avoids wasted block allocations. Verified on Windows (RTX 5090): cargo test -p victory-gpu --lib pool::tests -- --test-threads=1 (34 passed, 0 failed). Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
nidea1 commented 2026-12-01 14:39:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T14:39:24Z.


Thanks @Dukestar69 for the review and RTX 5090 test verification (pool::tests) on 468a183c!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7314613163 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7314613163). Originally posted by [nidea1](https://github.com/nidea1) on 2026-12-01T14:39:24Z. --- Thanks @Dukestar69 for the review and RTX 5090 test verification (`pool::tests`) on `468a183c`!
POMXARK commented 2026-12-01 15:26:28 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-12-01T15:26:28Z.


VERDICT: REVERTED — On 32 GB RAM + RTX 5080 (16 GB VRAM), VICTORY_BUFFER_BLOCK_MB=16 regressed both CPU frame-prep and host RAM (+0.95 GB Commit / -0.87 GB FreeRAM)

Tested head 468a183c cleanly on v2026.11.30.03 (e1251c31).

Hardware & Setup

  • GPU / CPU / RAM / OS: RTX 5080 16 GB (ReBAR ON) / Ryzen 7 5700X (8C/16T) / 32 GB DDR4 / Windows 11 23H2
  • Profile: Series X, 1440p, DLSS Quality, warm shader cache, same --release binary toggled via --set VICTORY_BUFFER_BLOCK_MB=64 vs --set VICTORY_BUFFER_BLOCK_MB=16 (VICTORY_PROCESS_MEMORY=0), with 2-second WorkingSet / PrivateBytes (Commit) / FreePhysicalMemory sampling.

Unit Tests

  • cargo test -p victory-gpu --lib pool::tests: 34 passed, 0 failed (including buffer_block_sizing_scales_down_for_limited_ram_and_respects_override).

Same-Binary Paired A/B (BLK_64 vs BLK_16, matched 3,363 vs 3,358 draws/frame)

Metric BUFFER_BLOCK_MB=64 med (p75) BUFFER_BLOCK_MB=16 med (p75) Delta med Delta p75
draws/frame 3,363 (3,936) 3,358 (3,973) -5 (-0.1%) +37
frame_ms 67.40 ms (73.50) 67.10 ms (76.60) -0.30 ms +3.10 ms
prep_ms 53.00 ms (59.90) 57.40 ms (63.00) +4.40 ms (+8.3%) +3.10 ms
refr_ms 16.20 ms (19.70) 17.80 ms (23.30) +1.60 ms (+9.9%) +3.60 ms
tex_all 5.80 ms (9.60) 8.70 ms (12.50) +2.90 ms (+50.0%) +2.90 ms
tex_ww 1.00 ms (2.70) 2.50 ms (3.10) +1.50 ms (+150%) +0.40 ms
1s WW_hi > 5ms spikes 28 / 40 39 / 41 worse —
3D WARNs 14 21 +7 —
WorkingSet @ T+45s 23,171 MB 23,794 MB +623 MB —
Commit (PrivateBytes) @ T+45s 28,777 MB 29,725 MB +948 MB —
Host FreeRAM @ T+45s 2.50 GB 1.63 GB -0.87 GB —
VRAM / Shared GPU @ T+45s 13,047 MB / 5,053 MB 13,281 MB / 5,753 MB +234 MB / +700 MB —

Visual Check & Decision

  • Visuals on BLK_16: clean (2/2 PNG screenshots verified, no rendering corruption).
  • Why reverted: On our 32 GB RAM + 16 GB VRAM RTX 5080 machine, dropping CPU buffer blocks from 64 MiB to 16 MiB did not reduce RAM pressure — it increased fragmentation / Shared GPU RAM (+700 MB) and Commit (+948 MB), leaving less FreeRAM (1.63 vs 2.50 GB), while adding +4.40 ms prep_ms and +2.90 ms tex_all. Reverted pool.rs cleanly. (This may still help 8–12 GB VRAM / 16 GB RAM hosts where 64 MiB block over-allocation hits OOM, so gating auto-16 MiB to < 32 GiB or < 12 GiB VRAM instead of <= 32 GiB might avoid regressing 32 GB / 16 GB VRAM systems.)
Full applied PR & patch chain on top of v2026.11.30.03 (e1251c31)
  • Upstream PRs already applied in this test tree: #4500 (Blackwell upload strides), #4501 (prebuild prologue irradiance-cache), #4496 (water tiled light VICTORY_WAVE_FOLDED_FIRST), #4506, #4545 (wide non-XOR texture detile cache tiling), #4558, #4567, #4571, #4648 (AVX2 landing), #4651 (SAME_PRINT), #4659 (TELEMETRY_OFF), #4885 (VICTORY_THIN_PEEPHOLE, opt-in).
  • Custom patch stack (POMXARK/victory-city-bench, patches/v2026.11.30.03/01..06, reviewed in Discussion #3556):
    • 01: COLD_WW_RO 1 MiB chunks + out-of-GUARDS 64-stripe VP_STRIPE
    • 02: VICTORY_STEPS_FAST=1 + VICTORY_LISTED_TWINS=0
    • 03: VICTORY_LOW_L0_DMA=1 (0xb10000 MEM_WRITE_WATCH 4K + L0→L1 GPU DMA)
    • 04: VICTORY_DESC_MIRROR_CAP=1 + VICTORY_SOFT_BATCH=1 (4 MiB LAZY_AT)
    • 05–06: Review hardening (ARMING bitmap + reopen_striped_block + real-path race test, dropped ahead_intact, strict per-range card_l0_dma_allows).
  • Runtime flags: --dlss quality, VICTORY_PROCESS_MEMORY=0, VICTORY_PORT_CONSTANTS=0, VICTORY_WC_BAR=3, VICTORY_CARD_CPU_FILE=0, VICTORY_MAP_ONCE=1, VICTORY_SCRATCH_CARD=1, VICTORY_ASK_FIRST=1, VICTORY_SWEEP_OFF_THREAD=0, VICTORY_DUE_INDEX=0, VICTORY_GUARD_SHARDED=1, VICTORY_STEPS_FAST=1, VICTORY_LISTED_TWINS=0, VICTORY_LOW_L0_DMA=1, VICTORY_DESC_MIRROR_CAP=1, VICTORY_SOFT_BATCH=1.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7315912804 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7315912804). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-12-01T15:26:28Z. --- **VERDICT: REVERTED — On 32 GB RAM + RTX 5080 (16 GB VRAM), `VICTORY_BUFFER_BLOCK_MB=16` regressed both CPU frame-prep and host RAM (`+0.95 GB` Commit / `-0.87 GB` FreeRAM)** Tested head `468a183c` cleanly on `v2026.11.30.03` (`e1251c31`). ### Hardware & Setup - **GPU / CPU / RAM / OS:** RTX 5080 16 GB (ReBAR ON) / Ryzen 7 5700X (8C/16T) / **32 GB DDR4** / Windows 11 23H2 - **Profile:** Series X, 1440p, DLSS Quality, warm shader cache, **same `--release` binary** toggled via `--set VICTORY_BUFFER_BLOCK_MB=64` vs `--set VICTORY_BUFFER_BLOCK_MB=16` (`VICTORY_PROCESS_MEMORY=0`), with 2-second `WorkingSet` / `PrivateBytes (Commit)` / `FreePhysicalMemory` sampling. ### Unit Tests - `cargo test -p victory-gpu --lib pool::tests`: **34 passed, 0 failed** (including `buffer_block_sizing_scales_down_for_limited_ram_and_respects_override`). ### Same-Binary Paired A/B (`BLK_64` vs `BLK_16`, matched `3,363` vs `3,358` draws/frame) | Metric | `BUFFER_BLOCK_MB=64` med (p75) | `BUFFER_BLOCK_MB=16` med (p75) | Delta med | Delta p75 | |---|---:|---:|---:|---:| | **draws/frame** | `3,363` (`3,936`) | `3,358` (`3,973`) | `-5 (-0.1%)` | `+37` | | **frame_ms** | `67.40 ms` (`73.50`) | `67.10 ms` (`76.60`) | `-0.30 ms` | **`+3.10 ms`** | | **prep_ms** | **`53.00 ms`** (`59.90`) | **`57.40 ms`** (`63.00`) | **`+4.40 ms (+8.3%)`** | **`+3.10 ms`** | | **refr_ms** | `16.20 ms` (`19.70`) | `17.80 ms` (`23.30`) | **`+1.60 ms (+9.9%)`** | **`+3.60 ms`** | | **tex_all** | `5.80 ms` (`9.60`) | `8.70 ms` (`12.50`) | **`+2.90 ms (+50.0%)`** | **`+2.90 ms`** | | **tex_ww** | `1.00 ms` (`2.70`) | `2.50 ms` (`3.10`) | **`+1.50 ms (+150%)`** | `+0.40 ms` | | **1s `WW_hi > 5ms` spikes** | `28 / 40` | **`39 / 41`** | worse | — | | **3D WARNs** | `14` | `21` | `+7` | — | | **WorkingSet @ T+45s** | `23,171 MB` | `23,794 MB` | **`+623 MB`** | — | | **Commit (`PrivateBytes`) @ T+45s** | `28,777 MB` | `29,725 MB` | **`+948 MB`** | — | | **Host `FreeRAM` @ T+45s** | `2.50 GB` | `1.63 GB` | **`-0.87 GB`** | — | | **VRAM / Shared GPU @ T+45s** | `13,047 MB` / `5,053 MB` | `13,281 MB` / `5,753 MB` | `+234 MB` / **`+700 MB`** | — | ### Visual Check & Decision - Visuals on `BLK_16`: clean (`2/2` PNG screenshots verified, no rendering corruption). - **Why reverted:** On our 32 GB RAM + 16 GB VRAM RTX 5080 machine, dropping CPU buffer blocks from 64 MiB to 16 MiB did **not** reduce RAM pressure — it increased fragmentation / Shared GPU RAM (`+700 MB`) and Commit (`+948 MB`), leaving less FreeRAM (`1.63` vs `2.50 GB`), while adding **`+4.40 ms` `prep_ms`** and **`+2.90 ms` `tex_all`**. Reverted `pool.rs` cleanly. (This may still help 8–12 GB VRAM / 16 GB RAM hosts where 64 MiB block over-allocation hits OOM, so gating auto-16 MiB to `< 32 GiB` or `< 12 GiB` VRAM instead of `<= 32 GiB` might avoid regressing 32 GB / 16 GB VRAM systems.) <details> <summary>Full applied PR &amp; patch chain on top of <code>v2026.11.30.03</code> (<code>e1251c31</code>)</summary> - Upstream PRs already applied in this test tree: `#4500` (Blackwell upload strides), `#4501` (prebuild prologue irradiance-cache), `#4496` (water tiled light `VICTORY_WAVE_FOLDED_FIRST`), `#4506`, `#4545` (wide non-XOR texture detile cache tiling), `#4558`, `#4567`, `#4571`, `#4648` (AVX2 landing), `#4651` (`SAME_PRINT`), `#4659` (`TELEMETRY_OFF`), `#4885` (`VICTORY_THIN_PEEPHOLE`, opt-in). - Custom patch stack (`POMXARK/victory-city-bench`, `patches/v2026.11.30.03/01..06`, reviewed in Discussion #3556): - `01`: `COLD_WW_RO` 1 MiB chunks + out-of-`GUARDS` 64-stripe `VP_STRIPE` - `02`: `VICTORY_STEPS_FAST=1` + `VICTORY_LISTED_TWINS=0` - `03`: `VICTORY_LOW_L0_DMA=1` (`0xb10000` MEM_WRITE_WATCH 4K + L0→L1 GPU DMA) - `04`: `VICTORY_DESC_MIRROR_CAP=1` + `VICTORY_SOFT_BATCH=1` (4 MiB `LAZY_AT`) - `05`–`06`: Review hardening (`ARMING` bitmap + `reopen_striped_block` + real-path race test, dropped `ahead_intact`, strict per-range `card_l0_dma_allows`). - Runtime flags: `--dlss quality`, `VICTORY_PROCESS_MEMORY=0`, `VICTORY_PORT_CONSTANTS=0`, `VICTORY_WC_BAR=3`, `VICTORY_CARD_CPU_FILE=0`, `VICTORY_MAP_ONCE=1`, `VICTORY_SCRATCH_CARD=1`, `VICTORY_ASK_FIRST=1`, `VICTORY_SWEEP_OFF_THREAD=0`, `VICTORY_DUE_INDEX=0`, `VICTORY_GUARD_SHARDED=1`, `VICTORY_STEPS_FAST=1`, `VICTORY_LISTED_TWINS=0`, `VICTORY_LOW_L0_DMA=1`, `VICTORY_DESC_MIRROR_CAP=1`, `VICTORY_SOFT_BATCH=1`. </details>
andrewpozdnakov7-jpg commented 2026-12-01 15:51:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T15:51:11Z.


The paired RTX 5080 run used a 32 GB host, so it falls under the new automatic 16 MiB default on 468a183c. On that machine, 16 MiB added 4.4 ms of median frame preparation and 948 MB of process commit at the reported 45-second point. The same binary and patch stack were used for both settings.

e68f5cf5 keeps 64 MiB as the default and leaves smaller blocks available through VICTORY_BUFFER_BLOCK_MB. The other pool changes in this PR remain independent of that setting.

A focused Windows check ran the exact sizing code. The default is 64 MiB on both host classes, explicit 16 MiB still selects 16, and the 8–64 MiB clamp stays in place. The staged asset policy passed.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7316617851 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7316617851). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T15:51:11Z. --- The [paired RTX 5080 run](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7315912804) used a 32 GB host, so it falls under the new automatic 16 MiB default on `468a183c`. On that machine, 16 MiB added 4.4 ms of median frame preparation and 948 MB of process commit at the reported 45-second point. The same binary and patch stack were used for both settings. [e68f5cf5](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/e68f5cf5b6f1b1459a89abe72dc47d1de80b2fa5) keeps 64 MiB as the default and leaves smaller blocks available through `VICTORY_BUFFER_BLOCK_MB`. The other pool changes in this PR remain independent of that setting. A focused Windows check ran the exact sizing code. The default is 64 MiB on both host classes, explicit 16 MiB still selects 16, and the 8–64 MiB clamp stays in place. The staged asset policy passed. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
nidea1 commented 2026-12-01 16:07:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T16:07:46Z.


Thanks @POMXARK for the clean same-binary A/B on 32 GB RAM + RTX 5080 16 GB — that caught a real gating gap and an underlying concurrency bug in pool.rs.

Why 16 MiB regressed on 32 GB RAM + 16 GB VRAM Series X:

  1. Gating was too broad: limited_host_ram() (<= 32 GiB) turned 16 MiB UPLOADS/SHARED blocks on for every 32 GB PC, including 12–16+ GB VRAM Series X rigs with 16 GiB Shared GPU headroom and heavy buffer traffic.
  2. 4 MiB packing stranding + 4x heap/residency churn: With BUFFER_MOST = 4 MiB (SCRATCH_CHUNK = 4 MiB, LAZY_AT = 4 MiB), stranding a < 4 MiB tail costs up to ~25% of a 16 MiB block (vs ~6% of a 64 MiB block), and BUFFERS_KEPT = 2 keeps only 32 MiB warm (vs 128 MiB), triggering more CreateHeap + buffer_resident + buffer_mapped cycles under bursty Series X traffic.
  3. Concurrent-growth sparse-block pinning in take_from_with_limit: When multiple threads concurrently missed Pool::cut and allocated blocks outside the mutex, every thread unconditionally called add_and_cut on its own newly allocated block upon reacquiring the lock — pinning duplicate sparse blocks with a single piece each (and hitting 4x more often with 16 MiB blocks).

Pushed follow-up commits cff7e115 and b34c3740 to #4737:

  • Narrowed auto-16 MiB gating to small_host_ram() (< 24 GiB RAM, e.g. 16 GB hosts if VICTORY_BUFFER_POOL=1) or limited_host_ram() (<= 32 GiB RAM) paired with a <= 9 GiB peak-latched DXGI local VRAM budget (6–8 GB GPUs). Systems with 32 GB RAM + 12–16+ GB VRAM (as well as > 32 GB RAM or unknown DXGI budget) now stay on 64 MiB by default, while VICTORY_BUFFER_BLOCK_MB overrides remain available everywhere. current_vram_budget() probes made_host().video_memory() at most once if cpu_buffer runs before the first 1 Hz room() tick and shares the fetch_max peak latch so transient startup dips on 12+ GB cards still recover to 64 MiB.
  • Hardened concurrent growth in take_from_with_limit: Refreshes the ripe() snapshot after unlocked make() (so blocks that ripened while waiting on MakeResident are recognized and lowered SPARES budgets from room() take effect immediately), re-checks Pool::cut after reacquiring the lock so concurrent growers pack into existing blocks, keeps duplicate blocks empty only up to the spare/ahead budget, and drops any surplus, undersized, or zero-size block outside the pool mutex.
  • Verified with cargo test -j 4 --locked -p victory-gpu --lib -- pool:: (36 passed, 0 failed, 3 ignored — including live ID3D12Heap::GetDesc().SizeInBytes checks at default auto-16 MiB, 8 MiB, and 64 MiB, RAM/VRAM gating matrix, 4-thread concurrent growth, and post-growth Ripe refresh), full victory-gpu --lib single-threaded and parallel (1101 passed, 0 failed, 66 ignored), --features diagnostics replay, full cargo test --workspace --locked, Clippy (0 warnings in pool.rs), cargo xtask policy, and a live merged #4737 + #4713 pool:: test run (39 passed, 0 failed).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7317082409 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7317082409). Originally posted by [nidea1](https://github.com/nidea1) on 2026-12-01T16:07:46Z. --- Thanks @POMXARK for the clean same-binary A/B on 32 GB RAM + RTX 5080 16 GB — that caught a real gating gap and an underlying concurrency bug in `pool.rs`. Why `16 MiB` regressed on 32 GB RAM + 16 GB VRAM Series X: 1. **Gating was too broad:** `limited_host_ram()` (`<= 32 GiB`) turned 16 MiB `UPLOADS`/`SHARED` blocks on for every 32 GB PC, including 12–16+ GB VRAM Series X rigs with 16 GiB Shared GPU headroom and heavy buffer traffic. 2. **4 MiB packing stranding + 4x heap/residency churn:** With `BUFFER_MOST = 4 MiB` (`SCRATCH_CHUNK = 4 MiB`, `LAZY_AT = 4 MiB`), stranding a `< 4 MiB` tail costs up to ~25% of a 16 MiB block (vs ~6% of a 64 MiB block), and `BUFFERS_KEPT = 2` keeps only 32 MiB warm (vs 128 MiB), triggering more `CreateHeap` + `buffer_resident` + `buffer_mapped` cycles under bursty Series X traffic. 3. **Concurrent-growth sparse-block pinning in `take_from_with_limit`:** When multiple threads concurrently missed `Pool::cut` and allocated blocks outside the mutex, every thread unconditionally called `add_and_cut` on its own newly allocated block upon reacquiring the lock — pinning duplicate sparse blocks with a single piece each (and hitting 4x more often with 16 MiB blocks). Pushed follow-up commits `cff7e115` and `b34c3740` to `#4737`: - **Narrowed auto-16 MiB gating** to `small_host_ram()` (`< 24 GiB` RAM, e.g. 16 GB hosts if `VICTORY_BUFFER_POOL=1`) **or** `limited_host_ram()` (`<= 32 GiB` RAM) paired with a `<= 9 GiB` peak-latched DXGI local VRAM budget (6–8 GB GPUs). Systems with **32 GB RAM + 12–16+ GB VRAM** (as well as `> 32 GB` RAM or unknown DXGI budget) now stay on **64 MiB** by default, while `VICTORY_BUFFER_BLOCK_MB` overrides remain available everywhere. `current_vram_budget()` probes `made_host().video_memory()` at most once if `cpu_buffer` runs before the first 1 Hz `room()` tick and shares the `fetch_max` peak latch so transient startup dips on 12+ GB cards still recover to 64 MiB. - **Hardened concurrent growth in `take_from_with_limit`:** Refreshes the `ripe()` snapshot after unlocked `make()` (so blocks that ripened while waiting on `MakeResident` are recognized and lowered `SPARES` budgets from `room()` take effect immediately), re-checks `Pool::cut` after reacquiring the lock so concurrent growers pack into existing blocks, keeps duplicate blocks empty only up to the spare/ahead budget, and drops any surplus, undersized, or zero-size block outside the pool mutex. - Verified with `cargo test -j 4 --locked -p victory-gpu --lib -- pool::` (36 passed, 0 failed, 3 ignored — including live `ID3D12Heap::GetDesc().SizeInBytes` checks at default auto-16 MiB, 8 MiB, and 64 MiB, RAM/VRAM gating matrix, 4-thread concurrent growth, and post-growth `Ripe` refresh), full `victory-gpu --lib` single-threaded and parallel (1101 passed, 0 failed, 66 ignored), `--features diagnostics` replay, full `cargo test --workspace --locked`, Clippy (0 warnings in `pool.rs`), `cargo xtask policy`, and a live merged `#4737 + #4713` `pool::` test run (39 passed, 0 failed).
andrewpozdnakov7-jpg commented 2026-12-01 16:14:29 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by andrewpozdnakov7-jpg on 2026-12-01T16:14:29Z.


The narrower buffer-size default in cff7e115 keeps 64 MiB on the reported 32 GB / RTX 5080 setup. There is one more path around the new concurrent-growth recheck. When our allocation returns Deferred or Attempted(None), it can exit before checking whether another caller supplied a usable block while the pool lock was released.

18c7ee6e rechecks pool availability after all growth outcomes. It still records the backoff for a real failed allocation. A deferred allocation keeps its existing backoff behavior.

A focused Windows fixture ran the exact allocation routing with a synthetic pool. A block added during the unlocked interval was reused after both a deferred and a failed growth. A failed growth with no new block still returned no piece. The staged asset policy passed.

Updated for b34c3740: d69c95e8 keeps the revised ripe snapshot and the rule that surplus blocks are dropped outside the pool lock. It rechecks the pool after Deferred and Attempted(None), too. The same Windows fixture now models a block that becomes usable during the unlocked interval. On b34c3740 both outcomes missed it. With the updated patch both reuse it. A real failure still records backoff and returns no piece if the second check finds nothing. Staged asset policy passed.

Please keep the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding the change in.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7317270864 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7317270864). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-12-01T16:14:29Z. --- The narrower buffer-size default in `cff7e115` keeps 64 MiB on the reported 32 GB / RTX 5080 setup. There is one more path around the new concurrent-growth recheck. When our allocation returns `Deferred` or `Attempted(None)`, it can exit before checking whether another caller supplied a usable block while the pool lock was released. [18c7ee6e](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/18c7ee6e4c90385cc850abd6f6c2f3ff94683519) rechecks pool availability after all growth outcomes. It still records the backoff for a real failed allocation. A deferred allocation keeps its existing backoff behavior. A focused Windows fixture ran the exact allocation routing with a synthetic pool. A block added during the unlocked interval was reused after both a deferred and a failed growth. A failed growth with no new block still returned no piece. The staged asset policy passed. Updated for `b34c3740`: [d69c95e8](https://github.com/andrewpozdnakov7-jpg/VIctory-NVIDIA/commit/d69c95e8e0ac4c8bc1bdf5a5e45da4924729dbf3) keeps the revised ripe snapshot and the rule that surplus blocks are dropped outside the pool lock. It rechecks the pool after `Deferred` and `Attempted(None)`, too. The same Windows fixture now models a block that becomes usable during the unlocked interval. On `b34c3740` both outcomes missed it. With the updated patch both reuse it. A real failure still records backoff and returns no piece if the second check finds nothing. Staged asset policy passed. Please keep the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding the change in. AI-assisted with OpenAI Codex.
POMXARK commented 2026-12-01 16:42:48 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-12-01T16:42:48Z.


VERDICT: KEPT IN TREE (re-tested cff7e115) — Regression fully resolved on 32 GB RAM + RTX 5080 (16 GB VRAM); stays on 64 MiB by default, pool::tests 35/35 PASS, Commit -115 MB / Shared GPU -159 MB, prep_ms -0.90 ms

Thanks @nidea1 and @andrewpozdnakov7-jpg for the super fast turnaround on cff7e115!

Verification on cff7e115 (RTX 5080 16 GB ReBAR ON / Ryzen 7 5700X / 32 GB DDR4 / Win11 23H2 / Series X 1440p DLSS Quality)

  • Patch apply: Clean git apply --3way on crates/victory-gpu/src/pool.rs (zero conflicts).
  • Unit tests: cargo test -p victory-gpu --lib pool::tests: 35 passed, 0 failed (including buffer_block_sizing_gates_on_small_ram_or_limited_ram_with_small_vram and concurrent_growth_reuses_existing_block_and_drops_excess_outside_lock).
  • Live 3D --release comparison (no VICTORY_BUFFER_BLOCK_MB override — verifying automatic 64 MiB selection on 32 GB RAM + 16 GB VRAM, same target\release\victory.exe Agility SDK path & flags):
Metric Pre-#4737 (64 MiB) med (p75) #4737 cff7e115 (auto) med (p75) Delta med
draws/frame 3,323 (4,092) 3,711 (4,167) +388 (+11.7%)
Normalized ms / 1k draws 15.50 ms 15.52 ms +0.1% (dead-even)
p75 FPS 21.90 21.80 -0.10
prep_ms 41.30 ms (44.90) 40.40 ms (46.90) -0.90 ms (-2.2%)
ww_ask 8.60 ms (9.70) 8.30 ms (11.50) -0.30 ms
card_ms 1.80 ms (2.00) 1.30 ms (1.80) -0.50 ms
heaps_wait 3.99 ms (4.31) 3.40 ms (4.49) -0.59 ms
3D WARNs 11 6 -5
Commit @ T+45s (memory now) 30,075 MB 29,960 MB -115 MB
Shared GPU @ T+45s (memory now) 5,841 MB 5,682 MB -159 MB

The earlier +4.4 ms prep_ms / +948 MB Commit / +700 MB Shared GPU regression from 468a183c is completely gone, and take_from_with_limit trimmed ~115–159 MB off steady-state Commit/Shared GPU with zero overhead. Keeping cff7e115 in our build!

Full applied PR & patch chain on top of v2026.11.30.03 (e1251c31)
  • Upstream PRs active: #4500, #4501, #4496, #4506, #4545, #4558, #4567, #4571, #4648, #4651, #4659, #4885 (opt-in =0), #2764 (VICTORY_RAYMISS_ZERO=1, KEPT), #4737 (cff7e115, this PR — KEPT).
  • Custom patch stack (POMXARK/victory-city-bench, patches/v2026.11.30.03/01..06, clean 06 at 1942705, COPY_XRAY removed).
  • Runtime flags: --dlss quality, VICTORY_PROCESS_MEMORY=0, VICTORY_ASK_FIRST=0, VICTORY_COPY_BESIDE=1, VICTORY_STORE_BESIDE=1, VICTORY_PORT_CONSTANTS=0, VICTORY_WC_BAR=3, VICTORY_CARD_CPU_FILE=0, VICTORY_MAP_ONCE=1, VICTORY_SCRATCH_CARD=1, VICTORY_SWEEP_OFF_THREAD=0, VICTORY_DUE_INDEX=0, VICTORY_GUARD_SHARDED=1, VICTORY_STEPS_FAST=1, VICTORY_LISTED_TWINS=0, VICTORY_LOW_L0_DMA=1, VICTORY_DESC_MIRROR_CAP=1, VICTORY_SOFT_BATCH=1, VICTORY_THIN_PEEPHOLE=0, VICTORY_RAYMISS_ZERO=1.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318086409 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7318086409). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-12-01T16:42:48Z. --- **VERDICT: KEPT IN TREE (re-tested `cff7e115`) — Regression fully resolved on 32 GB RAM + RTX 5080 (16 GB VRAM); stays on 64 MiB by default, `pool::tests` 35/35 PASS, Commit `-115 MB` / Shared GPU `-159 MB`, `prep_ms -0.90 ms`** Thanks @nidea1 and @andrewpozdnakov7-jpg for the super fast turnaround on `cff7e115`! ### Verification on `cff7e115` (RTX 5080 16 GB ReBAR ON / Ryzen 7 5700X / 32 GB DDR4 / Win11 23H2 / Series X 1440p DLSS Quality) - **Patch apply:** Clean `git apply --3way` on `crates/victory-gpu/src/pool.rs` (zero conflicts). - **Unit tests:** `cargo test -p victory-gpu --lib pool::tests`: **35 passed, 0 failed** (including `buffer_block_sizing_gates_on_small_ram_or_limited_ram_with_small_vram` and `concurrent_growth_reuses_existing_block_and_drops_excess_outside_lock`). - **Live 3D `--release` comparison (no `VICTORY_BUFFER_BLOCK_MB` override — verifying automatic 64 MiB selection on 32 GB RAM + 16 GB VRAM, same `target\release\victory.exe` Agility SDK path & flags):** | Metric | Pre-`#4737` (64 MiB) med (p75) | **`#4737 cff7e115` (auto)** med (p75) | Delta med | |---|---:|---:|---:| | **draws/frame** | `3,323` (`4,092`) | `3,711` (`4,167`) | `+388 (+11.7%)` | | **Normalized `ms / 1k draws`** | `15.50 ms` | **`15.52 ms`** | **`+0.1% (dead-even)`** | | **p75 FPS** | `21.90` | **`21.80`** | `-0.10` | | **prep_ms** | `41.30 ms` (`44.90`) | **`40.40 ms`** (`46.90`) | **`-0.90 ms (-2.2%)`** | | **ww_ask** | `8.60 ms` (`9.70`) | **`8.30 ms`** (`11.50`) | **`-0.30 ms`** | | **card_ms** | `1.80 ms` (`2.00`) | **`1.30 ms`** (`1.80`) | **`-0.50 ms`** | | **heaps_wait** | `3.99 ms` (`4.31`) | **`3.40 ms`** (`4.49`) | **`-0.59 ms`** | | **3D WARNs** | `11` | **`6`** | `-5` | | **Commit @ T+45s (`memory now`)** | `30,075 MB` | **`29,960 MB`** | **`-115 MB`** | | **Shared GPU @ T+45s (`memory now`)** | `5,841 MB` | **`5,682 MB`** | **`-159 MB`** | The earlier `+4.4 ms prep_ms` / `+948 MB Commit` / `+700 MB Shared GPU` regression from `468a183c` is completely gone, and `take_from_with_limit` trimmed ~115–159 MB off steady-state Commit/Shared GPU with zero overhead. Keeping `cff7e115` in our build! <details> <summary>Full applied PR &amp; patch chain on top of <code>v2026.11.30.03</code> (<code>e1251c31</code>)</summary> - Upstream PRs active: `#4500`, `#4501`, `#4496`, `#4506`, `#4545`, `#4558`, `#4567`, `#4571`, `#4648`, `#4651`, `#4659`, `#4885` (opt-in `=0`), `#2764` (`VICTORY_RAYMISS_ZERO=1`, KEPT), **`#4737` (`cff7e115`, this PR — KEPT)**. - Custom patch stack (`POMXARK/victory-city-bench`, `patches/v2026.11.30.03/01..06`, clean `06` at `1942705`, `COPY_XRAY` removed). - Runtime flags: `--dlss quality`, `VICTORY_PROCESS_MEMORY=0`, `VICTORY_ASK_FIRST=0`, `VICTORY_COPY_BESIDE=1`, `VICTORY_STORE_BESIDE=1`, `VICTORY_PORT_CONSTANTS=0`, `VICTORY_WC_BAR=3`, `VICTORY_CARD_CPU_FILE=0`, `VICTORY_MAP_ONCE=1`, `VICTORY_SCRATCH_CARD=1`, `VICTORY_SWEEP_OFF_THREAD=0`, `VICTORY_DUE_INDEX=0`, `VICTORY_GUARD_SHARDED=1`, `VICTORY_STEPS_FAST=1`, `VICTORY_LISTED_TWINS=0`, `VICTORY_LOW_L0_DMA=1`, `VICTORY_DESC_MIRROR_CAP=1`, `VICTORY_SOFT_BATCH=1`, `VICTORY_THIN_PEEPHOLE=0`, `VICTORY_RAYMISS_ZERO=1`. </details>
nidea1 commented 2026-12-01 17:03:04 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nidea1 on 2026-12-01T17:03:04Z.


Thanks @POMXARK for the fast re-test and confirmation on 32 GB RAM + RTX 5080 16 GB (glad to see the automatic 64 MiB path resolved the regression and trimmed steady-state Commit/Shared GPU), and thanks @andrewpozdnakov7-jpg for catching the Deferred / Attempted(None) recheck path in 18c7ee6e / d69c95e8!

Integrated in 22b6286b (with Co-authored-by: andrewpozdnakov7-jpg) and hardened in 24635360 on top of b34c3740:

  • take_from_with_limit now refreshes ripe(), reacquires the pool lock, records failed_growth() backoff on BlockGrowth::Attempted(None) (leaving Deferred backoff-free), suppresses immediate short_ahead retries on both Deferred and Attempted(None) using a single timestamp per lock acquisition, and rechecks Pool::cut(..., retry_ripe) across all growth outcomes while keeping unlocked dropping of surplus, undersized, and zero-size blocks.
  • Added isolated unit tests covering concurrent block reuse and resting-piece expiry after Deferred (without backoff, plus follow-up growth) and Attempted(None) (with backoff recorded), Attempted(None) with no concurrent block returning None with backoff recorded, and a 3-thread Deferred + Attempted(None) + concurrent grower race.
  • Verified with cargo test -j 4 --locked -p victory-gpu --lib -- pool:: (40 passed, 0 failed, 3 ignored, default and --features diagnostics), full cargo test -j 4 --locked -p victory-gpu --lib both single-threaded (--test-threads=1) and parallel (1105 passed, 0 failed, 66 ignored), cargo test -j 4 --locked -p victory-gpu --features diagnostics --test replay --test replay_big (replay 1 passed), cargo clippy on victory-gpu (0 warnings in pool.rs, default and --all-features), and cargo xtask policy (464 files ok).
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7318670475 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7318670475). Originally posted by [nidea1](https://github.com/nidea1) on 2026-12-01T17:03:04Z. --- Thanks @POMXARK for the fast re-test and confirmation on 32 GB RAM + RTX 5080 16 GB (glad to see the automatic 64 MiB path resolved the regression and trimmed steady-state Commit/Shared GPU), and thanks @andrewpozdnakov7-jpg for catching the `Deferred` / `Attempted(None)` recheck path in `18c7ee6e` / `d69c95e8`! Integrated in `22b6286b` (with `Co-authored-by: andrewpozdnakov7-jpg`) and hardened in `24635360` on top of `b34c3740`: - `take_from_with_limit` now refreshes `ripe()`, reacquires the pool lock, records `failed_growth()` backoff on `BlockGrowth::Attempted(None)` (leaving `Deferred` backoff-free), suppresses immediate `short_ahead` retries on both `Deferred` and `Attempted(None)` using a single timestamp per lock acquisition, and rechecks `Pool::cut(..., retry_ripe)` across all growth outcomes while keeping unlocked dropping of surplus, undersized, and zero-size blocks. - Added isolated unit tests covering concurrent block reuse and resting-piece expiry after `Deferred` (without backoff, plus follow-up growth) and `Attempted(None)` (with backoff recorded), `Attempted(None)` with no concurrent block returning `None` with backoff recorded, and a 3-thread `Deferred` + `Attempted(None)` + concurrent grower race. - Verified with `cargo test -j 4 --locked -p victory-gpu --lib -- pool::` (40 passed, 0 failed, 3 ignored, default and `--features diagnostics`), full `cargo test -j 4 --locked -p victory-gpu --lib` both single-threaded (`--test-threads=1`) and parallel (1105 passed, 0 failed, 66 ignored), `cargo test -j 4 --locked -p victory-gpu --features diagnostics --test replay --test replay_big` (`replay` 1 passed), `cargo clippy` on `victory-gpu` (0 warnings in `pool.rs`, default and `--all-features`), and `cargo xtask policy` (`464 files ok`).
POMXARK commented 2026-12-01 17:24:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-12-01T17:24:40Z.


VERDICT: KEPT IN TREE (re-tested 22b6286b) — Applies cleanly alongside #4558, pool::tests 39/39 PASS (0 warnings in pool.rs)

@nidea1 @andrewpozdnakov7-jpg Updated our tree from cff7e115 to 22b6286b (integrating b34c3740 + 22b6286b Deferred / Attempted(None) recheck and refreshed ripe() snapshot):

  • Unit tests (cargo test -p victory-gpu --lib -- pool:: on Windows 11 23H2 / RTX 5080 16 GB / Ryzen 7 5700X / 32 GB DDR4): 39 passed, 0 failed, 3 ignored, including all new concurrent-growth tests:
    • deferred_growth_reuses_concurrent_block_without_backoff — PASS
    • failed_growth_reuses_concurrent_block_and_records_backoff — PASS
    • failed_growth_without_concurrent_block_returns_none_and_records_backoff — PASS
    • take_from_refreshes_ripe_after_growth_and_drops_rejected_blocks_outside_lock — PASS
  • Warnings: 0 warnings in pool.rs.
  • Merge hygiene: Cleanly preserves #4558 sweeper::skipped() hooks in pool::room().
Full applied PR & patch chain in our test tree (base v2026.11.30.03 / e1251c31)
  • Base: trustno1-coder/VIctory-NVIDIA v2026.11.30.03 (e1251c31)
  • Upstream PRs applied: #4294, #4297, #4337, #4332, #4319, #4288, #4500, #4501, #4545, #4506, #4496, #4571, #4567, #4558 (SWEEP_OFF_THREAD=0), #4659, #4651, #4648, #4885 (opt-in =0), #2764 (VICTORY_RAYMISS_ZERO=1), #4737 (22b6286b, KEPT)
  • Local patches (01..06): SIM-006 (WC_BAR=3), SIM-007 (COLD_WW_RO), SIM-008 H2 (GUARD_SHARDED=1), SIM-010 M4 (LOW_L0_DMA=1 + ARMING + strict UAV/RO gate), SIM-011 (STEPS_FAST=1, LISTED_TWINS=0), SIM-013 (DESC_MIRROR_CAP=1, SOFT_BATCH=1)
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7319255047 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7319255047). Originally posted by [POMXARK](https://github.com/POMXARK) on 2026-12-01T17:24:40Z. --- **VERDICT: KEPT IN TREE (re-tested `22b6286b`) — Applies cleanly alongside `#4558`, `pool::tests` 39/39 PASS (0 warnings in `pool.rs`)** @nidea1 @andrewpozdnakov7-jpg Updated our tree from `cff7e115` to `22b6286b` (integrating `b34c3740` + `22b6286b` `Deferred` / `Attempted(None)` recheck and refreshed `ripe()` snapshot): - **Unit tests (`cargo test -p victory-gpu --lib -- pool::` on Windows 11 23H2 / RTX 5080 16 GB / Ryzen 7 5700X / 32 GB DDR4):** **39 passed, 0 failed, 3 ignored**, including all new concurrent-growth tests: - `deferred_growth_reuses_concurrent_block_without_backoff` — PASS - `failed_growth_reuses_concurrent_block_and_records_backoff` — PASS - `failed_growth_without_concurrent_block_returns_none_and_records_backoff` — PASS - `take_from_refreshes_ripe_after_growth_and_drops_rejected_blocks_outside_lock` — PASS - **Warnings:** 0 warnings in `pool.rs`. - **Merge hygiene:** Cleanly preserves `#4558` `sweeper::skipped()` hooks in `pool::room()`. <details> <summary>Full applied PR & patch chain in our test tree (base <code>v2026.11.30.03</code> / <code>e1251c31</code>)</summary> - Base: `trustno1-coder/VIctory-NVIDIA` `v2026.11.30.03` (`e1251c31`) - Upstream PRs applied: `#4294`, `#4297`, `#4337`, `#4332`, `#4319`, `#4288`, `#4500`, `#4501`, `#4545`, `#4506`, `#4496`, `#4571`, `#4567`, `#4558` (`SWEEP_OFF_THREAD=0`), `#4659`, `#4651`, `#4648`, `#4885` (opt-in `=0`), `#2764` (`VICTORY_RAYMISS_ZERO=1`), **`#4737` (`22b6286b`, KEPT)** - Local patches (`01..06`): `SIM-006` (`WC_BAR=3`), `SIM-007` (`COLD_WW_RO`), `SIM-008 H2` (`GUARD_SHARDED=1`), `SIM-010 M4` (`LOW_L0_DMA=1` + `ARMING` + strict UAV/RO gate), `SIM-011` (`STEPS_FAST=1`, `LISTED_TWINS=0`), `SIM-013` (`DESC_MIRROR_CAP=1`, `SOFT_BATCH=1`) </details>
trustno1-coder commented 2026-12-01 18:33:59 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:33:59Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321148130 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4737#issuecomment-7321148130). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:33:59Z. --- 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

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