Rewrite getting-started with Factoring→SpinGlass and path overhead API#78
Rewrite getting-started with Factoring→SpinGlass and path overhead API#78
Conversation
…th overhead API - Rewrite getting-started.md Example 2 to Factoring→SpinGlass with notebook style - Add path_overheads() as single source of truth for per-edge overhead lookup - Refactor compose_path_overhead() and tests to build on path_overheads() (DRY) - Remove evaluate_path_overhead() in favor of symbolic per-edge checks - Add 7 rich paper examples recovered from stash (SAT→KColoring, SAT→DS, etc.) - Fix rustdoc unresolved link to ProblemSize - Add force-push prohibition to CLAUDE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
==========================================
+ Coverage 96.10% 96.13% +0.02%
==========================================
Files 193 193
Lines 26567 26585 +18
==========================================
+ Hits 25532 25557 +25
+ Misses 1035 1028 -7 ☔ 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 refactors the reduction graph overhead API and updates documentation with richer examples. The main changes include adding path_overheads() as a new API for per-edge overhead inspection, removing the old evaluate_path_overhead() function in favor of symbolic polynomial checks, and rewriting the getting-started guide's Example 2 to demonstrate the Factoring→SpinGlass reduction path.
Changes:
- Adds
path_overheads()API returning per-edge overhead polynomials, refactorscompose_path_overhead()to build on it (DRY principle) - Replaces numeric overhead evaluation with symbolic polynomial checks in tests for better clarity
- Rewrites getting-started Example 2 from KSat→MIS to Factoring→SpinGlass with Jupyter-style code/output blocks
- Adds Display implementations for ReductionPath and ReductionStep with arrow notation (→)
- Fixes rustdoc link, corrects JSON field names (
num_elements→universe_size), and adds 7 paper reduction examples
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/rules/graph.rs | Added path_overheads() for per-edge polynomials, refactored compose_path_overhead(), added Display impls for ReductionPath/Step |
| src/unit_tests/reduction_graph.rs | Replaced evaluate_path_overhead() numeric checks with symbolic polynomial assertions |
| src/traits.rs | Fixed rustdoc link to use full path crate::types::ProblemSize |
| src/rules/mod.rs | Minor formatting change (line wrapping) |
| examples/chained_reduction_factoring_to_spinglass.rs | Added anchors and overhead inspection code demonstrating path_overheads() and compose_path_overhead() |
| docs/src/getting-started.md | Rewrote Example 2 to use Factoring→SpinGlass path with step-by-step walkthrough |
| docs/src/reductions/reduction_graph.json | Corrected field names (num_elements→universe_size, added num_literals fields, fixed num_gates→num_variables+num_assignments) |
| docs/paper/reductions.typ | Added 7 paper examples with real test data (SAT→KColoring, SAT→DominatingSet, SAT→KSat, CircuitSAT→SpinGlass, Factoring→CircuitSAT, MaxCut→SpinGlass, SpinGlass→MaxCut) |
| .claude/CLAUDE.md | Added force-push prohibition guideline |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
path_overheads()as single source of truth for per-edge overhead lookup; refactorcompose_path_overhead()to build on it (DRY)evaluate_path_overhead()in favor of symbolic per-edge polynomial checks in testsProblemSizeTest plan
make testpasses (all 47 doctests + unit/integration tests)cargo run --features ilp --example chained_reduction_factoring_to_spinglassmake docbuilds mdBook with updated getting-started pagemake paper🤖 Generated with Claude Code