4.1.0
最新
GitHub Release Homebrew 收录
Version 4.1.0 (December 1, 2026)
Significant new features
-
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 (
mjtNum4inengine_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).
-
-
Extended spatial tendon wrapping in MuJoCo, MJX, and MuJoCo Warp with closed-form multi-idler chains and multi-turn spools:
-
fa79308f9Wrapping 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. -
a40c5690fSpools: 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 andmjsWrap.. Below, a drum at three angles of the hinge and a fairlead displaced along the axis.turns
-
-
b32846bbaAddedmju_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
69798e647Cables, i.e. spatial tendons with springlength"0 L"andL > 0, now have a pull-only spring-damper. Previously the spring acted only beyondLbut 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
springlengthto"eps L"(for example"1e-6 L"; this disables catenary rendering and lets tensile plasticity shift the lower bound along withL). Otherwise, move slack damping to joints or a separate tendon.
7842fd7caRemoved theHfield ofmjContactand theflg_coneHessianparameter ofmj_constraintUpdate, as the Newton solver now computes closed-form elliptic cone factors directly without materializingmjContact.. The size ofH mjContactwas reduced from 608 to 320 bytes (from 328 to 184 bytes in single precision).Migration: Remove uses of
mjContact.and drop the trailingH flg_coneHessianargument when callingmj_constraintUpdate.
06d5f051cRemoved the per-geom/per-flexsolmixattribute and thegeom_solmix/flex_solmixmodel 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 thesolmixname for the new global option/solmix attribute below.
-
Added global contact-parameter mixing options on option to control how equal-priority contacts combine per-geom and per-flex parameters (see Contact parameters):
-
188926babfricmix (mjOption.,fricmix mjtFricMix): selects the pairwise friction mixing rule (max,geometric, ormin; defaultmax). -
49adf9709solmix (mjOption.,solmix mjtSolMix): selects howsolrefandsolimpare combined (averageorseries; defaultaverage). The newseriesmode models two compliant surfaces in series so softer surfaces dominate physically and smooth (solimp[0] = 0) contact onset is preserved.
-
-
3e57ab8a6Optimized 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. -
30c53c3d3Optimized spatial tendon Jacobian computation (mj_tendon) and sparsity (mjModel.) 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.ten_J_colind
Deformables
-
64959ac81Passive interpolated flexes are no longer reduced tomjMAXCONPAIR(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). -
7b7fc90c6Passive 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. -
15c2f1183Passive 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 threshold1e-3m/s). Previously, both modes ignoredcondimand were always frictionless. Existing models using passive or IPC flex contacts withcondim >= 3(the default) now experience contact friction; setcondim=for frictionless behavior. In IPC mode,"1" mjData.now stores the barycentrically weighted sum of touching pair multipliers (previously the maximum across touching pairs).flexvert_lambda -
1554e7d3d,5f99d0d25Under thediscreteintegrator, the unconstrained smooth solve (qacc_smooth) now follows the selected solver:Newtonsolves $(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), eliminatingmjWARN_INERTIAunder-convergence on 3D passive contacts and speeding up stiff interpolated-flex mechanisms (model/~3.3x faster). Underflex/ mechanisms/ cantilever. xml 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% onmodel/, and up to ~1.9x on unconstrained 3D tetrahedral meshes).plastic/ clay. xml -
f9420c6daFixed effective-metric PCG stalls and spuriousmjWARN_INERTIAwarnings 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 ondrape.; existing models with passive flex contacts can change trajectory due to the more accurate solve).xml -
73327e000AddedmjModel.(flex_cellempty nflexcell x 1) andmjModel., 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_celladr flex_vertcell). Previously contact weights near pruned cells could weight the pinned nodes of the empty cell. -
630212fbbFixed 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.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 checkflex_edgeflap mjModel.instead.flex_bendingadr
Rendering
d0def6e64Added Kannala-Brandt fisheye projection and camera lens distortion coefficients: projection now supportsfisheyeviamjPROJ_FISHEYE, and distortion specifies up tomjNDISTCOEF= 8 coefficients forfisheyeandperspectivecameras viamjsCamera.anddistortion mjModel..cam_distortion
[!WARNING] Breaking changes
ca95109ecFixed 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.
ed8323d45Orthographic 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/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 thanfovy global/. For these camerasfovy mjv_cameraFrustumnow returns a vertical extent that depends onmjvCamera..distance Migration: Models that set
global/to a length for an orthographic free camera now render zoomed in. Setfovy global/back to an angle in degrees (the default is 45); the view height then follows the camera distance.fovy
e11f9e4c0Planar 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 withreflectance=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"
-
4019e053cAdded mjGEOM_DISC rendering-only geom type for flat double-sided discs and annuli (size = [r_out, r_in, 0]). -
2a860e53fAddedmjvOption., an offset added to simulation coordinates when rendering, so that several simulations of one model can be drawn side by side.offset -
77718b1fcAddedimage_diffuse_scaletomjrfLightParamsto control the diffuse colour of image based lights. -
6b907360cFixed 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). -
3f8569e2bBuiltin textures withmark=now draw a 2-pixel wide cross on even-sized textures so that it is centered."cross"
Compiler
-
bbaec528dSequentially appending elements to anmjSpecbody tree now runs in $O(1)$ instead of rebuilding the model's tree lists, making procedural model construction up to ~250x faster. -
50c5900d7Added the facetexcoord attribute to mesh and updated XML saving to emit it whenmjsMesh.is set. Previously, saving an inline textured mesh with per-corner UVs droppeduserfacetexcoord userfacetexcoord, causing the saved XML to fail compilation or map UVs to the wrong corners (#3931, reported by @andrewkaufman). -
da306ace5strippath no longer strips file names that match a registered resource provider, such aspackage:/URIs. These names are not filesystem paths, and the compiler already treats them as absolute when combining them with meshdir./
Plugins
da306ace5Added a first-party resource provider plugin,plugin/, that serves ROS-stylepackage_uri package:/URIs by locating packages through/ AMENT_PREFIX_PATHandROS_PACKAGE_PATHwithout depending on ROS. It is not included in release packages: build it from source and load the resulting shared library withmj_loadPluginLibrarybefore parsing a model, so that URDF and MJCF files can reference ROS package assets unchanged. Contribution by @noah-wardlow.
OpenUSD
2f754ec82The native C++ OpenUSD exporter andLayerSinknow authorxformOp:translate(double3) andxformOp:orient(quatd) instead ofxformOp:transform(matrix4d), avoiding shear artifacts when USD or external renderers interpolate between time samples.
Models
9a1af89e6Upgraded 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 usetimestep=, the"0. 002" discreteintegrator,cone=, and face motor"elliptic" ctrlrange=(previously"-0. 0.45 45" timestep=,"0. 01" integrator=, and"implicitfast" ctrlrange=; motor commands must now exceed the ~0.17 N*m breakaway torque)."-0. 0.05 05"
Bug fixes
-
36a33b4f4Fixed a memory leak inmujoco-core(introduced in 4.0.0) whereimport mujocowithoutglfwinstalled stored theImportErrorinmujoco.and kept every local variable on the importing call stack alive for the life of the process (#3928, reported by @adenzler-nvidia).rendering. classic. gl_context -
026907613Fixed capsule-box collisions when the capsule's centerline intersects the box, which could miss the contact. -
ce23b6e70Fixed floating-point cancellation and non-orthogonal fallback frames inmju_makeFrameandmjc_PlaneCylinderfor 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). -
82196b63eUnder thediscreteintegrator, 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. -
82196b63eUnder thediscreteintegrator, 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. -
3f8569e2bFixed Filament cube textures withtexuniformbeing scaled inversely; they now match the classic renderer.