Repository navigation
perf(victory-gpu): single-lock indirect::learn, O(1) clean check, and zero-HashMap sanitize pass - #405
Closed
Lewandox wants to merge 1 commit into
Closed
perf(victory-gpu): single-lock indirect::learn, O(1) clean check, and zero-HashMap sanitize pass#405Lewandox wants to merge 1 commit into
Lewandox wants to merge 1 commit into
Conversation
…hurn in sanitize pass
Collaborator
Author
|
Closing as superseded after #409 (\indirect.rs\ was rewritten around the GPU compute clamp shader and \indirect::batch, replacing the old CPU sanitize path). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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