Repository navigation
Conversation
- New option alg:pdhgearlycrossover (PDHGEarlyCrossover, added in the 14.0.0 release; the beta's PDHGCrossover was dropped). - pre:sparsify documents value 2 (all model types). - Ranges of pre:funcpieceerror, pre:funcpiecelength and pre:funcpieces follow the limits enforced by Gurobi. - bar:crossover text covers PDHG and NL barrier. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Gurobi 14 keeps constraints added by GRBaddnlconstr() in their own list. The driver put them into the algebraic and general groups, so IISNLConstr was never read and nonlinear IIS members were reported as 'non'. They now form the CG_Nonlinear group: iis:find reads IISNLConstr and .iisforce sets IISNLConstrForce. Builds against Gurobi 13 keep GRBaddgenconstrNL() in the general group. Document that with Gurobi 14 the .funcpiece... suffixes apply only to function constraints (acc:_expr=0). end2end: infeas_nl_01 (nonlinear IIS member; fails without the fix on Gurobi 14, passes on 13.0.3) and funcpieces_01_lcon with acc:_expr=0. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- The five .funcpieces cases set acc:_expr=0: Gurobi 14 accepts the suffix only on function constraints. The separate acc:_expr=0 copy of funcpieces_01_lcon is dropped. - Three ellipse qcpdual cases: QCP duals at the default barrier tolerance are accurate to about 1e-3 and differ between Gurobi 13 and 14. Gurobi runs them with a tighter bar:qcptol; the converged duals are accepted next to the previous values. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The missing nonlinear IIS members affected only builds against Gurobi 14, which were not released. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fdabrandao
left a comment
There was a problem hiding this comment.
Review of the Gurobi 14 NL-constraint IIS group change. The core fix looks right: without it, NL constraints inflated CG_General past Gurobi's general-constraint count. Comments below are from reading the code only (not built against a Gurobi 14 header).
One point outside the diff: InputGurobiFuncApproxParams() (gurobibackend.cc ~L967) reads .funcpieces / .funcpieceerror / .funcpiecelength / .funcpieceratio / .funcnonlinear / .global only from CG_General. With Gurobi 14 and default acc:_expr, these suffixes on NL constraints (now in CG_Nonlinear) are silently ignored; only the changelog mentions acc:_expr=0. Consider warning when these suffixes are set and CG_Nonlinear is non-empty.
🤖 Generated with Claude Code
| /// Constraints added by GRBaddnlconstr() form their own list | ||
| /// in Gurobi (attributes NumNLConstrs, IISNLConstr, ...), | ||
| /// separate from the general constraints. | ||
| #define GRB_NLCON_GROUP CG_Nonlinear |
There was a problem hiding this comment.
Group selection here is gated on the version macro (13.9+ / __GRB_NL_OBJCON__), but IIS read/force for the new group is gated separately on #ifdef GRB_INT_ATTR_IIS_NLCONSTR / _IIS_NLCONSTRFORCE / _NUMNLCONSTRS. If a header passes the version check but lacks (or spells differently) those attributes, NL constraints go to CG_Nonlinear but ConsIIS never fills it: every NL IIS member is reported as non and .iisforce is dropped silently. Suggest gating all of these on the same condition, or #error if the attributes are missing.
| void SetNLObjective(int, const NLObjective&); | ||
| #else | ||
| /// GRBaddgenconstrNL(): a general constraint | ||
| #define GRB_NLCON_GROUP CG_General |
There was a problem hiding this comment.
Nit: GRB_NLCON_GROUP is a #define inside the class body, so it leaks into every TU including this header. Since NLConstraint only exists in the __GRB_NL_OBJCON__ branch, the NLAssign* ACCEPT_CONSTRAINT lines could be written with CG_Nonlinear / CG_General directly in each #if/#else branch (or use a static constexpr member) instead of a macro.
| { CG_General, iis_gencon }}}; | ||
| #ifdef GRB_INT_ATTR_IIS_NLCONSTR // Gurobi 14: separate NL constraints | ||
| std::vector<int> iis_nlcon = | ||
| GrbGetIntAttrArray(GRB_INT_ATTR_IIS_NLCONSTR, NumNLCons()); |
There was a problem hiding this comment.
GrbGetIntAttrArray swallows Gurobi errors and returns an empty vector. If the IISNLConstr query fails, CG_Nonlinear gets 0 entries while the model has NumNLCons() NL constraints, and the user gets no diagnostic. Suggest checking the size against NumNLCons() and warning / skipping the group.
| Swap_0_vs_minus1(iisf); | ||
| GrbSetIntAttrArray(GRB_INT_ATTR_IIS_GENCONSTRFORCE, iisf); | ||
| } | ||
| #ifdef GRB_INT_ATTR_IIS_NLCONSTRFORCE |
There was a problem hiding this comment.
The presolved CG_Nonlinear array is passed to GRBsetintattrarray(IISNLConstrForce, ...) without checking its length equals NumNLCons(). If anything other than NLConstraint / NLAssign* ever maps to this group, this would write past Gurobi's NL constraint list. A cheap size check would guard it.
| - *pre:sparsify* documents value 2 (all model types). | ||
| Documented ranges of *pre:funcpieceerror*, *pre:funcpiecelength* | ||
| and *pre:funcpieces* follow the Gurobi limits. | ||
| - With Gurobi 14, *iis:find* reports nonlinear constraints as |
There was a problem hiding this comment.
Commit 144d11b says Gurobi 14 builds were never released, and AGENTS.md says to highlight regressions only when they affected a shipped build. This entry reads as a fix to a shipped Gurobi 14 driver; suggest dropping it or folding it into the Gurobi 14 support note.
| }, | ||
| "values": { | ||
| "_con[1]": -1.581437391665411 | ||
| "_con[1]": [-1.581437391665411, -1.5811388] |
There was a problem hiding this comment.
Widening the expected dual to [-1.581437391665411, -1.5811388] applies to every solver, not just Gurobi, so a regression between the two values (~3e-4 apart) would pass for all solvers. Could this be a solver-specific expectation, or a single corrected reference with tolerance?
…irst Gurobi 14 release One condition (MP_GRB_NLCON_LIST) selects the NL constraint group and the IIS attributes; the group is a constexpr member instead of a macro; the IIS force array for NL constraints is size-checked; a warning when .funcpiece... suffixes are set on nonlinear constraints, which ignore them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks for the review. Pushed 6c90c3b; checked with Gurobi 14.0.0
🤖 Generated with Claude Code |
…well Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The cases set acc:_expr=0, which the MP2NL driver cannot handle for log; and an MP2NL run does not exercise the suffix anyway. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pushed three more commits (end2end test lists only, no driver code):
Checked together with # (the two branches merged; the 🤖 Generated with Claude Code |
fdabrandao
left a comment
There was a problem hiding this comment.
Review of the diff as it is now (read-only review; not built, tests not run). No blocking bugs found.
Checked and fine
GetConValues()(CG_Nonlinear)is safe:mvis non-const, so the non-constoperator()(int)creates the key instead of hitting the throwingmap_.at().NLConstraint,NLAssignEQ/LE/GEall useGRBaddnlconstrunder__GRB_NL_OBJCON__and all go throughNLConGroup(), so group order matches Gurobi's NL list order.- On Gurobi 14 headers
__GRB_NL_OBJCON__is always defined, so theGRBaddgenconstrNLfallback can't be mixed withCG_Nonlinear.
Suggestions
- Gurobi 13.9 (minor, pre-existing): with
__GRB_NL_OBJCON__set but noMP_GRB_NLCON_LIST, cons are added viaGRBaddnlconstrbut still classifiedCG_General, soConsIIS()/.iisforcereadIISGenConstrfor them. Not a regression, but worth checking on 13.9 if supported. - No test for
.iisforceon NL constraints; the newIISNLConstrForcebranch and its size check are untested. - The
.funcpiece*NL warning has no test; the test edits only addacc:_expr=0. funcpieceerror[1e-6, 1e6],funcpiecelength[1e-5, 1e6],funcpieces<= 2e8 now apply to all Gurobi versions; older versions may have accepted wider values. Consider gating by version.- The new
pdhgearlycrossovertext says "default 2"; please verify against the Gurobi 14 docs. infeas_nl_01lists 8 solvers with identical expectations (N1.iis = ["mem","upp"]); please confirm they all pass (the comment says Xpress reports the upper side only).barqcptol=1e-9/1e-11in the qp tests are applied to every Gurobi version, not just 14.- Nit:
WarnFuncSuffixOnNLConsparameters are unused whenMP_GRB_NLCON_LISTis undefined; may trigger unused-parameter warnings ([[maybe_unused]]).
The NL constraints are a new group, needed that for IIS/Force