Repository navigation
perf(gpu): coalesce cross-queue and bottom-of-pipe dependent held pieces - #419
gdemontalivet wants to merge 2 commits into
Conversation
Coalesce ready command-list segments across queues inside Held::pump when a producer segment's deferred bottom-of-pipe write or deferred fence signal satisfies a waiting segment's dependency, inserting a reusable global UAV barrier command list at each joined synchronization boundary. Guard coalescing against submission-phase ordering hazards (title memory copies or post-execution callbacks before explicit texture uploads; GPU writes or post-execution callbacks before deferred CPU reads) and cap joined submissions via VICTORY_JOIN_LISTS (default 64). Toggle with VICTORY_COALESCE_PIECES (default on unless "0").
… join boundaries Do not run can_join_batch between consecutive ready segments on the same queue that already ran together in a single host submission in legacy mode. Checking can_join on every intra-queue segment shredded multi-list graphics submissions whenever an earlier list had a GPU write or title copy and a later list in the same submission had a CPU copy/fill or texture upload. Restrict can_join checks to actual join boundaries (switching queues, crossing a BoP-satisfied wait, or crossing a deferred-signal fence wait), preserving full cross-queue BoP coalescing without spurious intra-queue splits.
|
Two new scheduler checks find an ordering problem at gdemontalivet’s exact #419 head. With a consumer waiting for A local change that checks the newest overlapping pending write before looking at CPU memory passes 19/19 scheduler tests, including both new cases. On M4 Pro / D3DMetal 4.0 beta 3, a separate generated guest list with two dependent buffer copies and an actual bottom-of-pipe cut reduced 2 fenced native submissions to 1, with both exact output words. That positive result held with the ordering change too. The overwrite checks ran in the CPU scheduler model. Prepared and tested with Codex. |
|
In-game check on an M5 Pro (macOS 27.0.1, CrossOver 26.3 Wine with the repo's current patches, D3DMetal 4.0 beta 3, Series X), with #439 and #419 together on
I didn't test them separately, so I can't say how the gain splits between them. Prepared with Claude Code. |
Summary
Item::Signaldelivery across queues insideHeld::pump_coalesced()(VICTORY_COALESCE_PIECES, default ON,0restores legacy per-queue pump;VICTORY_JOIN_LISTSdefault64).HostList::will_write(&ValueWait)andHostList::batch_flags()so held segments waiting on a bottom-of-pipe write or fence signal already queued in the current piece coalesce into the sameHost::executeinstead of triggering a separate submission, inserting a reusable globaluav_barrier()command list at each crossed synchronization boundary.Measured M5 Max (CrossOver / D3DMetal) Impact
17.5–18.0 → 11.0–12.0(-35% to -39%), coalescing 6–8 BoP waits per frame, and median GPU time dropped from107.5 ms → 89.2–90.8 ms(-17.0%).Verification
cargo xtask policy: passcargo test -p victory-gpu --lib hold::tests: 17/17 passed (including cross-queue BoP chain, hazard split, deferred signal/fence-wait, and same-queue non-split tests)cargo clippy --target x86_64-pc-windows-gnullvm --workspace --all-targets -- -D warnings(default &--features diagnostics): 0 warnings