Add the Newton decrement as a termination criterion of the Newton solver.

After an accepted line-search step, the solver has already rebuilt the gradient
and Hessian and solved for the next search direction, so the Newton decrement
0.5*g'*H^-1*g -- the quadratic model's predicted cost improvement of the next
iteration -- costs one dot product. Terminating when it falls below tolerance
avoids running one more iteration only to observe a correspondingly small
actual improvement.

This is a C port of Alain's proposal in MJWarp:
https://github.com/google-deepmind/mujoco_warp/pull/1520

PiperOrigin-RevId: 947768034
Change-Id: I94e5c71a4e2b4a7775611edd1dad254bba2633b4
This commit is contained in:
Yuval Tassa
2026-07-14 10:29:30 -07:00
committed by Copybara-Service
parent 2444defc63
commit 1e66efd114
6 changed files with 115 additions and 3 deletions
+4 -1
View File
@@ -1392,7 +1392,10 @@ representations of the constraint Jacobian and related matrices.
This algorithm implements the exact Newton method, with analytical second-order derivatives and Cholesky
factorization of the Hessian. The line-search is the same as in the CG method. When constraint states change between
iterations (e.g., a constraint transitions from quadratic to linear), the Hessian factorization is updated
incrementally via rank-1 Cholesky updates, avoiding full refactorization. It is the default solver.
incrementally via rank-1 Cholesky updates, avoiding full refactorization. Early termination is triggered when any of
three quantities falls below :ref:`tolerance<option-tolerance>`: the cost improvement of the last iteration, the
gradient norm, and the Newton decrement :math:`\tfrac{1}{2} g^T H^{-1} g` -- the predicted cost improvement of the
next iteration. It is the default solver.
**PGS** : Projected Gauss-Seidel method
This is the most common algorithm used in physics simulators, and used to be the default in MuJoCo, until we