perf(victory-gpu): reduce fence waiter lock contention and queue submission allocations #411
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!411
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-411"
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?
@Lewandox on GitHub · 2026-11-26 17:53 UTC · original
Lewandox:perf/victory-gpu-fence-and-queue→main· +182 −77 · 2 files · 2 commits · closed without mergingSummary
Reduces mutex contention on GPU fence signaling/waiting and removes avoidable hot-path allocations and O(N) queue shifts during command-list submission.
Changes
fence.rs— lock-free fast path & out-of-lockSetEvent:set_event_on_completion, checkfence.value.load(Ordering::Acquire) >= valuebefore callingmerge_fence_askedor lockingfence.waiters, firing the event immediately when already completed.set, extract due waiters underfence.waitersand drop the mutex guard before callingSetEventso concurrent callers are not blocked behind Win32 kernel calls.concurrent_waiters_and_signals_never_miss_an_eventunit test.queue.rs— O(1) held-queue draining & allocation reduction:Queue::heldfromVec<Held>toVecDeque<Held>sorelease_heldpops from the front in O(1) instead of shifting elements viaVec::remove(0).execute_host_liststo pass a single-element stack slice (&[h]) on single-list submissions and pre-sizedVec::with_capacityfor multi-list submissions, avoiding per-submission heap allocations insubmit_cut,submit_split,execute, andrelease_held.piecesinsubmit_cutandsubmit_split, removed the intermediateby[from..to].concat()temporaryVec, and reused thequeuesscratch buffer acrossrelease_heldloop iterations.WAITINGregistration inmark_waiting.held_signals_release_in_fifo_order_after_waitunit test.Verification
cargo test -p victory-gpu --lib fence::tests(default and--features diagnostics)cargo test -p victory-gpu --lib queue::tests(default and--features diagnostics)cargo xtask policy@LooperSalty on GitHub · 2026-11-26 18:27 UTC · original
Thanks. The fence part is the same as #415, which is being merged first, so this will conflict on
fence.rs: could you rebase and keep only thequeue.rspart?One fix there:
execute_host_listsskipshost.executewhen the single list has nohost_list. Before,host.execute(&[])still ran and calledmerge_send(Sync)(host.rs,execute). Please keep callinghost.execute(&[])in that case.🤖 Generated with Claude Code
@Lewandox on GitHub · 2026-11-26 18:56 UTC · original
Thanks for the review!
execute_host_listsso a single-list submission with nohost_liststill callshost.execute(&[]), preservingmerge_send(Sync).fence.rsandqueue.rshere has no conflict withmain. (Happy to splitfence.rsout if you still prefer them separate!)Re-verified locally with
cargo test -p victory-gpu --lib fence::testsandqueue::tests(default and--features diagnostics) +cargo xtask policy.8176019683to82efbf094b82efbf094btodbac17de62@LooperSalty on GitHub · 2026-11-26 23:09 UTC · original
Closing after #454 moved
third_party/victoryto the Vice-Tay base (TaynanGT/Vice-Tay a252348).The files do not apply to the new base any more, and the change came without a measurement (rule 2 of AGENTS.md asks for one for performance work).
Thanks for the work. If you measure a gain on the new base, a new PR against
mainis welcome.🤖 Closed by Claude Code on behalf of the maintainer
Pull request closed