Defer residency candidate construction until a migration tick #221
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!221
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-221"
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-02 19:12 UTC · original
tommiehansen:perf/residency-migration-cadence→main· +60 −19 · 1 files · 1 commits · merged 2026-12-03 17:15 UTCThe residency worker builds vectors of candidates on housekeeping ticks where it cannot migrate pages. It also linearly searches a pool snapshot by ID and sorts candidates by weight even when every one fits the budget.
The snapshot preserves slot identity for indexed lookup. Heat sampling, age, scores, cooldowns and retirements still run on their existing schedules. Migration ticks use the same priority order when budget selection is required. The emitted ranges stay in the original address order, with the original placement calls and fence sequence.
The expected effect is lower CPU cost and fewer allocations on high-activity residency ticks. The branch passed Windows-target Rust checking with and without diagnostics. An extracted differential test covered 33,408 input-size and budget pairs, including tied weights and the maximum batch length.
Expected work reduction
This is a worker-side CPU optimization, not a change to migration eligibility or a guarantee of higher resident bytes. Evaluate alongside, but independently of, #303, which changes optional ranking.
Hardware testing
Hardware benchmarking was unavailable. Please compare migration counts, worker CPU time and frame-time tails at native 1080p on RX 9060 XT 16 GB and native 1440p on RX 9070 XT under Linux, with RT enabled and frame generation disabled, especially when streaming under VRAM pressure.
87993c77b0to0b3d41517d