Skip to content

Fix #438: [Model] PartialFeedbackEdgeSet#755

Merged
isPANN merged 5 commits intomainfrom
issue-438
Mar 23, 2026
Merged

Fix #438: [Model] PartialFeedbackEdgeSet#755
isPANN merged 5 commits intomainfrom
issue-438

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

Summary

Add the implementation plan for PartialFeedbackEdgeSet and execute issue #438 in follow-up commits.

Fixes #438

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 99.57627% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.64%. Comparing base (ccf12f4) to head (8926ad3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/models/graph/partial_feedback_edge_set.rs 99.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #755      +/-   ##
==========================================
- Coverage   97.64%   97.64%   -0.01%     
==========================================
  Files         449      451       +2     
  Lines       55134    55370     +236     
==========================================
+ Hits        53834    54064     +230     
- Misses       1300     1306       +6     

☔ 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

Changes

  • Added the new PartialFeedbackEdgeSet<G> satisfaction model, schema registration, bounded-cycle validation logic, and a canonical example matching the corrected issue discussion.
  • Wired the model into library exports and the CLI create flow, including the new --max-cycle-length input.
  • Added focused unit and CLI tests, and documented the model in the paper.
  • Verified with make test, make clippy, and make paper.

Deviations from Plan

  • I did not enforce max_cycle_length >= 3. For bounds below 3, the implementation treats the instance as vacuously satisfiable within budget because simple graphs have no cycles of length 1 or 2.

Open Questions

  • None.

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Agentic Review Report

Structural Check

Deterministic packet check: Whitelist FAIL, Completeness PASS.

Confirmed whitelist violations for a model PR:

  • problemreductions-cli/src/cli.rs
  • problemreductions-cli/src/commands/create.rs
  • src/lib.rs
# Check Status
1 Model file exists PASS
2 inventory::submit! present PASS
3 Serialize / Deserialize derive on struct PASS
4 Problem trait impl PASS
5 SatisfactionProblem impl PASS
6 #[cfg(test)] + #[path = "..." ] test link PASS
7 Test file exists PASS
8 Test file has at least 3 test functions PASS
9 Registered in graph/mod.rs PASS
10 Re-exported in models/mod.rs PASS
11 declare_variants! entry exists PASS
12 CLI resolve_alias / catalog discovery support PASS
13 CLI create support PASS
14 Canonical model example registered PASS
15 Paper display-name entry PASS
16 Paper problem-def block PASS

Build Status

  • make test: PASS
  • make clippy: PASS

Semantic Review

  • evaluate() matches the decision problem and rejects invalid config length, non-binary entries, and over-budget removals in src/models/graph/partial_feedback_edge_set.rs:85.
  • dims() returns the expected binary configuration space for each edge in src/models/graph/partial_feedback_edge_set.rs:105.
  • The short-cycle detector is consistent with the bounded-cycle formulation and the simple-graph assumption in src/models/graph/partial_feedback_edge_set.rs:125.
  • CLI creation wiring and help text are present in problemreductions-cli/src/commands/create.rs:1359 and problemreductions-cli/src/cli.rs:268.
  • The canonical example and paper entry are aligned with the checked-in model example in docs/paper/reductions.typ:4821.

Issue Compliance

# Check Status
1 Problem name matches issue OK
2 Mathematical definition matches OK
3 Problem type matches OK
4 Type parameters match OK
5 Configuration space matches OK
6 Feasibility check matches OK
7 Objective / satisfaction behavior matches OK
8 Complexity matches OK

Summary

  • 16/16 structural checks passed.
  • 8/8 issue-compliance checks passed.
  • Build is green: make test and make clippy both passed.
  • No blacklisted generated files were committed.
  • The only non-passing deterministic signal is the model-PR whitelist violation above.

Quality Check

Design Principles

  • DRY: OK
  • KISS: OK
  • HC/LC: OK

HCI

  • Error messages: ISSUE - The invalid-budget path omits the supplied value, so it is slightly less actionable than the strongest existing CLI errors. See problemreductions-cli/src/commands/create.rs:1371.
  • Discoverability: OK - PartialFeedbackEdgeSet and --max-cycle-length are surfaced in pred create help and after-help. See problemreductions-cli/src/cli.rs:268 and problemreductions-cli/src/cli.rs:616.
  • Consistency: OK
  • Least surprise: OK
  • Feedback: OK

Test Quality

  • Naive test detection: ISSUE - test_create_partial_feedback_edge_set_json writes to a fixed path under std::env::temp_dir(), which is a potential collision point under concurrent test runs. See problemreductions-cli/src/commands/create.rs:7508.
  • Boundary coverage: ISSUE - the new model tests do not exercise the documented max_cycle_length < 3 branch in has_cycle_with_length_at_most(). See src/models/graph/partial_feedback_edge_set.rs:130 and src/unit_tests/models/graph/partial_feedback_edge_set.rs:53.

Issues

Important

  • The new create-path test uses a fixed temp filename, which is a possible flake risk in parallel execution. See problemreductions-cli/src/commands/create.rs:7508.

Minor

  • The invalid-budget CLI error could include the supplied value for easier debugging. See problemreductions-cli/src/commands/create.rs:1371.
  • The suite should cover the max_cycle_length < 3 boundary explicitly. See src/models/graph/partial_feedback_edge_set.rs:130.

Summary

  • 0 critical issues.
  • 1 important issue.
  • 2 minor issues.

Agentic Feature Tests

PartialFeedbackEdgeSet was discoverable and usable end to end from the CLI in this review worktree. I exercised the requested user path: pred list, pred show PartialFeedbackEdgeSet, pred create --example PartialFeedbackEdgeSet, and pred solve on the generated example.

Feature Discoverable Setup Works Expected Outcome Met Doc Quality
PartialFeedbackEdgeSet yes yes yes yes good

Per-Feature Details

  • Role: downstream CLI user.
  • Use case: discover the model, inspect it, create the canonical example instance, and solve that instance from docs/CLI alone.
  • What I tried: pred list, pred show PartialFeedbackEdgeSet, pred create --example PartialFeedbackEdgeSet, and pred solve <generated-instance> --solver brute-force.
  • Discoverability: yes. The model appears in pred list as PartialFeedbackEdgeSet/SimpleGraph, and pred show PartialFeedbackEdgeSet prints the model summary and fields.
  • Setup: yes. The pred binary ran successfully from the review worktree.
  • Functionality: yes. pred list showed PartialFeedbackEdgeSet/SimpleGraph with O(2^num_edges), pred show displayed the expected description and fields, pred create --example wrote a JSON instance, and pred solve returned evaluation: true with a valid solution vector.
  • Expected vs Actual: matched.
  • Blocked steps: none.
  • Friction points: none observed in this run.
  • Doc suggestions: none from this test.

Issues Found

  • None.

Generated by review-pipeline

@isPANN isPANN mentioned this pull request Mar 23, 2026
3 tasks
Widen the feature gate to `#[cfg(any(feature = "example-db", test))]`
so the test module can reuse the parent's normalize_edge via super::.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@isPANN isPANN merged commit fed65e9 into main Mar 23, 2026
5 checks passed
@GiggleLiu GiggleLiu deleted the issue-438 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] PartialFeedbackEdgeSet

2 participants