Skip to content

Complete remaining ILP overhead predictions and normalize scheduling bounds - #1184

Draft
isPANN wants to merge 1 commit into
fix/augmentation-ilp-overheadfrom
fix/remaining-ilp-overhead
Draft

isPANN wants to merge 1 commit into
fix/augmentation-ilp-overheadfrom
fix/remaining-ilp-overhead

Conversation

@isPANN

@isPANN isPANN commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Motivation

This PR completes the remaining 20 direct integer-coefficient ILP prediction contracts relative to #1183. A graph audit now finds 126/126 complete direct contracts, up from 106/126 on the base branch.

These reductions already predicted structural counts, but left numeric constraint magnitudes unavailable. Binary encoding and ILP → QUBO need those magnitudes to bound the variables introduced by the construction. Consequently, a missing field on an incoming ILP edge could prevent an end-to-end size prediction even when the reduction itself was implemented.

The changes supply coarse, sound bounds using intrinsic source data and propagate the necessary parameters through incoming edges. Each rule keeps its prediction contract explicit and local, with only source parameters on the right-hand side.

Stack: targets fix/augmentation-ilp-overhead (#1183). Related to #1175; unavailable contracts elsewhere in the graph remain outside this PR's scope.

Changes

Predict numeric magnitudes from source data

Add magnitude getters for the numeric inputs actually needed by the affected rules: delays, weights and capacities, processing times, resource requirements, costs, and circuit lengths. They reuse the existing helper that computes the smallest h >= 1 with each absolute magnitude strictly below 2^h.

  • Complete the CapacityAssignment, PartiallyOrderedKnapsack, ShortestWeightConstrainedPath, BoundedComponentSpanningForest, AcyclicPartition, MultipleChoiceBranching, MinimumCapacitatedSpanningTree, MinMaxMulticenter, DecisionLongestCircuit, and scheduling/sequencing ILP contracts.
  • Keep objective-only values out of these parameters where they do not affect the constraints or variable domains.
  • Propagate copied or bounded magnitudes through incoming Partition, ThreePartition, ThreeDimensionalMatching, KSatisfiability, HamiltonianCircuit, OptimalLinearArrangement, path-partition, and dominating-set reductions.
  • Preserve the repository's uniform parameter schema across variants; the unit-length MinimumTardinessSequencing variant exposes the constant processing magnitude 1.

Normalize constructions where source bounds suffice

Reduction Before After and consequence
MinimumTardinessSequencing → ILP, both variants A negative deadline could make an otherwise valid scheduling problem infeasible in the target. Clip deadlines to the possible completion-time interval. This preserves the optimum and removes any need for a deadline-magnitude parameter. Compute the normalized bound once per task.
ResourceConstrainedScheduling → ILP The implementation allocated n × deadline assignment variables and evaluation scanned every time slot. Compress occupied slots into at most n slots and cap useful processor capacity at n. The ILP has at most n² variables; source evaluation visits only occupied slots.
DecisionLongestCircuit → ILP The acceptance row copied an arbitrary decision threshold. Thresholds at or below zero produce a redundant row; thresholds above the sum of edge lengths produce an impossible row. Other thresholds are bounded by that sum. The generic Decision API needs no new parameter.
MinMaxMulticenter → ILP Shortest-path addition could overflow unchecked. Model evaluation and reduction construction return typed overflow errors.

The size contracts, mathematical explanations, and regression tests cover these changes. Constructors and reduction signatures retain their existing APIs.

Verified CLI behavior

The following checks ran through pred inspect, pred path, pred reduce, pred solve --solver ilp, and pred evaluate, including recovery of the original source solution.

Source instance Predicted QUBO upper bounds: variables / quadratic terms Constructed QUBO: variables / quadratic terms Recovered source result
ResourceConstrainedScheduling: two tasks, two processors, resource requirements [1,1], capacity 1, deadline i64::MAX 46 / 2,116 10 / 18 Or(true), schedule [1,0]
MinimumTardinessSequencing: one task of length 1, deadline i64::MIN 17 / 289 3 / 3 Min(1)
PartiallyOrderedKnapsack: weights [2,3], values [1,9], precedence (0,1), capacity 3 10 / 100 5 / 8 Max(1)

The old resource-scheduling allocation behavior in the table above is established from the base implementation; it was not executed with i64::MAX.

Validation

  • cargo test --workspace --all-features: 6,967 passed before the final behavior-preserving cleanup.
  • After cleanup: 72 focused tests passed, covering overhead contracts, QUBO solution recovery, multicenter validation, tardiness, and circuit reductions.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: passed.
  • Formatting and git diff --check: passed.
  • make paper and the final Typst build: passed.
  • Graph export: 126 complete direct integer-coefficient ILP contracts, zero incomplete, and zero parameter-contract errors across the graph.

Tests compare predicted parameters against constructed targets and recovered source objectives against brute-force reference solutions. Large ThreeDimensionalMatching numeric gadgets are checked for incoming contracts and symbolic composition; their full QUBO solve is not claimed here. Fixed-width construction can still return typed numeric errors even when a symbolic size bound is available.

@isPANN
isPANN added this pull request to stack #1181 September 28, 2026 07:29
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.06542% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.79%. Comparing base (0535205) to head (65056cb).

Files with missing lines Patch % Lines
src/rules/minimumtardinesssequencing_ilp.rs 54.54% 5 Missing ⚠️
src/rules/resourceconstrainedscheduling_ilp.rs 71.42% 2 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           fix/augmentation-ilp-overhead    #1184      +/-   ##
=================================================================
+ Coverage                          96.77%   96.79%   +0.01%     
=================================================================
  Files                               1072     1073       +1     
  Lines                             140741   141444     +703     
=================================================================
+ Hits                              136199   136905     +706     
+ Misses                              4542     4539       -3     

☔ 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.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant