[VRAM] LowVram preset admission threshold conflicts with texture eviction policy #449
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX#449
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@FunWithFlagsDev on GitHub · 2026-11-26 19:39 UTC · original
<html>Summary
The current LowVram preset sets
VICTORY_TEXTURE_ROOM_PERCENT=85, but the default texture eviction policy only starts pressure-based reclamation at 88% of the effective VRAM budget.This creates a potential admission/reclamation mismatch: new texture allocations may be refused while otherwise eligible idle textures are retained for up to 600 seconds.
This may particularly affect GPUs with 8 GB of VRAM.
Source code analysis
Reviewed against commit
37d4686711bbb04c2cc3825f3f13bbff7c140fb0.1. LowVram preset
crates/anyxboxx-launcher/src/options.rs#L33-L42
The 8 GB preset sets:
VICTORY_CARD_BUFFERS_MB=512VICTORY_TEXTURE_ROOM_PERCENT=852. Texture admission
third_party/victory/crates/victory-gpu/src/resource.rs#L1819-L1848
Once the unconditional texture floor is exceeded, and no explicit absolute texture budget overrides the percentage-based path,
room()uses the configured percentage to determine whether more textures may be admitted.3. Texture reclamation
third_party/victory/crates/victory-gpu/src/host.rs#L171-L185
The default
vram_keep()policy uses fixed thresholds:Below 88%: retain textures until idle for 600,000 ms.
Between 88% and 95%: reclaim eligible textures idle for 5,000 ms, targeting 85% usage.
At or above 95%: reduce the idle threshold to 1,500 ms.
Both percentage-based admission and the default pressure-based sweep use the same effective usage calculation, including reserved headroom.
However, the eviction policy does not receive the configured admission percentage.
Potential impact
Using the 6,823 MiB DXGI budget reported for an RTX 5060 8 GB in #396 as an illustrative example:
Effective usage | Admission | Current idle threshold -- | -- | -- 84% | Allowed | 600 s 85% | Refused | 600 s 87% | Refused | 600 s 88% | Refused | 5 s 95% | Refused | 1.5 sThis assumes the percentage-based admission path is active and the default eviction policy is enabled.
The 85–88% interval could delay the reclamation of eligible idle resources while new textures are waiting.
This is a static code finding, not a confirmed in-game reproduction or a demonstrated memory leak.
Proposed change
Consider making the default pressure-based eviction thresholds aware of
VICTORY_TEXTURE_ROOM_PERCENT, while preserving the current policy for admission limits of 88% or higher.One possible approach:
Pass the already parsed
room_percent()value fromresource::let_go_idle()tohost::vram_keep().For the 8 GB preset, this would produce:
Admission threshold: 85%.
Pressure-based reclamation threshold: 85%.
Reclamation target: 82%.
Critical pressure threshold: unchanged at 95%.
The three-percentage-point hysteresis preserves the existing distance between the default reclamation threshold and its target.
Existing resource lifetime checks, descriptor references, GPU synchronization and retirement logic would remain unchanged.
Preliminary verification
An isolated Python model reproducing the original and proposed threshold logic was executed.
Results: 6 tests passed, 0 failures.
Coverage:
Existing behavior preserved for admission percentages of 88% and higher.
Correct boundary behavior for the 85% preset.
Three-percentage-point reclamation hysteresis.
Unchanged critical-pressure threshold.
All accepted percentage values from 50% to 97%.
Zero-budget fallback behavior.
The full Rust workspace was not compiled, and no GPU or in-game benchmark was performed.
Related work
#256 — Adaptive memory caps.
#287 — Correct accounting of mapped tile bytes during eviction.
#354 — Fence-safe LRU texture eviction.
#381 — Releasing older views when texture admission is blocked.
#396 — Low-memory presets.
#409 — Migration to the combined VIctory base.
This proposal is intended to complement those changes, not replace them.
Correct tile-byte accounting, particularly the work in #287, should be considered when validating the reclamation target.
Done when
The default reclamation policy respects lower percentage-based admission limits.
A Rust regression test demonstrates the 85–88% threshold mismatch.
Existing behavior remains unchanged for admission limits of 88% or higher.
Existing GPU resource lifetime safeguards remain intact.
An 8 GB GPU A/B test compares texture refusals, local/non-local memory usage, texture re-uploads and frame times.
No excessive eviction/re-upload cycle is introduced.
The explicit
VICTORY_TEXTURE_BUDGET_MBoverride is outside the scope of this proposal.Would aligning these thresholds be consistent with the intended texture retention policy? If so, I would be interested in preparing a focused patch with regression tests.
AI disclosure
AI assistance (OpenAI ChatGPT) was used for static source analysis, policy modeling, test preparation and drafting this report.
</html>## SummaryThe current LowVram preset sets
VICTORY_TEXTURE_ROOM_PERCENT=85, but the default texture eviction policy only starts pressure-based reclamation at 88% of the effective VRAM budget.This creates a potential admission/reclamation mismatch: new texture allocations may be refused while otherwise eligible idle textures are retained for up to 600 seconds.
This may particularly affect GPUs with 8 GB of VRAM.
Source code analysis
Reviewed against commit
37d4686711bbb04c2cc3825f3f13bbff7c140fb0.1. LowVram preset
[crates/anyxboxx-launcher/src/options.rs#L33-L42](
github.com/LooperSalty/AnyXboxX@37d4686711/crates/anyxboxx-launcher/src/options.rs (L33-L42))The 8 GB preset sets:
VICTORY_CARD_BUFFERS_MB=512VICTORY_TEXTURE_ROOM_PERCENT=852. Texture admission
[third_party/victory/crates/victory-gpu/src/resource.rs#L1819-L1848](
github.com/LooperSalty/AnyXboxX@37d4686711/third_party/victory/crates/victory-gpu/src/resource.rs (L1819-L1848))Once the unconditional texture floor is exceeded, and no explicit absolute texture budget overrides the percentage-based path,
room()uses the configured percentage to determine whether more textures may be admitted.3. Texture reclamation
[third_party/victory/crates/victory-gpu/src/host.rs#L171-L185](
github.com/LooperSalty/AnyXboxX@37d4686711/third_party/victory/crates/victory-gpu/src/host.rs (L171-L185))The default
vram_keep()policy uses fixed thresholds:Both percentage-based admission and the default pressure-based sweep use the same effective usage calculation, including reserved headroom.
However, the eviction policy does not receive the configured admission percentage.
Potential impact
Using the 6,823 MiB DXGI budget reported for an RTX 5060 8 GB in #396 as an illustrative example:
This assumes the percentage-based admission path is active and the default eviction policy is enabled.
The 85–88% interval could delay the reclamation of eligible idle resources while new textures are waiting.
This is a static code finding, not a confirmed in-game reproduction or a demonstrated memory leak.
Proposed change
Consider making the default pressure-based eviction thresholds aware of
VICTORY_TEXTURE_ROOM_PERCENT, while preserving the current policy for admission limits of 88% or higher.One possible approach:
Pass the already parsed
room_percent()value fromresource::let_go_idle()tohost::vram_keep().For the 8 GB preset, this would produce:
The three-percentage-point hysteresis preserves the existing distance between the default reclamation threshold and its target.
Existing resource lifetime checks, descriptor references, GPU synchronization and retirement logic would remain unchanged.
Preliminary verification
An isolated Python model reproducing the original and proposed threshold logic was executed.
Results: 6 tests passed, 0 failures.
Coverage:
The full Rust workspace was not compiled, and no GPU or in-game benchmark was performed.
Related work
This proposal is intended to complement those changes, not replace them.
Correct tile-byte accounting, particularly the work in #287, should be considered when validating the reclamation target.
Done when
The explicit
VICTORY_TEXTURE_BUDGET_MBoverride is outside the scope of this proposal.Would aligning these thresholds be consistent with the intended texture retention policy? If so, I would be interested in preparing a focused patch with regression tests.
any002_policy_model.py
@KainanP on GitHub · 2026-11-26 20:39 UTC · original
Thanks for the careful write-up. I checked it against both revisions:
37d4686(combined base, #409): confirmed.resource::let_go_idlecallshost::vram_keep(budget, used)with fixed 88 / 85 / 95 % thresholds and a 600 s keep time, whileresource::room()refuses admission atroom_percent()(85 with the LowVram preset).room_percent()never reachesvram_keep, so between 85 % and 88 % the texture queue is refused while idle copies are kept for up to 10 minutes, exactly as your table shows.main(15024d5): not present. #452 reverted #409 and restored the Neptune base, which has novram_keep. There the sweep takes its idle time fromhost::vram_idle_ms_by_room(video, room_lately()). Onceroom()refuses admission, idle time drops tomin(by_share, moderate). With the profile'sVICTORY_VRAM_IDLE_MS=8000,2000,1000that is at most 2 s, and 1 s at 85 % or above. Admission and reclamation are tied through the sameroom()answer, so no 85–88 % window exists whateverVICTORY_TEXTURE_ROOM_PERCENTis set to.So I'm not opening a PR against
mainbecause there is nothing to fix there right now. If the combined base comes back (the revert says it can once it holds on NVIDIA), your proposal should go in with it. That means passingroom_percent()intovram_keep, usingstart = min(room_percent, 88), keeping the target 3 points below it and leaving 95 % unchanged, along with a Rust test that fails at 85–87 % on the unpatched code. Leaving this open so that isn't lost seems reasonable; maintainers' call.AI use: analysis done with Claude Code (reading both revisions' source); nothing was run in game.
@akimfomin on GitHub · 2026-11-26 23:01 UTC · original
The 85% admission / 88% eviction gap is still present in the new Vice-Tay proposal
5ac6926(#454). I checked the LowVram preset, the admission formula and the eviction formula. The preset's 1024 cap is also listed as unread by Vice-Tay, so it cannot compensate on that head.The first test for this proposal is a synthetic 86%-usage row with an idle, fence-complete texture. Keep other allocations fixed, check both refusal and reclamation, then progress through 88% as a positive control. This is a pinned source check; it does not attribute an observed game regression to the gap. PortBridge · AI-assisted source review.
@KainanP on GitHub · 2026-11-27 00:11 UTC · original
Thanks @akimfomin, you were right: the gap is back with #454's Vice-Tay base. Fix in #465. The sweep now starts at
min(VICTORY_TEXTURE_ROOM_PERCENT, 88)and comes down 3 points below that start. It is unchanged for the default share (90) and for anything from 88 up. Your test is in there as a host-device test: an idle, fence-complete copy with the preset's 85 % gets 84 % (admitted, kept), 86 % (refused, and the copy now goes) and 88 % (control). With the old fixed 88 % start it fails at 86 %. The preset's 1024 cap really is unread on this base, so #465 also drops it from both card presets and their descriptions instead of claiming a cap. An A/B from someone with an 8 GB card would help.AI use: Claude Code.