Repository navigation
Support search without a division or spills; a tiny bench scene - #238
Merged
Merged
Conversation
tiny is a ground box and eight resting spheres that never sleep, so a step's fixed cost is most of what is timed (ours 3.77 us, Box3D 3.52, pinned). Both suites print each colour's constraint count after a scene; the two colour every scene the same.
find_hull_support_vertex started from -infinity, which is a division on every call (1.0 / 0.0 written in the source), and its reduction read the lanes at a loop's index (a spill and a reload each) and converted every lane's index through the checked float-to-int path. Now it starts from -FLT_MAX as the reference does, reads the four lanes at fixed indices and keeps the indices as floats until one conversion at the end. The manifold's edge search starts from FLT_MAX as the reference's does. Pinned: trees25 2.5% faster, the convex pile 1.1%, the junkyard 1.9%. 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
-FLT_MAX, as Box3D does, instead of a run-time-infinitydivisionFLT_MAX, as Box3D's doestinybench scene on both sides (ground plus 8 resting spheres, never sleeping)Why
The hull support search was 2.4 times slower per call than Box3D's in trees25 (385 samples against 161), and the compiled code showed three costs:
-infinity, and1.0 / 0.0in the source is adivsson every call.Box3D starts from
-FLT_MAXand indexes plain arrays.Numbers
Pinned to one core, best of four, ms per step:
Bench additions
tinymeasures a step's fixed cost: ours 3.77 µs against Box3D's 3.52, pinned.