Skip to content

Close Julia parity test gaps: BicliqueCover, BMF, SAT→CircuitSAT, reduction paths#75

Merged
GiggleLiu merged 15 commits intomainfrom
jg/issue-67-julia-parity-gaps
Feb 16, 2026
Merged

Close Julia parity test gaps: BicliqueCover, BMF, SAT→CircuitSAT, reduction paths#75
GiggleLiu merged 15 commits intomainfrom
jg/issue-67-julia-parity-gaps

Conversation

@GiggleLiu
Copy link
Contributor

@GiggleLiu GiggleLiu commented Feb 16, 2026

Summary

Closes #67 — closes all Julia parity test gaps identified in the coverage comparison.

  • BicliqueCover & BMF parity tests: Added Julia fixtures and Rust evaluation tests for the 2 missing model problems
  • SAT → CircuitSAT reduction: Full implementation converting CNF to boolean circuit (OR gates per clause + final AND gate), with closed-loop and JL parity tests
  • Reduction-path parity tests: 3 tests mirroring Julia's test/reduction_path.jl (MaxCut→SpinGlass, MaxCut→QUBO, Factoring→SpinGlass via chained paths)
  • Factoring → SpinGlass example: New chained reduction example matching Julia's examples/Ising.jl
  • Julia fixture generation: Extended generate_testdata.jl with BicliqueCover/BMF serializers and reduction-path fixture exports
  • Path finding API cleanup: Replaced name-level find_paths_by_name/find_shortest_path_by_name with variant-level find_all_paths and find_cheapest_path. Removed redundant find_shortest_path (use find_cheapest_path with MinimizeSteps). Removed unused cost functions (MinimizeWeighted, MinimizeMax, MinimizeLexicographic). Updated design.md.

Coverage after this PR

  • Models: 18/18 problems tested (100%)
  • Reductions: 14/14 Julia reductions tested (100%)
  • Reduction paths: 3 chained path tests added

Test plan

  • make test — all tests pass
  • make clippy — no warnings
  • New SAT→CircuitSAT reduction has closed-loop, unsatisfiable, and JL parity tests
  • Reduction path tests verify solution extraction across multi-hop chains
  • Reduction graph regenerated with new SAT→CircuitSAT edge
  • All path-finding tests updated to variant-level API

🤖 Generated with Claude Code

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 99.21875% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.41%. Comparing base (5320302) to head (87332fc).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/rules/sat_circuitsat.rs 95.31% 3 Missing ⚠️
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.
📢 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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +179 to +181
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"; \
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
GiggleLiu and others added 11 commits February 16, 2026 18:46
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>
@GiggleLiu GiggleLiu force-pushed the jg/issue-67-julia-parity-gaps branch from 4be1b51 to a4ac457 Compare February 16, 2026 10:52
GiggleLiu and others added 4 commits February 16, 2026 18:53
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
@GiggleLiu GiggleLiu merged commit 776e855 into main Feb 16, 2026
4 of 5 checks passed
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.

Julia parity test gaps: missing models and reductions

2 participants