bench/compound.ae (PR #10): 100,000 rays through a compound of 2,000 children run at 2.9x the reference (75 vs 26 ms), while the same children's own casts (sphere, capsule, hull) sit at parity to 1.5x. A probe with a visitor that does nothing puts the time in dynamic_tree.tree_ray_cast: 77 ms for 520,000 leaf visits, about 150 ns per leaf. bench/dynamic_tree.ae showed the same cast at 1.9x on a sparser scene (13.4 vs 7.2 ms).
Suspects: the per-node segment-box test plus test_bounds_ray_overlap on 48-byte double boxes against the reference's SIMD slab test; the nodes[index].aabb.lower/upper and proxies[proxy_id] struct copies per visit; the closest-first ordering computing two centres per pair.
To do: profile the traversal with the -finstrument-functions shim on the compound scene, compare node and leaf visit counts with the reference's (b3DynamicTree_RayCast returns them too), try reading the box fields directly and a fused slab test, and bring the cast to the box query's 1.3x. The box cast (tree_box_cast) shares the structure and should follow.
bench/compound.ae(PR #10): 100,000 rays through a compound of 2,000 children run at 2.9x the reference (75 vs 26 ms), while the same children's own casts (sphere, capsule, hull) sit at parity to 1.5x. A probe with a visitor that does nothing puts the time indynamic_tree.tree_ray_cast: 77 ms for 520,000 leaf visits, about 150 ns per leaf.bench/dynamic_tree.aeshowed the same cast at 1.9x on a sparser scene (13.4 vs 7.2 ms).Suspects: the per-node segment-box test plus
test_bounds_ray_overlapon 48-byte double boxes against the reference's SIMD slab test; thenodes[index].aabb.lower/upperandproxies[proxy_id]struct copies per visit; the closest-first ordering computing two centres per pair.To do: profile the traversal with the
-finstrument-functionsshim on the compound scene, compare node and leaf visit counts with the reference's (b3DynamicTree_RayCastreturns them too), try reading the box fields directly and a fused slab test, and bring the cast to the box query's 1.3x. The box cast (tree_box_cast) shares the structure and should follow.