perf(victory-gpu): reclaim idle surplus upload slabs from windowup pool #404

Closed
github-bot wants to merge 1 commit from github-bot/gh-404 into main AGit
Owner

@⁠Lewandox on GitHub · 2026-11-26 17:32 UTC · original
Lewandox:perf/windowup-trim-idle-slabs → main · +129 −1 · 3 files · 1 commits · closed without merging

Summary

Reclaims idle surplus upload slabs from the transient-window upload pool (third_party/victory/crates/victory-gpu/src/windowup.rs + 1-line hook in host::sweep):

  1. Problem: With VICTORY_CARD_WINDOW_UPLOAD=1, windowup::alloc grows POOL.slabs in 16 MiB D3D12 upload slabs up to VICTORY_CARD_WINDOW_UPLOAD_MB (default 512 MiB) during loading/streaming bursts, and previously never released idle slabs once gameplay settled back to 1–2 active slabs.
  2. Fix:
    • Tracks last_used (crate::host::moment()) on each PooledSlab.
    • Adds windowup::let_go_idle() called from host::sweep() using the same adaptive ram_idle_ms + IDLE_FRAMES = 4 policy as shadow::let_go_idle() and texture::let_go_idle().
    • Always keeps the single most recently used slab warm so steady-state uploads never churn D3D12 resource creation, and releases any other slab with live == 0 (all Chunks already dropped after GPU completion in Host::card_done) outside the POOL mutex.
    • Updates POOLED and pool.cur accurately and logs reclaimed bytes via host::trail.
  3. Test: Adds windowup::tests::trim_idle_releases_unused_surplus_slabs_and_keeps_live_ones verifying live slabs are never evicted, idle surplus slabs are released and deducted from POOLED, and the last warm slab stays reusable.

Verification

  • cargo test -p victory-gpu --lib windowup::tests (default and --features diagnostics)
  • cargo xtask policy inside third_party/victory
**@⁠Lewandox** on GitHub · 2026-11-26 17:32 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/404) `Lewandox:perf/windowup-trim-idle-slabs` → `main` · +129 −1 · 3 files · 1 commits · closed without merging ## Summary Reclaims idle surplus upload slabs from the transient-window upload pool (`third_party/victory/crates/victory-gpu/src/windowup.rs` + 1-line hook in `host::sweep`): 1. **Problem**: With `VICTORY_CARD_WINDOW_UPLOAD=1`, `windowup::alloc` grows `POOL.slabs` in 16 MiB D3D12 upload slabs up to `VICTORY_CARD_WINDOW_UPLOAD_MB` (default **512 MiB**) during loading/streaming bursts, and previously never released idle slabs once gameplay settled back to 1–2 active slabs. 2. **Fix**: - Tracks `last_used` (`crate::host::moment()`) on each `PooledSlab`. - Adds `windowup::let_go_idle()` called from `host::sweep()` using the same adaptive `ram_idle_ms` + `IDLE_FRAMES = 4` policy as `shadow::let_go_idle()` and `texture::let_go_idle()`. - Always keeps the single most recently used slab warm so steady-state uploads never churn D3D12 resource creation, and releases any other slab with `live == 0` (all `Chunk`s already dropped after GPU completion in `Host::card_done`) outside the `POOL` mutex. - Updates `POOLED` and `pool.cur` accurately and logs reclaimed bytes via `host::trail`. 3. **Test**: Adds `windowup::tests::trim_idle_releases_unused_surplus_slabs_and_keeps_live_ones` verifying live slabs are never evicted, idle surplus slabs are released and deducted from `POOLED`, and the last warm slab stays reusable. ## Verification - `cargo test -p victory-gpu --lib windowup::tests` (default and `--features diagnostics`) - `cargo xtask policy` inside `third_party/victory`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 17:36:27 +00:00
github-bot closed this pull request 2026-11-26 19:34:45 +00:00
Author
Owner

@⁠Lewandox on GitHub · 2026-11-26 19:16 UTC · original

Closing as obsolete after #409 (\windowup.rs\ was removed in the combined base). Keeping the PR queue clean.

**@⁠Lewandox** on GitHub · 2026-11-26 19:16 UTC · [original](https://github.com/LooperSalty/AnyXboxX/pull/404#issuecomment-7201386268) Closing as obsolete after #409 (\windowup.rs\ was removed in the combined base). Keeping the PR queue clean.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.