Repository navigation
feat(planner): optimizer accepts label-set facts and costs by cardinality - #780
Merged
milindsrivastava1997 merged 5 commits intoOct 4, 2026
Conversation
Replace --dataset/--rho with --label-set-facts: series_count per (metric, spatial filter) and cardinality per (metric, spatial filter, grouping labels). Arrival rate is derived as series_count / scrape interval. The label schema now comes from the workload's metrics: hints. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cardinality now scales cost by how each sketch holds its groups: keyed maps grow per key, fixed-size sketches don't, and grouped queries read one value per output group (one heap read per top-k bucket). Trivial accumulators get an analytical per-key memory estimate, and only their Multiple* forms are proposed. Optimizer configs now use the legacy planner's grouping/aggregated label split, so keyed sketches deploy as one instance rather than one per group, and CMS/HydraKLL deploy their paired DeltaSet key aggregation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolutions: - Optimizer items (#776) replace AQEs throughout; label-set facts, group counts, and the paired key aggregation carry over onto items. - EXACT is removed: greedy reports unservable items and the facts pipeline returns OptimizerPipelineError (LabelSetFacts | Optimizer). - dataset.rs stays deleted (replaced by label_set_facts.rs). - Example workload drops its top-k query, which is unservable without atomic costs now that EXACT is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milindsrivastava1997
deleted the
756-optimizer-accept-externally-provided-label-set-facts-cardinality-arrival-rate
branch
October 4, 2026 22:10
19 tasks
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.
Closes #756. Part of #753.
Summary
--dataset/--rho.asap-optimizer-cli --label-set-facts <yaml>takesseries_countper (metric, spatial filter) andcardinalityper (metric, spatial filter, grouping labels). Arrival rate is derived asseries_count / scrape interval. The label schema now comes from the workload'smetrics:hints, which are required. Missing facts produce an error listing every expected key; unused facts only warn.dataset.rsandSUBPOPULATION_COUNTare removed.output_group_countfor keyed maps (Multiple*) and withinstance_countotherwise. Query reads scale with output groups, except top-k (one heap read per bucket). Trivial accumulators get an analytical per-key memory estimate (dictionary-encoded label codes + value, hash-table slack). Single-groupSum/MinMax/Increaseare no longer proposed, since they tie with theirMultiple*forms.build_confignow usesset_subpopulation_labels, so keyed sketches are one instance rather than one per group (or one top-k heap per series).does_precompute_operator_support_subpopulationshandles Set/DeltaSet and non-top-k CMS+heap instead of panicking. Legacy planner calls are unchanged..design_docs/optimizer-v1-implementation-plan.mdupdated, plus runnable example workload and facts files.Notes
⌈range / slide⌉panes. The legacy planner reuses the value's count, which falls short for sliding windows.Test plan
cargo test -p asap_planner -p promql_utilities, clippy,cargo check --workspacetopk by), metric-hint errors, label split per sketch type, cost scaling per class, top-k reads, end-to-end CMS + key tracker deployment and query-config referencesasap-optimizer-clion the example files: HydraKLL + DeltaSet for the quantile query,MultipleSumforsum by; without--atomic-coststhe run reports the top-k query as unservable (EXACT was removed in feat(planner): model assignments as SLA-aware items #776)🤖 Generated with Claude Code