Skip to content

Fat bounds: the convex kinds' own boxes, inline - #241

Merged
nicolas-maman merged 1 commit into
mainfrom
fat-aabb-fast
Nov 25, 2026
Merged

nicolas-maman merged 1 commit into
mainfrom
fat-aabb-fast

Conversation

@nicolas-maman

Copy link
Copy Markdown
Collaborator

Progress at a glance

  • compute_fat_shape_aabb handles hulls, spheres and capsules directly; other kinds keep the general dispatch
  • Full local suite on Aether 0.945.0: green, golden trace bit for bit, no warnings

Why

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:

Scene main this PR
many pyramids 14.90 (15.77) 14.33 (14.97)
convex pile 9.88 (9.92) 9.79 (9.85)
large pyramid 6.07 (6.22) 6.11 (6.20)
sleep 1.93 (1.95) 1.91 (2.00)

Also tried

Removing the prepare stage's prefetch loops changed nothing beyond about 1% of noise either way, so they stay.

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.
@nicolas-maman
nicolas-maman merged commit 0a41eda into main Nov 25, 2026
3 checks passed
@nicolas-maman
nicolas-maman deleted the fat-aabb-fast branch November 25, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant