oxfordcontrol/Clarabel.rs

Clarabel Panics rather than indicating insufficient progress with mixed cones.

AlexandreAmice opened this issue · 0 comments

When Clarabel is solving problems with mixed PSD and exponential cone constraints, Clarabel panics when it cannot make sufficient progress rather than setting it's status to Insufficient Progress.

An example is the following program:
image

In it's default settings, Clarabel solves the program with no issues.
However, by setting max_step_fraction = 1e-10, we can get Clarabel to throw the stack trace at the bottom of this thread. If the the log det Z >= 0 constraint is removed and the small step-size is used then Clarabel accurately throws Insufficient Progress.

If the max_step_fraction = 1e-3 then Clarabel also panics on the original program, but the program without the log det Z >= 0 constraint reports MaxIterations

Please note that reducing the max_step_fraction to be so small is only done for illustrative purposes. Such small step sizes are currently causing issues in the Drake CI: RobotLocomotion/drake#20799 (comment). A discussion is available in the Drake Developer Slack:
https://drakedevelopers.slack.com/archives/C3L92BM2Q/p1705935880972559

Stack Trace:

-------------------------------------------------------------
           Clarabel.rs v0.6.0  -  Clever Acronym              

                   (c) Paul Goulart                          
                University of Oxford, 2022                   
-------------------------------------------------------------

problem:
  variables     = 20
  constraints   = 32
  nnz(P)        = 0
  nnz(A)        = 39
  cones (total) = 6
    :        Zero = 1,  numel = 13
    : Nonnegative = 1,  numel = 0
    : Exponential = 2,  numel = (3,3)
    : PSDTriangle = 2,  numel = (3,10)

settings:
  linear algebra: direct / qdldl, precision: 64 bit
  max iter = 200, time limit = Inf,  max step = 0.001
  tol_feas = 1.0e-8, tol_gap_abs = 1.0e-8, tol_gap_rel = 1.0e-8,
  static reg : on, ϵ1 = 1.0e-8, ϵ2 = 4.9e-32
  dynamic reg: on, ϵ = 1.0e-13, δ = 2.0e-7
  iter refine: on, reltol = 1.0e-13, abstol = 1.0e-12,
               max iter = 10, stop ratio = 5.0
  equilibrate: on, min_scale = 1.0e-4, max_scale = 1.0e4
               max iter = 10

iter    pcost        dcost       gap       pres      dres      k/t        μ       step      
---------------------------------------------------------------------------------------------
  0  +0.0000e+00  -1.1128e+00  1.11e+00  7.77e-01  6.58e-01  1.00e+00  1.00e+00   ------   
  1  +0.0000e+00  -1.1128e+00  1.11e+00  7.77e-01  6.58e-01  1.00e+00  1.00e+00  0.00e+00  
thread '<unnamed>' panicked at external/crate__clarabel-0.6.0/src/solver/core/cones/psdtrianglecone.rs:292:9:
not implemented: Mixed PSD and Exponential/Power cones are not yet supported
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: <clarabel::solver::core::cones::psdtrianglecone::PSDTriangleCone<T> as clarabel::solver::core::cones::Cone<T>>::compute_barrier
             at external/crate__clarabel-0.6.0/src/solver/core/cones/psdtrianglecone.rs:292:9
   3: <clarabel::solver::core::cones::supportedcone::SupportedCone<T> as clarabel::solver::core::cones::Cone<T>>::compute_barrier
             at external/crate__clarabel-0.6.0/src/solver/core/cones/mod.rs:42:1
   4: <clarabel::solver::core::cones::compositecone::CompositeCone<T> as clarabel::solver::core::cones::Cone<T>>::compute_barrier
             at external/crate__clarabel-0.6.0/src/solver/core/cones/compositecone.rs:363:24
   5: <clarabel::solver::implementations::default::variables::DefaultVariables<T> as clarabel::solver::core::traits::Variables<T>>::barrier
             at external/crate__clarabel-0.6.0/src/solver/implementations/default/variables.rs:213:20
   6: <clarabel::solver::core::solver::Solver<D,V,R,K,C,I,SO,SE> as clarabel::solver::core::solver::internal::IPSolverInternals<T,D,V,R,K,C,I,SO,SE>>::backtrack_step_to_barrier
             at external/crate__clarabel-0.6.0/src/solver/core/solver.rs:483:31
   7: <clarabel::solver::core::solver::Solver<D,V,R,K,C,I,SO,SE> as clarabel::solver::core::solver::internal::IPSolverInternals<T,D,V,R,K,C,I,SO,SE>>::get_step_length
             at external/crate__clarabel-0.6.0/src/solver/core/solver.rs:473:22
   8: <clarabel::solver::core::solver::Solver<D,V,R,K,C,I,SO,SE> as clarabel::solver::core::solver::IPSolver<T,D,V,R,K,C,I,SO,SE>>::solve
             at external/crate__clarabel-0.6.0/src/solver/core/solver.rs:330:18
   9: clarabel_cpp_rust_wrapper::solver::implementations::default::solver::_internal_DefaultSolver_solve
             at external/clarabel_cpp_internal/rust_wrapper/src/solver/implementations/default/solver.rs:109:5
  10: clarabel_DefaultSolver_f64_solve
             at external/clarabel_cpp_internal/rust_wrapper/src/solver/implementations/default/solver.rs:117:5