Skip to content

Remove weight type parameter from CircuitSAT and KColoring#56

Merged
GiggleLiu merged 7 commits intomainfrom
fix/circuitsat-no-weight
Feb 13, 2026
Merged

Remove weight type parameter from CircuitSAT and KColoring#56
GiggleLiu merged 7 commits intomainfrom
fix/circuitsat-no-weight

Conversation

@GiggleLiu
Copy link
Contributor

@GiggleLiu GiggleLiu commented Feb 13, 2026

Summary

  • Remove weight type parameter from CircuitSAT and KColoring — these problems have no meaningful weight semantics, so the generic W parameter was unnecessary complexity
  • Add graph visualization library (docs/paper/lib.typ) and tutorial-style KColoring→QUBO example in the paper
  • Add reduction macro redesign doc (docs/plans/2026-02-13-reduction-macro-redesign-design.md)
  • Restructure .claude/ — make CLAUDE.md purely declarative (architecture, conventions, naming) and move action pipelines into the issue-to-pr skill's plan-writing step
  • Add natural variant reduction plans — design and implementation plans for natural variant reductions
  • Expand unit tests — add variant checking, edge cases, and improved test coverage across models and rules
  • Update paper — streamline reduction content and update examples
  • Update issue template and README

Test plan

  • make test passes — all existing tests updated for removed type parameters
  • make clippy passes
  • Verify examples compile and run (make examples)
  • Paper builds (make paper)

🤖 Generated with Claude Code

GiggleLiu and others added 5 commits February 13, 2026 16:45
…BO example

Create docs/paper/lib.typ with reusable graph drawing functions (draw-graph,
petersen-graph, house-graph, octahedral-graph, draw-grid-graph,
draw-triangular-graph) and import it from reductions.typ. Add a featured
KColoring→QUBO example with a colored house graph visualization and a 4-step
tutorial walkthrough (encode, one-hot penalty, edge conflict, verify).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CircuitSAT and KColoring are satisfaction problems (Metric = bool),
not optimization problems, so they should not have a weight type
parameter W.

- CircuitSAT: remove W, simplify from CircuitSAT<W> to CircuitSAT
- KColoring: remove W, simplify from KColoring<K, G, W> to KColoring<K, G>
- Fix #[reduction] macro: check second type param is actually a weight
  type before treating it as one (fixes KColoring<K, SimpleGraph> being
  misinterpreted as having weight "SimpleGraph")
- Update all reduction rules, tests, examples, benchmarks
- Regenerate reduction_graph.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dynamic variant extraction using fn pointers instead of static
inference from type parameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…to-pr skill

Move "Adding a Reduction Rule" and "Adding a Model" procedural sections
from CLAUDE.md into the issue-to-pr skill's plan-writing step. CLAUDE.md
now contains only global rules and reference; the skill contains actionable
pipelines keyed by issue type ([Rule] and [Model]).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add natural variant reduction design and implementation plans
- Expand unit tests with variant checking and edge cases
- Update paper with streamlined reduction content
- Update examples with improved structure
- Update issue template and README

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 97.90210% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.95%. Comparing base (715ae78) to head (3e2e29d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...t_tests/rules/unitdiskmapping/pathdecomposition.rs 69.23% 4 Missing ⚠️
src/unit_tests/rules/registry.rs 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
+ Coverage   96.93%   96.95%   +0.02%     
==========================================
  Files         176      176              
  Lines       25337    25386      +49     
==========================================
+ Hits        24560    24614      +54     
+ Misses        777      772       -5     

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

GiggleLiu and others added 2 commits February 13, 2026 21:23
Replace hardcoded ("graph", ...), ("weight", ...) variant fields in the
#[reduction] macro with fn pointers that call Problem::variant() at
runtime. This makes Problem::variant() the single source of truth for
variant fields, fixing disconnected KColoring and KSatisfiability nodes
in the reduction graph.

Key changes:
- ReductionEntry/ConcreteVariantEntry use fn pointers for variants
- Macro substitutes usize::MAX for const generics (maps to "N")
- Added "k" field support in is_variant_reducible() for natural edges
- KColoring[k=3] → KColoring[k=N] → ILP/QUBO now properly connected
- KSatisfiability[k=2,3] → KSatisfiability[k=N] now properly connected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GiggleLiu GiggleLiu merged commit 65bb77c into main Feb 13, 2026
3 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.

1 participant