perf(card_steps): overlap D3D12 command recording onto background thread #404
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/readmet3xt-lab--foxhound!404
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-404"
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?
@leixner on GitHub · 2026-12-01 22:34 UTC · original
leixner:perf/async-card-steps-record→main· +153 −28 · 2 files · 72 commits · closed without mergingSummary
Cuts submitting-thread
card_stepsoverhead by ~30% per 1k fills (-37% p50, -33% p90, -35% p99) by offloadingcard_stepsD3D12 command recording (CopyBufferRegion,ResourceBarrier, andClose) onto a dedicated background helper thread (victory-card-rec) while the submitting thread runs write-watch, refreshes, and list steps (~25–35 ms of overlap).Problem
In
Host::submit,card_steps::take_stepsruns at the start of the submission and synchronously records ~2,000–2,700CopyBufferRegioncalls, resource barriers, andlist.Close()intoown.list.liston the submitting thread — even thoughown.list.listis not submitted to the GPU until ~25–35 ms later (all intermediate stages only readown.list.deferred()).Changes (
crates/victory-gpu/src/host/card_steps.rs,crates/victory-gpu/src/host.rs)CardRecordJobandrecord_async(using a single persistentvictory-card-rechelper thread, mirroringwatch::ask_first) that runsrecord(...)across all levels andlist.Close()in the background (non-diagnostics builds; diagnostics builds keep the synchronousown.list.close()path for timestamp/op queries).Taken::wait_recorded(&self)(also called inTaken::landedandDrop for Takensoown.listis never submitted, recycled, or dropped while recording is in flight).own.wait_recorded()inHost::submitright beforeHandoff/ExecuteCommandLists(~25–35 ms after dispatch, when recording has already completed).Verification
cargo test -p victory-gpu --lib card_steps— 14 passed, 0 failed (zero warnings).cargo test -p victory-gpu --lib host::refresh_tests— 5 passed, 0 failed.cargo xtask policy— 293 files ok.VICTORY_WIDE_THREADS=8, 179 gameplay windows, 0 errors):p50 / mean / p90 / p99)card_stepsmscard_steps(ms / 1k fills)Pull request closed