Skip to content

Fix #212: [Model] MultiprocessorScheduling#223

Open
zazabap wants to merge 10 commits intoCodingThrust:mainfrom
zazabap:issue-212-multiprocessor-scheduling
Open

Fix #212: [Model] MultiprocessorScheduling#223
zazabap wants to merge 10 commits intoCodingThrust:mainfrom
zazabap:issue-212-multiprocessor-scheduling

Conversation

@zazabap
Copy link
Collaborator

@zazabap zazabap commented Mar 10, 2026

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

  • Plan file: docs/plans/2026-03-10-multiprocessor-scheduling.md
  • Category: misc/ (scheduling input structure)
  • Problem type: satisfaction (Metric = bool)
  • Variables: n tasks, each assigned to one of m processors
  • Complexity: num_processors ^ num_tasks (strongly NP-hard for general m)

Fixes #212

🤖 Generated with Claude Code

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

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.06%. Comparing base (dfcc313) to head (fc060aa).

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

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

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 MultiprocessorScheduling model 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 pred CLI (alias resolution, dispatch, and pred create flags/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.

Comment on lines +11 to +22
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" },
],
}
}
Comment on lines +48 to +55
pub struct MultiprocessorScheduling {
/// Processing time for each task.
lengths: Vec<u64>,
/// Number of identical processors.
num_processors: u64,
/// Global deadline.
deadline: u64,
}
Comment on lines +458 to +470
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,
))?,
@GiggleLiu
Copy link
Contributor

Implementation Summary

Changes

  • Merged current origin/main into this PR and adapted the branch to the registry-driven model/CLI architecture now on main.
  • Updated MultiprocessorScheduling to current model conventions: schema metadata, usize processor count, declared default variant, total-length helper, and canonical example-db support.
  • Hooked the model into the current CLI/create flows, paper metadata, canonical fixtures, and trait/example-db coverage.

Deviations from Plan

  • Resuming this PR required a conflict-resolution migration because the original branch predated the registry/example-db refactor on main.
  • Regenerated checked-in example/schema exports after the merge so the paper and CLI example paths reflect the final implementation.

Open Questions

  • None.

Verification

  • make test
  • make clippy
  • make paper

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

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 MultiprocessorScheduling model with schema registration, evaluation logic, and variant complexity declaration.
  • Expose the model via src/models/mod.rs and prelude, and add unit tests.
  • Add CLI support (alias resolution, JSON dispatch, pred create flags/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.

Comment on lines +11 to +15
inventory::submit! {
ProblemSchemaEntry {
name: "MultiprocessorScheduling",
module_path: module_path!(),
description: "Assign tasks to processors so that no processor's load exceeds a deadline",
Comment on lines +48 to +54
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" },
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.
@GiggleLiu
Copy link
Contributor

Review Pipeline Report

Check Result
Copilot comments 0 actionable
Issue/human comments checked, fixed actionable items
Structural review passed after merge resolution and verification
CI green
Agentic test passed
Needs human decision none
Board Review pool -> Final review

Remaining issues for final review

  • None.

🤖 Generated by review-pipeline

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.

[Model] MultiprocessorScheduling

3 participants