Memory switches: idle times for staging and windows, and the most a read buffer keeps #374

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

@⁠Esteban-V on GitHub · 2026-11-26 22:50 UTC · original
Esteban-V:perf/idle-cache-knobs → a-publier · +89 −3 · 2 files · 1 commits · open

With 12 GiB or more free, staging buffers (system memory the size of each texture) and loose windows are kept for five minutes after their last use (ram_idle_ms, called from crates/victory-gpu/src/texture.rs:521 and shadow.rs:3009), and each thread's texture read buffer stays at the size of the largest texture it ever read. This adds three switches, unset by default, to shorten those.

  • VICTORY_STAGING_IDLE_MS: replaces the computed idle time in texture::let_go_idle, never below 2 s.
  • VICTORY_WINDOW_IDLE_MS: the same for windows in shadow::let_go_idle. The existing RAM bands (VICTORY_WINDOW_BUDGET_MB) still shorten it under pressure.
  • VICTORY_READ_KEEP_MB: a read buffer over this is freed after the read; the next read makes it again.
  • No keep or let-go guard changes (strong count, list holds, references, retire, IDLE_FRAMES); only the duration does. Env vars are read once, outside the sweep closures.
  • Default unchanged: with all three unset, the idle times and read buffers are as before.

To A/B: VICTORY_STAGING_IDLE_MS=10000 VICTORY_WINDOW_IDLE_MS=10000 VICTORY_READ_KEEP_MB=32 with the memory line.

Already merged in DoubleGhosty/cool_fox (cf3f615).

Testing

  • Windows CI (windows-latest): Clippy, default tests and diagnostics tests pass (run). The first attempt hit host::refresh_tests::unchanged_ranges_are_known, a write-watch timing test in a file this PR does not touch; the re-run passed.
  • 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 an_idle_override_is_two_seconds_or_more and a_read_buffer_over_the_most_is_let_go added.
**@⁠Esteban-V** on GitHub · 2026-11-26 22:50 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/374) `Esteban-V:perf/idle-cache-knobs` → `a-publier` · +89 −3 · 2 files · 1 commits · open With 12 GiB or more free, staging buffers (system memory the size of each texture) and loose windows are kept for five minutes after their last use (`ram_idle_ms`, called from `crates/victory-gpu/src/texture.rs:521` and `shadow.rs:3009`), and each thread's texture read buffer stays at the size of the largest texture it ever read. This adds three switches, unset by default, to shorten those. - `VICTORY_STAGING_IDLE_MS`: replaces the computed idle time in `texture::let_go_idle`, never below 2 s. - `VICTORY_WINDOW_IDLE_MS`: the same for windows in `shadow::let_go_idle`. The existing RAM bands (`VICTORY_WINDOW_BUDGET_MB`) still shorten it under pressure. - `VICTORY_READ_KEEP_MB`: a read buffer over this is freed after the read; the next read makes it again. - No keep or let-go guard changes (strong count, list holds, `references`, `retire`, `IDLE_FRAMES`); only the duration does. Env vars are read once, outside the sweep closures. - Default unchanged: with all three unset, the idle times and read buffers are as before. To A/B: `VICTORY_STAGING_IDLE_MS=10000 VICTORY_WINDOW_IDLE_MS=10000 VICTORY_READ_KEEP_MB=32` with the memory line. Already merged in DoubleGhosty/cool_fox (cf3f615). ## Testing - Windows CI (`windows-latest`): Clippy, default tests and diagnostics tests pass ([run](https://github.com/Esteban-V/VIctory-Belobug-AMD/actions/runs/45916909478)). The first attempt hit `host::refresh_tests::unchanged_ranges_are_known`, a write-watch timing test in a file this PR does not touch; the re-run passed. - 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 `an_idle_override_is_two_seconds_or_more` and `a_read_buffer_over_the_most_is_let_go` added.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:44 +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 7ae8a2f: 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/374#issuecomment-7206404176) 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 `7ae8a2f`: `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/374/head:github-bot/gh-374'
git switch 'github-bot/gh-374'

Merge

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