Skip to content

Task 043: Row/column vector fixes, cone fixes, bounds of exp/log results, driver fixes - #290

Open
glebbelov wants to merge 14 commits into
masterfrom
task-043/start-vector-sizes
Open

glebbelov wants to merge 14 commits into
masterfrom
task-043/start-vector-sizes

Conversation

@glebbelov

@glebbelov glebbelov commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes for issues found while re-running the INFORMS Talk experiments (see benchmarks/.../INFORMS_Handoff).

Most changes checked by 3 rounds of subagent reviews, as descirbed by pre-release rules.

Fixes found while checking that vectors exchanged with solvers (starts,
duals, IIS, constraint groups) have the right sizes and positions, plus
conversion bugs found on the way. Seven commits, each with its tests and
CHANGES entries.

  1. end2end: the fast set runs with a 5 s limit by default (--timeout
    overrides); new runner entries '_mp2nl' run an MP driver as the
    MP2NL subsolver.
  2. cones: a convex QP objective became a rotated cone with the coefficient
    instead of its square root; qcones2qc dropped the square of a fixed first
    variable; the exponential-cone check ignored a constant term (a driver
    returned a wrong optimum, 1.3 instead of 1.109). Tests socp_14..18,
    expcones_08.
  3. multi-objective emulator: with a negative .objweight of the first
    objective the nonlinear part of a pass objective was relaxed in the wrong
    direction (unbounded or wrong optimum). Tests multiobj_NL_01/QP_02.
  4. preprocessing: the results of exp, a^x, log and log_a are bounded by the
    argument's bounds, so logical constraints containing them no longer stop
    with "Set bounds on variables participating in logical expressions" when
    big-M is needed. New option cvt:pre:funcbndtol (relative margin, default
    1e-12; negative restores the old behavior). Tests funcbnd_*.
  5. baronmp: duals, skipped constraints, scratch=<dir> overwrite no longer
    deletes the user's directory, == for function constraints.
  6. gcgmp, mosek, cbcmp, mp2nl, cuoptmp, scipmp: small fixes found by
    Debug/ASan runs (indexing, guards, SOC parameters passed unchanged).
  7. xpress, cplex, gurobi, copt: constraints groups (indicator, PWL,
    nonlinear) and duals of the fixed model; native multi-objective optimization
    stops with "all of them must be linear" when an objective is not linear
    (COPT used to drop a quadratic objective silently).

Compatibility: the only new behavior with an option is item 4
(cvt:pre:funcbndtol=-1 restores the old bounds). Item 7 turns a silently wrong
result (COPT) or a solver error into a clear error message.

Validation: fast end2end set, 5 s, 1 thread, all drivers directly and as MP2NL
subsolvers, Release, Debug, ASan; MP unit tests: same failures as on master
(expr-test, expr-visitor-test, problem-test; sp-test in Debug).
For item 4 Debug and ASan were not run.

Known open items, not in this PR: BARON 25.12.10 returns a wrong optimum for
x3 - exp(x0+x1) == 0 with a lower bound on x3 (acc:_expr=0 avoids it; vendor
report pending); BARON duals pair with the last solution; COPT 8 NLP preview
issues.

Overlap with #289: both change CHANGES.gurobi.md and
iis_feasrelax/modellist.json (appended entries; the conflicts are textual,
resolve by keeping both parts). The merged tree of the two branches was built
and the whole fast end2end set was run with every driver, directly and under
MP2NL (Gurobi 14.0.0, COPT 9.0.0): no new failures.

🤖 Generated with Claude Code

glebbelov and others added 7 commits November 16, 2026 10:32
…NL subsolvers

Cases of the fast set run with a 5 s limit by default (--timeout overrides).
New solver entries '<driver>_mp2nl' run an MP driver through MP2NL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A convex QP objective became a rotated cone with the coefficient instead of its
square root; qcones2qc dropped the square of a fixed first variable; the
exponential-cone check ignored a constant term. Tests socp_14..18, expcones_08.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e right direction

With a negative .objweight of the first objective the pass objective's nonlinear
part was relaxed the wrong way. Tests multiobj_NL_01, multiobj_QP_02.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…argument

Needed for big-M of logical constraints with such functions. New option
cvt:pre:funcbndtol (default 1e-12 relative margin; negative: old behavior).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…' for functions

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… Debug and ASan runs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tive multi-objective errors

Indicator, PWL and nonlinear constraints in the right groups; duals of the fixed
model; a clear error when several objectives are passed natively and one is not
linear (COPT dropped a quadratic one silently).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
glebbelov and others added 4 commits November 16, 2026 13:50
…ounds

Since the result of exp is bounded by its argument (z >= 0 gives 1) and
widened by cvt:pre:funcbndtol, the explicified exp result no longer has
lower bound 0 with best bounds: check for a value just below 1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…obj=0 and cvt:nlobj=0

When several objectives are handled natively and one is quadratic or
nonlinear, the message now also names the options that move quadratic and
nonlinear objective terms into constraints (synonyms passquadobj, passnlobj):
all objectives are then linear and the native multi-objective optimization
works. New end2end case multiobj_QP_02 with cvt:quadobj=0 (Gurobi, Xpress,
COPT; CPLEX's native multi-objective optimization does not take the
quadratic constraint, its message is unchanged).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…in scipmp

The small-fixes commit had added a second "unreleased" section next to an
existing "Unreleased" one; merge them. scipmp: use the spelling of the other
files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… supported

The synonyms passquadobj and passnlobj are no longer named in the error
messages or changelogs. The Xpress changelog states only that Xpress 10 is
supported (customer-facing text: no Optimizer build numbers or older
versions).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@glebbelov

Copy link
Copy Markdown
Contributor Author

Three more commits:

  • Test fix: BoundsBestExprTest expected the exp result lower bound 0; since the
    bounds follow the argument (z >= 0 gives 1, widened by cvt:pre:funcbndtol) it
    checks for a value just below 1.
  • Gurobi, Xpress and COPT: when several objectives are handled natively and one
    is quadratic or nonlinear, the error also names cvt:quadobj=0 and
    cvt:nlobj=0, which move those terms into constraints so that native
    multi-objective optimization works. New end2end case multiobj_QP_02 covers it
    (not CPLEX: its native multi-objective optimization does not accept the
    quadratic constraint, its message is unchanged).
  • Changelogs: one unreleased section in MOSEK and GCG; Xpress states only that
    Xpress 10 is supported.
    Checked together with PR 289 and the task-041 branch on a local merge: unit
    tests and end2end show no new failures.

🤖 Generated with Claude Code

glebbelov and others added 2 commits November 16, 2026 16:42
The quadratic form of a cone whose first variable is fixed by its bounds
used (c0*v)^2 as the right-hand side, which drops the cone's v >= 0:
sqrt(x^2+y^2) <= t with t fixed at -3 was solved (Gurobi, Xpress, CPLEX,
SCIP, BARON: objective 4.24). The right-hand side is now c0^2*v*|v|.
Found in the review of the merged branches (finding B-F1). Test
conic/socp_19_fixed_x0_negative; changelog entry for the fixed-head fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With cvt:pre:funcbndtol=0 the domain of a piecewise-linear approximation,
clipped by the function values, can end 1 ulp below an integer bound
(exp(log(5)) = 4.999...): the breakpoint x = 5 was lost and the solver
extrapolated there (log(x) - 0.27x over integer x in [1,5]: x = 5,
0.324 reported instead of x = 4, 0.306). ConsiderIntegrality() now
rounds the ends with a relative tolerance of 1e-9. The help of
cvt:pre:funcbndtol no longer calls 0 "exact bounds".
Review findings B-F2, B-F3. Test logical/funcbnd_log_02_int.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glebbelov

Copy link
Copy Markdown
Contributor Author

Review on Windows of this branch merged with #289 and #288 (MSVC 2026, Gurobi 13.0.3, Xpress 10.0, COPT 8.0.6, HiGHS 1.15.1, MOSEK 11.2, SCIP 10.0.2): two rounds, four reviewers on two models (round 1 independent, diff and descriptions only; round 2 each confirmed or refuted the others' findings with a run or the exact lines). Two commits added, d703b2a and 99eca00.

Fixed (confirmed by runs of three or four reviewers, reproduced again before the fix)

  1. Cone with the first variable fixed at a negative value (qcones2qc.h, 99eca00). The quadratic form used (c0*v)^2 as the right-hand side, which drops v >= 0. As a result sqrt(x^2+y^2) <= t with t fixed at -3 was reported solved with objective 4.24 by Gurobi, Xpress, CPLEX, SCIP and BARON. MOSEK, COPT and HiGHS were right. The right-hand side is now c0^2*v*|v|. Before this branch the old c0^2*v was infeasible here by accident, so this was a regression of the fixed-head fix. Test conic/socp_19_fixed_x0_negative: it fails with the previous commit on those five drivers and passes now.
  2. cvt:pre:funcbndtol=0 loses the last integer breakpoint of a PL approximation (d703b2a). The domain clipped by the function values ended at exp(log(5)) = 4.999..., and floor dropped x = 5, so the solver extrapolated there. For log(x) - 0.27x over integer x in [1,5] HiGHS and COPT returned x = 5, objective 0.259, instead of x = 4, objective 0.306. ConsiderIntegrality() now rounds the ends with a relative tolerance of 1e-9. The default 1e-12 was not affected. The option help no longer calls 0 "exact bounds". Test logical/funcbnd_log_02_int funcbndtol=0 (HiGHS, COPT, directly and under MP2NL): it fails before and passes after.

Checked and correct

  • The old behaviour is restored exactly: funcbndtol < 0 gives the bounds of master.
  • With cvt:pre:disj2ind and cvt:pre:vbnd (default, -1, 0, disj2ind=0 vbnd=0, native indicators on and off) the optimum is the same in every combination, apart from the expected refusal with -1 when big-M is needed.
  • Multi-objective direction with a negative weight; QP-objective and exponential cones.
  • Xpress IIS with indicator rows.
  • CPLEX mip:basis on an MIQCP.
  • BARON duals, skipped rows, scratch=<dir> overwrite (user files kept) and == for function constraints.

Investigated, not a defect of this branch

  • Xpress mip:basis on a MIP with max() reported "nonlinear solve, with duals" with zero duals. The cause is Xpress itself: its local SLP returns duals of the wrong sign, or zeros, when the model has a MAX formula (-3 instead of 3 on a smooth point, -0.5 instead of 0.5 at the kink). acc:max=0 gives the right duals. On smooth NLPs the signs are right, and the driver passes XPRSgetduals unchanged. A report for FICO is being prepared.

Optional, not changed (confirmed by code lines)

  • CPLEX original_model_type_ is not reset in Solve().
  • Xpress: the start vector is silently resized; return codes in SolveFixedNonlinear are ignored; garbled comment at xpressmodelapi.cc:119.
  • Xpress mip:basis fails on some convex MIQCPs ("XPRSlpoptimize failed"). Not claimed fixed.
  • BARON: "txt" typo at baronmpcommon.cc:295; the dual count is not checked; the changelog does not mention the scratch, skipped-row and == changes.
  • a^x with a negative base is mishandled (NaN; this predates the branch); degenerate result bounds make the function a constant (no wrong result reproduced).

Tests on Windows

  • MP unit tests, Release and ASan: the same failures as master (expr-test, expr-visitor-test, problem-test, os-test path layout; solver-test does not compile on master and has 16 failures here, as on macOS). No sanitizer report.
  • end2end fast set, Release, 1 thread: 12 MP drivers directly, 10 as MP2NL subsolvers, 5 ASL drivers through MP2NL. Comparison with master is running.
  • ASan and Debug runs with the fixes are running.

🤖 Generated with Claude Code

…nd cvt:nlobj=0

With Gurobi 14 the quadratic objective is passed as a nonlinear one, so both
options (as the error message says) are needed for native multi-objective
optimization; Gurobi 13, Xpress and COPT accept either.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@fdabrandao fdabrandao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of the diff as it is now (read-only review; not built, tests not run). No blocking bugs found.

Fixes that look correct against the code

  • qcones2qc.h: fixed-x0 RHS was c0²·v, now c0²·v|v|. The cone is (c0·x0)² >= Σ(ci·xi)², so the old code dropped a square; a negative fixed v now makes the row infeasible, as the cone needs x0 >= 0.
  • cones.h: QP objective gives cone coefficients sqrt(|q|); exp-cone check 0.0 == fabs(a && b) is now 0.0 == a && b (it ignored the constant term).
  • converter_multiobj.h: the pass objective takes its own sense for sense_true, not the first objective's (flipped by a negative weight).
  • piecewise_linear.cpp: tolerance in the integer-domain rounding.
  • Solver fixes: CBC Cbc_setMIPStartI now passes sparse val; COPT AddGenericCone missing return; CPLEX CPXgetctype exclusive end index; SCIP extra sqrt on SOC coefficients; GCG linking read as a VAR suffix; Mosek sizes from the task (the INFO items are 0 before the first solve); MP2NL dual/primal array sizing; BARON no longer deletes a user scratch dir (removeBaronDir compiles: all file-name constants are std::string).

Suggestions

  1. MonotoneRange edge cases (constr_prepro.h): a log argument with ub == 0 gives {-inf, -inf}, and logA with base 1 (log(v)/0) can give {+inf, +inf}; both reach narrow_result_bounds as degenerate ranges. Fall back to {-inf, inf} when ru == -inf or rl == +inf. The PR notes Debug/ASan were not run for this item, so these edges are untested.
  2. Garbled comment in xpressmodelapi.cc: "the solve fails it refuses additional objectives next to a quadratic one." Please reword.
  3. Xpress SolveFixedNonlinear converts integer columns to continuous on model_fixed_, which is the main lp(). Check that IsMIP() and other later queries reading column types are unaffected.
  4. BARON DualSolution_LP does std::find over skipped for every position (O(n·k)); a set or merge walk is cheaper for models with many empty constraints.
  5. GCG header: a stray blank line between the /// Index in GCG's decomposition data... comment and findDecompVarIndex detaches the doc comment.
  6. Overlap with #289 (CHANGES.gurobi.md, iis_feasrelax/modellist.json, and the Gurobi 14 NL constraint group): HasNLGenCons() / IsNLP should still hold, but please rerun the merged-tree check after whichever PR merges first.
  7. CPLEX ConsiderCplexFixedModel now skips the fixed solve for an MIQCP with indicator/SOS/PWL constraints, with a message. Reasonable; a CHANGES note would help users relying on mip:basis there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants