Status
WIP — Codex-generated analysis and implementation. No pull request is open.
This is step 4 of the Acados v0.5.5 integration roadmap tracked in #1088. It builds on the solver-mode work in #1090.
Motivation
Applications such as Cocofest currently have to query the mutable Acados solver capsule directly to collect convergence information. That becomes fragile when the solver is reused: a later solve overwrites the statistics needed to understand the previous result.
Stable diagnostics are also useful for RHO and warm-start/homotopy studies: they make it possible to compare residuals, QP effort, solver status, and timing when changing a grid or interpolation strategy, instead of judging a warm start only from total solve time.
Current WIP scope
The branch attaches a detached solver_diagnostics snapshot to the returned Solution containing:
- Acados status code, v0.5.5 status label, and success flag;
- NLP and QP solver modes;
- named KKT residuals (stationarity, dynamics, inequality, complementarity);
- NLP/SQP iteration counts and QP-scaling status;
- detailed timing fields exposed by Acados v0.5.5;
- raw Acados statistics plus normalized QP status/iteration histories;
- the three per-iteration QP solves used by
SQP_WITH_FEASIBLE_QP;
- unavailable-field errors without masking an otherwise usable solve.
Arrays are copied out of the Acados capsule, and residuals are read with recompute=False so diagnostics do not alter an RTI/AS-RTI linearization. Solution.copy() also preserves the solve status and deep-copies the diagnostics.
Validation
Using the Acados v0.5.5 Python interface and native libraries:
pytest tests/shard1/test_acados_interface.py -k acados_v055 -q --disable-warnings
6 passed, 28 deselected
This includes native solves with Anderson acceleration and SQP_WITH_FEASIBLE_QP, as well as synthetic checks of the solver-specific statistics layouts.
Deliberately out of scope
- defining convergence/acceptance thresholds for Bioptim;
- changing warm-start or grid-interpolation behavior;
- runtime parameter updates (planned step 5);
- opening a pull request while the analysis remains WIP.
Maintainer feedback requested later
Before turning this analysis into a PR, it would be useful to decide whether:
Solution.solver_diagnostics is the right public location, or diagnostics should remain Acados-specific;
- exposing
raw_statistics is desirable alongside normalized fields;
- a small cross-solver diagnostics schema would be preferable for future RHO comparisons.
This issue and its branch were produced as a Codex analysis for maintainer discussion.
Status
WIP — Codex-generated analysis and implementation. No pull request is open.
This is step 4 of the Acados v0.5.5 integration roadmap tracked in #1088. It builds on the solver-mode work in #1090.
mickaelbegon:codex/acados-v055-diagnostics1b0aee0fMotivation
Applications such as Cocofest currently have to query the mutable Acados solver capsule directly to collect convergence information. That becomes fragile when the solver is reused: a later solve overwrites the statistics needed to understand the previous result.
Stable diagnostics are also useful for RHO and warm-start/homotopy studies: they make it possible to compare residuals, QP effort, solver status, and timing when changing a grid or interpolation strategy, instead of judging a warm start only from total solve time.
Current WIP scope
The branch attaches a detached
solver_diagnosticssnapshot to the returnedSolutioncontaining:SQP_WITH_FEASIBLE_QP;Arrays are copied out of the Acados capsule, and residuals are read with
recompute=Falseso diagnostics do not alter an RTI/AS-RTI linearization.Solution.copy()also preserves the solve status and deep-copies the diagnostics.Validation
Using the Acados v0.5.5 Python interface and native libraries:
This includes native solves with Anderson acceleration and
SQP_WITH_FEASIBLE_QP, as well as synthetic checks of the solver-specific statistics layouts.Deliberately out of scope
Maintainer feedback requested later
Before turning this analysis into a PR, it would be useful to decide whether:
Solution.solver_diagnosticsis the right public location, or diagnostics should remain Acados-specific;raw_statisticsis desirable alongside normalized fields;This issue and its branch were produced as a Codex analysis for maintainer discussion.