perf(victory-gpu): eliminate no-op refresh flushes, offload post-send list reset, and coalesce MakeResident waits #16
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!16
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-16"
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:54 UTC · original
MahanYTT:perf/host-noop-refreshes→mega-upgrade-v3· +468 −115 · 1 files · 1 commits · merged 2026-12-04 20:18 UTCSummary
Addresses three submitting-thread and allocation-path bottlenecks observed in
victory-ma-play-20261204-165800-18832.log(RTX 5070 Ti 16 GB, 1440p DLSS Quality + FG 2x), modifying onlycrates/victory-gpu/src/host.rs:Early no-op refresh filtering & zero-alloc bitmask sifting (
refreshes 3.6 ms in 28 flushes of 13,977, 12,995 no-op / 93%):watch::aheadonce per kept submission (Batch::begin_kept_snap/ reused fromrefresh_front_spans) and filters known no-ops directly inBatch::add()before hashing intoindex, cloningArc<Shadow>, or queuing intorefreshes.Batch::clean(invalidated ontitle_written,flush_one, andStep::Run/ask_once_end, never bridging disjoint gaps viamerge_clean_span) and skips redundant re-filtering inBatch::flush_all()whenall_filteredholds.Vec<AtomicBool>allocations insift_indexed_withandsift_spans_withwith a reusable cache-line-paddedVec<KeepWord>(#[repr(align(64))]) 64-bit mask (64x fewer atomic stores, zero false sharing, single-branch skip for all-zero 64-item chunks).Offload post-send flight/list reset off the submitting thread (
1.9 ms/frameinAFTER_SEND):victory-late-wait(late_helper) started (HELPER_RUNNING).Host::send_late(), avoids synchronously runningland()andbury()on the submitting thread whenlate_helperis running (pokinglate_helperunder the existingLINElock whenlanded.len() > bury_lag()), falling back to synchronous execution only if the helper thread failed to start.Coalesce
MakeResidentmapping waits (VICTORY_WAIT_RESIDENT) (20,000 times, only 17 coalesced, 1,798.2 ms):MappedBarrier::mark_needed,has_pending, andflush_pending.mapped()copy-queue fence waits untilsettle()runs before writing a shader-visible descriptor heap slot (VICTORY_DEFER_MAPPED=0restores immediate per-allocation waits), coalescing sequential allocations into a single GPU round-trip while preserving WDDM paging-queue ordering for lists submitted afterMakeResident.Verification
cargo clippy --lib --tests -p victory-gpu --target x86_64-pc-windows-msvc -- -D warnings: 0 warnings, 0 errorsrustc --edition 2024 --test): 4 passed, 0 failedmapped_barrier_defers_and_coalesces_sequential_allocationssync_land_after_send_only_when_not_apart_and_no_helpermerge_clean_span_never_bridges_unchecked_gapscompact_by_bitmask_skips_zero_chunks_and_preserves_order