Skip to content

Integration 2026-11: logical-conversion fixes, start vectors, MP2NL and driver fixes - #293

Open
glebbelov wants to merge 101 commits into
masterfrom
integration/2026-11
Open

glebbelov wants to merge 101 commits into
masterfrom
integration/2026-11

Conversation

@glebbelov

Copy link
Copy Markdown
Contributor

Summary

This pull request combines three topic branches that were developed and tested together,
plus one Gurobi 14 commit that is not yet on master:

  • task-041/nl-writer-long-temp-path: the NL writer and MP2NL on long temporary paths
    (Windows), and MP2NL error reporting;
  • task-043/start-vector-sizes: row and column vectors passed to and from the solvers
    (Xpress row order, driver audit), function bounds for exp/a^x/log,
    multi-objective messages;
  • task-045/logical-conversion-fixes: logical-constraint conversion, inlining of linear
    subexpressions, feasrelax, solution pools, and driver fixes from a systematic review;
    new randomly generated test models;
  • 7a43570f from task-007/gurobi-14-release, which was merged without it: a warning on a
    failed NL IIS query, and .funcnonlinear/.global on NL constraints.

It replaces the separate pull requests of these branches. The changelogs ("unreleased"
sections) describe every user-visible change; this description lists the main ones.

Main changes

Conversion of logical constructs, all solvers:

  • wrong results fixed:
    • a comparison shared by a disjunction and an if-then-else condition;
    • fractional fixed integers;
    • abs() of negative fixed variables;
    • comparisons outside a later-fixed domain;
    • contradictory auxiliary bounds;
    • domain holes (stack overflow);
  • an indicator whose flag becomes fixed later is folded (cvt:pre:indfixedflag, 0 restores
    the old behavior);
  • div/mod/floor/ceil/round/trunc result bounds are passed also without
    cvt:pre:boundsbest;
  • a warning when a divisor's domain contains 0;
  • contradictory equalities of an integer variable are reported infeasible.

Inlining. Linear and quadratic subexpressions are also inlined into the expressions
that define other variables:

  • new bit 32 of cvt:pre:unnest, default 63;
  • fill limits cvt:pre:linfill (default 10) and cvt:pre:quadfill;
  • cvt:pre:unnest=31 cvt:pre:linfill=-1 restores the old model.

With NL output, linear terms are no longer written as nonlinear, so CPLEX and Xpress through
MP2NL no longer reject such models as "not convex quadratic".

Bounds:

  • cvt:pre:roundintbnd rounds integer bounds inwards with a tolerance;
  • cvt:pre:infeasvarbnd=1 declares contradictory bounds infeasible; the default warns and
    passes them on;
  • the result bounds of exp, a^x, log and log_a follow from the argument; none for a
    base ≤ 0 or 1; cvt:pre:funcbndtol.

feasrelax (Gurobi, CPLEX, COPT, HiGHS):

  • constraints and variables added by the conversion are no longer relaxed for free;
  • CPLEX penalties were inverted.

Messages. Warnings and errors are wrapped at 60 characters; tech:msgwidth=0 restores
the old output.

Drivers:

  • Xpress:
    • row order with indicators;
    • IIS when none exists;
    • the legacy pool with best value 0;
    • MINLP solve messages;
  • SCIP:
    • the pool always contains the best solution;
    • unique indicator names;
  • MOSEK: the interrupt flag is reset per solve;
  • CPLEX: MIQCP duals of the fixed model;
  • BARON: skipped-element index;
  • Gurobi:
    • Gurobi 14 IIS and suffix warnings;
    • kappa_exact;
    • InfUnbdInfo only for continuous models;
  • MP2NL:
    • solve result codes;
    • temporary folders;
    • duals;
    • AMPLS error reporting;
  • AMPLS: a second AMPLSSolve() solves again (regression in 20261029).

Tests:

  • new end-to-end cases for each fix;
  • cases/categorized/fast_random: 4100 randomly generated logical models, with expected
    results from enumeration. It is not run by default;
  • test/end2end/generators/logical_models.py reproduces those models exactly;
  • fixed_sos2_pl (fixed model with SOS).

Compatibility

New defaults change models passed to solvers. The old behavior is restored by:

  • cvt:pre:unnest=31 cvt:pre:linfill=-1 (inlining);
  • cvt:pre:indfixedflag=0;
  • cvt:pre:roundintbnd=-1;
  • cvt:pre:funcbndtol=-1;
  • tech:msgwidth=0.

One instance of the INFORMS showcase (battery, Gurobi) became slower with the new inlining
in some seeds. With other seeds both formulations stop at the time limit. It is
equivalent, and is documented as variability.

Testing

Builds: Release, Debug and ASan/UBSan of the MP build and of the private driver build;
GCC 16 where the ABI allows it.

  • Unit tests: converter-flat, converter-mip, nl-solver, nl-reader and util pass
    on Release, Debug and ASan.
  • End-to-end fast set for every driver, including the ASL drivers through MP2NL: no new
    failures against the previous runs. Each failure that remains is known and listed in the
    task record.
  • Generated sets: 4119 cases. Remaining failures are vendor defects, reported separately.
  • INFORMS showcase: 216 cases. Results unchanged except the battery instance above.
  • Examples benchmark: Gurobi 14, Xpress and Knitro, 4 threads, 5 seeds; equal to the
    previous runs where compared.
  • colab.ampl.com notebooks with these builds: no failure attributable to MP.
  • Reviews: several rounds by two independent reviewers. Each finding was reproduced
    before the fix and re-tested after it.

The tree equals the tested merge of the three branches, apart from the order of changelog
entries, the master changelog date, and the new test models.

🤖 Generated with Claude Code

glebbelov and others added 30 commits November 13, 2026 10:57
A temporary directory whose path approaches or exceeds the 248-character
limit for directories made MP2NL terminate abnormally after the
conversion. The writer now keeps the directory as given when its
absolute form fits, otherwise uses the 8.3 form or the extended-length
form, and reports an error when the directory cannot be used.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…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>
…ong-path forms

The solver is run through std::system(), and the file stub went onto
that command line unquoted: a temporary directory with a space or another
shell character in its path broke the solver call. The stub is now
quoted (double quotes on Windows, single quotes elsewhere; on Windows a
stub with a double quote, which no file name can contain, is reported).
On Windows the whole command is also wrapped in one more pair of quotes,
which cmd.exe /c removes when the command has more than two. A quoted
solver path gets ".exe" before its closing quote.

The 8.3 and extended-length forms of a long temporary directory are
removed: Windows does not accept a TMP longer than MAX_PATH anyway, so
they only extended the usable length from about 225 to 259 characters,
and the extended-length form would reach third-party solvers. A
temporary directory that cannot be used still ends with a message
instead of an uncaught exception.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nl-solver-test runs NLSolver with a stand-in solver (nlsol-fake-solver)
that checks its command line and writes back the stub it received:
QuoteCommandArg; a custom stub and an automatic one in a temporary
directory whose name has shell characters; a missing temporary
directory; on Windows, one too long for NLSolver's subdirectory. The
last two expect NLUtils::myexit() rather than an uncaught exception.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DECLARE_SOLVER_API_FUNCTIONS(mp2nl) instead of (MP2NL): the library
now exports AMPLSClose_mp2nl and AMPLSGetModel_mp2nl, matching
AMPLSOpen_mp2nl and the other MP libraries (AMPLSOpen_gurobi /
AMPLSClose_gurobi, ...). AMPLSOpen_mp2nl, which released drivers look
up, is unchanged. Callers of the former AMPLSClose_MP2NL can look up
both names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NLSolver reports an unusable temporary directory via NLUtils::myexit(),
which exits by default; MP2NL then wrote no solution file. MP2NL now uses
an NLUtils whose myexit() throws, and Solve() catches it: the failure and
its message are reported to AMPL in the solution file. NLSolver forgets the
directory name before reporting, so a throwing myexit() cannot make the
destructor delete a directory it did not create.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…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>
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>
MP2NLUtils::myexit() now throws its own type, NLSolverExit, and Solve()
catches only that: other exceptions (NL feeder errors, bad_alloc) keep
their handling by BackendApp, with their own exit code, as before
d062836. The changelog notes that on Windows '%' in the temporary
directory path is still expanded by the command interpreter.
Review findings D-F2, D-F1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…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>
…ps integers

- Strict comparisons (<, >) that are true at the root now propagate the context
  into their arguments: a comparison shared by a disjunction and an
  if-then-else condition lost one of its implications (wrong optimum).
- An integer variable fixed at a fractional value stays integer (infeasible),
  instead of being made continuous; contradictory bounds keep the type.
- abs() of a variable fixed at a negative value: the constant result took a
  garbage variable index; use a fixed variable.
- Unary encoding: comparisons x==c with c outside the variable's domain (or
  fractional) are fixed to 0; their flags were left free and counted.
- MakeComplementVar accepts contradictory bounds (the model is infeasible).
- CP-SAT: cvt:pre:continuous_fixed_vars is off by default (new hook
  FixedVarsContinuousDefault()); contradictory or empty domains give
  infeasible instead of an error.
- Five regression cases in end2end fast/logical.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ReportKappaExact() used the .kappa suffix definitions, so the exact condition
number overwrote the estimate and .kappa_exact was never set.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The sense 'F' was passed to CPXaddindconstr, which CPLEX 22.2 mishandled
(wrong results or violated indicators; the LP writer printed '?').

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ted by the shell

NLSolver::Solve():
- remove <stub>.sol before the subsolver runs; a solve that wrote none fails
  instead of reporting the result of the previous solve (reused stub, passes
  of the multi-objective emulation);
- the subsolver's exit code (not the raw wait status) is reported, and a
  solution written before a nonzero exit is kept;
- solver options are split at white space (quotes group words) and quoted for
  the shell, one argument each: ';', '$' and quotes no longer act as commands.
Easy API: quadratic objectives with one or two terms were written as an NL sum
with fewer than three arguments (invalid); nonlinear variables were counted per
Hessian nonzero with only one index marked (CONOPT: wrong optimum).
MP2NL model API: logical constraints are not counted as nonlinear objectives;
after a solve, primal values, duals and suffixes that the subsolver did not
return are dropped (the previous values stay until then: they are the initial
guess of the next pass).
Tests for the exit code, the stale solution, the shell and the quoting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…bounds reported as infeasible

- A domain hole of a variable made x == ub and x >= ub rewrite into each
  other endlessly (stack overflow): equality is no longer classified
  by IfPreprocessHole.
- Contradictory (lower > upper) hard bounds of a variable are reported as
  infeasible (exit code 200) instead of being passed to the solver, where
  Xpress and SCIP failed for an indicator flag: option cvt:pre:infeasvarbnd
  (default 1). The exit code now survives the three rethrowing wrappers
  in the constraint keeper.
- Bounds of integer variables are rounded inwards: option
  cvt:pre:roundintbnd (default 1).
- Regression cases holes_eq_bound_loop_01 and indicator_contradict_bounds_01.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…overs implied-integer variables

- cvt:pre:roundintbnd is the tolerance of rounding the bounds of integer
  and implied-integer variables inwards (default 1e-9, negative: off).
- Integral constants (shared fixed variables) are marked implied-integer;
  best-known bounds are rounded too, so [1, 1/6] becomes [1, 0].

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The mark changed the count of auxiliary integer variables that
auxint_01 checks through MP2NL. The rounding of integer bounds
(cvt:pre:roundintbnd) still covers integer and implied-integer variables.

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

Best-known bounds are deduced from the model's constraints, so their
contradiction (beyond pre:eps / pre:epsrel) proves infeasibility as well.
Before, only a warning was issued and the contradictory bounds reached the
solver; Xpress then stopped with "Non binary variable used as an indicator
binary" instead of reporting infeasibility. Controlled by
cvt:pre:infeasvarbnd, as for hard bounds.

Test: end2end logical/indicator_contradict_bounds_02 (generated example).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The static presolve folded an indicator only if its binary was fixed
when the indicator was added. A binary fixed later (e.g., by a root
logical constraint flattened afterwards) reached the solver as a
constant, made continuous by PrepareVariables(); Xpress and SCIP then
stopped with "Non binary variable used as an indicator binary".

Now the indicator converters (le/ge/eq/quad, new base
BasicIndicatorConverter_MIP) fold such an item: the subconstraint is
added if the binary has the indicator's value, otherwise the item is
dropped. IfNeedsConversion() makes accepted indicators convert, and
ConvertDelayedItems() revisits indicators behind the conversion cursor
(ConstraintKeeper::ConvertNeededBehindCursor()). No big-M rows on the
constant binary when indicators are linearized.

Option cvt:pre:indfixedflag (0/1*), subject to cvt:pre:all;
0 restores the old behavior.

Tests: end2end logical/fixed_indicator_flag_* (objective on all
solvers; final-model structure with Gurobi, accepted and linearized
indicators, with and without folding, cvt:pre:all=0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add headers missing from the add_prefix() lists (ampls-ccallbacks.h,
expr-linear.h, constr_nonlinear.h, eexpr_hashed.h, var_bnd_impl.h,
redef/MIP: cond_literal.h, disj2ind.h, indicator_fixed_flag.h,
int_div.h, rounding.h) and src/wrap_xml.h to parse-xpress-options,
so that IDEs such as Qt Creator show them in the project tree.

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

Copy link
Copy Markdown
Contributor Author

Review follow-up

  • MP2NL now reports an error if a previous SOL cannot be removed before the subsolver starts. A fresh SOL can still be read when the subsolver returns a nonzero exit code.
  • MP preserves exact integer bounds during rounding and uses the integer domain when expanding a product with fractional NL bounds. CP-SAT reports unsupported fractional linear coefficients and preserves finite row bounds within its supported integer range.
  • Reporting a fixed CPLEX MIQCP or Xpress MINLP now uses a separate native problem. The Windows AMPLS regression loads one model, reports both fixed solves and changes the objective between the two solves on the same native handle. The CLI suite also checks the CPLEX MIQCP case and the existing Xpress nonlinear duals case.
  • The model checker requires successful NL generation before applying formatting and preserves source edits detected during validation.

Validation

Five CTest suites, six formatting-tool tests, both Windows AMPLS runs and the new focused end-to-end cases passed. Full fast results for CPLEX, CP-SAT, Gurobi and HiGHS have the same failure cases as the reviewed baseline. Xpress had three additional timeouts and one fewer timeout, with the same failures outside the timing limit.

CI follow-up

The AMPLS regression is manual in this change. The testing guide documents both commands and distinguishes CTest, CLI end-to-end and same-handle AMPLS coverage. A separate follow-up can add a Windows job with the matching CPLEX and Xpress SDKs and licenses. That job should publish both logs, fail when an executed regression fails and make unavailable prerequisites explicit.

Review attribution — OpenAI Codex. The original review used GPT-6 / GPT-6.2-family reviewers with a separately configured GPT-6.1 model for adjudication. The correction review used GPT-6.1 and GPT-6.2 in two rounds.

@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 current head (including the 6 follow-up commits up to 53c5caf). This is from reading the code; nothing was compiled or run.

Fix before merging

  1. HiGHS feasibility relaxation raises an error instead of reporting the model infeasible (solvers/highsmp/highsmpbackend.cc:335). If a column or row has lower bound > upper bound and neither side can be relaxed, MinCostOfContradictoryBounds returns INFINITY, and CheckFeasRelaxCost then always fails with "reported violation cost X, at least inf required". This PR makes the case reachable in two ways:

    • auxiliary variables and constraints now get penalty -1, so they can't be relaxed;
    • the new default cvt:pre:infeasvarbnd=0 passes contradictory bounds through to the solver.

    This should report "infeasible, not repairable".

  2. CP-SAT now fails on coefficients with tiny rounding errors (solvers/cpsat/cpsatcommon.h, IsIntegerValue). It now accepts only exact integers. A coefficient like 2.9999999999999996, which AMPL can produce from ordinary arithmetic, used to be rounded and now raises "CP-SAT requires integer", so models that solved before will now fail. Rejecting real fractions makes sense, but values within a few ulps of an integer should probably still be accepted.

  3. CP-SAT now fails on very large finite row bounds (solvers/cpsat/cpsatmodelapi.cc, MakeDomain). Bounds at or beyond ±1e18 used to be clamped to the int64 limits. Now any finite bound of 4e18 or more raises an out-of-range error, so a row with a big-M of 1e19 fails. Clamping, or rejecting only when the bound actually changes the model, would avoid the regression.

Should fix

  1. The divisor warning fires too often (include/mp/flat/constr_prepro.h:805). WarnDivisorDomainContains0 runs for every DivConstraint, including on solvers that handle division natively (Gurobi NL, Xpress, BARON, MP2NL). Any x/y with the default y ∈ [0, inf) gets a warning that solutions may be cut off, which isn't true on those solvers. It should only fire when division is reformulated.

  2. Xpress fixed solve on the copy needs confirming (solvers/xpress/xpressbackend.cc, CopyFixedNonlinearModel). XPRSloadmipsol on an unsolved copy may only store the solution for a future solve, and XPRSfixmipentities normally needs a solved MIP. The Windows AMPLS test reportedly covers this case; please confirm that the fixed nonlinear solve really runs with the integers fixed to the saved solution (e.g. check the log or the duals).

  3. Release builds can linearize a native indicator (include/mp/flat/redef/MIP/indicator_fixed_flag.h:51). FoldIfFlagFixed relies only on assert(folded). In a release build, if the fold fails, an indicator the solver accepts natively gets a big-M linearization, which needs finite bounds and can throw a ConstraintConversionFailure that ConvertNeededBehindCursor doesn't catch.

Cleanups

  1. Repeated full scans in the final conversion loop (include/mp/flat/converter.h:481). ReconsiderInliningAlgExpr resets last_con_ to 0, and ReassessFixedFlagIndicators restarts from index 0, so every pass walks the whole model again. Tracking only items added since the last pass, as the main loop does, would avoid this.
  2. Presolve runs twice (include/mp/flat/backend_flat.h:215). PresolveRhsPenalties makes a second full presolve pass with a vector of ones just to find which rows have an original constraint. One pass with a NaN sentinel would do.
  3. Duplicated code across drivers. The "all objectives must be linear" check and message, the num_obj_total_ calculation and the IsWithinPoolGap logic are copied across COPT, CPLEX, Xpress and Gurobi. The copies have already drifted: the CPLEX message leaves out the cvt:quadobj/cvt:nlobj advice. A shared helper in BasicFlatModelAPI or MIPBackend would keep them in sync.
  4. Misplaced doc comment (include/mp/flat/converter.h:2559). LinFillLimit()/QuadFillLimit() were inserted between the existing /// Whether inline nested forall, exists, lin/quad expr comment and IfPreproUnnest(), so the comment now documents the wrong function.
  5. CPLEX original_model_type_ is never reset (solvers/cplex/cplexbackend.cc:1371). Minor: after an MIQCP solve, IsMIP() stays true even if an AMPLS user later turns the model into a plain QCP.

Resolved by the follow-up commits

  • CPLEX MIQCP fixed solve now runs on a copy, so the original model is no longer changed.
  • Xpress nonlinear MIP fixed solve now runs on a copy (item 5 still to confirm).
  • MP2NL: an old .sol file that can't be deleted now gives an error instead of possibly being read as the new result.
  • Integer bounds: bounds that are already integers are left alone, and products of variables with fractional NL bounds now expand correctly.

Testing

The new end-to-end cases and the AMPLS repeat-solve test are good. The AMPLS test is manual only, so the main regression for the CPLEX/Xpress fixes isn't in CI yet; the suggested Windows CI job would be worth adding soon. Missing tests: item 1 (HiGHS feasrelax with contradictory auxiliary bounds) and items 2–3 (CP-SAT near-integer coefficients and large row bounds).

Verdict: items 1–3 block merging; the rest can be follow-ups.

glebbelov and others added 16 commits November 21, 2026 01:53
Records the merges of master into task-043 on GitHub. The tree is
unchanged: in the two conflicts (the Gurobi changelog and the
iis_feasrelax case list) integration already has the content.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- knitro_storequadcoefs0_01 with hessopt=6 and hessopt=2,
  storequadcoefs=0: the driver stopped with suf_get("xhonorbnd") fails.
- quad_min_floor_01: degree_ASL called the constraint quadratic, the
  quadratic decomposition failed and the driver stopped.
Both for knitroasl; they fail with the driver as shipped with Knitro
16.0.0 (the first) or with ASL before 2026-11-21 (the second).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6-11

Conflict in fast/nonlinear/modellist.json: the three new cases are
appended after the cases integration already has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… row bounds

Near-integer coefficients, row bounds, fixed values and exponents (0.1*3*10) are taken as the integer; a fractional row bound is rounded inward after the tolerance; a finite bound beyond the int64 range is clamped instead of raising an error. Error messages print the value with 17 digits. Fixes wrong optima and false infeasibility introduced with the exact integrality test.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…srelax cost

With HiGHS 1.16 Highs_getBasis fails when there is no valid basis (an LP that presolve proves infeasible); the error stopped the later suffixes, so iis:find returned no IIS. The basis is now reported only when basis_validity is valid. CheckFeasRelaxCost returns explicitly for an infinite minimum cost instead of relying on a NaN comparison.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The extra solve message is cleared once it is written, so a repeated solve through AMPLS does not repeat earlier messages. CPLEX fixed-solve messages end with a newline; the original model type is a local of the report and no longer survives into later solves. The AMPLS test checks the second report's own text; the fixed MIQCP case checks a dual of a linear row.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The problem copy used for the fixed nonlinear solve gets the callbacks of the original, and the fixed solve is skipped with a warning unless the integer columns are in fact fixed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
clean_coefficients no longer rewrites 1e-1*y or (-2)**y; tests for these, for trailing and inner comments and for ';' in a string. nlcheck docstring states what --apply does.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ording

RoundIntBound unit test gets an exact-integer input; the unnest doc comment is back on IfPreproUnnest(); Gurobi changelog states what the code does; three test models no longer refer to an issue tracker outside this repository.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…cycle

The notes of a solve cycle are those of its first report. A repeated
AMPLS report of the same solve writes them again, so a note made once
per solve (the mip:basis fixed solve) is no longer lost; the next solve
starts anew. AMPLSReportError drops the notes of the abandoned cycle.

The AMPLS test reports twice after one solve, rejects a report with a
warning, keeps argv alive for the solver, and for Xpress changes a bound
of the binary instead of the objective sense, whose exponential terms
reach Xpress as an inequality valid for minimization only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"s"[f == 1.] put a NUL into the solve message when the fixed solve took
one iteration; the message ended there and Gurobi lost the gap line.

The Xpress fixed nonlinear copy gets only the driver's message callback
instead of all callbacks of the original problem, so that callbacks of
an AMPLS user are not called for this internal copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20261029 was built with HiGHS 1.15.1; the basis-validity fix repairs a
breakage that never shipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A value is taken as an integer within max(1e-9, min(4 ulp, 0.25)): the
relative 8*eps rule of 959e2d6 took real fractions such as 1e12+0.001,
1e13+1/64 or 2^48+0.5 for rounding noise.

tech:varbound now replaces infinite variable bounds only. Finite bounds
of that magnitude were replaced too (since the first release): a
constant such as the objective's 2e12 or a lower bound x >= 2e12 gave a
false infeasibility, and x <= 2e14 was silently lowered to 1e12. Finite
bounds are passed as given within the CP-SAT domain limit (+-4e18); an
infinite bound opposite one beyond varbound is set varbound beyond it.

Four new int_ops cases; the changelog and the specification drop the
exponent rule, which the conversion decides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Warning VARBOUND lists the infinite variable bounds replaced by
tech:varbound (first three, with the values set) and recommends finite
bounds for all variables; VARBOUND_ACTIVE lists solution values at such
a bound, where the result may depend on the option (e.g., an unbounded
model). Variables are named as in AMPL when the name files are written,
else as _svar[i]. New int_ops case cpsat_varbound_warn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a MILP / MIQP, the mip:basis fixed solve changes the native problem
to FIXEDMILP / FIXEDMIQP. It stayed so after the report: through AMPLS
a repeated report fixed it again and returned the solution of the
continuous relaxation, and changes of the native problem before the
next solve were rejected (CPLEX error 1023). The problem type is now
restored after each report and, if still fixed, before each solve.

The AMPLS test also runs a linear MIP (fixed_milp_cplex, also an e2e
case); without the fix it fails with "Reporting changed the native
problem type".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fixed model of mip:basis was neither freed before a new solve nor
before a repeated report (AMPLS). A repeated report leaked a copy of the
model; after the native model was made continuous between solves, the
report gave the duals and basis of the previous solve's fixed model.

The AMPLS test runs Gurobi on the linear MIP case and then makes the
model continuous natively; without the fix it fails with "The duals are
those of an earlier fixed model: [0.0, 0.0]".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants