Skip to content

[Codex analysis][Acados v0.5.5][2/5] Safe code reuse and solver reset #1089

Description

@mickaelbegon

Status: Codex analysis / WIP — no pull request will be opened for now.

This issue tracks the second Acados v0.5.5 analysis branch while keeping the
maintainers' PR queue unchanged.

Codex analysis

Acados v0.5.5 can compare a formulation with previously generated code and
reuse the solver only when they are compatible. Its reset API also provides a
clean way to discard primal-dual iterates and QP memory between repeated solves.
Both are relevant to repeated OCP and MHE workflows in Bioptim.

The branch adds opt-in Bioptim options:

  • set_check_reuse_possible(True) to reuse compatible generated code and
    regenerate/rebuild it otherwise;
  • set_tol_code_reuse(...) to control the Acados formulation-comparison
    tolerance;
  • set_reset_solver_before_solve(True) to reset iterates and QP memory before
    repeated solves.

Code reuse requires an explicit, stable Acados model name. The existing default
behavior is unchanged when these options are not enabled.

Validation performed by Codex

  • first solve generates and builds the solver;
  • a second equivalent OCP reuses the generated code;
  • a repeated solve calls the Acados reset path;
  • reuse without a stable model name is rejected with an actionable error;
  • Acados interface suite: 31 passed;
  • solver-options suite: 10 passed.

This branch is stacked on the compatibility branch because the reuse API is
specific to Acados v0.5.5. It remains WIP until the analysis sequence is ready
for maintainer review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions