Host lists reset many times are let go instead of pooled (VICTORY_LIST_RESETS_MOST) #3

Open
github-bot wants to merge 1 commit from github-bot/gh-3 into main AGit
Owner

@⁠tbarnavon on GitHub · 2026-11-28 17:52 UTC · original
tbarnavon:windows/retire-worn-host-lists → main · +46 −1 · 2 files · 1 commits · open

What

A host list counts its resets (HostList::worn). list::recycle drops one past VICTORY_LIST_RESETS_MOST resets (default 256; 0: never) instead of putting it back in the pool, or past 8 while the PC's memory shared with the card is over 80 % of its budget (shared_memory_pressed: asked at most every 100 ms, said in the log when it crosses). The pool makes a new one when it runs dry, as before.

From crossducking/RAZDA4A-XEN 7e9c3b90 (its max_resets), GPL-3.0 as here.

Why

A command allocator keeps the most memory it ever held until it is destroyed, and the pool kept host lists for good. On AMD's Windows driver that memory is the PC's memory shared with the card. On an RX 6900 XT (32 GB RAM, Windows 11) it stood at ~9 GB of a 15.5 GB budget when the device was removed with the debug layer's Kernel memory failure (no driver event). Throwing worn lists away gives that memory back; at the default it costs one list made per 256 reuses.

Independent of the borrowed host lists PR (#1): that one lowers how many host lists are alive, this one how much each holds.

Tested

  • cargo check -p victory-gpu and cargo check -p victory --features diagnostics: no new warnings (the four existing ones stay)
  • In game on the PC above together with #1. Not tested on Linux / RADV, where the memory is not the shared group's.

🤖 Generated with Claude Code

**@⁠tbarnavon** on GitHub · 2026-11-28 17:52 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/3) `tbarnavon:windows/retire-worn-host-lists` → `main` · +46 −1 · 2 files · 1 commits · open ## What A host list counts its resets (`HostList::worn`). `list::recycle` drops one past `VICTORY_LIST_RESETS_MOST` resets (default 256; `0`: never) instead of putting it back in the pool, or past 8 while the PC's memory shared with the card is over 80 % of its budget (`shared_memory_pressed`: asked at most every 100 ms, said in the log when it crosses). The pool makes a new one when it runs dry, as before. From crossducking/RAZDA4A-XEN 7e9c3b90 (its `max_resets`), GPL-3.0 as here. ## Why A command allocator keeps the most memory it ever held until it is destroyed, and the pool kept host lists for good. On AMD's Windows driver that memory is the PC's memory shared with the card. On an RX 6900 XT (32 GB RAM, Windows 11) it stood at ~9 GB of a 15.5 GB budget when the device was removed with the debug layer's `Kernel memory failure` (no driver event). Throwing worn lists away gives that memory back; at the default it costs one list made per 256 reuses. Independent of the borrowed host lists PR (#1): that one lowers how many host lists are alive, this one how much each holds. ## Tested - `cargo check -p victory-gpu` and `cargo check -p victory --features diagnostics`: no new warnings (the four existing ones stay) - In game on the PC above together with #1. Not tested on Linux / RADV, where the memory is not the shared group's. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A command allocator keeps the most memory it ever held until it is
destroyed, and the pool kept host lists for good. On AMD's Windows driver
that memory is the PC's memory shared with the card: with ~1,100 host
lists that had each recorded a heavy frame it stood at ~9 GB of a 15.5 GB
budget when the device was removed ("Kernel memory failure", RX 6900 XT,
32 GB, no driver event).

A host list counts its resets; `recycle` drops one past
VICTORY_LIST_RESETS_MOST (default 256; 0: never) instead of pooling it,
or past 8 while the shared memory is over 80 % of its budget (asked at
most every 100 ms, said in the log when it crosses). A new one is made
when the pool runs dry, as before.

From crossducking/RAZDA4A-XEN 7e9c3b90 (its `max_resets`, GPL-3.0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:00 +00:00
Author
Owner

@⁠Luxuride on GitHub · 2026-12-04 12:00 UTC · original · edited 2026-12-05 11:24 UTC

As I read it, this was superseded: main fixed the same defect by time rather than by count.

crates/victory-gpu/src/host.rs:1248 pub(crate) const ALLOCATOR_TRIM: u64 = 60;, :1261 fn remake_for_age(age_ms, keep, over_budget), driven from the idle-list pass at crates/victory-gpu/src/list.rs:302-318. A count-based bound on top of a 60 s remake is a second, weaker knob for the same thing, and after 410 commits it conflicts in both files it touches.

Two things from the diff worth keeping as separate issues, though:

  • crates/victory-gpu/src/host.rs:1290 keep_host_buffers() makes VICTORY_KEEP_HOST_BUFFERS=1 skip the age remake while under budget — which re-opens exactly the "allocator keeps its high-water mark" leak this PR describes.
  • The pressure path drops the threshold to 8 resets, which in a heavy scene is roughly "every list that ran a frame", so the pool would thrash; the 8 is undocumented and unjustified.

Also VICTORY_LIST_RESETS_MOST is in neither docs/SETTINGS.md nor run.conf.default, so per the header of the latter it would never appear in the F1 menu.

Whether it still has work of its own is the maintainer's call, not mine.

**@⁠Luxuride** on GitHub · 2026-12-04 12:00 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/3#issuecomment-7410834726) · edited 2026-12-05 11:24 UTC As I read it, this was superseded: `main` fixed the same defect by time rather than by count. `crates/victory-gpu/src/host.rs:1248` `pub(crate) const ALLOCATOR_TRIM: u64 = 60;`, `:1261 fn remake_for_age(age_ms, keep, over_budget)`, driven from the idle-list pass at `crates/victory-gpu/src/list.rs:302-318`. A count-based bound on top of a 60 s remake is a second, weaker knob for the same thing, and after 410 commits it conflicts in both files it touches. Two things from the diff worth keeping as separate issues, though: - `crates/victory-gpu/src/host.rs:1290` `keep_host_buffers()` makes `VICTORY_KEEP_HOST_BUFFERS=1` skip the age remake while under budget — which re-opens exactly the "allocator keeps its high-water mark" leak this PR describes. - The pressure path drops the threshold to 8 resets, which in a heavy scene is roughly "every list that ran a frame", so the pool would thrash; the 8 is undocumented and unjustified. Also `VICTORY_LIST_RESETS_MOST` is in neither `docs/SETTINGS.md` nor `run.conf.default`, so per the header of the latter it would never appear in the F1 menu. Whether it still has work of its own is the maintainer's call, not mine.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/list.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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