Skip to content

Tighten sparse, geometric and cached construction overhead formulas - #1190

Merged
GiggleLiu merged 31 commits into
mainfrom
fix/tighter-overhead-formulas
Oct 3, 2026
Merged

GiggleLiu merged 31 commits into
mainfrom
fix/tighter-overhead-formulas

Conversation

@isPANN

@isPANN isPANN commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Dense variable×constraint, padded-grid-area and factorial magnitude bounds greatly overstate the targets actually built. This PR replaces them with counts of sparse construction blocks and geometric bit bounds. Compared with prerequisite 44537006, it changes 68 formulas across 37 rules, adds one explicitly unavailable incoming field, and supplies eight cheap/cached source statistics with their incoming contracts. Reduction targets, solving, extraction, public input formats and existing APIs retain their behavior; exact/composition engines and path selection are untouched.

The three highlighted declarations now use these derivations:

  • RectilinearPictureCompression → ILP: the source already caches maximal rectangles. Register their count R (O(1)) and summed area A (O(R)). Each distinct rectangle contributes one variable, one coefficient for each covered cell, and one budget coefficient. No terms merge or cancel: variables=R and nonzeros=A+R are exact, including overlapping rectangles and all-zero images. There are no incoming rectangle constructors to update.
  • ClosestVectorProblem → QUBO: entry bits and rank omit conditioning. Retain the determinant D already computed during rank validation. For each coefficient i, complementary column norm product P_i bounds its squared adjugate-row norm by Cauchy–Binet/Hadamard. A zero candidate bounds squared radius by ||target||²; with full rank, coefficient rounding also bounds it by floor(r sum(||basis_j||²)/4). The interval's integer width is at most floor(sqrt(floor(4 P_i rho/D²))); its bit length bounds its binary encoding. Cache the sum B of those individual bounds, giving variables≤B and off-diagonal terms≤B²/2, with final exact-arithmetic ceiling. This adds norm scans and integer arithmetic after the existing rank check, with no source solve, coefficient-center computation or target reconstruction. The finite-count u64 cap remains an upper bound for constructible targets. SubsetSum's unit-determinant carry lattice supplies the proved incoming bound r*(r(k+3)/2+2); the Decision identity copies B exactly.
  • Unweighted MIS → KingsSubgraph: at order position i, vertical slot span≤i and horizontal span≤n−1−i. Copy-line support is ≤4n(n−1)+n. A disconnected crossing consumes a doubled cell and adds at most two vertices and ten internal edges; there are at most n(n−1)/2 such cells. Other gadgets decrease counts, and mapped boundary cells add no outside edges. Counting corner and crossing contacts gives vertices≤5n² and edges≤11n² after monotonic relaxation. These stay upper bounds because the actual order and simplification successes affect counts.

An independently derived unequal-coordinate CVP test uses basis [[1,0,0],[3,1,0]] and target [0,0,1]. Its widths six and two require three and two bits: the real target has five variables and ten quadratic terms, while registered predictions are five and thirteen. A two-domino overlapping image has four rectangle-cell incidences and two budget terms, giving exactly six nonzeros. Tests failed before the corresponding implementation changes and cover degenerate/zero encodings, Gram cancellation, large cancelling determinant products, row swaps, normalized budgets and final rational ceiling. Real SubsetSum→DecisionCVP→CVP→QUBO intermediate targets and extracted solutions are checked.

All 16 initial proposals were reconciled with current source: four sparse-support candidates were already present, the remaining candidates are covered, and the PR also tightens ILP, timetable, macro and scheduling declarations. The other added statistics are NAE clause-variable memberships (expected O(L)), homologous pair count (O(1)) and capacity bits (O(m)), Partition's existing total sum (O(n)), and ThreePartition's existing bound (O(1)). Incoming SAT and 3D-matching contracts are updated. Five original unavailable raw numeric fields become available. LCS's exponential cross-frequency product and SubsetSum→Partition's arbitrary-precision raw total remain precisely unavailable; their schema/variable-exponent limitations are documented without expanding #1175 into engine redesign.

The test-only cleanup at 29d2373 reuses measured and predicted parameters from the existing contract check instead of constructing targets and evaluating predictions twice. All assertions remain. The 51 existing overhead tests pass, and make check and make paper pass again at this follow-up. Production code is unchanged from 6f9dbe9; construction measurements and correctness records keep their original commit provenance.

Fresh evidence at 6f9dbe9, built exclusively from this worktree:

  • 322 rules × 100 existing inputs = 32,200 fresh constructions; 102,900 measured formula comparisons; zero underestimates, exact-equality violations, construction errors or timeouts. Two unavailable declarations contribute 200 separately labeled observations.
  • Every common target count and old source parameter agrees with both preserved runs (44537006 and previous dashboard a44a350c). Corpus remains b9ae9e39; no instances or oracle values changed. The intermediate 4e20d877 run is also preserved with its own provenance.
  • 216 fresh representative CLI checks agree: 99 original solves and 117 forced-rule reduce/solve/extract checks across 39 changed declaration/reason rules. Selection is first random plus first/last special paths per rule; canonical examples are covered by repository tests.
  • make check (format, all-feature clippy, workspace tests including ignored tests/docs) and make paper pass. Changed production methods/closures have 98.14% instrumented-region coverage; the retained invariant-error closure is explicitly recorded as unexercised.
  • 57,800 full clean correctness checks remain retained at prerequisite 4453700: 25,600 original solves and 32,200 forced-rule checks, byte-identical to the baseline. Other correctness cases were not rerun at this commit. Corpus agreement is empirical evidence, not a universal proof.

Immediate improvement from the previous dashboard (a44a350c) to this commit, using the same 100 inputs per field:

Rule / target field Median ratio P95 ratio Maximum ratio Equality Zero cases Median absolute excess Total absolute excess
ClosestVectorProblem → QUBO / num_quadratic_terms 605.59 → 13.17 6,272.00 → 139.95 17,113.00 → 221.00 0.00% → 0.00% 0/50 → 0/50 3,890.00 → 60.50 610135 → 10324
MaximumIndependentSet → MaximumIndependentSet / num_edges 52.02 → 7.40 234.55 → 33.39 368.00 → 52.38 0.00% → 0.00% 0/0 → 0/0 7,579.00 → 951.00 754456 → 91656
RectilinearPictureCompression → ILP / num_nonzeros 48.57 → 1.00 85.00 → 1.00 85.00 → 1.00 0.00% → 100.00% 0/0 → 0/0 666.00 → 0.00 66487 → 0

Ratios exclude zero actuals. Equality and absolute excess include them; zero columns are both-zero/positive-for-zero counts. P95 interpolates at (n−1)×0.95. CVP still has 50 zero-actual cases with positive predictions: the geometric relaxation does not compute the concrete rounded residual or Gram cancellations. CVP and grid declarations remain proved bounds; observed equality is not a basis for exactness.

Other leading improvements against prerequisite 4453700
Rule / target field Median ratio P95 ratio Maximum ratio Equality Zero cases Median absolute excess Total absolute excess
KSatisfiability → TimetableDesign / num_available_assignments 53,291.12 → 1.18 186,654.69 → 5.44 771,162.95 → 12.74 0.00% → 0.00% 0/46 → 0/46 28,645,070.00 → 471.00 3985736229 → 51765
ClosestVectorProblem → QUBO / num_quadratic_terms 2,314.07 → 13.17 24,336.00 → 139.95 70,225.00 → 221.00 0.00% → 0.00% 0/50 → 0/50 17,474.00 → 60.50 2497001 → 10324
KSatisfiability → TimetableDesign / num_nonzero_requirements 977.36 → 1.19 3,186.38 → 5.54 11,543.14 → 12.96 0.00% → 0.00% 0/46 → 0/46 301,928.50 → 240.00 34351817 → 26087
MonochromaticTriangle → ILP / num_nonzeros 453.25 → 5.00 2,767.50 → 7.67 6,147.00 → 7.67 1.00% → 67.00% 1/60 → 61/0 4,375.00 → 0.00 1371826 → 4940
RectilinearPictureCompression → ILP / num_nonzeros 310.86 → 1.00 544.00 → 1.00 544.00 → 1.00 0.00% → 100.00% 0/0 → 0/0 4,338.00 → 0.00 433687 → 0
RootedTreeStorageAssignment → ILP / num_nonzeros 245.25 → 1.42 245.25 → 1.42 245.25 → 1.42 0.00% → 0.00% 0/0 → 0/0 783,301.00 → 1,349.00 78330100 → 134900
MinimumInternalMacroDataCompression → ILP / num_nonzeros 194.21 → 4.26 205.00 → 4.50 205.00 → 4.50 0.00% → 0.00% 0/0 → 0/0 7,342.00 → 124.00 734002 → 12202
PartitionIntoTriangles → ILP / num_nonzeros 169.36 → 1.31 328.05 → 2.11 410.06 → 3.00 0.00% → 1.00% 0/0 → 0/0 7,730.00 → 29.00 2816292 → 3612
MonochromaticTriangle → ILP / num_constraints 132.31 → 5.50 1,025.00 → 8.50 2,049.00 → 8.50 0.00% → 67.00% 0/61 → 61/0 972.00 → 0.00 161209 → 1872
SparseMatrixCompression → ILP / num_nonzeros 123.56 → 6.46 450.72 → 21.04 746.18 → 32.67 0.00% → 0.00% 0/0 → 0/0 20,804.00 → 677.00 2623650 → 69234
StringToStringCorrection → ILP / num_nonzeros 119.80 → 1.17 257.41 → 1.22 362.48 → 1.23 0.00% → 0.00% 0/25 → 0/25 617,040.00 → 1,822.00 210954387 → 259713
EnsembleComputation → ILP / num_nonzeros 115.18 → 1.00 253.02 → 1.00 350.35 → 1.00 0.00% → 100.00% 0/0 → 0/0 263,524.00 → 0.00 51556199 → 0
MinimumExternalMacroDataCompression → ILP / num_nonzeros 111.92 → 1.01 112.97 → 1.02 112.97 → 1.02 0.00% → 0.00% 0/0 → 0/0 21,962.00 → 2.00 1459086 → 200
PartitionIntoPathsOfLength2 → ILP / num_nonzeros 109.42 → 1.00 153.69 → 1.00 169.69 → 1.00 0.00% → 100.00% 0/0 → 0/0 37,080.00 → 0.00 4353072 → 0
PartitionIntoCliques → ILP / num_nonzeros 90.67 → 3.84 147.73 → 5.68 180.56 → 8.00 0.00% → 1.00% 0/0 → 0/0 3,212.00 → 87.00 223468 → 7020
RectilinearPictureCompression → ILP / max_constraint_magnitude_bits 85.67 → 2.67 128.50 → 4.00 128.50 → 4.00 0.00% → 0.00% 0/0 → 0/0 254.00 → 5.00 25448 → 548

The unified private dashboard (version 8, source 49110a96) preserves its URL, Sites project and owner-only audience. The measured table and per-rule details retain correctness results, true numeric ratios, case evidence and run provenance. The overview axis ends at 64×; larger values show an overflow arrow and their true maximum. Local and hosted browser checks pass for filters, downloads, pagination, mobile layout and removal of the four supplementary sections. Underlying evidence files are retained unchanged, and the hosted snapshot matches the local artifact.

The inventory retains 406 upper-bound fields with median ratio above one and 195 fields with same-complete-source-vector/different-target observations. This focused PR does not close the broader systematic-tightening issue merely because this batch passes.

Refs #1188. Prerequisite #1174 is squash-merged; this PR now targets main. Related availability work: #1175.

Review follow-up: 76c7d3ac includes the reviewed solver fixes from #1174, including budgeted quadratic preprocessing and large ensemble union chains, plus the current-Clippy compatibility fix. The branch incorporates the prerequisite squash merge with a regular merge commit, preserving published history. Its tree is identical to the combined head 8c7fd591. make check and make paper both pass on this combined tree. All nine CI and Codecov checks pass on final commit 76c7d3ac. The original construction-corpus measurements above retain their recorded provenance; they were not rerun.

Correct exactness claims, count sparse coefficients by construction block, reject negative flow capacities, and verify metadata using existing behavior inputs and real executors.
Squash the combined changes from PRs #1180, #1182, #1183, #1184, and #1185 into #1174. Preserve the complete stack-tip tree so subsequent corrections can be maintained on one branch.
Derive upper bounds from conditional even padding and the set-packing endpoint universe. Preserve the exact edge-to-set count and verify the registered promises in existing parity and isolated-vertex tests.
Replace oversized formulations with compact constructions for partition,
register, matrix, graph, and ordering problems. Add direct bounded ILP
pipelines and reuse exact customized subset-sum and clique-cover solvers.

Preserve signed weights and costs, avoid artificial partition-bound
overflow, and align overhead contracts, rule targets, tests, and proofs
with the resulting constructions.

Validated with make check, make paper, independent reduction audits, and
CLI solver and extraction round trips.
@isPANN isPANN changed the title Tighten construction overhead formulas and raw numeric predictions Tighten sparse, geometric and cached construction overhead formulas Oct 2, 2026
@GiggleLiu
GiggleLiu changed the base branch from fix/exact-reduction-parameters to main October 3, 2026 20:41

@GiggleLiu GiggleLiu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Independent review covered all 49 changed files, including sparse construction counts, geometric CVP bounds, cached statistics and incoming parameter contracts. No material findings remain; policy audit PASS. The solver regression fixes from #1174 are included.

The merge from main preserves the already-reviewed combined tree exactly. On that tree, make check and make paper pass. CI is running on final head 76c7d3a; merge remains conditional on all checks passing. Historical construction-corpus measurements retain their original provenance and were not rerun for this review.

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.35795% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.90%. Comparing base (ae1c7aa) to head (76c7d3a).

Files with missing lines Patch % Lines
src/models/algebraic/closest_vector_problem.rs 91.83% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1190      +/-   ##
==========================================
+ Coverage   96.88%   96.90%   +0.01%     
==========================================
  Files        1095     1095              
  Lines      144504   145109     +605     
==========================================
+ Hits       140006   140621     +615     
+ Misses       4498     4488      -10     

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

2 participants