Convergence Logic Tree#
This page helps trace an AL-iLQR solve from the innermost line-search
decision to the final AL-iLQR status. Use it when trajOpt reports a
failure, when constraints are satisfied but the inner iLQR status is not
Converged, or when a trajectory appears unchanged despite a successful
return.
The three layers are:
How To Read The Tree#
Start at the top of the outer layer. Each AL-iLQR outer iteration calls one iLQR subproblem. Each iLQR iteration repeatedly tries a backward pass and a forward-pass line search while increasing regularization. The forward pass is the only place where the state and control trajectory are actually accepted and overwritten.
AL-iLQR loop
Goal: satisfy all inequality constraints, then return a trajectory only if the inner solve made real progress or converged.
-
Initialize augmented terms
Collect each constraint vector
c_k. Initializelambda_augandmu_augwith the same per-timestep sizes. -
Call the iLQR subproblem
Run the middle layer with the current augmented Lagrangian penalties.
enter middle layer -
Did iLQR return a non-recoverable failure?
Current recoverable statuses are
MaxIterationsandRegularizationExceeded, because either may still leave an improved trajectory.YesReturn
ALILQRStatus::InnerFailed.NoMeasure the maximum positive constraint violation.
-
Is
max_c <= constraint_tol?This is the AL feasibility test. It is checked after every iLQR subproblem, even if the iLQR status is not
Converged.Yes, and iLQR converged or accepted at least one forward-pass stepReturn
ALILQRStatus::Converged. Constraint satisfaction is valid because the trajectory was optimized or the inner cost tolerance was reached.Yes, but iLQR accepted zero stepsReturn
ALILQRStatus::InnerFailed. This blocks false positives where the warm start was feasible but the optimizer never improved the trajectory.NoUpdate
lambda_augandmu_aug, then start another AL outer iteration. -
Outer iteration budget exhausted
If constraints never satisfy the tolerance, return
ALILQRStatus::MaxOuterIterations.
iLQR subproblem
Goal: locally reduce the augmented trajectory cost by alternating backward and forward passes.
-
Start iLQR iteration
Set
reg = reg_init. Telemetry starts withaccepted_steps = 0. -
Does the backward pass factorize successfully?
The Riccati step requires a positive-definite regularized
Q_uu.NoIncrease regularization by
reg_scaleand retry the same iLQR iteration.YesBuild feedback gains
K, feedforward termsd, and expected cost termsdeltaV. -
Run forward-pass line search
Try to roll out a new trajectory using
K,d, and decreasing line-search step sizes.enter inner layer -
Did the forward pass accept a rollout?No
Increase regularization by
reg_scaleand retry from the backward pass.YesOverwrite
XandU. Incrementaccepted_steps, storelast_delta_J, and storefinal_cost. -
Is
abs(J_prev - J_new) <= cost_tol?YesReturn
ILQRStatus::Convergedandtrue.NoContinue to the next iLQR iteration. The trajectory may still be useful because a forward pass was accepted.
-
Middle-layer terminal statuses
RegularizationExceededmeans all regularization retries failed.MaxIterationsmeans the cost tolerance was not reached before the iLQR iteration budget ended.
Forward pass and line search
Goal: find one acceptable rollout that decreases cost consistently with the expected model reduction.
-
Try line-search step
alpha = 1, 1/2, 1/4, ...Initialize
X_barandU_barfrom the current nominal trajectory. -
Does the backward pass predict descent for this step?
The predicted cost change is
dV(alpha) = alpha*dV0 + alpha^2*dV1from the backward pass. A trial is only meaningful when the model predicts descent (dV(alpha) < -1e-16); when it predicts ascent or no change, the acceptance ratiozflips sign and a cost-increasing rollout could otherwise be accepted.No (predicted ascent / degenerate)Reject this
alphawithout rolling out and keep backtracking. If everyalphais rejected this way, the forward pass fails and regularization escalates — persistent ascent predictions usually mean stale or indefinite curvature (check the cost Hessian mode and regularization settings, not the dynamics).YesRoll out the trial.
-
Is the rollout dynamically valid?
Reject the trial if the state is non-finite, the timestep is invalid, dynamics throw, the next state is invalid, or quaternion normalization fails.
NoReject this
alphaand try the next smaller step.YesCompute nominal cost plus augmented Lagrangian penalty terms.
-
Are augmented-constraint vector sizes consistent?
The line search requires
lambda_aug[k],mu_aug[k], andc_kto have matching sizes.NoReturn forward-pass failure immediately.
YesEvaluate the line-search acceptance ratio.
-
Does the line-search ratio satisfy
beta1 <= z <= beta2?With
ilqr.ls_strict_decreaseenabled, acceptance additionally requires a strict merit decrease (J_new < J_prev).YesAccept the rollout, overwrite
XandU, return forward-pass success.NoReject this
alphaand keep searching. -
All line-search trials rejected
Return forward-pass failure. The middle layer will usually increase regularization and retry.
Status Reference#
Layer |
Status or return |
Meaning |
First places to inspect |
|---|---|---|---|
Inner |
|
A line-search trial accepted and updated the trajectory. |
Accepted |
Inner |
|
No line-search step was accepted, or augmented constraint vector sizes mismatched. |
State validity, dynamics exceptions, |
Middle |
|
The latest accepted rollout reached |
|
Middle |
|
iLQR accepted steps but never reached the cost tolerance before |
|
Middle |
|
Backward or forward pass kept failing until |
Whether |
Outer |
|
Constraints are within tolerance and the iLQR subproblem either converged or accepted at least one rollout. |
|
Outer |
|
The inner solve failed in a way AL-iLQR cannot safely accept, or constraints were satisfied with zero accepted trajectory updates. |
Warm-start feasibility, |
Outer |
|
AL penalty updates did not drive constraints below |
Constraint component traces, penalty scaling, active constraints, actuator limits. |
Common Diagnosis Paths#
Constraints satisfied, but iLQR did not converge
This can be acceptable if accepted_steps > 0. It means the trajectory was optimized, but the inner cost-delta tolerance was not the final stopping reason.
Constraints satisfied with zero accepted steps
Treat this as unsafe. The warm start may have been feasible, but the optimizer did not produce a new trajectory.
Regularization exceeded after accepted steps
The latest refinement attempt stalled, but previous accepted steps may still have produced a valid AL solution if constraints are now below tolerance.
Max outer iterations
The middle layer may be working, but AL penalty updates are not enforcing at least one active constraint quickly enough.