Reuse Planner accuracy guarantees and remove disconnected cost summaries - #710
Merged
Merged
Conversation
This was referenced Sep 13, 2026
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.
Why
Accuracy metadata duplicated formulas that disagreed with ASAPPlanner, and
/api/v1/planreported cost-summary placement decisions that did not drive emitted deployment configs.Closes #707 using the agreed Planner-owned formula boundary. Addresses item 1 and stale module documentation in #703; the broader cleanup remains open.
What
plan_summary; retaintransmission_costsand the actual deployment path.delta: nulland preserve it through multi-segment envelopes.How
Source adapters normalize their parameters to Planner
SketchParams. The shared wire adapter projectsDefaultAccuracyModel::sketch_guarantee; no family formula is copied into the backend. Existing derivation traits remain available. Installed config fields and fingerprints are unchanged.Before this PR
CMS reported
2^-depth, KLL used2.296/sqrt(k), and HLL reporteddelta: 0. A separate legacy allocator producedplan_summaryeven though deployment configs came from another path.After this PR
CMS and KLL follow Planner's
exp(-depth)and empirical 99th-percentile rank-error contract. HLL reports relative standard error with unknown confidence. The plan API no longer exposes the disconnected estimate.Evidence
For HLL precision 14, metadata changes from
{ "epsilon": 0.008125, "delta": 0, "kind": "relative_cardinality" }to the same record with"delta": null; the text summary saysδ=unknown.Screenshots and performance measurements are not applicable to this backend refactor.
Verification
Validated on the clean PR branch based on
b1a58ca8with Rust 1.98:cargo check --workspace --all-targets: passed.cargo test -p control_plane --lib: 742 passed, including physical compilation and publication coverage.cargo test -p data_plane --lib accuracy: 53 passed.cargo test -p data_plane --lib query_engines::asap_query_engine: 127 passed.cargo test -p control_plane --bin control_plane api_tests::plan_: 4 passed.cargo test -p data_plane --test e2e_controller_plans_and_backend_serves: 12 passed.git diff --check: passed.New tests compare control-plane and backend profiles for representative parameters across all four shared families, preserve GOS confidence, retain uncalibrated UnivMon, and check that unknown confidence survives segment merging and HTTP serialization. The plan API test verifies removal of
plan_summarywhile retaining transmission costs.Architectural decisions
Reuse the existing authoritative Planner model rather than introducing another formula module or moving the old approximations.
asap_typesowns only the wire representation and projection. Parameter extraction remains source-specific because accumulator construction has different normalization rules.Limitations and follow-up
Consumers must handle nullable
deltaand removal ofplan_summary. Formula-derived metadata changes intentionally. Resource-budget-aware placement and deployment-derived cost explanations remain separate v2 work; deleting the old summary chain does not implement them. Other #703 cleanup items are outside this PR.Human review — do not complete with an agent