[Critical] Fix reduction result recovery and reference validation contracts - #1171
Conversation
Use exact integer CVP and a bipartite solver for K2 coloring. Validate derived model state and report reference-solver size and interval failures explicitly. Correct signed vertex-cover weights and prize-collecting Steiner gadget costs, with regression tests and updated proofs.
Register value mappings beside their implementations and share constructed results across witness and aggregate recovery. Enforce decision thresholds, correct reduction edge cases, and verify typed errors and multi-step mappings.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1171 +/- ##
==========================================
+ Coverage 96.22% 96.73% +0.50%
==========================================
Files 1070 1069 -1
Lines 133605 138549 +4944
==========================================
+ Hits 128564 134023 +5459
+ Misses 5041 4526 -515 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…panic - QUBO sparse loader reserves the dense matrix fallibly, returning a ConstructionError instead of aborting on huge num_vars. - KColoring -> PartitionIntoCliques maps k = 0 on a nonempty graph to a NO instance instead of panicking in PartitionIntoCliques::new. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agentic Review ReportReviewed head
Structural Check
Verified bugs
Stale paper text
Minor
Checked OK:
Quality CheckImportant
Minor Positives:
Agentic Feature Tests
Findings, all reproduced
Generated by review-pipeline (PR is not on the project board, so no column move was made). |
- The sparse QUBO loader rejects num_vars above 8192 before densifying; the previous try_reserve guard was ineffective under memory overcommit. - TSP -> QUBO requires -2nA to fit i64 so every valid tour's energy is representable, instead of producing a target no solver can evaluate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
…xamples Co-Authored-By: Codex <noreply@openai.com>
…ngle Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
QUBO keeps sorted upper-triangular nonzero entries, so memory follows the input instead of num_vars^2. from_entries is the shared validating constructor for the persisted format and the i64->f64 cast; evaluate, QUBO->ILP and QUBO->SpinGlass iterate entries in the same order as the old dense scan. matrix() now returns an owned dense copy. Removes the hardcoded 8192-variable limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Fix reduction result recovery, model validation, and reference-solver correctness while retaining the existing
Problem,SolutionAggregate, and typed witness/value reduction interfaces.API and behavior changes
extract_value.pred extract bundle.json --config '<target config>'to map a target witness through the rules' solution mapping, or--value <completed aggregate>to map a completed target value. Extraction does not solve the target or establish optimality or exhaustive NO.Decision<P>. Direct bounded OpenShopScheduling and LongestCircuit ILP encodings add a bound constraint and use a zero objective; their optimization versions retain their objectives.Min<i64>values and thecoefficientvariant key. Persist QUBO asnum_varsplus sparseentries. Register KColoring KN/K2/K3 variants and provide a direct bipartite solver for K2.Core
Problemand solver return interfaces are not migrated. Model-specific getters/parameters, dynamic extraction signatures, persisted formats, and supported variants do change; this is a critical API review.P → Decision<P>remains a Turing edge (binary search over the decision bound).Scope
Against main at head
31bdb314: 404 files changed, 14,058 additions, 4,712 deletions. No website changes. The obsolete SteinerTreeInGraphs removal is already in main and is not part of this diff.Validation
31bdb314: Test, Clippy, Rustfmt, coverage, RISC-V, Windows x86_64, and macOS ARM64 checks passed; Codecov checks passed.ef634c2b: 6,727 passed, 2 ignored. Workspace Clippy with warnings denied, formatting, and paper build passed.67715f12: all 19 solver-registry tests passed.