Skip to content

4.1.0

Latest

Choose a tag to compare

@mmossg mmossg released this 01 Dec 16:22

Version 4.1.0 (December 1, 2026)

Significant new features

  1. Substantially improved CPU stepping performance in both double and single precision, averaging ~1.4x faster on x86-64
    and ARM64 across our benchmark suite, including ~1.3x (~1.6x ARM64) on Unitree G1 with hands, ~2.1x on ALOHA, and
    ~2.2x (~2.5x ARM64) on Shadow Hand. Continuous CPU performance across commits can be tracked at
    mjbench (maintained by @kevinzakka):

    • Portable SIMD infrastructure and vectorized kernels: Added a 4-wide SIMD layer (mjtNum4 in
      engine_simd.h; 6a6595c, d4c37d5) supporting AVX/FMA, ARM NEON, WebAssembly SIMD128, and a
      scalar fallback across both double and single precision (mjUSESINGLE, 298d367), replacing the legacy
      double-precision AVX-only BLAS header (e603d5f). Vectorized hot kernels across dense and sparse linear
      algebra (c4b0610, 17cb305, 6f5bbec, 596c94b, 90c2ad5), the primal
      solver and constraint regularization (6c9e627, 9995525, ec0384c), elliptic friction
      cone updates (dbf9a74), flex contact Jacobian rotation (d5f6b13), and broadphase/dynamic BVH
      bounding boxes (186f4dc, d6bcc2a).

    • Algorithmic and memory-layout optimizations: Fused contact Jacobian construction and direct sparse CSR contact
      assembly (09b8ea2, 09834d3, d7fda58), supernode-accelerated sparse matrix squaring,
      transposition, and matrix-vector products (681731c, 8148157, 020335c,
      fa6c9fb), 2-column/4-row blocked Cholesky updates (6054e3c), dense elliptic Newton Hessian
      folding and refactorization thresholds (c6ac133, 0c51e88), single-island fast paths
      (61659cf, 5e06cd0), PGS sweeps and fused Nesterov updates (72add57), faster inertia
      factorization and impedance assembly (05b1ae4, 5ad852a), radix-sort broadphase with single-pass
      projection frame (2787bae, 9742035), cached relative-frame OBB tests and streamlined BVH
      midphase traversal (27ebada), and warm-started convex mesh support queries and streamlined GJK simplex
      projection (6e384ac, 7bd0173).

  2. Extended spatial tendon wrapping in MuJoCo, MJX, and MuJoCo Warp with closed-form multi-idler
    chains and multi-turn spools:

    • fa79308f9 Wrapping chains: Consecutive cylinder geoms in the path of a
      spatial tendon, with no sites between them, model a tendon running over several idlers. The
      tendon is the shortest path that passes each cylinder on the side of its side site, computed in closed form, and it
      lifts off a cylinder and touches down again with continuous length and moment arm. The cylinders must have parallel
      axes and side sites, and the compiler checks that the idlers stay in one plane. See
      Wrapping chains and the
      idler elbow example. Below,
      the idler elbow at three angles of the elbow and the role of the side sites.

  • a40c5690f Spools: A cylinder geom in the path of a
    spatial tendon with the new turns attribute is a drum on a hinge
    joint that the tendon is anchored to and winds around by any number of turns. The number of turns follows from the
    angle of the hinge, so the tendon can be reeled in, paid out completely and wound the other way without additional
    state. Instead of a site, the drum can be followed by the idlers of a wrapping chain. See Spools and
    the winch example. Added
    mjWRAP_SPOOL and mjsWrap.turns. Below, a drum at three angles of the hinge and a fairlead
    displaced along the axis.

  1. b32846bba Added mju_QP, a dual active-set solver for dense convex quadratic programs with bounds and
    two-sided linear constraints. Constraints can be soft: a soft constraint holds exactly up to a threshold on its
    multiplier and then yields with a given compliance, so problems with soft constraints remain feasible. The solver can
    be warmstarted from a previous active set. The Hessian can be singular or zero (a linear program).

Engine

Warning

Breaking changes

  1. 69798e647 Cables, i.e. spatial tendons with
    springlength "0 L" and L > 0, now have a pull-only spring-damper.
    Previously the spring acted only beyond L but the damper always acted, so a slack cable was dragged by its
    damping and a taut one could push. Now the spring and damper combine into a smooth tension that is zero when
    slack, never negative and at most three times the spring force. A cable with zero stiffness now applies no force,
    including from its damping, and the compiler warns when such a cable is damped. Damped cables now also render as
    catenaries when slack. All other tendons are unchanged. This applies to MJX and MuJoCo Warp as well.

    Migration: To keep the previous behavior for lengths above a small $\epsilon > 0$, set
    springlength to "eps L" (for example "1e-6 L"; this disables catenary rendering and lets tensile
    plasticity shift the lower bound along with L). Otherwise, move slack damping to joints or a separate tendon.

  2. 7842fd7ca Removed the H field of mjContact and the flg_coneHessian parameter of
    mj_constraintUpdate, as the Newton solver now computes closed-form elliptic cone factors directly without
    materializing mjContact.H. The size of mjContact was reduced from 608 to 320 bytes (from 328 to 184
    bytes in single precision).

    Migration: Remove uses of mjContact.H and drop the trailing flg_coneHessian argument when calling
    mj_constraintUpdate.

  3. 06d5f051c Removed the per-geom/per-flex solmix attribute and the geom_solmix/flex_solmix
    model arrays, which weighted the arithmetic averaging of contact solver parameters. They were rarely used because
    arithmetic averaging is poorly suited to combining solver parameters; removing them also frees the solmix name
    for the new global option/solmix attribute below.

  1. Added global contact-parameter mixing options on option to control how equal-priority contacts
    combine per-geom and per-flex parameters (see Contact parameters):

    • 188926bab fricmix (mjOption.fricmix, mjtFricMix): selects the
      pairwise friction mixing rule (max, geometric, or min; default max).

    • 49adf9709 solmix (mjOption.solmix, mjtSolMix): selects how solref
      and solimp are combined (average or series; default average). The new series mode models two
      compliant surfaces in series so softer surfaces dominate physically and smooth (solimp[0] = 0) contact onset is
      preserved.

  2. 3e57ab8a6 Optimized elliptic friction cone Hessians in the
    Newton solver using closed-form rank-(dim - 1) factors (~5–30% faster elliptic Newton
    solves). Thanks to @adenzler-nvidia for proposing the optimization in MJWarp pull
    request 1879.

  3. 30c53c3d3 Optimized spatial tendon Jacobian computation (mj_tendon) and
    sparsity (mjModel.ten_J_colind) by stopping ancestor walks at the endpoints' lowest common ancestor, skipping
    shared ancestor DOFs whose contributions cancel (~7–22% faster stepping on MyoSuite musculoskeletal models). Thanks
    to @kaibohex for identifying the opportunity in MJWarp issue
    1733 and to @vishalkotak for the
    implementation in MJWarp pull request
    2014.

Deformables

  1. 64959ac81 Passive interpolated flexes are no longer
    reduced to mjMAXCONPAIR (50) contacts per geom via farthest-point selection, preventing contact-set churn and
    resting jitter when more than 50 surface vertices touch a geom (solver cost remains independent of contact count via
    aggregated contact CSR).

  2. 7b7fc90c6 Passive flex contacts now also handle
    collisions with moving and mocap rigid bodies (previously only flex-flex, self-collision, and static-geometry pairs
    took the passive path while moving-body pairs fell back to the constraint solver), scaling pair stiffness by the
    minimum participating effective mass and excluding active passive-contact free bodies from the decoupled free-body
    gyroscopic solve.

  3. 15c2f1183 Passive and IPC
    flex contacts with condim 3 or higher now model isotropic lagged
    Coulomb sliding friction using the pair's first friction coefficient (capped at the
    viscous slip threshold 1e-3 m/s). Previously, both modes ignored condim and were always frictionless.
    Existing models using passive or IPC flex contacts with condim >= 3 (the default) now experience contact
    friction; set condim="1" for frictionless behavior. In IPC mode, mjData.flexvert_lambda now stores the
    barycentrically weighted sum of touching pair multipliers (previously the maximum across touching pairs).

  4. 1554e7d3d, 5f99d0d25 Under the discrete integrator, the
    unconstrained smooth solve (qacc_smooth) now follows the selected solver: Newton
    solves $(M + S)\,\dot{v}_{\text{smooth}} = f$ directly by Cholesky (reusing the 3x3-block sparse factor on
    covered 1D/2D flexes and general sparse/dense Cholesky otherwise), eliminating mjWARN_INERTIA under-convergence
    on 3D passive contacts and speeding up stiff interpolated-flex mechanisms
    (model/flex/mechanisms/cantilever.xml ~3.3x faster). Under CG, the smooth solve for 3D and interpolated
    flexes uses symmetric Gauss-Seidel (Eisenstat) preconditioning instead of diagonal
    preconditioning, reusing the assembled stiffness matrix in place with zero extra arena memory (cutting smooth-solve
    iterations 2-3x and speeding up stepping by ~15% on model/plastic/clay.xml, and up to ~1.9x on unconstrained 3D
    tetrahedral meshes).

  5. f9420c6da Fixed effective-metric PCG stalls and spurious mjWARN_INERTIA warnings on 2D flexes with
    passive contacts by including fully covered passive flex contacts in the sparse Cholesky preconditioner. Previously,
    passive flex contacts were omitted from the preconditioner, causing the implicit solve to stall or under-converge on
    stacked cloth scenes (2.1-2.7x faster on drape.xml; existing models with passive flex contacts can change
    trajectory due to the more accurate solve).

  6. 73327e000 Added mjModel.flex_cellempty (nflexcell x 1) and mjModel.flex_celladr, flagging the
    empty (pruned) cells of interpolated flexes. Points of an interpolated flex, such as contact points, are now
    evaluated in their active cell: their natural cell, or the nearest non-empty cell if it is empty, consistently with
    the vertex positions (flex_vertcell). Previously contact weights near pruned cells could weight the pinned nodes
    of the empty cell.

  7. 630212fbb Fixed capsule collision against 2D flexes missing contacts along the
    capsule shaft (when crossing triangle edges, lying coplanar with a triangle, or piercing a triangle interior) and
    fixed a NaN for zero-length capsules and degenerate triangles. Existing models with capsule--2D-flex contacts can
    change behavior. mjModel.flex_edgeflap is now populated for all 2D flexes, not only those with bending, so that
    interior shared edges do not generate opposing contacts. Code that used a valid flap to detect bending must check
    mjModel.flex_bendingadr instead.

Rendering

  1. d0def6e64 Added Kannala-Brandt fisheye projection and camera lens distortion coefficients:
    projection now supports fisheye via mjPROJ_FISHEYE, and
    distortion specifies up to mjNDISTCOEF = 8 coefficients for fisheye and
    perspective cameras via mjsCamera.distortion and mjModel.cam_distortion.

Warning

Breaking changes

  1. ca95109ec Fixed some Filament-specific rendering options that were not working as intended. These
    changes will affect the way all models are rendered by the Filament renderer.

    • The principal fix was to interpret material RGBA color values as linear colors instead of sRGB colors. This
      ensures that material colors defined in the model will match any texture colors also defined in the model. For
      example, the following two materials now appear identical (whereas previously they would not):
<texture name="tex" rgb1="0.1 0.2 0.3" builtin="flat" />
<material texture="tex" />
<material rgba="0.1 0.2 0.3 1.0" />
  Because the above change can affect any model, other long-standing issues with the default rendering settings
  were fixed in the same release, so that their impact is concentrated in a single release.

- The tonal ranges for shadows, midtones, and highlights have been updated to a neutral weight. Previously, the
  weights were incorrectly set to 1.0, resulting in oversaturated colors. As a result, scenes may now appear
  darker and light intensities may need to be increased to compensate.

- The tone mapping and output color spaces for scenes without physical lights are now set to linear space
  instead of sRGB. (Recall that scenes without physical lights are rendered using a fallback lighting model
  [as described here](https://mujoco.readthedocs.io/en/stable/programming/rendering.html#reFilamentFallbackLighting).) Before this change, you may have noticed that such
  scenes appeared "washed out" when rendered with the filament renderer compared to the classic renderer. To
  compensate for the darker scenes in these scenarios, the default intensity of the headlight and environment
  light has also been adjusted.

- The quality levels of the ambient occlusion settings have been reduced to match filament's recommended
  defaults. This change is less likely to be noticed visually and was included to improve performance.

**Migration:** Add the following to your model to revert back to previous defaults:
<custom>
   <text name="filament.material.base_color_type" data="srgb" />
   <text name="filament.cg.output_color_space"    data="srgb" />
   <text name="filament.cg.tone_mapping"          data="pbr_neutral" />
   <text name="filament.ao.quality"               data="ultra" />
   <text name="filament.ao.low_pass_filter"       data="ultra" />
   <text name="filament.ao.upsampling"            data="ultra" />
   <numeric name="filament.cg.shadows"            data="1 1 1 1" />
   <numeric name="filament.cg.midtones"           data="1 1 1 1" />
   <numeric name="filament.cg.highlights"         data="1 1 1 1" />
   <numeric name="filament.fallback.head_light_intensity" data="100000" />
   <numeric name="filament.fallback.scene_light_intensity" data="80000" />
   <numeric name="filament.fallback.environment_light_intensity" data="5000" />
   <numeric name="filament.fallback.environment_light_diffuse_scale" data="1" />
</custom>
Note that the `cg.output_color_space`, `cg.tone_mapping`, and all the `fallback` settings are only needed for
scenes without physical lights.
  1. ed8323d45 Orthographic free and tracking cameras now derive their vertical view height from the camera
    distance and global/fovy (matching the perspective view height at the lookat point)
    and place the eye behind the model's bounding sphere so zooming scales the view without near-plane clipping.
    Previously, global/fovy was used directly as a fixed view height in length units (45 by default), so zooming
    had no visible effect and toggling orthographic made the view jump. Fixed orthographic cameras
    (camera/fovy) are unchanged. In Studio and simulate, the Free Camera
    field-of-view control shows the vertical view height in length units while in orthographic mode, and editing it
    changes the camera distance rather than global/fovy. For these cameras mjv_cameraFrustum now returns a
    vertical extent that depends on mjvCamera.distance.

    Migration: Models that set global/fovy to a length for an orthographic free camera now render zoomed in.
    Set global/fovy back to an angle in degrees (the default is 45); the view height then follows the camera
    distance.

  2. e11f9e4c0 Planar reflections in the Filament renderer are now energy conserving: diffuse base color is
    attenuated by one minus the Fresnel reflection weight (dielectrics only; metals are unchanged), so a surface with
    reflectance="1" is a pure mirror regardless of its base color. Previously, reflections were added on top of
    the fully lit diffuse surface, washing out reflections on bright materials.

  1. 4019e053c Added mjGEOM_DISC rendering-only geom type for flat double-sided discs and
    annuli (size = [r_out, r_in, 0]).

  2. 2a860e53f Added mjvOption.offset, an offset added to simulation coordinates when rendering, so that
    several simulations of one model can be drawn side by side.

  3. 77718b1fc Added image_diffuse_scale to mjrfLightParams to control the diffuse colour of image
    based lights.

  4. 6b907360c Fixed Filament planar reflections leaking geometry behind or crossing the mirror plane by
    clipping the reflection camera at the mirror plane with an oblique near-plane projection (#3902).

  5. 3f8569e2b Builtin textures with mark="cross" now draw a 2-pixel wide cross on even-sized textures so
    that it is centered.

Compiler

  1. bbaec528d Sequentially appending elements to an mjSpec body tree now runs in $O(1)$ instead
    of rebuilding the model's tree lists, making procedural model construction up to ~250x faster.

  2. 50c5900d7 Added the facetexcoord attribute to mesh and
    updated XML saving to emit it when mjsMesh.userfacetexcoord is set. Previously, saving an inline textured mesh
    with per-corner UVs dropped userfacetexcoord, causing the saved XML to fail compilation or map UVs to the wrong
    corners (#3931, reported by @andrewkaufman).

  3. da306ace5 strippath no longer strips file names that match a registered
    resource provider, such as package:// URIs. These names are not filesystem paths, and the
    compiler already treats them as absolute when combining them with meshdir.

Plugins

  1. da306ace5 Added a first-party resource provider plugin, plugin/package_uri, that
    serves ROS-style package:// URIs by locating packages through AMENT_PREFIX_PATH and ROS_PACKAGE_PATH
    without depending on ROS. It is not included in release packages: build it from source and load the resulting shared
    library with mj_loadPluginLibrary before parsing a model, so that URDF and MJCF files can reference ROS
    package assets unchanged. Contribution by @noah-wardlow.

OpenUSD

  1. 2f754ec82 The native C++ OpenUSD exporter and LayerSink now author
    xformOp:translate (double3) and xformOp:orient (quatd) instead of xformOp:transform
    (matrix4d), avoiding shear artifacts when USD or external renderers interpolate between time samples.

Models

  1. 9a1af89e6 Upgraded the 3x3x3 cube
    example model with calibrated mass and inertia, flush outer collision hulls, and an internal drive and 90-degree
    detent mechanism. Standalone defaults now use timestep="0.002", the discrete
    integrator, cone="elliptic", and face motor ctrlrange="-0.45 0.45" (previously
    timestep="0.01", integrator="implicitfast", and ctrlrange="-0.05 0.05"; motor commands must now exceed
    the ~0.17 N*m breakaway torque).

Bug fixes

  1. 36a33b4f4 Fixed a memory leak in mujoco-core (introduced in 4.0.0) where import mujoco without
    glfw installed stored the ImportError in mujoco.rendering.classic.gl_context and kept every local
    variable on the importing call stack alive for the life of the process (#3928, reported by
    @adenzler-nvidia).

  2. 026907613 Fixed capsule-box collisions when the capsule's centerline intersects the box, which could miss
    the contact.

  3. ce23b6e70 Fixed floating-point cancellation and non-orthogonal fallback frames in mju_makeFrame and
    mjc_PlaneCylinder for plane-capsule and plane-cylinder contacts on tilted planes. Previously, axes parallel or
    nearly parallel to a tilted plane normal could produce non-orthogonal or singular contact frames and inaccurate
    contact depths (especially in single precision). Discovered via MJWarp issue
    1949 and pull requests
    1950 (@YannBerthelot) and
    1989 (@etaoxing).

  4. 82196b63e Under the discrete integrator, negative flex
    damping is clamped to zero in the effective metric, like negative joint and tendon
    damping, and its force is integrated explicitly. Previously it made the metric indefinite.

  5. 82196b63e Under the discrete integrator, the ellipsoid
    fluid model contributes the dissipative part of its drag derivative to the effective metric. The
    symmetrized derivative used before is indefinite for slender shapes at small angles of attack.

  6. 3f8569e2b Fixed Filament cube textures with texuniform being scaled inversely; they now match the
    classic renderer.