sweep: plan the look under pressure on a thread of its own #495
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!495
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-495"
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?
@arutkowski00 on GitHub · 2026-12-04 18:32 UTC · original
arutkowski00:pr/sweep-thread→main· +168 −39 · 2 files · 1 commits · closed without mergingProblem
Under VRAM pressure the texture sweep walked every host copy of a texture the title fills (over 70,000 in one play) on the submitting thread, with the table of textures held throughout. That cost 8.9 ms a look on average and up to 175 ms, once a second, and making and dropping textures on the title's threads waited for the same lock.
Change
A thread of its own now makes the look (idle copies, coldest first), a slice of 4,096 members at a time so the table is held briefly. The look before a submission takes the last plan, drops entries no longer in the table, and lets go only what
take_idlefinds idle again, so the moment and the checks under which copies are let go are unchanged. Copies whose lock another thread holds are in use and are skipped rather than waited for. The memory line reports the planner's looks and their cost.Touches
resource.rsand a few lines ofhost.rs. No new switch.Evidence
The look cost (8.9 ms average, 175 ms maximum, over 70,000 members) was measured from the memory line in a play session on an RX 7900 XTX (RADV, stock Mesa,
VICTORY_PAGES=0). The commit was then used in every play session after that. I have not run a controlled before and after of frame times for this change alone.Not tested
@arutkowski00 on GitHub · 2026-12-04 18:44 UTC · original
Closing: #355 addresses the same sweep stall (and the placed-textures lock) and is ahead in the queue; the two conflict in resource.rs. I'll re-measure with #355 applied instead.
Pull request closed