Skip to content

Fix #301: [Model] MinimumDummyActivitiesPert#751

Merged
GiggleLiu merged 8 commits intomainfrom
issue-301
Mar 22, 2026
Merged

Fix #301: [Model] MinimumDummyActivitiesPert#751
GiggleLiu merged 8 commits intomainfrom
issue-301

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

Summary

Add the implementation plan for MinimumDummyActivitiesPert and execute issue #301.

Fixes #301

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Implementation Summary

Changes

  • Added the MinimumDummyActivitiesPert graph model with DAG validation, brute-force dimensions 2^num_arcs, and evaluation logic that merges selected predecessor-finish / successor-start event pairs, rejects cyclic or reachability-changing encodings, and minimizes the number of distinct dummy activity arcs.
  • Added dedicated unit coverage for creation, invalid cyclic input, the corrected issue example with optimum 2, an invalid spurious-reachability merge, brute-force optimality, serialization, and the paper example path.
  • Registered the model in the graph module exports, crate prelude, and example-db coverage so it appears in schema/example exports.
  • Extended pred create and CLI help with MinimumDummyActivitiesPert parsing and example support.
  • Added a paper problem-def entry with the canonical example and figure.

Deviations from Plan

  • Used a direct-precedence merge encoding with one binary choice per input arc rather than a larger event-assignment search space. This keeps the implementation aligned with the issue's intended 2^num_arcs brute-force complexity and makes the canonical example exhaustively solvable.

Open Questions

  • None.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 99.60630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.63%. Comparing base (adfe9ae) to head (69e123c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/models/graph/minimum_dummy_activities_pert.rs 99.41% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #751    +/-   ##
========================================
  Coverage   97.62%   97.63%            
========================================
  Files         437      439     +2     
  Lines       53997    54251   +254     
========================================
+ Hits        52715    52968   +253     
- Misses       1282     1283     +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

Agentic Review Report

Structural Check

Structural Review: model MinimumDummyActivitiesPert

Structural Completeness

# Check Status
1 Model file exists PASS — src/models/graph/minimum_dummy_activities_pert.rs was added
2 inventory::submit! present PASS
3 Serialization support present PASS — Serialize is derived and Deserialize is implemented manually
4 Problem trait impl PASS
5 OptimizationProblem or SatisfactionProblem impl PASS — OptimizationProblem
6 #[cfg(test)] + #[path = ...] test link PASS
7 Test file exists PASS — src/unit_tests/models/graph/minimum_dummy_activities_pert.rs
8 Test file has >= 3 test functions PASS — 7 tests
9 Registered in graph/mod.rs PASS
10 Re-exported in models/mod.rs PASS
11 declare_variants! entry exists PASS
12 CLI problem-name resolution PASS — handled through registry-backed resolve_alias, no manual match arm required
13 CLI create support PASS
14 Canonical model example registered PASS — through graph::canonical_model_example_specs() into the example DB
15 Paper display-name entry PASS
16 Paper problem-def block PASS

Deterministic Checks

  • Whitelist: FAIL — the packet flagged files outside the current model whitelist (problemreductions-cli/src/cli.rs, problemreductions-cli/src/commands/create.rs, src/lib.rs, src/models/graph/mod.rs, src/models/mod.rs, src/unit_tests/example_db.rs). These changes look related to registration/CLI/docs rather than autogenerated outputs, but the whitelist still reports them.
  • Completeness: PASS
  • Blacklisted auto-generated files: PASS — none of the forbidden generated files are in the diff.

Build Status

  • make test: PASS
  • make clippy: PASS

Semantic Review

  • evaluate() correctness: ISSUE — src/models/graph/minimum_dummy_activities_pert.rs:131 unconditionally materializes one dummy arc for every precedence arc whose config bit is 0. That makes the model overcount DAGs with transitive arcs. Reproduction in the checked-out branch: create MinimumDummyActivitiesPert on arcs 0>1,1>2,0>2, then run pred solve ... --solver brute-force; the solver returns Valid(1) with solution [1,1,0]. Under the issue definition, zero dummy arcs suffice by merging 0+=1- and 1+=2-, because 0+ already reaches 2- through task 1.
  • dims() correctness: OK — binary choice per input arc.
  • Size getter consistency: OK — num_arcs() matches the declared complexity string.
  • Weight handling: OK — not applicable for this unweighted directed-graph model.

Issue Compliance (linked issue #301)

# Check Status
1 Problem name matches issue OK
2 Mathematical definition matches ISSUE — the implementation solves a stricter “every direct precedence must be merge or dummy” encoding, not the full reachability-preserving optimization problem stated in the issue
3 Problem type (opt/sat) matches OK
4 Type parameters match OK — none
5 Configuration space matches OK — 2^num_arcs as documented
6 Feasibility check matches OK — candidate networks are required to stay acyclic and preserve task reachability
7 Objective function matches ISSUE — redundant transitive precedences are still charged as dummy arcs
8 Complexity matches OK for the implemented search space, but it is no longer an exact solver for the full issue definition because of #2/#7

Summary

  • 16/16 structural completeness checks passed.
  • 6/8 issue-compliance checks passed.
  • ISSUE — the evaluator overcounts dummy arcs on DAGs with transitive precedence edges, so the model does not implement the full problem from issue [Model] MinimumDummyActivitiesPert #301.
  • FAIL (deterministic) — file whitelist check reported extra touched files outside the current model whitelist.

Quality Check

Quality Review

Design Principles

  • DRY: OK — the model/CLI/doc wiring follows existing patterns without obvious copy-paste debt.
  • KISS: ISSUE — the simplified one-bit-per-direct-precedence encoding is easy to brute-force, but it changes the optimization problem’s semantics; the simplification is not behavior-preserving.
  • HC/LC: OK — model logic, CLI support, tests, and paper docs remain separated by module.

HCI (CLI changed)

  • Error messages: OK — cyclic-input rejection is explicit and actionable.
  • Discoverability: ISSUE — the paper/example flow tells users to run pred solve minimum-dummy-activities-pert.json, but that command fails for this model unless the user already knows to add --solver brute-force.
  • Consistency: OK — pred create help and examples are wired in the usual way.
  • Least surprise: ISSUE — pred create --example MinimumDummyActivitiesPert followed by the documented solve command fails with No reduction path from MinimumDummyActivitiesPert to ILP... Try --solver brute-force.
  • Feedback: OK — the CLI clearly reports the failure reason and the workaround.

Test Quality

Issues

Critical (Must Fix)

  • src/models/graph/minimum_dummy_activities_pert.rs:131: non-merged direct precedence arcs are always counted as dummy arcs, even when the precedence is already implied transitively in the event network. This makes the solver return suboptimal values on valid DAG inputs such as 0>1,1>2,0>2.

Important (Should Fix)

Minor (Nice to Have)

  • None beyond the deterministic whitelist noise already noted above.

Summary

  • ISSUE — the core search space is too restrictive for the mathematical problem, so the model can return a non-optimal dummy count.
  • ISSUE — the published example solve command is not runnable as written.
  • ISSUE — tests miss the transitive-arc case that exposes the correctness bug.

Agentic Feature Tests

Feature Test Report: problem-reductions

Date: 2026-03-22
Project type: CLI + Rust library
Features tested: MinimumDummyActivitiesPert model
Profile: ephemeral
Use Case: Discover the new model from the CLI, create the canonical example, and solve it from docs/examples alone.
Expected Outcome: The model appears in the catalog, pred show explains it, pred create --example writes a valid instance, and the documented solve flow works end-to-end.
Verdict: fail
Critical Issues: 1

Summary

Feature Discoverable Setup Works Expected Outcome Met Doc Quality
MinimumDummyActivitiesPert yes yes partial no incorrect solve command

Per-Feature Details

MinimumDummyActivitiesPert

  • Role: downstream CLI user trying the newly added model.
  • Use Case: find the model in the catalog, inspect it, create the example instance, and solve it without reading the Rust source.
  • What they tried: pred list, pred show MinimumDummyActivitiesPert, pred create --example MinimumDummyActivitiesPert, pred solve minimum-dummy-activities-pert-example.json, pred solve ... --solver brute-force, and pred evaluate ... --config 1,0,0,1,1.
  • Discoverability: good. The model appears in pred list and pred show prints the expected description and field list.
  • Setup: good. No extra setup was required inside the PR worktree.
  • Functionality: partial. Example creation and evaluation work. Default pred solve fails with No reduction path from MinimumDummyActivitiesPert to ILP or ILP solver found no solution. Try --solver brute-force. Adding --solver brute-force succeeds on the canonical example.
  • Expected vs Actual Outcome: not met. The paper/example flow implies pred solve should work directly, but a real user must discover --solver brute-force on their own.
  • Blocked steps: none.
  • Friction points: the documented solve command is wrong for this model.
  • Doc suggestions: update the paper/example command to pred solve minimum-dummy-activities-pert.json --solver brute-force.

Expected vs Actual Outcome

  • Catalog and show output matched expectations.
  • Example creation matched expectations.
  • Solving did not match expectations because the documented command fails without an explicit solver selection.

Issues Found

  • Confirmed critical: on a custom transitive DAG instance (0>1,1>2,0>2), pred solve ... --solver brute-force returns Valid(1) even though zero dummy arcs suffice under the issue’s reachability-only definition.
  • Confirmed important: the paper’s documented pred solve minimum-dummy-activities-pert.json command fails unless the user adds --solver brute-force.

Suggestions

  • Fix the evaluator/search space so transitive precedence arcs can be satisfied without forcing an extra dummy arc.
  • Add a regression test for a DAG with redundant transitive precedence edges.
  • Correct the paper/example solve command to include --solver brute-force.

Generated by review-pipeline

GiggleLiu and others added 3 commits March 22, 2026 16:21
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
…paper solve command

- Subtract task-arc intersections from dummy count: when a non-merged
  arc's dummy coincides with a task arc, it doesn't add a new arc to the
  event network and shouldn't be counted.
- Add regression test for DAG 0→1, 1→2, 0→2 (optimal = 0 dummies).
- Fix paper's pred solve command to include --solver brute-force.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@GiggleLiu GiggleLiu mentioned this pull request Mar 22, 2026
3 tasks
@GiggleLiu GiggleLiu merged commit 63b53e3 into main Mar 22, 2026
3 checks passed
@GiggleLiu GiggleLiu deleted the issue-301 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] MinimumDummyActivitiesPert

1 participant