Skip to content

Adds native IIS support#79

Merged
odow merged 17 commits into
jump-dev:mainfrom
ValentinKaisermayer:main
Jul 21, 2026
Merged

Adds native IIS support#79
odow merged 17 commits into
jump-dev:mainfrom
ValentinKaisermayer:main

Conversation

@ValentinKaisermayer

Copy link
Copy Markdown
Contributor

It is try-catch based.
Adds option native_iis::Bool = false to opt-out of this. Should the default be true?
There is a test with HiGHS with has compute_conflict! implemented.

Closes #63

@ValentinKaisermayer

Copy link
Copy Markdown
Contributor Author

Oh, wow, why do these tests take 5 hours here?

@odow

odow commented Jun 16, 2026

Copy link
Copy Markdown
Member

They shouldn't 😢

Seems like it's stuck in your test_native_iis_feasible_model test.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.42%. Comparing base (735ebae) to head (074cc41).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Infeasibility/analyze.jl 98.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #79      +/-   ##
==========================================
+ Coverage   98.39%   98.42%   +0.02%     
==========================================
  Files          14       14              
  Lines        1437     1527      +90     
==========================================
+ Hits         1414     1503      +89     
- Misses         23       24       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ValentinKaisermayer
ValentinKaisermayer marked this pull request as draft June 16, 2026 19:36
@ValentinKaisermayer
ValentinKaisermayer marked this pull request as ready for review June 17, 2026 12:16
@ValentinKaisermayer

Copy link
Copy Markdown
Contributor Author

@odow would you review this? Do you want me to improve the coverage further?

@odow

odow commented Jun 21, 2026

Copy link
Copy Markdown
Member

Do you want me to improve the coverage further?

Yes please, we should always aim for 100% coverage.

Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
function _analyze_native_iis(model::MOI.ModelLike, optimizer)
# Instantiate solver with bridges so that constraint types the solver
# doesn't natively support (e.g. Interval) are automatically transformed.
solver = MOI.instantiate(optimizer; with_bridge_type = Float64)

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.

Hmm. Okay. Open question.

I had envisaged calling compute_conflict on model, but maybe this is okay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should I new_model=JuMP.copy_model(model) and JuMP.set_optimizer(new_model, optimizer)?

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.

I meant

function _analyze_native_iis(model::MOI.ModelLike)
    MOI.compute_conflict!(model)
    # do stuff...
end

@odow odow Jul 21, 2026

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.

But this is also okay. I'm still not super happy with the Infeasibility module. It's an open question what the best approach is from a user's perspective.

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.

If it's just looking for an IIS, there's already copy_conflict at the JuMP level: https://jump.dev/JuMP.jl/stable/api/JuMP/#copy_conflict

@odow odow Jul 21, 2026

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.

I kinda see IIS being orthogonal to MathOptAnalyzer. We have MathOptIIS for packages that want to add an IIS (like HiGHS.jl does now).

Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread src/Infeasibility/analyze.jl Outdated
Comment thread test/test_Infeasibility.jl Outdated
ValentinKaisermayer and others added 2 commits June 22, 2026 11:29
Co-authored-by: Oscar Dowson <odow@users.noreply.github.com>
@ValentinKaisermayer

Copy link
Copy Markdown
Contributor Author

Wuhu, green!

index_map = MOI.copy_to(solver, model)
reverse_map = _reverse_index_map(index_map)

MOI.optimize!(solver) # make sure model is infeasible

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we remove that? It can be very costly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why is it here? HiGHS.jl implements compute_conflict! but via MathOptIIS, which stalls on a feasible model. Maybe other solvers do too.

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.

I think most solvers need an infeasible model before they call compute_conflict!. We need to call optimize! here because we instantiated the new solver.

@ValentinKaisermayer
ValentinKaisermayer requested a review from odow June 23, 2026 11:44
@ValentinKaisermayer

Copy link
Copy Markdown
Contributor Author

@odow can you have a look again?

@odow
odow merged commit 5057063 into jump-dev:main Jul 21, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use solver's IIS if supported

2 participants