Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A topk by heap partitions by its group labels, so Planner's weighted frequency item identity excludes them. Stored-state readout now merges the stored group labels back into each series identity before rendering it, and install no longer rejects identity items that exclude labels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 30, 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.
Stacked on #801.
Why
Grouped temporal TopK over a raw heap, e.g.
topk by (job) (2, count_over_time(m[5s])), failed at install withraw heap items that exclude identity labels are not readable. The heap is partitioned byjob, so Planner's heap item is the series identity withoutjob. The group labels are not lost: storage keeps them as the heap state's group key. Stored-state readout just never put them back when it rendered the item.What
SummaryState::topk_items,topk_ranked,readout_bound) now gets the stored group labels and adds each missing non-empty one back into a decoded series identity before rendering the series key. Planner still does the heap estimate and the ranking. No Planner change is needed.raw_dag.rs.344369e(integration/planner-for-backend, adds e2e.sh list misses ignored Rust tests outside data_plane and crates #490). Only the rev strings change inCargo.lock.Before this PR
topk by (job) (2, count_over_time(top_endpoint_qps[5s]))→ the data plane refuses the physical plan at startup. Onmainand at #795/#797, the same query was also refused at install (raw DAG item expression is unsupported/raw heap item expression is unsupported).After this PR
The query installs and returns the top 2 per job. Each row carries
jobplusitem= the whole series key, the same shape the legacy heap kernel produced for identity items:Validation
registered_temporal_topk_by_{cms,count_sketch}_heap(instant and range queries). It fails before the fix with the install error and passes after. The ungrouped variants still pass.weighted_frequency_items_restore_group_labels.cargo fmt --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked --lib,cargo test -p control_plane --locked --tests,cargo test -p data_plane --locked --test asapquery_compatibility_process_e2e -- --test-threads=1(28 passed).🤖 Generated with Claude Code