Repository navigation
Fat bounds: the convex kinds' own boxes, inline - #241
Merged
Merged
Conversation
Every awake body's shapes get their fat bounds in finalize each step, and compute_fat_shape_aabb went through compute_shape_aabb, whose dispatch over every kind stays a call with its transform and box through memory. The hull, the sphere and the capsule now take their own small bounds there, which inline; the rest keep the call. Pinned, best of five: many pyramids 14.90 to 14.33 ms a step (median 15.77 to 14.97), the convex pile 9.88 to 9.79; the large pyramid and sleep within noise. Bits unchanged.
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.
Progress at a glance
compute_fat_shape_aabbhandles hulls, spheres and capsules directly; other kinds keep the general dispatchWhy
Finalize computes every awake body's fat shape bounds each step. In many pyramids, finalize was 40% behind Box3D (439 samples against 314). Most of that was the bounds going through
compute_shape_aabb: its dispatch over every shape kind stays an out-of-line call, and the 56-byte transform and the box travel through memory. The convex kinds' own bounds functions are small, so called directly they inline.Numbers
Pinned, best of five (median in brackets), ms per step:
Also tried
Removing the prepare stage's prefetch loops changed nothing beyond about 1% of noise either way, so they stay.