-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run all tests against bridged SDPA model #2357
Conversation
|
They are skipped for the SDPA, CSDP, SDPLR, ... solvers but not for the tests in MathOptInterface.jl/test/Bridges/lazy_bridge_optimizer.jl Lines 365 to 372 in 2fb6eb2
|
Oh. Let's just exclude it. They're not really meant to be bridged like this just yet. |
7790ece
to
cac4138
Compare
51b1531
to
fac23aa
Compare
fac23aa
to
efbad9c
Compare
I'm taking a look at some of the remaining issues |
test_model_ListOfVariablesWithAttributeSetimport MathOptInterface as MOI
include("test/Bridges/sdpa_models.jl")
model =
MOI.instantiate(StandardSDPAModel{Float64}; with_bridge_type = Float64)
config = MOI.Test.Config(
exclude = Any[MOI.optimize!, MOI.SolverName, MOI.SolverVersion],
)
MOI.Test.test_model_ListOfVariablesWithAttributeSet(model, config) test_model_LowerBoundAlreadySetimport MathOptInterface as MOI
include("test/Bridges/sdpa_models.jl")
model =
MOI.instantiate(StandardSDPAModel{Float64}; with_bridge_type = Float64)
config = MOI.Test.Config(
exclude = Any[MOI.optimize!, MOI.SolverName, MOI.SolverVersion],
)
MOI.Test.test_model_LowerBoundAlreadySet(model, config) test_model_UpperBoundAlreadySetimport MathOptInterface as MOI
include("test/Bridges/sdpa_models.jl")
model =
MOI.instantiate(StandardSDPAModel{Float64}; with_bridge_type = Float64)
config = MOI.Test.Config(
exclude = Any[MOI.optimize!, MOI.SolverName, MOI.SolverVersion],
)
MOI.Test.test_model_UpperBoundAlreadySet(model, config) test_model_ScalarFunctionConstantNotZeroimport MathOptInterface as MOI
include("test/Bridges/sdpa_models.jl")
model =
MOI.instantiate(StandardSDPAModel{Float64}; with_bridge_type = Float64)
config = MOI.Test.Config(
exclude = Any[MOI.optimize!, MOI.SolverName, MOI.SolverVersion],
)
MOI.Test.test_model_ScalarFunctionConstantNotZero(model, config) |
So it makes sense that the But look at this: julia> model =
MOI.instantiate(GeometricSDPAModel{Float64}; with_bridge_type = Float64);
julia> x = MOI.add_variable(model)
MOI.VariableIndex(1)
julia> set2 = MOI.GreaterThan(0.0)
MathOptInterface.GreaterThan{Float64}(0.0)
julia> set1 = MOI.EqualTo(0.0)
MathOptInterface.EqualTo{Float64}(0.0)
julia> ci = MOI.add_constraint(model, x, set1)
MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}(1)
julia> print(model)
Feasibility
Subject to:
VariableIndex-in-EqualTo{Float64}
v[1] == 0.0
julia> ci = MOI.add_constraint(model, x, set1)
MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.EqualTo{Float64}}(1)
julia> print(model)
Feasibility
Subject to:
VectorAffineFunction{Float64}-in-Zeros
┌ ┐
│-0.0 + 1.0 v[1]│
└ ┘ ∈ Zeros(1)
VariableIndex-in-EqualTo{Float64}
v[1] == 0.0 |
# Cannot substitute `MOI.VariableIndex(1)` as it is bridged into `0.0 + 1.0 MOI.VariableIndex(-1)`. | ||
# This seems okay. We can't get a list of variables if they are | ||
# bridged. | ||
"test_model_ListOfVariablesWithAttributeSet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a maybe. I didn't look too deeply if you know better
6667579
to
a0cc5a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. There are still a couple of stragglers, but I don't now what we should do about them. We're much better than before.
Closes #2375
When looking over the failing tests of https://github.com/blegat/SDPLR.jl/, I noticed some were due to MOI bugs. When looking at how to reproduce them, I found out that we could have detected them by running against all the tests. Looking back at the history, it seems I initially just called
nametest
because it wasn't so easy to run all the tests. When @odow migrated to the new test infrastructure, he usedinclude = ["ConstraintName", "VariableName"],
so that's its equivalent tonametest
. This did not take the opportunity brought by this new test infrastructure to run it against all the tests. These tests are usually failing for all solvers so fixing them should help many solver wrappers at the same time.This brings up a few bugs that I suggest we first fix in separate PRs with their own tests:
GeometricSDPA
(so it should help SCS, ECOS, COSMO, SeDuMi, SDPT3, CDCS, Clarabel, ...)test_conic_SecondOrderCone_INFEASIBLE
Fix RSOCtoPSD bridge for dimension 2 #2359test_model_LowerBoundAlreadySet
[Bridges] fix BoundAlreadySet errors #2376test_model_UpperBoundAlreadySet
[Bridges] fix BoundAlreadySet errors #2376StandardSDPA
(so it should help CSDP, SDPA, SDPLR, DSDP, ...)test_basic_VectorOfVariables_Nonpositives
[Bridges] Fix ConstraintIndex conflicts between variable and constraint bridges #2362test_basic_VectorOfVariables_SecondOrderCone
[Bridges] Fix ConstraintFunction getter of conversion bridge with small rounding errors #2360test_conic_SecondOrderCone_INFEASIBLE
Fix RSOCtoPSD bridge for dimension 2 #2359test_model_ListOfVariablesWithAttributeSet
[Bridges] Fix ListOfVariablesWithAttributeSet #2380test_model_LowerBoundAlreadySet
[Bridges] Throw for bound already set on bridged variable #2383test_model_UpperBoundAlreadySet
[Bridges] Throw for bound already set on bridged variable #2383test_model_ScalarFunctionConstantNotZero
[Bridges] Throw in Constraint.SlackBridge if scalar constant is nonzero #2382test_model_delete
[Bridges] Fix deletion corner cases #2377test_multiobjective_vector_nonlinear
,test_multiobjective_vector_nonlinear_delete
,test_multiobjective_vector_nonlinear_delete_vector
,test_multiobjective_vector_nonlinear_modify
: missingisapprox(::MOI.ScalarAffineFunction{Float64}, ::MOI.VariableIndex)
test_multiobjective_vector_of_variables
,test_multiobjective_vector_of_variables_delete_all
,test_multiobjective_vector_of_variables_delete
,test_multiobjective_vector_of_variables_delete_vector
: missingsubstitute_variables(_, ::MOI.VectorOfVariables)