-
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
Add tests, extend docstring for ScalarQuadraticFunction. #697
Conversation
By the way, I don't know the process for adding tests to MOI. Should these pass with some subset of solvers? Is this considered a breaking change that requires a major version bump? |
It's not considered a breaking change. The solvers should be passing the new tests, otherwise it means they have a bug. |
That makes sense, but it also requires that tests should be highly configurable in terms of what the solvers support. For example, SCIP.jl excludes one test of the QCP suite, because it requires |
Codecov Report
@@ Coverage Diff @@
## master #697 +/- ##
=========================================
- Coverage 95.23% 95.2% -0.04%
=========================================
Files 53 54 +1
Lines 5546 5690 +144
=========================================
+ Hits 5282 5417 +135
- Misses 264 273 +9
Continue to review full report at Codecov.
|
It requires |
The other QCP tests are written with |
Yes, you could use the |
Sorry, this is kind of off-topic here, but let's clarify it anyways:
And we do: SCIP/test/MOI_wrapper.j. Also, even using the |
Indeed, if you do that, you might be easily be broken by new tests. With the addition of Scalarize, Functionize, FlipSign and Slack bridges, solvers can have a very limited set of supported constraints and may not pass many tests without bridges. I would recommend running all tests with the optimizer bridged with
This should be resolved by #529 so it shouldn't weight in the long term decision on whether new tests mean breaking change :-P |
That's a good suggestion which I will implement now 👍 |
- will not fail when future tests use unsupported constraints or other features - as discussed in jump-dev/MathOptInterface.jl#697
These two tests do not correspond to convex qcp for qcp4, it is quadratic-in-lessthan with a non-psd matrix and for qcp5 it is quadratic-in-equalto. We should probably make a different testset for non-convex or a sub-testset so that SOC solvers can easily exclude them all. |
Fair enough, it was not obvious that the QCP testset should be limited to convex problems. Actually, the intent of these cases was not to test nonconvex constraints, but quadratic constraints with off-diagonal nonzeros, because they are treated differently w.r.t. to the scaling factor 2. So maybe it would be better to turn them into convex problems instead. EDIT: or do both 😄. I just defined |
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.
Looks good, SCS and Mosek are passing these two new convex qcp tests
We just discovered a bug in SCIP.jl (#106) in the handling of quadratic coefficients off the diagonal, based on my misunderstanding of the MOI docs.
To add prevent this kind of problem, I've added a small example to the docstring and two QCP tests.