perf(victory-gpu): single-lock indirect::learn, O(1) clean check, and zero-HashMap sanitize pass #405
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!405
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-405"
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:35 UTC · original
Lewandox:perf/indirect-single-lock-and-fast-san→main· +60 −14 · 2 files · 1 commits · closed without mergingSummary
Reduces per-draw CPU overhead and removes temporary
HashMapchurn on the indirect-draw sanitization path (third_party/victory/crates/victory-gpu/src/indirect.rs):learn():learn()lockedLEARNED, calledcontains_key(&at), dropped the lock, then immediately re-lockedLEARNEDto prune andinsert(at, (kind, frame)).LEARNEDonce, prunes on frame change, and checksinsert(...).is_none()to count unseen records — cutting mutex acquisitions andBTreeMaplookups in half on every indirect draw.San::is_clean():self.writes, even when no write had been declared since the sanitize pass (s == self.seq).s == self.seq.HashMapdisjoint range collection inpass():coalesce_ranges) before queryingLEARNED(BTreeMap::range), collecting(at, kind)directly in ascending address order without allocating a temporaryHashMap(also giving the GPU sanitize compute shader monotonically increasing buffer offsets).indirect/san_tests.rs):coalesce_rangesmerges overlapping/adjacent ranges and preserves disjoint intervals.learn()prunes entries older than two frames and counts unseen records once per sight under a single lock.Verification
cargo test -p victory-gpu --lib indirect::(default and--features diagnostics)cargo xtask policyinsidethird_party/victory@Lewandox on GitHub · 2026-11-26 19:16 UTC · original
Closing as superseded after #409 (\indirect.rs\ was rewritten around the GPU compute clamp shader and \indirect::batch, replacing the old CPU sanitize path).
Pull request closed