Skip to content

Fix #512: [Model] StaffScheduling#682

Merged
isPANN merged 8 commits intomainfrom
issue-512-staffscheduling
Mar 18, 2026
Merged

Fix #512: [Model] StaffScheduling#682
isPANN merged 8 commits intomainfrom
issue-512-staffscheduling

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

Summary

  • add an implementation plan for the StaffScheduling model issue
  • stage the dedicated issue branch for autonomous execution

Fixes #512

@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.15%. Comparing base (8c86ffb) to head (22637e9).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
+ Coverage   97.13%   97.15%   +0.01%     
==========================================
  Files         298      300       +2     
  Lines       39563    39753     +190     
==========================================
+ Hits        38430    38621     +191     
+ Misses       1133     1132       -1     

☔ 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 src/models/misc/staff_scheduling.rs for the new StaffScheduling model, plus registry/export wiring in src/models/misc/mod.rs, src/models/mod.rs, and src/lib.rs.
  • Added model and example-db coverage in src/unit_tests/models/misc/staff_scheduling.rs, src/unit_tests/example_db.rs, and regenerated src/example_db/fixtures/examples.json.
  • Added CLI support in problemreductions-cli/src/cli.rs and problemreductions-cli/src/commands/create.rs for --schedules, --requirements, --num-workers, and --k.
  • Added paper/docs entries in docs/paper/reductions.typ and docs/paper/references.bib.

Deviations from Plan

  • Added explicit CLI-side prevalidation for malformed schedules and shared boolean-row parsing after review feedback so invalid StaffScheduling input returns an error instead of panicking.
  • No other material deviations.

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 StaffScheduling satisfaction model to the problem registry, including CLI instance creation support, curated examples, and paper documentation updates.

Changes:

  • Introduces StaffScheduling model (schema registration, evaluation, variants, canonical example).
  • Adds unit tests and example-db fixture/example lookup coverage for StaffScheduling.
  • Extends CLI pred create to parse/validate StaffScheduling inputs and updates paper docs/references accordingly.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/models/misc/staff_scheduling.rs New StaffScheduling model implementation + schema + canonical example + variants.
src/models/misc/mod.rs Registers the new misc model module/export and adds it to canonical example specs.
src/models/mod.rs Re-exports StaffScheduling from the models top-level.
src/lib.rs Exposes StaffScheduling via the crate prelude.
src/unit_tests/models/misc/staff_scheduling.rs Adds unit tests for creation, evaluation, solver behavior, and serialization.
src/unit_tests/example_db.rs Adds a model-example lookup test for StaffScheduling.
src/example_db/fixtures/examples.json Adds StaffScheduling canonical fixture and updates some existing fixture solutions.
problemreductions-cli/src/cli.rs Adds --schedules, --requirements, --num-workers flags and documents StaffScheduling flags.
problemreductions-cli/src/commands/create.rs Implements pred create StaffScheduling parsing/validation + help/format hints + tests.
docs/paper/references.bib Adds citation for Bartholdi/Orlin/Ratliff (1980).
docs/paper/reductions.typ Adds StaffScheduling to the paper’s problem definitions and catalog mapping.

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

Comment on lines +2106 to 2117
fn parse_bool_rows(rows_str: &str) -> Result<Vec<Vec<bool>>> {
rows_str
.split(';')
.map(|row| {
row.trim()
.split(',')
.map(|s| match s.trim() {
.map(|entry| match entry.trim() {
"1" | "true" => Ok(true),
"0" | "false" => Ok(false),
other => Err(anyhow::anyhow!(
"Invalid boolean value '{}': expected 0/1 or true/false",
other
"Invalid schedule entry '{other}': expected 0/1 or true/false"
)),
Comment on lines +42 to +52
/// Create a new Staff Scheduling instance.
pub fn new(
shifts_per_schedule: usize,
schedules: Vec<Vec<bool>>,
requirements: Vec<u64>,
num_workers: u64,
) -> Self {
assert!(
num_workers < usize::MAX as u64,
"num_workers must fit in usize so dims() can encode 0..=num_workers"
);
}

@article{bartholdi1980,
author = {John J. Bartholdi, James B. Orlin and H. Donald Ratliff},
GiggleLiu and others added 4 commits March 17, 2026 05:34
…nd concurrent additions)

Merge conflicts arose from concurrent model additions (MultiprocessorScheduling,
BiconnectivityAugmentation, BalancedCompleteBipartiteSubgraph, StrongConnectivityAugmentation)
landing on main while this branch adds StaffScheduling. Resolved by keeping both sides
in all six conflicted files.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
The merge-with-main commit accidentally corrupted
test_create_biconnectivity_augmentation_json and deleted three other
tests (biconnectivity_isolated, balanced_complete_bipartite, and
balanced_complete_bipartite_rejects). Restore them from origin/main.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Replace bar(R) with overline(R) for proper rendering of the
requirement vector notation.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@isPANN isPANN merged commit 6d2981d into main Mar 18, 2026
3 checks passed
@GiggleLiu GiggleLiu deleted the issue-512-staffscheduling 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] StaffScheduling

3 participants