Skip to content

Fix island discovery with multiple coupled trees#3088

Open
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/island-edge-array-small
Open

Fix island discovery with multiple coupled trees#3088
Ashutosh0x wants to merge 1 commit intogoogle-deepmind:mainfrom
Ashutosh0x:fix/island-edge-array-small

Conversation

@Ashutosh0x
Copy link
Contributor

This Pull Request fixes a crash in the MuJoCo engine when loading models with equality constraints that couple many bodies (e.g., complex tendon equalities).

The Problem

During island discovery, the engine builds an adjacency graph of bodies (trees). The temporary edge array was sized to hold at most
J (number of non-zeros in the constraint Jacobian) edges. However, when a single constraint row involves $ distinct trees, it can contribute up to (k-1)$ edges to the graph. If (k-1) > k$, the edge array can be too small even if \le nJ$.

The Fix

Increased the size of the temporary edge array from
J edges to 2nJ edges (and 4nJ integers). This provides a safe upper bound for any configuration of constraints.

Fixes #3073

When a constraint row involves multiple trees (e.g., in a complex tendon equality), the number of edges added to the adjacency graph can exceed the number of non-zeros in the Jacobian row.

This change increases the size of the temporary edge array to 2*nJ edges (4*nJ integers), ensuring sufficient space for graph construction.

Fixes google-deepmind#3073
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.

Engine Error when loading an equality constraint that couples two fixed tendon lengths

1 participant