Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco MJWarp Island

From Leeroopedia
Knowledge Sources
Domains Physics_Simulation, GPU_Computing, NVIDIA_Warp
Last Updated 2026-02-15 04:00 GMT

Overview

MJWarp Island computes tree-tree adjacency from constraint Jacobians for island detection in the constraint solver.

Description

This module computes the tree-tree adjacency matrix that identifies which kinematic trees are coupled by constraints. It launches a GPU kernel that examines each effective constraint row and determines which pairs of kinematic trees it connects. The module handles equality constraints (connect, weld, joint, tendon, flex), joint friction and limits, and contact constraints. For generic constraints, it scans the full Jacobian row to find non-zero entries and their corresponding trees. The resulting adjacency matrix is used to identify independent constraint islands that can be solved in parallel.

Usage

Called by the solver system when island-based constraint solving is enabled. The tree_edges function populates a tree-tree adjacency matrix that identifies coupled kinematic subtrees.

Code Reference

Source Location

Key Functions

# Primary entry point
def tree_edges(m: Model, d: Data, tree_tree: wp.array3d(dtype=int))

# GPU kernel for finding tree edges from constraints
@wp.kernel
def _tree_edges(
    nv, body_treeid, jnt_dofadr, dof_treeid,
    geom_bodyid, site_bodyid,
    eq_type, eq_obj1id, eq_obj2id, eq_objtype,
    nefc_in, contact_geom_in, efc_type_in, efc_id_in, efc_J_in, njmax_in,
    tree_tree)

Import

from mujoco.mjx.third_party.mujoco_warp._src.island import tree_edges

I/O Contract

Inputs

Name Type Required Description
m Model Yes Warp model with kinematic tree structure and body/joint/geom mappings
d Data Yes Warp simulation data with constraint Jacobians, types, and contact pairs

Outputs

Name Type Description
tree_tree wp.array3d(dtype=int) Tree-tree adjacency matrix (nworld x ntree x ntree)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment