oxfordcontrol / COSMO.jl

COSMO: Accelerated ADMM-based solver for convex conic optimisation problems (LP, QP, SOCP, SDP, ExpCP, PowCP). Automatic chordal decomposition of sparse semidefinite programs.
https://oxfordcontrol.github.io/COSMO.jl/stable
Apache License 2.0
282 stars 41 forks source link

Test failure on 1.9 due to upstream bug #177

Closed odow closed 1 year ago

odow commented 1 year ago

I've been looking into why COSMO is failing on Julia v1.9, and I think it's a compiler bug.

Here are the three methods:

https://github.com/oxfordcontrol/COSMO.jl/blob/c95bf89f111a83f52febf326615a091ad0418f00/src/interface.jl#L384-L391

julia> import COSMO, SparseArrays

julia> T = BigFloat
BigFloat

julia> A = SparseArrays.spdiagm(0 => ones(T, 4))
4×4 SparseArrays.SparseMatrixCSC{BigFloat, Int64} with 4 stored entries:
 1.0   ⋅    ⋅    ⋅ 
  ⋅   1.0   ⋅    ⋅ 
  ⋅    ⋅   1.0   ⋅ 
  ⋅    ⋅    ⋅   1.0

julia> b = zeros(T, 4)
4-element Vector{BigFloat}:
 0.0
 0.0
 0.0
 0.0

julia> constraint = COSMO.Constraint(A, b, COSMO.PsdCone)
Constraint{BigFloat}
Size of A: (4, 4)
ConvexSet: COSMO.PsdCone{BigFloat}

julia> COSMO.type_checks([constraint])

julia> COSMO.type_checks(constraint.convex_set)
ERROR: ArgumentError: COSMO currently does not support the combination of PSD constraints and BigFloat.
Stacktrace:
 [1] type_checks(convex_set::COSMO.PsdCone{BigFloat})
   @ COSMO ~/.julia/dev/COSMO/src/interface.jl:391
 [2] top-level scope
   @ REPL[27]:1

Opening this issue so I can track. I'll simplify a reproducible example and then report upstream. A temporary work-around is probably to break apart the Union.

migarstka commented 1 year ago

Merged and part of 0.8.8 release https://github.com/oxfordcontrol/COSMO.jl/commit/d03d34012ab82d4abebd08f7a10807b7d9761ad2