feat(gpu): adapt guest VRAM room with hysteresis and delayed-release damping #356
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!356
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-356"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@tommiehansen on GitHub · 2026-12-03 19:31 UTC · original
tommiehansen:perf/adaptive-vram-pressure→main· +408 −9 · 4 files · 7 commits · openWhy
Static pool budgets cannot respond smoothly to changing physical/process headroom.
What changes
Opt-in
VICTORY_POOL_PRESSURE_BUDGET=1, hysteresis and delayed-release damping; cache last valid process headroom and combine with fresh physical headroom, accept zero usage and clear on reset.Benchmark results
Four ABBA blocks at
7be46b2; roughly 49 µs additional synthetic controller cost.Why this should be merged / current decision
Potential stability benefit is unverified and CPU overhead measured. Keep opt-in; no performance promotion without live residency/transfer benefit.
Validation
Standard; earlier
1aaf030six controller tests and all-targets passed. Deterministic traces are not live hardware evidence.Compatibility
Require actual telemetry dropout, VRAM and transfer/frame data; no default change.
Archived detailed evidence and review history.
Continuous coverage update
47599113068 verified actual budget-adjustment activation 0→81900 and unchanged rejected fallback. Only 1/3 runtime files covered and host drift exceeded the review limit. No new reliable net improvement or physical residency result.
@Luxuride on GitHub · 2026-12-04 12:10 UTC · original
The controller is fine and neatly isolated — a unit-testable module with no D3D12 in it is the right shape. The wiring has one real bug, and it is exactly the kind that makes hysteresis look like it oscillates.
crates/victory-gpu/src/um/residency.rs:578setslet mut free = physical_free;, and only on a pass tick (:575,:588-591) is it replaced with the adaptive effective free. Butroomis read unconditionally from the controller (:602), andpressed/COUNTS[FREE_MB]are computed from the pair (:606,:613). So on every non-pass tick,freeis a different quantity than on a pass tick whileroomstays adaptive; withwave() > 1the down-for-room decisions (:734-751) flip between two bases and the hysteresis is partly defeated. Fix: keep the last effective free in astatic, or only computeroomwhereeff_freeis fresh.process_usage == 0is not "no telemetry".effective_free()returnsNonefor it, which makes the controller reset instead of holding. Zero usage is legitimate — a fresh process, or a driver that reports a budget but not usage. Narrow the missing-data test to the budget/total fields.VICTORY_POOL_PRESSURE_BUDGETis indocs/SETTINGS.md:60but not inrun.conf.default, where this project keeps the same switch list. (Two other PRs in this batch break the same convention, so maybe the convention needs a decision rather than three separate fixes.)On the tests: the five in
pressure_budget.rs(bounds across 8/12/16/24 GiB, oscillation, release damping, oversized cap, missing telemetry) look reasonable, but nothing invictory-gpucompiles on Linux, so the first person to run them will be you on Windows. And there is no end-to-end measurement in the body — hysteresis without a before/after is a hypothesis, and after the tick fix it is the number that would justify the switch existing at all.56 commits behind, merges clean. Fix the tick mismatch first, then one A/B run, then it lands.
residency: adapt guest VRAM room with hysteresis and delayed-release dampingto feat(gpu): adapt guest VRAM room with hysteresis and delayed-release damping@tommiehansen on GitHub · 2026-12-05 10:19 UTC · original
Thanks @Luxuride for catching the alternating telemetry bases and zero-usage case. 1aaf030 retains process headroom between passes, combines it with fresh physical headroom and accepts legitimate zero usage. Six targeted tests and MSVC compilation passed. The new synthetic benchmark also discloses the ~49 µs controller overhead; end-to-end benefit remains unverified.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.