Skip to content

Optimize collision traversal and add arena memory modes#69

Open
VirxEC wants to merge 14 commits into
ZealanL:v3-rustfrom
VirxEC:bvh-opt
Open

Optimize collision traversal and add arena memory modes#69
VirxEC wants to merge 14 commits into
ZealanL:v3-rustfrom
VirxEC:bvh-opt

Conversation

@VirxEC

@VirxEC VirxEC commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the binary BVH with BVH4 and optimize collision/raycast traversal.
  • Reduce hot-path work through packed broadphase keys, cached wheel contact velocity, filtered ray candidates, and more compact collision layouts.
  • Add Heavy, Balanced, and Light arena memory modes:
    • Heavy prioritizes throughput.
    • Balanced cuts per-arena memory with ~1–3% overhead.
    • Light effectively disables grid partitioning for minimum memory.
  • Clean up and restrict internal physics/math APIs.

Performance

stress_v3 throughput improves from 577k TPS to 660k TPS (~14%).

Memory modes reduce marginal active-arena memory from roughly 915–946 KiB in Heavy to:

  • Balanced: 108–123 KiB (same as the old light mode)
  • Light: 66–91 KiB

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