Close Julia parity test gaps: BicliqueCover, BMF, SAT→CircuitSAT, reduction paths#75
Close Julia parity test gaps: BicliqueCover, BMF, SAT→CircuitSAT, reduction paths#75
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
==========================================
+ Coverage 96.38% 96.41% +0.03%
==========================================
Files 190 193 +3
Lines 25306 25552 +246
==========================================
+ Hits 24391 24636 +245
- Misses 915 916 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR closes Julia parity test gaps by implementing missing model evaluation tests and reductions. It adds comprehensive test coverage for BicliqueCover and BMF problems, implements the SAT→CircuitSAT reduction with full test suite, adds three reduction path parity tests mirroring Julia's test/reduction_path.jl, and includes a new chained reduction example for Factoring→SpinGlass. The Julia fixture generation script has been extended with BicliqueCover/BMF serializers and reduction-path fixture exports.
Changes:
- Added BicliqueCover and BMF parity tests with Julia-generated fixtures
- Implemented SAT→CircuitSAT reduction with closed-loop, unsatisfiable, and single-clause tests
- Added 3 reduction path parity tests (MaxCut→SpinGlass, MaxCut→QUBO, Factoring→SpinGlass)
- New chained_reduction_factoring_to_spinglass example matching Julia's examples/Ising.jl
- Extended generate_testdata.jl with BicliqueCover/BMF evaluation functions and reduction path fixtures
- Updated reduction graph JSON with new SAT→CircuitSAT edge
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/rules/sat_circuitsat.rs | New SAT→CircuitSAT reduction converting CNF to boolean circuit (OR gates per clause + final AND gate) |
| src/unit_tests/rules/sat_circuitsat.rs | Comprehensive tests for SAT→CircuitSAT including closed-loop, unsatisfiable, and single-clause cases |
| src/unit_tests/rules/reduction_path_parity.rs | Three reduction path tests verifying solution extraction across multi-hop chains |
| src/unit_tests/models/specialized/biclique_cover.rs | Added Julia parity evaluation test for BicliqueCover |
| src/unit_tests/models/specialized/bmf.rs | Added Julia parity evaluation test for BMF |
| examples/chained_reduction_factoring_to_spinglass.rs | New example demonstrating Factoring→SpinGlass chain reduction |
| scripts/jl/generate_testdata.jl | Extended with BicliqueCover/BMF evaluation functions, reduction path fixture generation, and Random.seed!(42) for reproducibility |
| tests/data/jl/biclique_cover.json | New fixture file with BicliqueCover test data |
| tests/data/jl/bmf.json | New fixture file with BMF test data |
| tests/data/jl/path_*.json | Three new reduction path fixture files |
| tests/data/jl/*.json | Regenerated existing fixtures with pinned random seed for consistency |
| docs/src/reductions/reduction_graph.json | Added SAT→CircuitSAT edge to reduction graph |
| src/rules/mod.rs | Added sat_circuitsat module and ReductionSATToCircuit export |
| src/rules/graph.rs | Added reduction_path_parity tests module |
| tests/suites/examples.rs | Registered chained_reduction_factoring_to_spinglass example test |
| Makefile | Unrelated workflow improvement changing "Post summary" to "Create a pull request" |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| PROCESS="1. Read the plan file$${NL}2. Use /subagent-driven-development to execute tasks$${NL}3. Push: git push origin $$BRANCH$${NL}4. Create a pull request"; \ | ||
| else \ | ||
| PROCESS="1. Read the plan file$${NL}2. Execute the tasks step by step. For each task, implement and test before moving on.$${NL}3. Push: git push origin $$BRANCH$${NL}4. Post summary"; \ | ||
| PROCESS="1. Read the plan file$${NL}2. Execute the tasks step by step. For each task, implement and test before moving on.$${NL}3. Push: git push origin $$BRANCH$${NL}4. Create a pull request"; \ |
There was a problem hiding this comment.
The Makefile changes appear to be unrelated to this PR's stated purpose of closing Julia parity test gaps. The change from "Post summary" to "Create a pull request" in the run-plan target seems like an independent workflow improvement that should be in a separate commit or PR.
Converts CNF formulas into boolean circuits by creating an OR gate per clause and a final AND gate constrained to true. Part of Julia parity gaps (issue #67). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add export functions for BicliqueCover and BMF in the Julia test data generator, with custom flat-config evaluation logic matching the Rust implementation (since the Julia ProblemReductions.jl package uses incompatible vector-of-vectors / BitMatrix interfaces for these types). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…_path.jl Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mirrors Julia's examples/Ising.jl — reduces Factoring to SpinGlass via the reduction graph, solves, and extracts factors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Random.seed!(42) so re-running generate_testdata.jl produces identical evaluation configs. Reduction path fixtures (deterministic) are skipped if they already exist to avoid slow BruteForce re-solves. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update MaxCut::unweighted calls to pass SimpleGraph instead of (num_vertices, edges) following the constructor refactor in #74. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4be1b51 to
a4ac457
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 1957aeb.
Remove find_paths<S,T>, find_paths_by_name, find_shortest_path<S,T>, and find_shortest_path_by_name. Replace with variant-level equivalents: - find_all_paths(src, src_variant, dst, dst_variant) - find_shortest_path(src, src_variant, dst, dst_variant) All path-finding now operates on exact variant nodes, consistent with find_cheapest_path. Update design.md and all tests accordingly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove find_shortest_path (duplicate of find_cheapest_path with MinimizeSteps). Remove MinimizeWeighted, MinimizeMax, and MinimizeLexicographic cost functions. Keep Minimize, MinimizeSteps, and CustomCost. Update design.md and all tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Closes #67 — closes all Julia parity test gaps identified in the coverage comparison.
test/reduction_path.jl(MaxCut→SpinGlass, MaxCut→QUBO, Factoring→SpinGlass via chained paths)examples/Ising.jlgenerate_testdata.jlwith BicliqueCover/BMF serializers and reduction-path fixture exportsfind_paths_by_name/find_shortest_path_by_namewith variant-levelfind_all_pathsandfind_cheapest_path. Removed redundantfind_shortest_path(usefind_cheapest_pathwithMinimizeSteps). Removed unused cost functions (MinimizeWeighted,MinimizeMax,MinimizeLexicographic). Updated design.md.Coverage after this PR
Test plan
make test— all tests passmake clippy— no warnings🤖 Generated with Claude Code