perf(gpu): cut thin hoist/heap_order stalls, skip no-op uploads, and coalesce ranges #13
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/MahanYTT--VIctory-MA!13
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-13"
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?
@MahanYTT on GitHub · 2026-12-04 18:42 UTC · original
MahanYTT:perf/thin-hoist-heap-order→mega-upgrade-v3· +302 −56 · 2 files · 1 commits · merged 2026-12-04 20:18 UTCSummary
Addresses the submit-thread stalls, no-op texture upload claims, and redundant work observed in
victory-ma-play-20261204-165800-18832.log:Changes
crates/victory-gpu/src/texture/hoist.rsVICTORY_THIN_UPLOAD_WAIT_USfrom50_000µs (50 ms) to500µs (0.5 ms), preventing 32.9 ms single-frame stalls while still catching fast passes (env override preserved).EPOCH_SLOTS = 8): Replaces the 2-slot toggle so a single timed-out slow pass no longer re-stalls every alternating submission while finishing.Hoist::take()returns immediately whentotal_open == 0 && queued == 0without locking or callingInstant::now(), skipsqueuelock when empty, handlesDuration::ZEROwithout condvar/timer overhead, and measures only actual condvar wait time.needs_hoistskips already-uploaded clean textures (uploaded && !dirty), already-hoisted uploads, and host-written textures at bothpush()andtake()(their own list still refreshes them inprelude_uploads).Hoist::push_uniquededuplicates queued uploads perArc<Staging>pointer within each batch.crates/victory-gpu/src/host/heap_order.rsVICTORY_THIN_HEAP_WAIT_US(falling back toVICTORY_THIN_UPLOAD_WAIT_US, defaulting to250µs) so asyncvictory-asidebuffer sweeps (2–12 ms) no longer block the submit thread for 11.7 ms.push()filters empty ranges up front;steps()consumesVec<Pass>by value (eliminating 545k+ redundantArc<Shadow>clones) and coalesces overlapping/adjacent(from, to)ranges per shadow when multiple passes accumulate.copies.splice(0..0, steps)with direct assignment whencopiesis empty orsteps.append(copies)otherwise.Verification
cargo clippy --target x86_64-pc-windows-gnu -p victory-gpu -- -D warnings: 0 warnings, 0 errors.cargo clippy --target x86_64-pc-windows-gnu -p victory-gpu --tests -- -D warnings: 0 warnings, 0 errors.rustc --edition 2024 --testexecution of all 12 unit tests coveringHoist<T>,push_unique,needs_hoist_state,zero_limit_times_out_immediately,epochs_alternate, andcoalesce_ranges: 12/12 passed.