Skip to content

Use MOI.Nonlinear.ModelWithQuad - #863

Open
blegat wants to merge 6 commits into
cvanaret:mainfrom
blegat:bl/model_with_quad
Open

blegat wants to merge 6 commits into
cvanaret:mainfrom
blegat:bl/model_with_quad

Conversation

@blegat

@blegat blegat commented Aug 19, 2026 •

Copy link
Copy Markdown

Comment thread .github/workflows/julia-tests-hsl.yml Resolved
@blegat blegat changed the title Use MOI.Nonlinear.ModelWithQuad instead of a QPBlockData copy Use MOI.Nonlinear.ModelWithQuad Aug 21, 2026
@cvanaret

Copy link
Copy Markdown
Owner

Hi @blegat, thanks for looking into this! The last commit fails with Did not find rev bl/model_with_quad in repository.

@cvanaret cvanaret added the julia label Aug 21, 2026
Comment thread .github/workflows/julia-tests-jll.yml Resolved
@blegat

blegat commented Aug 21, 2026

Copy link
Copy Markdown
Author

Should be fixed now

@cvanaret

Copy link
Copy Markdown
Owner

@blegat could you rebase? I updated the self-hosted runners for the HSL tests.

@blegat
blegat force-pushed the bl/model_with_quad branch from c9a0d33 to 41af3e1 Compare August 21, 2026 14:30
@blegat

blegat commented Aug 21, 2026

Copy link
Copy Markdown
Author

Just rebased

@cvanaret
cvanaret force-pushed the bl/model_with_quad branch from 41af3e1 to e6d7159 Compare August 25, 2026 08:10
@blegat
blegat force-pushed the bl/model_with_quad branch 2 times, most recently from 95f0beb to 3654b81 Compare October 26, 2026 16:27
Delete the local copy of QPBlockData (MOI_utils.jl): the variables, the
parameters, the affine and quadratic objective and constraints, and the
inner nonlinear model are stored in a single
model::MOI.Nonlinear.ModelWithQuad field that most of the MOI API forwards
to, and everything is evaluated through a MOI.Nonlinear.EvaluatorWithQuad
built in _setup_model. The inner evaluator is a new _OracleNLPEvaluator that
stacks the VectorNonlinearOracle rows before the NLPBlock rows and extends
the private MOI.Nonlinear._constraint_bounds, so the constraint bounds of
the whole stack are assembled by the evaluator. Parameters follow the
_PARAMETER_OFFSET convention of MOI.Nonlinear and their values are stored
once, in the inner nonlinear model, aliased by the QP block, which removes
the per-solve parameter sync. A uses_nlp_block flag tells the legacy
MOI.NLPBlock API apart, because optimize! overwrites nlp_data; the NLPBlock
is rebuilt on every setup unless that flag is set.
Replace the removed private constraint-bounds hook with
Utilities.constraint_bounds, preserving QP, oracle, and nonlinear row order.
Use ModelWithQuad's constraint type listing and allow a QP objective with a
legacy NLPBlock when no nonlinear data has been added.

Add regressions for bounds, duplicate parameter types, NLPBlock compatibility,
and feasibility reporting after an iteration limit.

Validation: MOI_wrapper.jl passes with filtersqp and ipopt on Julia 1.10.12
and MOI 5c77870e. The iteration-limit regressions pass for both presets.
@blegat
blegat force-pushed the bl/model_with_quad branch from 3654b81 to 094e2a5 Compare November 26, 2026 07:42
@blegat
blegat marked this pull request as ready for review November 26, 2026 07:42
@cvanaret

cvanaret commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Thanks @blegat! Could you add a short PR description for laypeople (like me)? :)

This branch has not been deployed

No deployments
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