vkback: the GTT line takes the free bytes of GTT arena blocks off its use #111
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/vktory6--VKtory!111
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-111"
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?
@Flezzonkeys on GitHub · 2026-12-01 14:57 UTC · original
Flezzonkeys:gtt-line-arena-free→main· +71 −8 · 3 files · 1 commits · merged 2026-12-01 15:03 UTCWhat
over_linetakes the free bytes inside the image arena's blocks off the card's use, but not off GTT's. Arena blocks are not freed while the game runs, so once a new GTT block (made while textures spill) pushes GTT use past its line, the line stays passed: letting textures go adds their bytes to the blocks' free space and leaves the heap's usage unchanged, so the let-go sweep can never bring it back under. With the card over its line too,texture_placeanswersPlace::Nonefrom then on, every refused texture's slot reads null, and faces and parts of the world stay black for the rest of the session.Both lines now go through one function,
past_line, which takes the free bytes of that heap's own arena blocks off its use. The next texture of that heap goes into that free space before a new block is made (Arena::alloc, first fit over the blocks of its memory type), so those bytes are not in use. The memory summary also reports how much of the arena's free space is in GTT blocks, so the case shows up in the log.This is one concrete way into "Black world after long sessions" and the refusals in "8 GB cards" (docs/TASKS.md). I have not shown that it is the whole cause of either.
The reference
D3D12 path,
crates/victory-gpu/src/resource.rsevict_unused(Marvisak/VIctory 219878a0e7): before comparing againstBUDGET_HIGH, it takesplacement::free_bytes()off the card's use ("Free space in the heaps of textures takes the card's memory but is not in use: new textures go there first"). It has no GTT line, so the GTT side has no counterpart. I carry the same rule over to the GTT line. vkd3d-proton has no residency line of this kind.Same pattern checked elsewhere (rule 22): umem's
can_growalso compares heap use with the budget without taking arena free space off. That is correct there, because title pool chunks cannot use the free space of image blocks, so I left it unchanged.Evidence
residency::tests, callingpast_line): free arena bytes do not count as used; letting textures go (usage flat, free grows) brings a passed line back under; free larger than used saturates.cargo test -p vkbackpasses andcargo clippy -p vkback --all-targets -- -D warningsis clean.7c7bba5, plus this commit and local-only changes that do not touch residency: present sharpening, a resolution patch left off, trace fields): 0 refused past both lines, GTT up to 13.8 GB. In one of them GTT stood at 13,517 of 15,662 MB, 48 MB past its line, with 1,573 MB of the arena's free space in GTT blocks: without the change that run would have been past the GTT line too.make_imagepath as before, at a different moment), not which Vulkan calls exist or how they are made. If you want the validation run before merging, I can't do it on my side at the moment.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited, the related items named above (rule 29)unsafeblock has a// SAFETY:comment (rule 36): no newunsafeLearnings: new entry in
docs/learnings/tex-letgo.md;docs/learnings/parity.mdrow "Residency line, idle let-go, target reserve" updated.@vktory6 on GitHub · 2026-12-01 15:04 UTC · original
Merged as
1325b2f. Thank you, this is an excellent PR: the cause read from the code, the D3D12 counterpart named, the same pattern checked in umem with a reason to leave it, unit tests on the production function, a before/after from real play, and an honest "one way in, not shown to be the whole cause". Nothing to change on my side.The task is updated (
github.com/vktory6/VKtory@dab263d): one cause of the black world is fixed, and the next step is a 30+ minute run on main. It may also help the two 8 GB reports (#103, #106), which show the same refusal counters; I've asked there for a recheck.