Restart the idle texture sweep when its cursor passes the last texture #198
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!198
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-198"
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?
@feanorsun on GitHub · 2026-11-26 11:21 UTC · original
feanorsun:fix/restart-idle-texture-sweep→main· +27 −1 · 1 files · 1 commits · openRefs #182
The idle texture sweep visits up to 8,192 addresses per pass when the runtime is keeping textures for minutes. If a full batch ends at the last address, the next cursor is past the end. The old loop only reset the cursor while visiting a texture, so subsequent passes could stay empty indefinitely. Releasing the remaining textures between passes has the same effect.
When the saved cursor has no remaining addresses, restart the batch at the first address. A cursor with a nonempty tail continues from that tail. The age, reference-count and memory-budget checks still govern which resources can be released.
Verified on Windows against
0dec5dcc228b, using ordered sets with three or four integer addresses and a batch size of two. Both regression assertions returned an empty batch before the fix and[1, 3]afterwards.Both cases ran on the CPU, with zero GPU allocations. The same cursor loop exists in the reporter's source revision. Their log does not show that the sweep reached this boundary, and the high-pressure eviction path uses a different traversal.
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.