Repository navigation
Extract a shared ALM core and add a Gaussian QP solver - #2924
Merged
Merged
Conversation
Share penalty, multiplier, damping and stopping logic with the nonlinear optimizer. Add cached Gaussian models, solver diagnostics, and a QpProblem driver with typed ALM options. Preserve terminal multipliers and use stable model reduction for small steps. Validated native ALM, QP, active-set and multifrontal suites, including original KKT checks, parameter forwarding and matching frontends.
Bind solver states, diagnostics, profiling counters and QpProblem ALM overloads. Expose nested QRMode controls and share MATLAB container proxies while retaining Python STL conversion. Validation: 586 Python tests and 89 subtests passed; 6 skipped. Full MATLAB proxy generation passed; MATLAB runtime validation remains pending.
Describe shared solver behavior, multiplier units, convergence state and profiling counters. Show QpProblem ALM options and QR selection, and link the existing optimizer and QP notebooks to the Gaussian guide. Validated guide Python calls, documentation build and links.
Compare Dense Dual, Sparse Dual and Gaussian ALM against DAQP, ProxQP, Clarabel and OSQP. Include five-repeat QR-off MPC timings, all G1 outcomes, original-QP certificates and campaign provenance. Remove primal GTSAM series and obsolete charts, retaining 2x2 layouts and refreshed PNGs. Keep the separate ALM investigation, raw measurements and benchmark drivers in the ignored local workspace. Validated interactive charts, 2x2 layout, documentation build and diff checks.
Require each accepted unary hard factor to have full column rank before fixing its variable block to zero. Reject partial or dependent constraints with MultifrontalSolverNotSupported instead of silently removing free directions. Revalidate constraints and fixed-key assumptions for every load, including fused, partial and damped nonlinear paths. Invalidate stale numerical state on rejection. Cover vector constraints, redundant factors, precomputed metadata and in-place coefficient changes against legacy constrained QR. Validation: all 11 affected native multifrontal and constrained-solver suites passed; clang-format and git diff --check passed. Existing tolerances and QP algorithms are unchanged.
Convert the nonnegative Jacobian block dimension to the stored size_t dimension type before comparing. This resolves the GCC and Clang -Werror=sign-compare failures in the fast-compile CI jobs without changing constraint validation behavior. Validated the translation unit with GCC and Clang using -Werror, both native multifrontal suites, clang-format and git diff --check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nonlinear ALM optimizer performed poorly in the QP benchmark, both in speed and robustness. Part of the performance lag came from repeatedly linearizing factors even though the input was already a quadratic program. I wanted to separate out the Gaussian core of ALM so we could use it directly in a QP setting, while keeping the nonlinear optimizer and the new solver on one implementation.
This adds
AugmentedLagrangianSolveringtsam/constrained, taking Gaussian objective, equality and inequality factors directly. The nonlinear optimizer and Gaussian solver share the penalty and multiplier updates, LM damping, stopping rules and diagnostics. The Gaussian adapter retains coefficient storage and updates RHS terms without nonlinear linearization. Numerical elimination still runs for each attempted inner solve.The refactor also fixes terminal multiplier reporting and stabilizes acceptance of steps whose cost changes are near roundoff.
QpProblemgets a small ALM driver and parameter overloads, including the existing multifrontal QR setting. Shared Python/MATLAB interfaces expose the solver, state and controls. QR remainsAllowby default; the benchmark explicitly usesOff.Current performance profiles
The report compares Gaussian ALM with QR off, Dense Dual, Sparse Dual, DAQP, ProxQP, Clarabel and OSQP. Each MPC combination has an initial call plus five fresh repetitions. Profiles use the repeat median, require all calls to certify against the original QP, and retain failures in every denominator. Default uses native tolerances and a loose external threshold, so it is not an equal-accuracy comparison.
Gaussian ALM certifies 222/256 MPC combinations; both GTSAM dual solvers certify 256/256. In the matched block-input investigation, the earlier ALM implementation certified 185/256. Removing linearization overhead helps, but ALM still has robustness and performance work ahead: QR-off ALM certifies G1CMCTWO in 12.308 seconds, misses the absolute-gap threshold on G1SP20, and reaches the 300-second watchdog on G1SPFULL.
The benchmark documentation links the interactive HTML report and recorded aggregates/provenance. GTSAM primal series are removed from this comparison. The separate ALM investigation, benchmark drivers, raw calls and private inputs remain outside version control.
Validation
develop.git diff --checkpassed.