Skip to content

refactor(planner): delete the greedy optimizer - #807

Merged
milindsrivastava1997 merged 3 commits into
mainfrom
790-a4-a5p-planner-milp
Oct 7, 2026
Merged

milindsrivastava1997 merged 3 commits into
mainfrom
790-a4-a5p-planner-milp

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

A4 of #790. The rqe-optimizer MILP replaces the greedy optimizer, so this deletes it instead of commenting it out, which the issue originally planned. Git history keeps the old code.

Changes

  • Deleted: candidate_gen, cost_model, greedy, sketch_properties, constants, translator, label_set_facts, pipeline, and the candidate-gen-dump binary (with its Cargo.toml and Dockerfile entries).
  • Trimmed to what the MILP path uses:
    • atomic_costs.rs: only load_flat_atomic_cost_table and the AtomicCostEntry/AtomicCostTable re-export remain. The profile-selecting loader and resolve_atomic_costs are gone.
    • solution.rs: only OptimizerItem.
    • error.rs: only the two errors aqe_extractor returns.
    • aqe_extractor::gcd is removed (only candidate_gen used it).
  • Moved: extract_hinted_items and config_to_rqes from pipeline.rs into milp.rs. MissingMetricHints and MetricsWithoutHints are now MilpError variants.
  • asap-optimizer-cli is MILP-only: the --milp, --label-set-facts and --atomic-cost-workload flags are removed, and --workload-facts and --atomic-costs are plain required arguments. Nothing in the repo passed --milp.
  • Removed the two greedy example YAMLs from .design_docs/. The .md design docs are unchanged.

Interface change

asap_planner::optimizer no longer exports anything greedy-related (run_greedy_pipeline, LabelSetFacts, the cost-model types). The only callers were the two binaries in this crate.

Test plan

  • Ported four tests from pipeline.rs to milp.rs: metric hints required, unhinted metric rejected, spatial-only range, and group flattening.
  • cargo test -p asap_planner, clippy with -D warnings, fmt; pre-commit hooks passed.
  • asap-optimizer-cli --help shows the MILP-only flags.

Next: A5′ (asap-planner --planner legacy|milp), stacked on this PR.

🤖 Generated with Claude Code

milindsrivastava1997 and others added 2 commits October 7, 2026 14:45
The rqe-optimizer MILP replaces it. Removes candidate_gen, cost_model,
greedy, sketch_properties, constants, translator, label_set_facts,
pipeline, the profile-selecting cost loader and candidate-gen-dump.
Hint extraction moves into milp.rs, and asap-optimizer-cli is MILP-only
(--milp and the greedy flags are gone).

Refs #790

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #790

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	asap-planner-rs/src/bin/optimizer_cli.rs
@milindsrivastava1997
milindsrivastava1997 merged commit 6541f49 into main Oct 7, 2026
5 checks passed
@milindsrivastava1997
milindsrivastava1997 deleted the 790-a4-a5p-planner-milp branch October 7, 2026 19:07
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.

1 participant