Skip to content

fix: remove 8 unsound reductions, fix 8 buggy rules (#1006)#1052

Open
isPANN wants to merge 3 commits intomainfrom
fix/1006-unsound-reductions
Open

fix: remove 8 unsound reductions, fix 8 buggy rules (#1006)#1052
isPANN wants to merge 3 commits intomainfrom
fix/1006-unsound-reductions

Conversation

@isPANN
Copy link
Copy Markdown
Collaborator

@isPANN isPANN commented Apr 14, 2026

Summary

Fixes #1006 — 16 buggy reduction rules identified by systematic NO-instance testing.

Remove 8 unsound reductions

Their reduce_to() constructions are mathematically incorrect (target feasibility does not imply source feasibility). Problem models are retained; only the reduction edges are removed.

  • HamiltonianPath → ConsecutiveOnesSubmatrix
  • Partition → ShortestWeightConstrainedPath
  • Partition → SequencingWithinIntervals
  • ThreePartition → FlowShopScheduling
  • ThreePartition → JobShopScheduling
  • ThreePartition → SequencingToMinimizeWeightedTardiness
  • ExactCoverBy3Sets → MinimumWeightSolutionToLinearEquations
  • SubsetSum → CapacityAssignment

Fix SAT → CircuitSAT panic

Handle variables that don't appear in any clause by adding identity assignments, preventing unwrap() panic.

Fix 2 overhead formulas (asymptotic errors)

  • CircuitSAT → SpinGlass: O(A)O(A·V) — gate arity scales with number of variables per assignment
  • SpinGlass → MaxCut edges: O(m)O(m+n) — ancilla edges contribute an O(n) term

Fix 3 extraction bugs

  • MVC → EnsembleComputation: iterate only meaningful steps via evaluate(), ignore padding
  • SpinGlass → MaxCut: overhead accounts for ancilla field edges (num_interactions + num_spins)
  • MIS → TriangularSubgraph: use map_config_back_via_centers instead of buggy weighted gadget unapply

Test plan

  • cargo test — 5152 tests pass, 0 failures
  • cargo clippy — clean
  • make paper — Typst paper compiles
  • New test: test_sat_to_circuitsat_unused_variables

🤖 Generated with Claude Code

…ment and Partition to ShortestWeightConstrainedPath. Also, delete related files for ExactCoverBy3Sets to MinimumWeightSolutionToLinearEquations and HamiltonianPath to ConsecutiveOnesSubmatrix. Update overhead calculations in various reduction implementations to reflect changes in problem structure.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.92%. Comparing base (e38b1b5) to head (8e4517e).

Files with missing lines Patch % Lines
...rc/rules/minimumvertexcover_ensemblecomputation.rs 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1052      +/-   ##
==========================================
- Coverage   97.94%   97.92%   -0.03%     
==========================================
  Files         979      963      -16     
  Lines      100890    99708    -1182     
==========================================
- Hits        98816    97635    -1181     
+ Misses       2074     2073       -1     

☔ View full report in Codecov by Sentry.
📢 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.

isPANN and others added 2 commits April 14, 2026 19:00
- sat_circuitsat: account for extra assignments/variables from unused SAT vars
- sat_coloring: OR-gadget adds 11 edges (not 10), plus base triangle constant
- circuit_spinglass: 4× spin and 6× interaction multipliers for gate arity

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Overhead expressions describe scaling (O(·)), not exact sizes.
Revert constant-factor adjustments and keep only the two
genuinely wrong asymptotic formulas:

- CircuitSAT → SpinGlass: O(A) → O(A·V) (gate arity scales with variables)
- SpinGlass → MaxCut edges: O(m) → O(m+n) (ancilla edges are O(n))

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

bug: 5 unsound reductions — reduce_to() constructions are mathematically incorrect

1 participant