Fix #212: [Model] MultiprocessorScheduling#223
Fix #212: [Model] MultiprocessorScheduling#223zazabap wants to merge 10 commits intoCodingThrust:mainfrom
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 #223 +/- ##
==========================================
+ Coverage 97.04% 97.06% +0.01%
==========================================
Files 284 286 +2
Lines 38037 38208 +171
==========================================
+ Hits 36914 37085 +171
Misses 1123 1123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add a satisfaction problem for multiprocessor scheduling: given tasks with processing times, processors, and a deadline, determine if tasks can be assigned so no processor exceeds the deadline. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds the MultiprocessorScheduling satisfaction-problem model (tasks with processing times assigned to identical processors under a global deadline) and wires it through the library exports and CLI so it can be created/loaded/serialized and solved via existing brute force.
Changes:
- Introduces
MultiprocessorSchedulingmodel with schema registration, evaluation logic, and variant complexity declaration. - Adds unit tests for evaluation, edge cases, brute force solving, and serde round-trip.
- Integrates the model into public exports and the
predCLI (alias resolution, dispatch, andpred createflags/help).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/models/misc/multiprocessor_scheduling.rs |
New model implementation + schema inventory registration + variant complexity declaration |
src/unit_tests/models/misc/multiprocessor_scheduling.rs |
Unit tests for correctness, edge cases, brute force, and serialization |
src/models/misc/mod.rs |
Registers module and re-exports the new model in misc |
src/models/mod.rs |
Re-exports the new model at the models module level |
src/lib.rs |
Adds the model to the crate prelude |
problemreductions-cli/src/problem_name.rs |
Adds alias resolution for the new model name |
problemreductions-cli/src/dispatch.rs |
Enables CLI load/serialize dispatch for MultiprocessorScheduling |
problemreductions-cli/src/commands/create.rs |
Adds pred create MultiprocessorScheduling support and schema-driven help integration |
problemreductions-cli/src/cli.rs |
Documents new flags and adds an example invocation |
docs/plans/2026-03-10-multiprocessor-scheduling.md |
Adds implementation plan/documentation for the new model |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| inventory::submit! { | ||
| ProblemSchemaEntry { | ||
| name: "MultiprocessorScheduling", | ||
| module_path: module_path!(), | ||
| description: "Assign tasks to processors so that no processor's load exceeds a deadline", | ||
| fields: &[ | ||
| FieldInfo { name: "lengths", type_name: "Vec<u64>", description: "Processing time l(t) for each task" }, | ||
| FieldInfo { name: "num_processors", type_name: "u64", description: "Number of identical processors m" }, | ||
| FieldInfo { name: "deadline", type_name: "u64", description: "Global deadline D" }, | ||
| ], | ||
| } | ||
| } |
| pub struct MultiprocessorScheduling { | ||
| /// Processing time for each task. | ||
| lengths: Vec<u64>, | ||
| /// Number of identical processors. | ||
| num_processors: u64, | ||
| /// Global deadline. | ||
| deadline: u64, | ||
| } |
| let num_processors = args.num_processors.ok_or_else(|| { | ||
| anyhow::anyhow!("MultiprocessorScheduling requires --num-processors\n\n{usage}") | ||
| })?; | ||
| let deadline = args.deadline.ok_or_else(|| { | ||
| anyhow::anyhow!("MultiprocessorScheduling requires --deadline\n\n{usage}") | ||
| })?; | ||
| let lengths: Vec<u64> = util::parse_comma_list(lengths_str)?; | ||
| ( | ||
| ser(MultiprocessorScheduling::new( | ||
| lengths, | ||
| num_processors, | ||
| deadline, | ||
| ))?, |
Implementation SummaryChanges
Deviations from Plan
Open Questions
Verification
|
There was a problem hiding this comment.
Pull request overview
Adds a new misc/ satisfaction model, MultiprocessorScheduling, and wires it through the library re-exports and CLI so instances can be created/loaded/solved via pred.
Changes:
- Implement
MultiprocessorSchedulingmodel with schema registration, evaluation logic, and variant complexity declaration. - Expose the model via
src/models/mod.rsandprelude, and add unit tests. - Add CLI support (alias resolution, JSON dispatch,
pred createflags/help, and instance creation).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/models/misc/multiprocessor_scheduling.rs | New model implementation + schema registration + complexity declaration + test module hook |
| src/unit_tests/models/misc/multiprocessor_scheduling.rs | Unit tests covering construction, evaluation edge cases, bruteforce solve, and serde round-trip |
| src/models/misc/mod.rs | Registers and re-exports the new misc model module |
| src/models/mod.rs | Re-exports MultiprocessorScheduling at models::* level |
| src/lib.rs | Adds MultiprocessorScheduling to the crate prelude re-exports |
| problemreductions-cli/src/problem_name.rs | Adds CLI alias resolution for multiprocessorscheduling |
| problemreductions-cli/src/dispatch.rs | Adds load/serialize dispatch for MultiprocessorScheduling |
| problemreductions-cli/src/commands/create.rs | Adds pred create MultiprocessorScheduling ... support |
| problemreductions-cli/src/cli.rs | Adds create flags (--lengths, --num-processors, --deadline) and help text |
| docs/plans/2026-03-10-multiprocessor-scheduling.md | Plan doc describing the model and intended integration steps |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| inventory::submit! { | ||
| ProblemSchemaEntry { | ||
| name: "MultiprocessorScheduling", | ||
| module_path: module_path!(), | ||
| description: "Assign tasks to processors so that no processor's load exceeds a deadline", |
| pub struct MultiprocessorScheduling { | ||
| /// Processing time for each task. | ||
| lengths: Vec<u64>, | ||
| /// Number of identical processors. | ||
| num_processors: u64, | ||
| /// Global deadline. | ||
| deadline: u64, |
| description: "Assign tasks to processors so that no processor's load exceeds a deadline", | ||
| fields: &[ | ||
| FieldInfo { name: "lengths", type_name: "Vec<u64>", description: "Processing time l(t) for each task" }, | ||
| FieldInfo { name: "num_processors", type_name: "u64", description: "Number of identical processors m" }, |
problemreductions-cli/src/cli.rs
Outdated
| pub lengths: Option<String>, | ||
| /// Number of processors for MultiprocessorScheduling | ||
| #[arg(long)] | ||
| pub num_processors: Option<u64>, |
Resolve the registry-driven CLI/module conflicts, reject invalid zero-processor MultiprocessorScheduling instances during deserialization, add a brute-force hint when no ILP path exists, regenerate exported docs artifacts, and record a feature-test report for the CLI workflow.
Reconcile the remote branch with the validated review worktree state, keep the zero-processor deserialization guard and brute-force solver hint, refresh canonical MultiprocessorScheduling examples and exported docs artifacts, retain the feature-test report, and drop the completed implementation plan file.
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
Summary
Add the MultiprocessorScheduling problem model — a satisfaction problem asking whether n tasks with integer processing times can be scheduled on m identical parallel machines to meet a global deadline D (Garey & Johnson A5 SS8).
docs/plans/2026-03-10-multiprocessor-scheduling.mdmisc/(scheduling input structure)Metric = bool)num_processors ^ num_tasks(strongly NP-hard for general m)Fixes #212
🤖 Generated with Claude Code