Skip to content

Fix #503: [Model] SchedulingWithIndividualDeadlines#678

Merged
isPANN merged 10 commits intomainfrom
issue-503-scheduling-with-individual-deadlines
Mar 20, 2026
Merged

Fix #503: [Model] SchedulingWithIndividualDeadlines#678
isPANN merged 10 commits intomainfrom
issue-503-scheduling-with-individual-deadlines

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

@GiggleLiu GiggleLiu commented Mar 16, 2026

Summary

Add the SchedulingWithIndividualDeadlines model and integrate it across the library, CLI creation flow, example fixtures, tests, and paper documentation.

Review follow-ups

  • avoid per-evaluation allocations proportional to max_deadline
  • accept --m as a processor-count alias in pred create SchedulingWithIndividualDeadlines

Fixes #503

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.49%. Comparing base (418222f) to head (492bdaf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #678    +/-   ##
========================================
  Coverage   97.48%   97.49%            
========================================
  Files         357      359     +2     
  Lines       45418    45584   +166     
========================================
+ Hits        44274    44440   +166     
  Misses       1144     1144            

☔ 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
Copy link
Copy Markdown
Contributor Author

Implementation Summary

Changes

  • Added the new SchedulingWithIndividualDeadlines model in src/models/misc/scheduling_with_individual_deadlines.rs, registered it in the model modules, and exposed it through src/lib.rs.
  • Added CLI creation support in problemreductions-cli/src/commands/create.rs and updated shared pred create flag/help text in problemreductions-cli/src/cli.rs.
  • Added focused model tests in src/unit_tests/models/misc/scheduling_with_individual_deadlines.rs.
  • Added the canonical model example to src/example_db/fixtures/examples.json.
  • Added the paper/reference entries in docs/paper/reductions.typ and docs/paper/references.bib.

Deviations from Plan

  • Tightened the CLI contract during review by removing an accidental --m fallback for SchedulingWithIndividualDeadlines; the model now requires the documented --num-processors flag.
  • Added explicit CLI help/create regression tests to lock that contract down.

Open Questions

  • None.

Copy link
Copy Markdown

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 miscellaneous scheduling model, SchedulingWithIndividualDeadlines, integrating it across the library, CLI creation flow, fixtures, tests, and the paper docs.

Changes:

  • Introduces SchedulingWithIndividualDeadlines model (schema registration, evaluation logic, variants, example-db spec).
  • Adds unit tests + example-db fixture entry for the new model.
  • Wires the model into public exports and CLI pred create, and documents it in the paper.

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/scheduling_with_individual_deadlines.rs New problem model implementation, registry schema, evaluation, variants, example-db hook
src/unit_tests/models/misc/scheduling_with_individual_deadlines.rs New unit test suite for the model
src/models/misc/mod.rs Registers module + re-exports + example-db aggregation
src/models/mod.rs Re-exports model from top-level models module
src/lib.rs Re-exports model via prelude
src/example_db/fixtures/examples.json Adds canonical example fixture and solutions for the new model
problemreductions-cli/src/commands/create.rs Adds pred create support + a CLI test around --m behavior
problemreductions-cli/src/cli.rs Updates create-flag help text and adds a help-rendering test
docs/paper/references.bib Adds citation used by the new paper section
docs/paper/reductions.typ Adds model name mapping + a new narrative/figure section for the model

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +131 to +137
let mut slot_loads = vec![0usize; self.max_deadline()];
for &start in config {
slot_loads[start] += 1;
if slot_loads[start] > self.num_processors {
return false;
}
}
Comment on lines +1126 to +1145
// SchedulingWithIndividualDeadlines
"SchedulingWithIndividualDeadlines" => {
let deadlines_str = args.deadlines.as_deref().ok_or_else(|| {
anyhow::anyhow!(
"SchedulingWithIndividualDeadlines requires --deadlines, --n, and --num-processors\n\n\
Usage: pred create SchedulingWithIndividualDeadlines --n 7 --num-processors 3 --deadlines 2,1,2,2,3,3,2 [--precedence-pairs \"0>3,1>3,1>4,2>4,2>5\"]"
)
})?;
let num_tasks = args.n.ok_or_else(|| {
anyhow::anyhow!(
"SchedulingWithIndividualDeadlines requires --n (number of tasks)\n\n\
Usage: pred create SchedulingWithIndividualDeadlines --n 7 --num-processors 3 --deadlines 2,1,2,2,3,3,2"
)
})?;
let num_processors = args.num_processors.ok_or_else(|| {
anyhow::anyhow!(
"SchedulingWithIndividualDeadlines requires --num-processors\n\n\
Usage: pred create SchedulingWithIndividualDeadlines --n 7 --num-processors 3 --deadlines 2,1,2,2,3,3,2"
)
})?;
Comment on lines +2384 to +2412
#[test]
fn test_create_scheduling_with_individual_deadlines_rejects_m_alias() {
let cli = Cli::try_parse_from([
"pred",
"create",
"SchedulingWithIndividualDeadlines",
"--n",
"3",
"--deadlines",
"1,1,2",
"--m",
"2",
])
.expect("parse create command");

let Commands::Create(args) = cli.command else {
panic!("expected create subcommand");
};

let out = OutputConfig {
output: None,
quiet: true,
json: false,
auto_json: false,
};
let err = create(&args, &out).expect_err("`--m` should not satisfy --num-processors");

assert!(err.to_string().contains("requires --num-processors"));
}
Comment on lines +1 to +6
//! Scheduling With Individual Deadlines problem implementation.
//!
//! Given unit-length tasks with precedence constraints and per-task deadlines,
//! determine whether they can be scheduled on `m` identical processors so that
//! every task finishes by its own deadline.

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Review Pipeline Report

Check Result
Copilot comments 4 fixed
Issue/human comments 2 checked, 0 fixed
Structural review 16/16 passed
CI green
Agentic test passed
Needs human decision none
Board Review pool → Under review → Final review

Remaining issues for final review

  • None.

🤖 Generated by review-pipeline

@isPANN isPANN self-assigned this Mar 20, 2026
isPANN and others added 2 commits March 20, 2026 14:51
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverts the README.md build instruction change and the pred inspect
output format change in cli.md, which are outside the scope of this
model PR.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@isPANN isPANN merged commit e70b661 into main Mar 20, 2026
5 checks passed
@GiggleLiu GiggleLiu deleted the issue-503-scheduling-with-individual-deadlines branch April 12, 2026 00:53
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] SchedulingWithIndividualDeadlines

3 participants