Skip to content

dynamic_tree ray cast runs at 2-3x the reference; the time is in the traversal itself #11

Description

@nicolas-maman

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions