Skip to content

Make derivable reduction parameters exact - #1174

Open
isPANN wants to merge 6 commits into
mainfrom
fix/exact-reduction-parameters
Open

isPANN wants to merge 6 commits into
mainfrom
fix/exact-reduction-parameters

Conversation

@isPANN

@isPANN isPANN commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Several reductions marked target parameters unavailable even though their constructed values have exact formulas in registered source parameters. This PR adds 24 such formulas across 22 rules. For example, ExactCoverBy3Sets → ILP now reports num_nonzeros = 4 * num_subsets. HamiltonianPath → ILP reports all three ILP sizes exactly, including the empty-graph case, using a source parameter for consecutive positions. BMF → BicliqueCover no longer claims an exact edge count from matrix dimensions alone.

One registry-wide test checks every declared formula field against a constructed target: equality for exact, and predicted ≥ measured for upper_bound. It uses canonical examples or registered generators where examples are unavailable. Turing Decision wrappers and two proof-only rules have test-only target constructions because they have no single-shot reduction callback. This check caught a false QUBO → SpinGlass exact claim: sparse QUBOs do not have num_vars² interactions. QUBO now exposes its natural nonzero quadratic-term count, which restores an exact interaction formula and also makes all three QUBO → ILP size formulas exact. The canonical instructions and add-rule guide now require coverage for every formula field in future rules.

Validation: make check passed (formatting, Clippy, workspace tests, and doctests).

@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.11143% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.75%. Comparing base (309ac65) to head (f743491).

Files with missing lines Patch % Lines
src/unit_tests/parameter_formula_validation.rs 90.45% 19 Missing ⚠️
src/rules/multiplechoicebranching_ilp.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1174      +/-   ##
==========================================
+ Coverage   96.73%   96.75%   +0.02%     
==========================================
  Files        1069     1070       +1     
  Lines      138549   139440     +891     
==========================================
+ Hits       134023   134914     +891     
  Misses       4526     4526              

☔ 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 draft September 26, 2026 03:54
@isPANN
isPANN added this pull request to stack #1181 September 27, 2026 16:56
@isPANN
isPANN marked this pull request as ready for review September 27, 2026 16: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