Learning outcomes
- Choose a simulation tool using explicit task requirements.
- Separate dynamics libraries, engines, and learning frameworks.
- Design an equal-workload benchmark.
Prerequisites: Linear algebra, ODEs, and earlier lectures in this sequence.
Start with the workload
An inverse-dynamics query, a contact-rich rollout, a differentiable trajectory, and a million independent training environments are different workloads. Choose tools according to the quantities needed, model features, latency or throughput target, and deployment constraints.
MuJoCo supplies rigid-body simulation with contact and actuator modeling. Pinocchio focuses on rigid-body algorithms useful for estimation, optimization, and control. Drake combines multibody modeling with planning and optimization tools, including hydroelastic contact. These descriptions identify roles rather than rank tools globally.
Warp, Newton, Isaac-related stacks, and robot-learning frameworks belong in the survey, but their features and compatibility change. Treat them as optional investigation topics supported by their current official documentation, not required core dependencies or interchangeable engines.
CPU, batch execution, and differentiation
A compiled CPU engine can have excellent single-environment latency. Accelerator execution can excel at a large batch of compatible rollouts. A large batch amortizes overhead but consumes memory. End-to-end performance also includes policy evaluation, state transfer, reset logic, and logging.
MJX has backend-specific implementations and feature support. JAX-based differentiation is distinct from the capabilities of the Warp backend. The existence of gradients does not guarantee useful derivatives through every contact transition MuJoCo MJX.
Worked benchmark design
Suppose engine A advances one environment in 0.1 ms, while engine B advances a batch of 1,000 in 2 ms after compilation. A has lower single-environment latency; B has higher batch throughput. Claiming B is simply “50 times faster” omits the workload and compilation.
For a defensible comparison, fix model parameters, timestep, horizon, output quantities, precision where possible, and batch size. Report setup, compilation, steady execution, synchronization, and hardware separately.
Independent dynamics comparison
Practice 7 includes a CPU baseline and optional MJX batching. An optional Pinocchio script compares RNEA, CRBA, and ABA on an equivalent contact-free pendulum. It checks numerical agreement before reporting timings. Differences in joint axes, gravity direction, quaternion order, or armature can dominate an apparent engine disagreement.
Matching an MJCF model to a URDF or programmatic model requires checking inertial frames, actuator semantics, and limits. File conversion alone does not prove equivalence.
Exercise
One backend omits a feature used by the source model. May you silently remove that feature to make the benchmark run? Answer: no. Either define a common supported benchmark model and state the simplification, or report the original task as unsupported.
The project should argue for a tool from measured requirements. A feature checklist is useful, but a reproducible representative workload is stronger evidence.