Skip to content

[Critical] Fix reduction result recovery and reference validation contracts - #1171

Open
isPANN wants to merge 26 commits into
mainfrom
codex/reduction-result-recovery
Open

isPANN wants to merge 26 commits into
mainfrom
codex/reduction-result-recovery

Conversation

@isPANN

@isPANN isPANN commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

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

  • Keep witness extraction and completed aggregate mapping separate. Register value mappings beside their implementations and reuse the constructed reduction for both mappings. Dynamic aggregate extraction is fallible; chains expose extract_value.
  • Enforce decision thresholds during recovery. Established target or intermediate infeasibility propagates without a witness; extraction errors and worker failures remain errors, not NO answers.
  • Use pred extract bundle.json --result result.json with explicit feasible, optimal, infeasible, or complete status. Optional witness evaluations must match the model's evaluation. A candidate evaluation does not establish optimality or exhaustive NO.
  • Model decision thresholds explicitly with Decision<P>. Direct bounded OpenShopScheduling and LongestCircuit ILP encodings add a bound constraint and use a zero objective; their optimization versions retain their objectives.
  • Enforce construction constraints through Rust and JSON, with explicit numeric and representation errors. Correct rule edge cases, signed TSP costs, and malformed witness extraction.
  • Make CVP integer-only with squared-distance Min<i64> values and the coefficient variant key. Persist QUBO as num_vars plus sparse entries. Register KColoring KN/K2/K3 variants and provide a direct bipartite solver for K2.
  • Isolate HiGHS conversion and execution in a concrete adapter; native integer ILPs go directly to it. Numerical solver guarantees remain subject to HiGHS tolerances.
  • Remove the total-cardinality requirement from Cartesian enumeration. Use existing Lehmer decoding for CyclicOrdering, Betweenness, and MinimumCodeGenerationUnlimitedRegisters instead of enumerating invalid position vectors.

Core Problem and 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

  • CI at 31bdb314: Test, Clippy, Rustfmt, coverage, RISC-V, Windows x86_64, and macOS ARM64 checks passed; Codecov checks passed.
  • Local all-feature workspace library/binary/integration tests at ef634c2b: 6,727 passed, 2 ignored. Workspace Clippy with warnings denied, formatting, and paper build passed.
  • After the test-only simplification at 67715f12: all 19 solver-registry tests passed.
  • Local follow-up recovered all 597 original corpus recovery-error cases as infeasible with unchanged source truth.
  • Two previously timed-out full-bundle examples passed locally: Partition → bounded OpenShopScheduling in 0.80 s (NO), and DecisionMinimumVertexCover → HamiltonianCircuit in 0.57 s (YES with a valid recovered cover). These are debug-build examples, not HPC-wide performance claims.

@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.03423% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.75%. Comparing base (5a35ce7) to head (8291c5b).

Files with missing lines Patch % Lines
src/solvers/ilp/adapter.rs 91.61% 14 Missing ⚠️
src/rules/ksatisfiability_qubo.rs 71.42% 10 Missing ⚠️
src/rules/coloring_qubo.rs 55.00% 9 Missing ⚠️
src/rules/satisfiability_maximum2satisfiability.rs 60.00% 6 Missing ⚠️
src/solvers/customized/solver.rs 81.81% 6 Missing ⚠️
...s/misc/consistency_of_database_frequency_tables.rs 83.33% 4 Missing ⚠️
src/rules/ksatisfiability_timetabledesign.rs 73.33% 4 Missing ⚠️
...rules/ksatisfiability_simultaneousincongruences.rs 76.92% 3 Missing ⚠️
src/rules/sat_ksat.rs 88.46% 3 Missing ⚠️
src/registry/dyn_problem.rs 83.33% 2 Missing ⚠️
... and 21 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1171      +/-   ##
==========================================
+ Coverage   96.22%   96.75%   +0.52%     
==========================================
  Files        1070     1069       -1     
  Lines      133605   138821    +5216     
==========================================
+ Hits       128564   134312    +5748     
+ Misses       5041     4509     -532     

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

@isPANN
isPANN marked this pull request as ready for review September 21, 2026 06:23
@isPANN
isPANN marked this pull request as draft September 21, 2026 06:39
@isPANN
isPANN marked this pull request as ready for review September 21, 2026 07:56

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