Skip to content

Decouple native ILP backend execution from registered pipelines - #1147

Open
isPANN wants to merge 5 commits into
mainfrom
refactor/native-ilp-adapter
Open

Decouple native ILP backend execution from registered pipelines#1147
isPANN wants to merge 5 commits into
mainfrom
refactor/native-ilp-adapter

Conversation

@isPANN

@isPANN isPANN commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Integer ILP solving currently passes through a registered integer-to-float coefficient reduction before reaching HiGHS. This refactor moves backend encoding, execution, decoding, and original-ILP validation into an internal HighsAdapter that accepts native ILP<V, C> values. Registry lookup, type-erased terminal dispatch, and source-solution extraction stay in orchestration.

All 155 registered source variants retain their ILP solving pipelines: 147 integer pipelines now stop at their original integer ILP, and eight native float pipelines retain their routes. The adapter supports all four bool/i64-variable and i64/f64-coefficient combinations, reuses the existing good_lp backend and numeric transport policy, and builds expressions without per-term temporary allocations.

The public ILPSolver::solve signature, configuration fields, error variants, and CLI/JSON/MCP result formats are preserved. Reported reduction paths now end at native ILPs. Integer coefficient transport failures use the existing InexactTransport error at the adapter boundary; assignments violating the original integer ILP use InvalidSolution instead of failing later during coefficient-cast extraction. Existing explicit coefficient-conversion reductions remain available.

Validation:

  • make check passes after the final cleanup: formatting, clippy, and full workspace tests.
  • make mcp-test and make paper passed during implementation.
  • Regression coverage checks all four native terminals, an unregistered ILP variable domain, rounding/shape/range/constraint validation, objective overflow, and pipeline terminal invariants.
  • A downstream integration test preserves generic call bounds, public struct construction, solution types, and exhaustive matching over the existing public errors.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.21362% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.96%. Comparing base (7dd5fcd) to head (5977594).

Files with missing lines Patch % Lines
src/rules/ilp_i64_ilp_f64.rs 90.90% 4 Missing ⚠️
src/solvers/ilp/adapter.rs 97.43% 4 Missing ⚠️
src/unit_tests/solvers/ilp/adapter.rs 97.98% 3 Missing ⚠️
src/unit_tests/rules/ilp_i64_ilp_bool.rs 81.81% 2 Missing ⚠️
src/solvers/ilp/solver.rs 88.88% 1 Missing ⚠️
...satisfiability_directedtwocommodityintegralflow.rs 85.71% 1 Missing ⚠️
...ests/rules/ksatisfiability_preemptivescheduling.rs 75.00% 1 Missing ⚠️
...nit_tests/rules/rootedtreestorageassignment_ilp.rs 50.00% 1 Missing ⚠️
...t_tests/rules/shortestweightconstrainedpath_ilp.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1147      +/-   ##
==========================================
+ Coverage   95.93%   95.96%   +0.02%     
==========================================
  Files        1074     1076       +2     
  Lines      132106   132337     +231     
==========================================
+ Hits       126730   126991     +261     
+ Misses       5376     5346      -30     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant