Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
+ Coverage 96.88% 96.90% +0.01%
==========================================
Files 196 198 +2
Lines 26747 26908 +161
==========================================
+ Hits 25913 26074 +161
Misses 834 834 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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>
Also fix pub(crate) -> mod consistency in optimization/mod.rs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…arations - Fix trailing blank line in bin_packing.rs - Fix clippy large_enum_variant in CLI (Box<CreateArgs>) - Fix clippy unnecessary_map_or in graph.rs - Add declare_variants! for BinPacking<i32> and BinPacking<f64> - Remove unnecessary Default bound and problem_size methods - Add edge-case tests: empty items, wrong config length, out-of-range bin, f64, variant - Update Makefile run-plan target Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new optimization problem model, BinPacking, to the core library and wires it through schema/CLI/documentation so instances can be loaded/solved/serialized, alongside a small robustness fix in the UnitDiskMapping path decomposition greedy method.
Changes:
- Add
BinPacking<W>model (schema registration, evaluation, variants, exports) and unit tests. - Register
BinPackingin the CLI dispatch and add naming/alias support. - Add BinPacking problem definition to the paper; clamp greedy path decomposition restarts to avoid empty layouts.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/models/optimization/bin_packing.rs |
New BinPacking optimization model implementation + schema/variants + tests module hook |
src/models/optimization/mod.rs |
Register and re-export BinPacking from optimization module |
src/models/mod.rs |
Re-export BinPacking from top-level models module |
src/unit_tests/models/optimization/bin_packing.rs |
Unit tests for creation/evaluation/bruteforce/serialization + f64 coverage |
problemreductions-cli/src/dispatch.rs |
CLI JSON load/serialize dispatch for BinPacking<i32> and BinPacking<f64> |
problemreductions-cli/src/problem_name.rs |
Add BinPacking name mapping and advertise short alias BP |
docs/paper/reductions.typ |
Add display name + #problem-def("BinPacking") |
src/rules/unitdiskmapping/pathdecomposition.rs |
Clamp nrepeat to at least 1 in greedy pathwidth mode |
src/unit_tests/rules/unitdiskmapping/pathdecomposition.rs |
Tests covering zero-restart clamping and non-empty layouts |
problemreductions-cli/src/commands/graph.rs |
Simplify default-variant diff filtering logic |
problemreductions-cli/src/cli.rs |
Box CreateArgs in Commands enum |
docs/plans/2026-02-25-bin-packing.md |
Add implementation plan document for BinPacking |
Makefile |
Update run-plan prompt/process handling |
.gitignore |
Ignore .claude/worktrees/ |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "paintshop" => "PaintShop".to_string(), | ||
| "bmf" => "BMF".to_string(), | ||
| "bicliquecover" => "BicliqueCover".to_string(), | ||
| "binpacking" => "BinPacking".to_string(), |
There was a problem hiding this comment.
ALIASES lists "BP" for BinPacking, but resolve_alias() does not handle the lowercase input "bp" (it only matches "binpacking"). As a result, pred ... BP will not resolve to BinPacking even though it’s advertised as an alias. Add a "bp" => "BinPacking" match arm (or reuse ALIASES for resolution).
| "binpacking" => "BinPacking".to_string(), | |
| "bp" | "binpacking" => "BinPacking".to_string(), |
| run-plan: | ||
| @NL=$$'\n'; \ | ||
| BRANCH=$$(git branch --show-current); \ | ||
| PLAN_FILE="$(PLAN_FILE)"; \ | ||
| if [ "$(AGENT_TYPE)" = "claude" ]; then \ | ||
| 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"; \ | ||
| PROCESS="1. Read the plan file$${NL}2. Choose the right skill to execute: use /add-model for new problem models, /add-rule for new reduction rules, or /subagent-driven-development for other 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. Create a pull request"; \ | ||
| fi; \ | ||
| PROMPT="Execute the plan in '$${PLAN_FILE}'."; \ | ||
| PROMPT="Execute the plan in '$$PLAN_FILE'."; \ |
There was a problem hiding this comment.
This PR is described as adding the BinPacking model, but it also changes the run-plan Makefile workflow/prompt logic. If these Makefile changes are intentional, please mention them in the PR description; otherwise consider splitting them into a separate PR to keep scope focused and make review/audit easier.
| BinPacking<i32> => "2^num_items", | ||
| BinPacking<f64> => "2^num_items", |
There was a problem hiding this comment.
declare_variants! complexity metadata is incorrect for BinPacking: the configuration space is n^n (each of n items chooses among n bins), but this is currently declared as 2^num_items. This will misreport complexity in the reduction graph/paper outputs; update the string to reflect num_items^num_items (or equivalent).
| BinPacking<i32> => "2^num_items", | |
| BinPacking<f64> => "2^num_items", | |
| BinPacking<i32> => "num_items^num_items", | |
| BinPacking<f64> => "num_items^num_items", |
- Remove stale problem_size_names/values (trait methods removed on main) - Add declare_variants! with verified O*(2^n) complexity (Björklund+ 2009) - Remove unnecessary Default trait bound on impl block - Add edge-case tests: empty items, wrong config length, out-of-range bin, f64 - Expand paper problem-def with background, algorithm citation, example, figure - Regenerate problem_schemas.json and reduction_graph.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "bp" lowercase alias in resolve_alias() (Copilot review) - Replace match/panic with matches!() macro to eliminate uncovered branch (codecov) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
BinPacking<W>optimization model tosrc/models/optimization/Closes #95
Plan
See
docs/plans/2026-02-25-bin-packing.mdfor the full implementation plan covering:BinPacking<W>struct +Problem/OptimizationProblemtraits)#problem-def)Test plan
make checkpasses (fmt + clippy + test)🤖 Generated with Claude Code