Conversation
isPANN
added this pull request to stack #1181
September 28, 2026 06:05
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/bounded-ilp-variants #1182 +/- ##
==========================================================
Coverage 96.76% 96.77%
==========================================================
Files 1072 1072
Lines 140453 140628 +175
==========================================================
+ Hits 135911 136086 +175
Misses 4542 4542 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Stacked on #1180 (base branch:
fix/bounded-ilp-variants). That PR makes bounded integer ILP encoding explicit, but four flow reductions still cannot predict ILP numeric magnitude and therefore cannot predict the size of their binary ILP and QUBO targets.This PR restores those predictions using one intrinsic statistic per flow model and fixes two domain/schema defects found during the audit.
Changes
max_capacity_bitsto IntegralFlowBundles, IntegralFlowWithMultipliers, UndirectedFlowLowerBounds, and UndirectedTwoCommodityIntegralFlow. It measures existing capacities (bundle capacities for IntegralFlowBundles), with a minimum of one; constructors take no additional input.min(multiplier, total_capacity + 1), with saturating arithmetic. Above total capacity, positive integral inflow would require impossible outflow, so the replacement preserves feasibility.max_constraint_magnitude_bits <= max_capacity_bits + num_arcs + 1(ornum_edges + 1) in each flow-to-bounded-ILP rule. Every RHS uses only source parameters.2, and from Partition with the upper boundmax_numeric_magnitude_bits + num_elements.Three flow models previously had no capacity-scale parameter. Multiplier flow already has raw
max_capacity, but capacity bits allow the incoming Partition chain to compose without variable-exponent support. The raw capacity field remains available on concrete instances and in the model's complexity expression; its symbolic prediction from Partition remains explicitly unavailable. Downstream ILP size predictions do not depend on it.API and validation changes
0 <= lower <= capacityconsistently through the shared constructorrequirement, causing a panic when negativerequirementfrom the canonical parameter schema; preserves the signed construction field, serialization, and gettermax_capacity_bitsNo new variants or model-level inference mechanisms are introduced.
Verified behavior
(0,1)and(2,3), capacities[1,10], lower bounds[-5,0], and demand5from0to1, the base branch reports feasible through source brute force but infeasible through ILP. The new constructor rejects this invalid input.-1previously panicked on conversion to an unsigned parameter. It now succeeds and reports capacity bits; the signed requirement remains instance data.i64::MAXremain infeasible after solving and recovery.Validation
Regression tests were run failing before implementation, including the validation defect, negative-parameter panic, coefficient normalization, and missing composed predictions.
cargo test --features example-db --workspace -- --include-ignored: 6,893 passed.cargo fmt --all --check: passed.cargo clippy --workspace --all-targets --all-features -- -D warnings: passed.make paper: passed.