Same Physics, Different Gradients: A State-of-the-Art Report on Differentiable Physics Simulation
Authors: Lei Shu, Zizhou Huang, Yunuo Chen, Yifei Li, Tao Du, Minchen Li, Tuur Stuyck, Miles Macklin, Kui Wu, Bo Zhu, Yin Yang, Ming C. Lin, Alberta Longhini, Rika Antonova, Leonidas Guibas, Gordon Wetzstein, Jeannette Bohg, Chenfanfu Jiang
Organizations: Stanford University · Courant Institute, New York University · University of California, Los Angeles · Massachusetts Institute of Technology · Tsinghua University · Carnegie Mellon University · NVIDIA · LightSpeed Studios, Tencent America · Georgia Institute of Technology · University of Utah · University of Maryland, College Park · University of Cambridge
Differentiable simulation propagates derivatives through a physics simulator, turning animation, system identification, control, and computational design into gradient-based optimization. Engines differ in the physics they model and, less visibly, in which mathematical object they differentiate. We separate two questions the literature conflates. The referent is which object the returned derivative belongs to: the finite computation that executed, the converged equation it approximates, or the continuous dynamics. The realization describes the organization of the backward pass: automatically generated differentiation, an equation-level adjoint solve, or a custom adjoint. The referent defines the target against which exactness is assessed; the implementation determines how accurately that target is approximated. Cost depends on the realization together with how the states needed by the backward pass are retained or recovered. Crossing the axes places every method and engine we classify in a cell, separates claims the literature merges, and shows that the apparent trade-off between exactness and memory follows from how methods have been built rather than from a constraint. A second, orthogonal taxonomy covers contact, where the map is non-smooth. We then ask whether a correct gradient helps. Four mechanisms by which useful gradients are lost are cataloged and measured on one testbed, where the advantage of the exact derivative over the equation-level adjoint depends on where the fitting target comes from as much as on the solver budget, and we review the evidence that zeroth-order methods can outperform simulator gradients in the regimes where those mechanisms act. The model classes, systems techniques and applications are surveyed through this lens, and we close with a reporting checklist, a released diagnostic that computes it, and a research agenda.
Figures & tables
Symbol
Meaning
st=(xt,vt)
simulation state at step t : positions, velocities
flow-map adjoints [ LHB∗25 ] ; consistency and state requirements depend on the custom continuous-adjoint operators
Table 2: The two axes crossed. Rows identify derivative targets; columns are operational categories for the organization of the backward pass. Exactness must be assessed against the row’s target and the implementation’s numerical qualifications. Construction may be automatic, manual, or hybrid within these categories. Memory depends on retained states, recomputation, checkpointing, and solver workspace, not on the column alone. Discrete custom adjoints can exploit forward operator or block structure without necessarily eliminating trajectory storage. A3 includes both equation-level solves and custom continuous-adjoint operators. Empty entries reflect the labeling convention and the examples selected, not impossibility claims. Entries are representative, not exhaustive.
Figure 2: What a contact solver is asked to resolve, and why contact modes matter. Left , two elastic beams twisted around one another, 97 thousand vertices between them, in sustained frictional contact along the whole interface while they buckle. The active pairs change along the trajectory. Local branch derivatives can remain valid despite these temporal changes, but may poorly predict finite parameter updates that change the contact sequence. Right , an elastic cube released on an incline at four friction coefficients. Whether it sticks or slides is decided by the friction cone. At a regular stick–slip transition, the branch derivatives can differ (Section 5.1 ). Images reproduced, cropped but otherwise unaltered, from [ CLYY24 ] under the authors’ CC BY 4.0 license.
Family
Mechanism
Obstacle addressed
Principal cost
Representative work
Complementarity branch derivatives
differentiate a regular active-set LCP, NCP or constrained solution map
(1)
mode-boundary selection; flat contact regimes
[ BPSA∗18 , WOL∗21 , QLKL20 ]
Compliant / penalty
relax hard constraints or regularize contact forces
(1)
stiffness–smoothness trade-off; altered physics
[ TET12 , GHZ∗20 , DHDw19 ]
Barrier / interior point
barrier potential on the feasible domain; piecewise smooth geometry
(1)
stiffness and conditioning; derivatives of any stiffness updates
[ LFS∗20 , LKJ21 , HTG∗24 ]
Randomized smoothing
smooth an objective, transition map, or collision query
(1), (2)
sampling cost; variance; smoothing bias
[ LLSM∗24 , MLLB∗23 , PSYT23 , SSZT22 ]
Event-aware / time-of-impact
differentiate regular event times and impact updates (approximated in Nimble)
(2)
event detection and sensitivity; often CCD for collisions
[ PSE∗00 , LLK19 , HAL∗20 , ZHDB23 , WOL∗21 ]
Forward/backward decoupling
backward differentiates a different model than the forward runs
(1), (3, partially)
may not be the forward objective’s gradient
[ PGS∗26 , SKS25 , HLCB∗22 ]
Table 3: Treatments of contact discontinuity. This axis is orthogonal to both axes of Table 2 : an engine can combine a cell there with one or more treatments here. “Obstacle addressed” refers to the enumeration in Section 5.1 .
Figure 3: The two model families where the choice of referent bites hardest, and why. Left , deformables at the scale the field now works at: every one of these bodies is soft, they are in sustained mutual contact, and the solver is truncated to a fixed iteration budget, which is the regime where the converged equation and the executed computation stop agreeing (Section 6.2 ). Right , the same smoke plume under four schemes. The differences are large and come from the numerics rather than from the physics being modeled, which is the sense in which a fluid solver’s structure decides what its adjoint can be (Section 6.4 ). Images reproduced, cropped but otherwise unaltered, from [ CLYY24 , LHB∗25 ] .
Method
Ref.
Real.
State
Contact
Notes and primary use
Control of simulation before general-purpose AD
Spacetime constraints [ WK88 ]
n/a
n/a
n/a
n/a
dynamics posed as constraints, not as a forward map
Interactive spacetime [ Coh92 ]
n/a
n/a
n/a
n/a
spacetime windows; same formulation
Smoke keyframes [ TMPS03 ]
A1*
n/a
none
n/a
forward sensitivities of the discrete operators, treating linear solves as exact
Adjoint fluid control [ MTPS04 ]
A1*
B3
trajectory
n/a
discrete adjoint, chosen over the continuous one; trajectory stored
Cloth keyframes [ WMT06 ]
surr.
B2
trajectory
penalty (repulsive springs)
adjoint of the full backward Euler scheme swapped in for the linearized implicit step the forward runs (Section 5.7 )
Table 4: Representative methods grouped by physical model. Ref. : A1 executed computation, A2 converged equation, A3 continuous dynamics (Section 4.1 ). Real. : B1 framework-generated reverse; B2 equation-level adjoint, including a discretized continuous adjoint; B3 custom operator-level adjoint composition (Section 4.2 ). For hybrid engines these labels identify the main documented backward construction; custom solves and recorded remainders are noted and do not imply exactness of the full engine. A1* treats an internal linear solve as exact; finite primal and adjoint tolerances still cause error. A2 a marks an additional approximation in the derivative system. surr. marks a returned direction that need not differentiate the forward objective; it can still have a specified surrogate target. State describes recovery: tape , recorded reverse-pass intermediates; trajectory , states and required auxiliary data per step; checkpoint , selected states with recomputation; recompute , per-step intermediates regenerated from saved states; final state , converged state of each step plus required auxiliary data, not just the rollout endpoint; replay , sweeps rerun from saved inputs; reverse , state recovered by reversing the map. These choices do not specify a unique memory cost. none and not stated indicate no reverse-state store or an unreported strategy. Contact follows Table 3 where applicable. Alternatives are noted in the final column. The realization is n/a when there is no backward pass, including forward sensitivities; shooting alone does not determine the realization. Methods that only consume a simulator appear in Sections 7 and 9 .
Method
Ref.
Real.
State
Contact
Notes and primary use
Deformable solids
ChainQueen [ HLS∗19 ]
A1
B3
trajectory
grid-mediated
hand-derived CUDA MPM backward; cached per-step states; TensorFlow reference is an alternative B1 path
DiffTaichi [ HAL∗20 ]
A1
B1
tape
impulse with TOI (rigid, mass-spring); grid boundary (MPM)
source-transformation AD preserving megakernel parallelism; custom primitive derivatives must be declared
Real2Sim [ HBBC19 ]
A3
B2
trajectory
n/a
continuous adjoint discretized with BDF2 for viscoelastic fitting; direct-sensitivity alternative
DiffPD [ DWM∗22 ]
A2
B2
final state
penalty / complementarity
reuses the projective-dynamics factorization in the backward
Qiao et al. [ QLKL21a ]
A1
B1
recompute
dry friction
coupled soft multi-body systems; projective-dynamics step differentiated with CppAD, per-step state stored, intermediates recomputed
Table 5: Table 4 continued: deformables, cloth and fluids. Columns are as in Table 4 .
Figure 4: The report’s running example, one implicit step followed from what is computed to what it costs. Two mass-spring chains stepped with implicit Euler and solved by K Gauss–Seidel sweeps; panels (a) to (c) take one step at k=2×105 , panel (d) fits random stiffness fields near 6×103 on a shorter, pinned chain over twelve steps. (a) what ran: the residual falls with the budget but does not vanish, so the iterate the sweeps reached (A1) and the root they approach (A2) are two different objects to differentiate. (b) the relative norm of the vector difference between the two gradients is of order one across the plotted range. (c) they disagree in direction too, the cosine sitting between 0.1 and 0.55 , so the two are nearly orthogonal. (d) and, for a target the same solver generated, it makes almost no difference to the optimization: from two sweeps onward no stable advantage is separable, median and interquartile range over forty seeds. Panels (b) and (c) are large at the stiff setting; (d) shows no separation between A1 and A2 for its fitting problem from two sweeps on. For this reason the report separates which derivative a method returns from whether it helps .
target generated at the same K
target generated converged
external target
K
A1
A2
A2 wins
A1
A2
A2 wins
A1
A2
A2 wins
1
1.4×10−2
1.1×10−1
10 %
1.5×10−1
9.7×10−1
0 %
8.2×10−4
4.7×10−1
0 %
2
1.3×10−2
2.1×10−2
38 %
3.7×10−3
8.9×10−1
0 %
5.9×10−4
1.2×10−3
0 %
4
1.7×10−2
1.6×10−2
48 %
2.3×10−3
4.6×10−1
0 %
3.9×10−4
7.4×10−4
0 %
8
4.4×10−2
4.4×10−2
45 %
2.6×10−2
4.3×10−2
28 %
4.0×10−4
6.1×10−4
0 %
16
5.7×10−2
6.0×10−2
40 %
5.2×10−2
5.3×10−2
35 %
6.7×10−4
7.0×10−4
12 %
Table 6: What the equation-level referent costs an optimizer, and how much that depends on where the target came from. Loss remaining after 120 gradient-descent steps, as a fraction of the initial loss, median over 40 random instances of the fitting problem (a 16-vertex chain over twelve steps), with the fraction of instances on which A2 finished lower; lower is better. Three constructions of the target, everything else identical: the endpoint the same solver at the same K produces from the true stiffness field, so that the fit can reach it exactly; the endpoint a solve run to convergence (2000 sweeps) produces, fitted with K sweeps; and the rest configuration, which no stiffness field reaches under gravity. Within-row comparisons isolate the choice of gradient for each target construction. Across-budget comparisons for same- K targets also change the target-generating solver; comparisons for converged or external targets isolate the budget only if instances and target data are held fixed.
Figure 5: Mechanism 1 measured. A mass-spring chain is stepped with implicit Euler and solved by K Gauss–Seidel sweeps of per-vertex Newton updates, a one-dimensional instance of vertex block descent [ CLYY24 ] ; the parameter is the vector of per-spring stiffnesses. We compare the exact derivative of the K sweeps that actually executed, referent A1, against the equation-level adjoint, referent A2, evaluated as an implementation evaluates it: at the iterate the K sweeps reached, as if the residual there had vanished. (a) how far the truncated solve is from convergence. (b) the norm of the difference between the two gradients, relative to the gradient of the same solve run to convergence; above the dashed line the discrepancy is larger than the quantity being estimated. (c) the cosine of the angle between them, which indicates whether the negative returned vector is a local descent direction for the executed objective. Actual progress also depends on step size, curvature, and the optimizer. The shaded band marks the one to ten sweeps a real-time deformable solver actually runs. Within that band the two derivatives agree well for compliant material from two sweeps on, but for the stiffest material ( k=2×105 ) the equation-level adjoint is nearly orthogonal to the true derivative of the executed computation, and agreement is recovered only after hundreds of sweeps; at k=2×104 a few dozen suffice. The forward sensitivity was differentiated by hand through the executed arithmetic and checked against central differences of the same pipeline to a relative error below 4×10−6 .
Figure 6: Mechanism 2 measured, on the mass-spring chain of Figure 5 stepped with implicit Euler and eight Gauss–Seidel sweeps. Per-spring stiffnesses are the parameters and the sensitivity is propagated forward through the executed arithmetic, so the experiment tests sensitivity to the forward states and arithmetic precision without introducing a reverse-mode implementation. (a) , the accumulated sensitivity ∥dxT/dk∥ varies by a factor of fifteen over three hundred steps: it does not explode, and the loss-gradient norm, not shown, rises by less than three orders of magnitude while the loss rises by eight and a half, so neither would alarm a monitor. (b) , the cosine between derivatives obtained from the same sensitivity recurrence in double and in single precision, with two controls that separate the two places rounding can enter. With state and sensitivity both in single, agreement holds to four figures out to twenty steps and three at forty, and then falls: 0.79 at eighty, 0.64 at a hundred and sixty, 0.48 at three hundred and twenty (the last two vary with hardware; see text). With the trajectory in double and only the sensitivity recurrence in single, the cosine stays above 0.999 throughout. With the trajectory in single and the sensitivity in double, the fall is reproduced to within 0.003 in cosine. The disagreement therefore comes from the single-precision trajectory, which differs from the double one by a relative 10−4 at eighty steps while the loss differs by about two parts in ten thousand (at most 2.2×10−4 ): the gradient is far more sensitive to the trajectory than the objective is. The final contraction of the sensitivity with the loss gradient is done in double in every variant, so that it does not enter the comparison.
Figure 7: Contact-gradient support and sensitivity amplification in the mass-spring contact testbed ( k=2×104 , eight sweeps, no gravity, wall stiffness 2×105 ), with launch velocity as the single parameter and accumulated contact energy as the objective. Panel (a) uses a 120-step rollout; panel (b) varies the horizon. (a) the derivative against launch velocity: below the velocity at which a vertex reaches the wall within the horizon (shaded), no contact occurs and the derivative is zero; gradients can be nonzero in the active-contact region. This is a derivative-support diagnostic, not evidence that minimizing contact energy fails in the zero-contact region. (b) spread (standard deviation) of the same derivative over an ensemble of launches perturbed by 10−6 . Between two walls, repeated bounces are associated with roughly seventy-fold growth in spread over the tested horizons. With one wall, the chain bounces once and the spread remains approximately flat. These observations do not establish chaos or show that repeated contact is necessary for sensitivity amplification.
System
Backward construction
Backward memory
Execution backend
DiffTaichi [ HAL∗20 ]
compiler source transformation
tape, with checkpointing
Taichi; CPU and CUDA
Warp [ Mac22 ]
compiler source transformation
kernel-launch tape and required data
CPU and CUDA
Brax [ FFR∗21 ]
framework tracing (JAX/XLA)
saved residuals; optional rematerialization
CPU, GPU and TPU; parallel envs
JAX MD [ SC21 ]
framework tracing (JAX/XLA)
saved residuals; optional rematerialization
CPU, GPU and TPU
Φ Flow [ HKT20 ]
backend AD; custom implicit solve derivatives
backend- and solver-dependent data
pluggable array backend
Genesis [ Gen24 ]
kernel source transformation (Taichi lineage)
saved state and derivative data
GPU and CPU backends; differentiable MPM path
Table 7: Differentiable simulation systems viewed as software, complementing Tables 4 and 5 . Backward construction describes how derivative computations are implemented. Backward memory lists principal retained information, not a complete allocation bound: forward states, contact data, and linear-solver data may also be required or recomputed. The absence of an inner-iteration tape does not imply constant rollout memory. Backend and AD coverage depend on the solver and version. Entries summarize the cited descriptions and supported derivative paths.
Figure 8: Three uses of a simulator gradient, as their authors report them. Left , material parameters recovered from observed cloth motion by optimizing through the simulator, the inverse problem of Section 9.1 . Middle , a trajectory optimized through frictional contact; the loss curve beneath compares the analytic gradient against two zeroth-order optimizers on the same task, which is the comparison item 7 of our checklist asks every paper to report. Right , smoke steered from one silhouette through fixed obstacles into another, by optimizing the forces with an adjoint taken on the flow map. Keyframe control of fluids is an early application of differentiable simulation. The illustrated result uses the recent continuous-adjoint flow-map method [ LHB∗25 ] , corresponding to referent A3 in Section 4.1 . None of the three results is ours. Images reproduced, cropped or letterboxed but otherwise unaltered, from [ LDW∗23 , LHB∗25 ] .
Suite
Domain
Underlying simulator
What it reports, and what it does not
PlasticineLab [ HHD∗21 ]
soft-body manipulation
MPM elastoplastic, on DiffTaichi
task reward across manipulation goals; no reference derivatives
FluidLab [ XZX∗23 ]
complex fluid manipulation
differentiable fluid engine
task reward on multi-material fluid tasks; non-smooth landscapes discussed, gradients not measured against a reference
SoftZoo [ WMS∗23 ]
soft robot co-design
MPM, multiple environments
co-design performance across morphologies and terrains, with gradient-landscape examples; no shared reference-Jacobian protocol
Brax [ FFR∗21 ]
rigid-body control
its own engine
throughput and policy return at scale; simple physics chosen for speed
DiSECt [ HMN∗21 ]
robotic cutting
dedicated cutting simulator
parameter fits against real cutting data; a system-identification benchmark in effect
Newbury et al. [ NCH∗24 ]
cross-engine survey
none (engines tabulated)
survey of engines’ design choices and features; not a task benchmark or a reference-Jacobian protocol
Table 8: Task benchmarks and a cross-engine survey for differentiable simulation. The task evaluations combine gradient behavior with the optimizer, policy class, and physical model; the Newbury et al. row summarizes engine features. Together they provide useful comparisons, but not a shared cross-engine protocol for reference-Jacobian accuracy at matched solver settings.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Checklist item
A1
A2
(i-a) implementation: relative error to an independent evaluation of the returned vector at the same state
as (ii)
5×10−16
(i-b) convergence gap: relative error to the declared referent’s target
0
0.47
(ii) relative error to executed finite differences
2×10−7
1.0
(ii) cosine to executed finite differences
1.000
0.184
(iii) median remaining loss after 120 gradient steps
0.27
0.76
(iii) zeroth-order at equal queries, two forwards per gradient step: remaining loss / gradient wins
0.45 / 100%
0.40 / 0%
Appendix
Table 9: The reporting checklist computed by the released diagnostic for the chain under both referents. Item (i) is split into an implementation part and a convergence part. The A1 zero in (i-b) denotes its finite-program target, not equality with the converged-equation derivative. Item (iii) uses two query budgets with wall-clock beside them. (v) uses this four-sweep configuration, distinct from Figure 6 , and is reported for A1 only because the A2 engine provides no single-precision path; (vi) is the diagnostic’s generic flat fraction, which is zero on this chain; the chain has no contact, so this says nothing about contact-induced flatness. Absence of contact does not rule out other flat directions.
School of Engineering, Cardiff University, Cardiff, United Kingdom · School of Computer Science and Informatics, Cardiff University, Cardiff, United Kingdom · College of Mechanical and Electrical Engineering, Hohai University, China