Skip to content

Avoid per-step state allocations in static revolute and wheel joints - #102

Open
edwardgushchin wants to merge 2 commits into
ikpil:mainfrom
edwardgushchin:codex/revolute-static-state-allocation
Open

edwardgushchin wants to merge 2 commits into
ikpil:mainfrom
edwardgushchin:codex/revolute-static-state-allocation

Conversation

@edwardgushchin

@edwardgushchin edwardgushchin commented Sep 30, 2026 •

Copy link
Copy Markdown

With a static and dynamic body connected by a revolute or wheel joint, warm-start and solve each clone the static identity body state even though those branches only read it. In a four-substep downstream fixed step, either active joint allocated 576 managed bytes per frame.

Reuse the existing identity state in those four branches. Dynamic-body writes remain guarded by the dynamic flag. Downstream warmed revolute and wheel joint tests now measure zero managed bytes over 64 active frames each.

Validation: dotnet test test/Box2D.NET.Test/Box2D.NET.Test.csproj -c Release -f net10.0 --no-restore (199 passed). An earlier complete multi-target run passed 199 tests on net8.0 and net10.0 but could not run net9.0 because that runtime is not installed locally.

@edwardgushchin edwardgushchin changed the title Avoid per-step allocations for static revolute joints Avoid per-step state allocations in static revolute and wheel joints Sep 30, 2026
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