Repository navigation
Collide as the reference keeps it: encoded body sims on the contact, dense fat boxes (#121) - #140
Merged
Merged
Conversation
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.
Ports two pieces of Box3D
e77352c's collide pass that were missing (#121):encodedBodySimA/B): the awake index for an awake body, -(index + 2) for a static one,NULL_INDEXotherwise. They are kept current wherever a sim moves, as the reference does: contact creation, entering the graph, wake, sleep, and the sim swapped into a destroyed or transferred body's place (refresh_body_contact_indices, the reference'sb3RefreshBodyContactIndices). The collide pass and both contact prepares read them instead of going shape, body, set, sim and rewriting the indices every step. A sleeping body's sim is found through the body (resolve_contact_body_sim, the reference'sb3ResolveContactBodySim).World.fat_aabbsby shape id, the reference'sfatAABBs): the overlap test reads two entries of a dense array, and a recycled contact never touches its shapes.Nothing is computed differently: the golden determinism trace (1136 steps) and every benchmark checksum are unchanged.
Edge cases:
validate_solver_setsnow checks every contact's encodings against its bodies (asb3ValidateSolverSetsdoes), so every existing test that validates covers them. A newtest_encoded_simsintests/test_edge_cases.aedrives each path that moves a sim, validating after every step: islands sleeping and waking one at a time, a non-touching contact between an awake body and a sleeping one, a static and an awake sim swapped into a destroyed body's place, kinematic and back, disabled and enabled. Leaving out the refresh on a destroy fails 4 of its checks, and leaving out the wake fixup fails 8.Pinned to one core, 5 runs each rotated, ms per step (median):
e77352c, AVX2Collide is level with the reference on the large pyramid and ahead on the many pyramids. The scenes stand at 1.2x, 1.15x and 1.05x; the mixed pile at 1.26x, its collide still behind because more of its contacts compute manifolds afresh in double. The rest of #121 is the lanes (aether#2550), the prepare, and the pairs' double tree.
Local gate on Aether 0.794.0: every suite passes and the golden trace matches bit for bit. Pins: Aether 0.794.0 and aeb v0.325, the latest releases.
Refs #121.