Upload memory: switches for the spare scratch chunks and send buffers kept (unset as before) #373

Open
github-bot wants to merge 1 commit from github-bot/gh-373 into a-publier AGit
Owner

@⁠Esteban-V on GitHub · 2026-11-26 22:50 UTC · original
Esteban-V:perf/upload-spare-caps → a-publier · +82 −6 · 2 files · 1 commits · open

Idle upload memory is kept with no way to lower it: up to 1 GiB of scratch chunks (SPARE_KEPT, crates/victory-gpu/src/host.rs:2030, with keep_freed unless limited_host_ram) and 768 MiB of send buffers (kept(), host/send.rs:122; 256 MiB with VICTORY_SEND_BAR). This adds two overrides, unset by default.

  • VICTORY_SCRATCH_SPARE_MB replaces the limit in give_chunks.
  • VICTORY_SEND_SPARE_MB replaces kept() in host/send.rs.
  • 0 keeps nothing. The only effect is that the existing "over the limit, free at give-back" branch runs more often; give-back still happens at list reset, after the bury lag.
  • Both rules are factored into pure functions (spare_limit, kept_for), with tests that unset reproduces today's values.
  • Default unchanged (the keep_freed retention is a deliberate mitigation), and trim_spare_chunks is untouched.

To A/B: VICTORY_SCRATCH_SPARE_MB=128 VICTORY_SEND_SPARE_MB=256 with the memory line.

Already merged in DoubleGhosty/cool_fox (39318a8). Related: #335 adds a pressure-driven send::trim() and touches send.rs too.

Testing

  • Windows CI (windows-latest): Clippy, default tests and diagnostics tests pass (run).
  • Type-checked and clippy-clean for x86_64-pc-windows-msvc on a macOS host (cargo clippy --workspace --all-targets -- -D warnings, default features and --all-features).
  • Unit tests spare_limit_is_as_before_unless_asked and kept_is_as_before_unless_asked added.
**@⁠Esteban-V** on GitHub · 2026-11-26 22:50 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/373) `Esteban-V:perf/upload-spare-caps` → `a-publier` · +82 −6 · 2 files · 1 commits · open Idle upload memory is kept with no way to lower it: up to 1 GiB of scratch chunks (`SPARE_KEPT`, `crates/victory-gpu/src/host.rs:2030`, with `keep_freed` unless `limited_host_ram`) and 768 MiB of send buffers (`kept()`, `host/send.rs:122`; 256 MiB with `VICTORY_SEND_BAR`). This adds two overrides, unset by default. - `VICTORY_SCRATCH_SPARE_MB` replaces the limit in `give_chunks`. - `VICTORY_SEND_SPARE_MB` replaces `kept()` in `host/send.rs`. - `0` keeps nothing. The only effect is that the existing "over the limit, free at give-back" branch runs more often; give-back still happens at list reset, after the bury lag. - Both rules are factored into pure functions (`spare_limit`, `kept_for`), with tests that unset reproduces today's values. - Default unchanged (the `keep_freed` retention is a deliberate mitigation), and `trim_spare_chunks` is untouched. To A/B: `VICTORY_SCRATCH_SPARE_MB=128 VICTORY_SEND_SPARE_MB=256` with the memory line. Already merged in DoubleGhosty/cool_fox (39318a8). Related: #335 adds a pressure-driven `send::trim()` and touches `send.rs` too. ## Testing - Windows CI (`windows-latest`): Clippy, default tests and diagnostics tests pass ([run](https://github.com/Esteban-V/VIctory-Belobug-AMD/actions/runs/45916913255)). - Type-checked and clippy-clean for `x86_64-pc-windows-msvc` on a macOS host (`cargo clippy --workspace --all-targets -- -D warnings`, default features and `--all-features`). - Unit tests `spare_limit_is_as_before_unless_asked` and `kept_is_as_before_unless_asked` added.
Scratch chunks no list holds are kept up to 1 GiB with keep_freed on a
PC of more than 32 GB (128 MiB otherwise), and the memory submissions
sent from up to 768 MiB (256 MiB in the card's memory): up to some
1.8 GB of upload memory that nothing uses. VICTORY_SCRATCH_SPARE_MB and
VICTORY_SEND_SPARE_MB set the two limits in MiB; what is past them is
freed where it is given back, as before. Unset, both limits are what
they were (pure functions spare_limit and kept_for, with tests).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:42 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 00:22 UTC · original

Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at 374af2f: cargo test --release -p victory-gpu --lib 398 passed, 0 failed, 34 ignored.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 00:22 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/373#issuecomment-7206403748) Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `374af2f`: `cargo test --release -p victory-gpu --lib` 398 passed, 0 failed, 34 ignored. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/373/head:github-bot/gh-373'
git switch 'github-bot/gh-373'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-373'
git switch 'github-bot/gh-373'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-373'
git switch 'github-bot/gh-373'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-373'
git switch 'a-publier'
git merge --squash 'github-bot/gh-373'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-373'
git switch 'a-publier'
git merge 'github-bot/gh-373'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.