perf: batch completed host-list recycling #650
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!650
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-650"
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-05 23:49 UTC · original
tommiehansen:perf/batch-list-recycle-20261206→main· +547 −2 · 2 files · 8 commits · draftWhy
Retiring completed host command lists currently returns each list to the idle pool individually. When many lists complete together, repeated lock acquisitions and membership searches can add CPU overhead and contention during command recording/submission.
What changes
Batch completed-list recycling with one idle-pool lock for the batch, bounded membership tracking (allocation-free up to 64 lists), and the original path for batches below 16. Preserve fence completion, reset, capacity and retained-resource lifetime; no asynchronous reaper. Inspired by CNF/Larp #185, implemented against XMEM's own lifecycle. Remains opt-in.
Benchmark results — Windows WARP, four concurrent workers
CI 47586706004,
e6bca39. Eight ABBA/BAAB blocks per shape, 64 worker durations per arm, exact reuse oracle. Absolute values are medians of block medians; percentage is median paired change; p95 is pooled worker duration.Wide paired changes range from −96.48% to +115.58%; contention results are noisy. Earlier uncontended CI found −7.67% recycling time / −2.55% measured-phase sum at 16 lists and −1.75% / +2.13% at 32. Lock acquisitions fall from 32 to 2 for 16 lists (operation counts, not a timing claim).
Why this should be merged
Wide concurrent retirement is promising and the patch preserves the existing lifecycle. However, the small control and mixed workload do not establish robust overall benefit. Keep draft pending better contention-aware admission and repeatable net-cost evidence.
Validation and compatibility
Initial actual reuse 6/6 completed and reused exactly; subsequent 16 completed and 16 reused from 20 total, plus current four-worker test and both Windows configurations pass.
Reproduce:
cargo test --locked --release -p victory-gpu --features diagnostics --lib recycle_concurrent_paired_tail_cost -- --ignored --nocapture --test-threads=1. Native AMD/title command-list batch distribution and frame-time tails remain unmeasured.Current revision
264219fAdmission now requires overlapping eligible retirement calls, rather than batching every large uncontended retirement. A scoped activity guard restores the count on exit; shallow and disabled paths remain unchanged. The concurrent fixture now records actual activation, checks small/off controls and requires activation for the wide case. The serial fixture checks original lock counts. The table above measures the preceding revision; current-head CI 47589117773 has completed.
Verified adaptive-admission benchmark
CI 47589117773 passed both jobs at
264219f. Eight paired blocks per shape, exact reuse and admission controls. Recomputed medians of block medians:Wide paired changes range from −96.35% to +900.91%. Small never activates yet also appears faster; this is evidence of scheduling noise. Keep draft: persistent-worker contention and aggregate retirement throughput remain necessary before making a robust benefit claim.
Persistent-worker validation
Current head
169bd74adds persistent workers, synchronized already-completed retirement, four repetitions per measured arm, aggregate retired lists, elapsed retirement, release-to-end, start spread, worker p95 and actual batch-admission counts. Every repetition requires exact readback and recycled identity set. CI 47592042102 is running; no timing claim until completed.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.