Skip to content

Fix #409: [Model] RootedTreeStorageAssignment#749

Merged
isPANN merged 5 commits intomainfrom
issue-409
Mar 22, 2026
Merged

Fix #409: [Model] RootedTreeStorageAssignment#749
isPANN merged 5 commits intomainfrom
issue-409

Conversation

@GiggleLiu
Copy link
Copy Markdown
Contributor

Summary

  • Add the implementation plan for RootedTreeStorageAssignment

Fixes #409

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Implementation Summary

Changes

  • Added src/models/set/rooted_tree_storage_assignment.rs with schema registration, validation, parent-array evaluation logic, brute-force variant metadata, and example-db support for RootedTreeStorageAssignment.
  • Added src/unit_tests/models/set/rooted_tree_storage_assignment.rs covering construction, evaluation, invalid configs, solver behavior, serialization, and the paper example.
  • Registered and re-exported the new model through src/models/set/mod.rs, src/models/mod.rs, and src/lib.rs.
  • Extended pred create and CLI help in problemreductions-cli/src/commands/create.rs and problemreductions-cli/src/cli.rs for --universe, --sets, and --bound.
  • Documented the problem in docs/paper/reductions.typ with a definition, example, commands, and figure.

Deviations from Plan

  • Used the parent-array encoding and universe_size^universe_size exhaustive-search bound described in the maintainer comments; no additional deviations.

Open Questions

  • None.

@GiggleLiu
Copy link
Copy Markdown
Contributor Author

Agentic Review Report

Structural Check

Structural Review: model RootedTreeStorageAssignment

Structural Completeness

# Check Status
1 Model file exists PASS
2 inventory::submit! present PASS
3 Serialize / Deserialize derive on the model PASS
4 Problem trait impl PASS
5 SatisfactionProblem impl PASS
6 #[cfg(test)] + #[path = ...] test link PASS
7 Dedicated test file exists PASS
8 Test file has at least 3 test functions PASS
9 Registered in src/models/set/mod.rs PASS
10 Re-exported in src/models/mod.rs PASS
11 declare_variants! entry exists PASS
12 CLI resolution path PASS — registry-driven resolution works; pred show RootedTreeStorageAssignment succeeds without a handwritten alias table entry
13 CLI create support PASS
14 Canonical model example registered PASS — wired through src/models/set/mod.rs and exercised by pred create --example RootedTreeStorageAssignment
15 Paper display-name entry PASS
16 Paper problem-def block PASS

Build Status

  • make test: PASS
  • make clippy: PASS

Semantic Review

  • evaluate() correctness: OK — the implementation validates config length and parent bounds, rejects non-tree parent arrays, enforces the ancestor-chain condition for each subset, and sums the minimal extension cost against bound.
  • dims() correctness: OK — vec![universe_size; universe_size] matches the parent-array encoding described in the linked issue.
  • Size getter consistency: OK — universe_size() / num_subsets() match the issue schema and the declared complexity string uses a valid getter.
  • Weight handling: N/A — this is an unweighted satisfaction model.
  • Blacklisted generated files: OK — none of the forbidden generated artifacts are present in the diff.

Issue Compliance

# Check Status
1 Problem name matches issue OK
2 Mathematical definition matches OK
3 Problem type (satisfaction) matches OK
4 Type parameters match OK
5 Configuration space matches OK
6 Feasibility check matches OK
7 Objective function matches OK
8 Complexity metadata matches the issue plan OK

Summary

  • 16/16 structural checks passed.
  • 8/8 issue-compliance checks passed.
  • Deterministic packet note: the generated review packet flagged the model PR whitelist because it does not currently include required CLI / re-export touchpoints (problemreductions-cli/..., src/lib.rs, src/models/mod.rs, src/models/set/mod.rs). Manual inspection found those files to be expected for a new model addition, not unrelated scope creep.
  • No structural or semantic defects found.

Quality Check

Quality Review

Design Principles

  • DRY: OK — tree validation and subset-cost logic are factored into small helpers without duplicating behavior elsewhere in the patch.
  • KISS: OK — the parent-array encoding is implemented directly, with only the helper functions needed to keep evaluate() readable.
  • HC/LC: OK — model logic, CLI wiring, tests, and paper documentation stay in the repository’s expected modules.

HCI (CLI touched)

  • Error messages: OK — missing --bound and invalid subset elements produce actionable messages.
  • Discoverability: OK — pred list, pred show, CLI help text, and pred create --example expose the new model clearly.
  • Consistency: OK — the flag names and output style match neighboring set-model commands.
  • Least surprise: OK — the solver and evaluator outputs follow the existing satisfaction-problem conventions.
  • Feedback: OK — pred create confirms the output path and pred solve / pred evaluate emit explicit JSON results.

Test Quality

  • Naive test detection: OK
  • Residual gap: constructor rejection paths (for example duplicate elements) are not covered by focused unit tests, but the main evaluation, solver, serialization, paper example, and CLI creation flows are covered and the branch passes the full test suite.

Issues

Critical (Must Fix)

  • None.

Important (Should Fix)

  • None.

Minor (Nice to Have)

  • None.

Summary

  • No code-quality issues found.
  • Residual risk is limited to lightly targeted validation branches rather than any reproduced user-facing defect.

Agentic Feature Tests

Feature Test Report: problem-reductions

Project type: Rust library + CLI
Features tested: RootedTreeStorageAssignment model registration and CLI flows
Profile: ephemeral review-pipeline run
Use Case: As a downstream CLI user, discover the new model, inspect its schema, create an example instance, create a custom instance, solve it, and evaluate the known satisfying configuration.
Expected Outcome: The model is discoverable through the CLI catalog and all basic create / solve / evaluate commands work without manual patching.
Verdict: pass
Critical Issues: 0

Summary

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

Per-Feature Details

RootedTreeStorageAssignment

  • Role: downstream CLI user validating a newly added model.
  • Use Case: inspect the catalog entry, generate both example and direct-input instances, and solve / evaluate them with the brute-force solver.
  • What I tried:
    • pred list
    • pred show RootedTreeStorageAssignment
    • pred create --example RootedTreeStorageAssignment -o /tmp/rooted-tree-storage-assignment-749.json
    • pred solve /tmp/rooted-tree-storage-assignment-749.json --solver brute-force
    • pred evaluate /tmp/rooted-tree-storage-assignment-749.json --config 0,0,0,1,2
    • pred create RootedTreeStorageAssignment --universe 5 --sets "0,2;1,3;0,4;2,4" --bound 1 -o /tmp/rooted-tree-storage-assignment-direct-749.json
    • pred solve /tmp/rooted-tree-storage-assignment-direct-749.json --solver brute-force
    • negative-path smoke checks for missing --bound and an out-of-range subset element
  • Discoverability: good — the model appears in pred list, pred show renders the schema and complexity metadata, and the CLI help lists the new flags.
  • Setup: good — no extra setup beyond the normal CLI build was required.
  • Functionality: good — example creation, direct creation, brute-force solving, and explicit evaluation all succeeded.
  • Expected vs Actual Outcome: matched.
  • Blocked steps: none.
  • Friction points: none reproduced in the current worktree.
  • Doc suggestions: none required for this basic path.

Expected vs Actual Outcome

  • The expected catalog / create / solve / evaluate flow worked as described.
  • Error handling for missing required flags and invalid subset elements was actionable.

Issues Found

  • None.

Suggestions

  • None.

Generated by review-pipeline

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 95.63107% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.63%. Comparing base (e8fbdbe) to head (d235a22).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/models/set/rooted_tree_storage_assignment.rs 94.11% 9 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #749    +/-   ##
========================================
  Coverage   97.63%   97.63%            
========================================
  Files         445      447     +2     
  Lines       54775    54981   +206     
========================================
+ Hits        53478    53681   +203     
- Misses       1297     1300     +3     

☔ 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.

isPANN and others added 2 commits March 23, 2026 00:38
# Conflicts:
#	problemreductions-cli/src/commands/create.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@isPANN isPANN mentioned this pull request Mar 22, 2026
3 tasks
@isPANN isPANN merged commit 1590ea6 into main Mar 22, 2026
5 checks passed
@GiggleLiu GiggleLiu deleted the issue-409 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] RootedTreeStorageAssignment

2 participants