Fix #503: [Model] SchedulingWithIndividualDeadlines#678
Open
Fix #503: [Model] SchedulingWithIndividualDeadlines#678
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #678 +/- ##
========================================
Coverage 97.04% 97.05%
========================================
Files 284 286 +2
Lines 38037 38195 +158
========================================
+ Hits 36914 37071 +157
- Misses 1123 1124 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
Implementation SummaryChanges
Deviations from Plan
Open Questions
|
There was a problem hiding this comment.
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
SchedulingWithIndividualDeadlinesmodel (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. | ||
|
|
Contributor
Author
Review Pipeline Report
Remaining issues for final review
🤖 Generated by review-pipeline |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add the
SchedulingWithIndividualDeadlinesmodel and integrate it across the library, CLI creation flow, example fixtures, tests, and paper documentation.Review follow-ups
max_deadline--mas a processor-count alias inpred create SchedulingWithIndividualDeadlinesFixes #503