gpu(send,residency): bound upload spares by working set and flatten send plans #269

Closed
github-bot wants to merge 1 commit from gh-pr/269/head into gh-pr/269/base
Owner

@⁠Androtim on GitHub · 2026-11-30 23:54 UTC · original
Androtim:feat/iter269-send-window-trim-and-scratch-reuse → main · +767 −160 · 3 files · 1 commits · closed without merging

Summary

Reduces host RAM/commit bloat and per-submission CPU allocation overhead in the submission upload path (crates/victory-gpu/src/host/send.rs,
esidency.rs, host.rs):

  • Bounded upload sizing & zero-retention past 256 MiB: made_for() allocates buffers by powers of two up to 64 MiB, in 64 MiB linear steps up to 256 MiB, and exact 64 KiB multiples beyond 256 MiB. Buffers over 256 MiB (e.g., world-load spikes) are retired immediately on a background thread ( ictory-send-free) instead of doubling or staying cached in SPARE.
  • Working-set window trimming & RAM-aware spare cap: Caps idle SPARE retention at 256 MiB on <= 32 GiB hosts (128 MiB under 24 GiB, overrideable via VICTORY_SEND_SPARE_MB), tracks active working-set demand over a rolling window (VICTORY_SEND_KEEP_SECONDS=10), and trims idle spares under host memory pressure without stalling the submission thread.
  • Allocation-free send plans (PlanBuffers + TLS scratch): Replaces per-copy
    uns vectors and per-submission TakeScratch/RecordScratch vectors with flattened recycled buffers (SPARE_PLANS) and single-pass scatter chunk planning.

Verification

  • cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy -> sset policy: 315 files ok
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu host::send:: -- --test-threads=1 -> 6 passed; 0 failed
  • cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu residency:: -- --test-threads=1 -> 4 passed; 0 failed
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings -> clean
  • cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings -> clean
**@⁠Androtim** on GitHub · 2026-11-30 23:54 UTC · [original](https://github.com/Androtim/MiniVI/pull/269) `Androtim:feat/iter269-send-window-trim-and-scratch-reuse` → `main` · +767 −160 · 3 files · 1 commits · closed without merging ### Summary Reduces host RAM/commit bloat and per-submission CPU allocation overhead in the submission upload path (crates/victory-gpu/src/host/send.rs, esidency.rs, host.rs): - **Bounded upload sizing & zero-retention past 256 MiB**: made_for() allocates buffers by powers of two up to 64 MiB, in 64 MiB linear steps up to 256 MiB, and exact 64 KiB multiples beyond 256 MiB. Buffers over 256 MiB (e.g., world-load spikes) are retired immediately on a background thread ( ictory-send-free) instead of doubling or staying cached in SPARE. - **Working-set window trimming & RAM-aware spare cap**: Caps idle SPARE retention at 256 MiB on <= 32 GiB hosts (128 MiB under 24 GiB, overrideable via VICTORY_SEND_SPARE_MB), tracks active working-set demand over a rolling window (VICTORY_SEND_KEEP_SECONDS=10), and trims idle spares under host memory pressure without stalling the submission thread. - **Allocation-free send plans (PlanBuffers + TLS scratch)**: Replaces per-copy uns vectors and per-submission TakeScratch/RecordScratch vectors with flattened recycled buffers (SPARE_PLANS) and single-pass scatter chunk planning. ### Verification - cargo +1.98.1-x86_64-pc-windows-gnu run -p xtask -- policy -> sset policy: 315 files ok - cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu host::send:: -- --test-threads=1 -> 6 passed; 0 failed - cargo +1.98.1-x86_64-pc-windows-gnu test -p victory-gpu residency:: -- --test-threads=1 -> 4 passed; 0 failed - cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets -- -D warnings -> clean - cargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --features diagnostics -- -D warnings -> clean
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 20:24:30 +00:00
github-bot closed this pull request 2026-12-01 20:24:30 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-01 00:03 UTC · original · edited 2026-12-01 10:02 UTC

Automated triage for the maintainers (not an approval).

Verdict: needs-rebase · CI (check): passing

This PR no longer merges cleanly into main.

To change the verdict: Rebase onto current main and resolve conflicts; CI and triage will run again automatically.


Generated with Antigravity CLI (agy).

**@⁠Androtim** on GitHub · 2026-12-01 00:03 UTC · [original](https://github.com/Androtim/MiniVI/pull/269#issuecomment-7295874788) · edited 2026-12-01 10:02 UTC <!-- minivi-triage v1 head=fdac96cb29dd19bd32bb8a20996850b55b900ad1 verdict=needs-rebase ci=passing at=2026-12-01T10:02:41Z --> Automated triage for the maintainers (not an approval). **Verdict:** `needs-rebase` · **CI (`check`):** `passing` This PR no longer merges cleanly into `main`. **To change the verdict:** Rebase onto current `main` and resolve conflicts; CI and triage will run again automatically. --- _Generated with Antigravity CLI (`agy`)._
Author
Owner

@⁠Androtim on GitHub · 2026-12-01 01:22 UTC · original

A/B In-World Verification (--features diagnostics, RTX 4060 Ti 8 GB, 1440p Series X, DLSS Performance, 45–60s)

Verified cleanly across all 5 merged-stack runs (overhaul-diag-x, isolate-1, isolate-2, isolate-indoor, isolate-qw) with 0 crashes and passing visual/VRAM gates (isolate-qw and isolate-indoor):

  • baseline-main: 8.9 fps (112.7 ms), preparing 56.5 ms, VRAM max 5864 MB / budget min 6926 MB.
  • isolate-qw: 10.45 fps (95.95 ms), preparing 41.75 ms (-14.75 ms vs baseline, -27.05 ms vs isolate-1), VRAM max 5687 MB / budget min 6346 MB (over=0 MB, room_false=75.0%).
  • Scratch Reuse Telemetry (isolate-qw): host list scratch memory stayed bounded at 210 chunks 112 MB (42 chunks 14 MB spare, 47247 taken from spare).
**@⁠Androtim** on GitHub · 2026-12-01 01:22 UTC · [original](https://github.com/Androtim/MiniVI/pull/269#issuecomment-7297419139) ### A/B In-World Verification (`--features diagnostics`, RTX 4060 Ti 8 GB, 1440p Series X, DLSS Performance, 45–60s) Verified cleanly across all 5 merged-stack runs (`overhaul-diag-x`, `isolate-1`, `isolate-2`, `isolate-indoor`, `isolate-qw`) with **0 crashes** and passing visual/VRAM gates (`isolate-qw` and `isolate-indoor`): - **`baseline-main`:** `8.9 fps` (`112.7 ms`), preparing `56.5 ms`, VRAM max `5864 MB` / budget min `6926 MB`. - **`isolate-qw`:** **`10.45 fps` (`95.95 ms`)**, preparing **`41.75 ms`** (`-14.75 ms` vs baseline, `-27.05 ms` vs `isolate-1`), VRAM max **`5687 MB`** / budget min `6346 MB` (`over=0 MB`, `room_false=75.0%`). - **Scratch Reuse Telemetry (`isolate-qw`):** host list scratch memory stayed bounded at `210 chunks 112 MB` (`42 chunks 14 MB spare`, `47247 taken from spare`).
Author
Owner

@⁠Androtim on GitHub · 2026-12-01 01:31 UTC · original

Maintainer triage (strict merge gate): holding under triage: needs gpu test.

Before merging any performance or VRAM PR, we require isolated plain --release (no --features diagnostics) A/B measurements against current main (d79b943) showing:

  • median fps (must not regress)
  • preparing ms and copyback ms (must not increase)
  • VRAM max / over-budget MB and final_waiting textures (must not increase)
  • untranslated shaders (must not increase) and 0 crashes / DRED

(Combined-stack --features diagnostics numbers alone cannot pass the perf/VRAM gate because diagnostics instrumentation distorts frame timings and combines unrelated changes.)

**@⁠Androtim** on GitHub · 2026-12-01 01:31 UTC · [original](https://github.com/Androtim/MiniVI/pull/269#issuecomment-7297601495) Maintainer triage (strict merge gate): holding under `triage: needs gpu test`. Before merging any performance or VRAM PR, we require isolated **plain `--release` (no `--features diagnostics`)** A/B measurements against current `main` (`d79b943`) showing: - `median fps` (must not regress) - `preparing ms` and `copyback ms` (must not increase) - `VRAM max` / over-budget MB and `final_waiting` textures (must not increase) - `untranslated` shaders (must not increase) and `0` crashes / DRED (Combined-stack `--features diagnostics` numbers alone cannot pass the perf/VRAM gate because diagnostics instrumentation distorts frame timings and combines unrelated changes.)
Author
Owner

@⁠Androtim on GitHub · 2026-12-01 16:14 UTC · original

Closing as stale/conflicting and partially superseded by #278 (off-thread drop_aside reaper + pressure floors) and #289 (pooled D3D12 buffer heaps), with no paired plain --release A/B on current main.

**@⁠Androtim** on GitHub · 2026-12-01 16:14 UTC · [original](https://github.com/Androtim/MiniVI/pull/269#issuecomment-7317268190) Closing as stale/conflicting and partially superseded by #278 (off-thread drop_aside reaper + pressure floors) and #289 (pooled D3D12 buffer heaps), with no paired plain --release A/B on 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/Androtim--MiniVI!269
No description provided.