feat(moves): multi-objective enumeration ranking (Track E commit 5/8)#174
Open
feat(moves): multi-objective enumeration ranking (Track E commit 5/8)#174
Conversation
Replaces the slack-only ranking from commit 4 with a configurable
multi-objective score. Five modes: max-response (default), total-load,
total-power, total-weight, balanced. The score uses the same RTA +
property-accessor machinery the verify-pipeline uses, so verify/enumerate
output stays consistent.
Adds Spar_Power::Power_Budget property (numeric milliwatts).
CLI: spar moves enumerate --objective {max-response | total-load |
total-power | total-weight | balanced}
Default objective: max-response (matches commit-4 slack semantics in
single-CPU cases).
New requirement: REQ-MIGRATION-007.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spar-solver::enumerate::rank_candidate— overlay-aware multi-objective ranker that consumes the same RTA + property-accessor machinery the verify-pipeline already uses, so verify/enumerate outputs stay in lock-step.spar moves enumerate: the commit-4slack_nsfield is replaced by a richerrank: CandidateRankcarrying max-response, total-load, total-power, total-weight, and an aggregate score (lower = better).Spar_Power::Power_Budgetstandard property (numeric milliwatts) so models without SEI / Physical_Properties in scope can still annotate per-component power for ranking.--objective {max-response | total-load | total-power | total-weight | balanced}. Default ismax-response, which preserves commit-4 slack semantics on single-CPU models.balancedweights all four axes equally (each at 1/4).REQ-MIGRATION-007. New verification entry:TEST-MOVES-ENUMERATE-OBJECTIVESlinked to REQ-MIGRATION-{004,005,006,007}.What stayed the same
ok=true) candidates is unchanged across all five objective modes — only ordering changes.spar moves enumeratestill does not mutate the underlying model; the existing non-mutation regression test stays green.component / total / valid / candidates), and CLI plumbing for--root/--component/--target-filter/--formatare unchanged.What changed in JSON shape
slack_nsis removed; replaced by arankobject with five keys:max_response_ns(i64 or null),total_load(f64),total_power_mw(u64 or null),total_weight_g(u64 or null),score(f64).slackis replaced byscore. Deadline-miss candidates render as<missed>(matching the commit-4 idiom).Test plan
cargo test --workspace— 0 failures (10 new integration tests inmoves_enumerate_objectives.rs, 11 unit tests inspar-solver::enumerate, 2 unit tests inspar-cli::moves::enumerate_tests; all 10 commit-4 enumerate tests still pass).cargo clippy --workspace --all-targets -- -D warnings— clean.cargo fmt --all -- --check— clean.rivet validate— PASS.Files changed
artifacts/requirements.yaml— appendREQ-MIGRATION-007.artifacts/verification.yaml— appendTEST-MOVES-ENUMERATE-OBJECTIVES.crates/spar-cli/src/moves.rs— replace slack with rank; add--objectiveparser; newMovesError::UnknownObjective; updated text/JSON renderers.crates/spar-cli/tests/moves_enumerate_objectives.rs— new (10 integration tests).crates/spar-hir-def/src/standard_properties.rs— registerSpar_Power::Power_Budget; bump set count.crates/spar-solver/src/enumerate.rs— new (rank_candidate, EnumerationObjective, CandidateRank, power/weight readers, RTA-message parsers, 11 unit tests).crates/spar-solver/src/lib.rs— export the new module.🤖 Generated with Claude Code