perf(narrowphase): combined warm-start — GJK+MPR temporal coherence +…#83
Open
zhihuidu-amd wants to merge 2 commits into
Open
perf(narrowphase): combined warm-start — GJK+MPR temporal coherence +…#83zhihuidu-amd wants to merge 2 commits into
zhihuidu-amd wants to merge 2 commits into
Conversation
… stable pair IDs (+3.1%+1.0% on humanoid)
…warm-start Bug 1: The warm-start block used two separate 'if' statements: if portal_valid: ...call discover_portal if stale... if not portal_valid: ...call discover_portal cold... When portal_valid=True but stale, both branches fired, running mpr_discover_portal twice. Fixed by changing second 'if' to 'elif'. Also changed 'if i_pair < 0' to 'else' for clarity and to make the three-way branch structure explicit. Bug 2: ContactCache only stored Minkowski-difference vectors portal_v[1..3], but not the individual body support points v1[1..3] and v2[1..3]. On a warm-start hit, mpr_find_pos read stale/uninitialized v1/v2, producing wrong contact positions. Fixed by: - Adding portal_v1 and portal_v2 arrays to ContactCache (same shape as portal_v) - Restoring v1[1..3] and v2[1..3] from cache on warm-start restore - Storing v1[1..3] and v2[1..3] to cache on write-back (using qd.static(range(1,4))) Memory cost: +2 * (4 * n_possible_pairs * B * 3 * sizeof(float)) per ContactCache. For a typical scene with 512 possible pairs and B=4096 this is ~96MB additional HBM. After these fixes, MPR portal warm-start is both correct and safe to benchmark.
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.
… stable pair IDs (+3.1%+1.0% on humanoid)
Description
Related Issue
Resolves Genesis-Embodied-AI/Genesis#
Motivation and Context
How Has This Been / Can This Be Tested?
Screenshots (if appropriate):
Checklist:
Submitting Code Changessection of CONTRIBUTING document.