Skip to content

docs(control_plane): retire the stale analyzer-parity-matrix doc - #422

Merged
zzylol merged 1 commit into
mainfrom
docs/fix-analyzer-parity-matrix
Jul 29, 2026
Merged

zzylol merged 1 commit into
mainfrom
docs/fix-analyzer-parity-matrix

Conversation

@zzylol

@zzylol zzylol commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

analyzer-parity-matrix.md compared two PromQL analyzers: the control
plane's capability_for()-based one, and a "duplicate" engine analyzer
(ASAPQueryEngine::parse_and_match_promql + controller_patterns +
QueryPatternType, backed by the crates/promql_utilities crate).

Verified via grep across the whole tree: the engine-side symbols and the
promql_utilities crate itself are gone entirely, the doc's named
companion test (engine.rs::analyzer_parity_tests) doesn't exist, and
the doc itself was never linked from anywhere in the repo. Its own "When
to update this file" section anticipated this exact end state (phase δ:
"delete the engine analyzer... merge into a single unified column") but
was never updated once it actually happened.

Also stale independent of the missing engine side: several ctrl-column
rows (D1/D3/D4/D5 — sum/count/rate/increase) asserted
MISS · UnsupportedAggIntent, but capability_for() on main now
resolves all of them to Some(ExactAgg(...)).

A different, newer comparison mechanism (shadow_compare.rs
SummaryExecutor vs. the live SketchReducer path) now covers the
modern equivalent of this doc's purpose, but it's a genuinely different
pairing, not a continuation of this doc's table — so retiring rather
than rewriting.

Test plan

  • grep -rln "analyzer-parity-matrix" across the repo — zero hits, confirms nothing references the deleted file
  • N/A — docs-only change, no build/test impact

🤖 Generated with Claude Code

analyzer-parity-matrix.md compared two PromQL analyzers: the control
plane's capability_for()-based one, and a "duplicate" engine analyzer
(ASAPQueryEngine::parse_and_match_promql + controller_patterns +
QueryPatternType, backed by the crates/promql_utilities crate).

Both the engine-side symbols and the promql_utilities crate itself
are now gone from the tree entirely -- confirmed via grep, zero
matches anywhere. The doc's named companion test
(engine.rs::analyzer_parity_tests) doesn't exist either. Its own
"When to update this file" section anticipated this exact end state
(phase delta: "delete the engine analyzer... merge the two into a
single unified column") but the doc was never updated to reflect it
actually happening, so it sat describing dead code -- and, per a git
grep across the whole repo, was itself never linked from anywhere.

Also stale beyond the missing engine side: several ctrl-column rows
(D1/D3/D4/D5 -- sum/count/rate/increase) already asserted MISS ·
UnsupportedAggIntent while capability_for() on main now resolves all
of them to Some(ExactAgg(...)).

A different, newer comparison mechanism now covers the modern
equivalent of this doc's purpose --
data_plane/src/query_engines/asap_query_engine/shadow_compare.rs
(SummaryExecutor vs. the live SketchReducer path, gated behind
ASAP_SHADOW_SUMMARY_EXECUTOR) -- a genuinely different pairing than
what this doc compared, not a row-by-row continuation of it, so
rewriting this file's table wasn't the right fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol merged commit 79d2f34 into main Jul 29, 2026
@zzylol
zzylol deleted the docs/fix-analyzer-parity-matrix branch July 29, 2026 02:16
zzylol added a commit that referenced this pull request Jul 29, 2026
…xpr_canonical signature (#429)

* feat(control_plane): classify AggRole via real AggIntent, not a PromQL-string sniff

derive_agg_role() used to guess a workload entry's AggRole (Quantile/
Sum/Count/Topk/Other) by sniffing the leading token of its PromQL
query_string -- the same duplicate-classifier smell already retired
from the live serving path (the old two-analyzer comparison in
analyzer-parity-matrix.md, #422). Now parses the query through the
same canonical pipeline capability_for()/serving uses
(query_parser::parse_query_expr_canonical), runs it through the L3
rule-based optimizer (QueryOptimizer::new(0.0).optimize -- TopKFusion
is a pure structural rewrite, ignores the cost model, so the
placeholder throughput doesn't affect the outcome) so topk(k, m)
actually reaches an Aggregate{TopK} node instead of staying
Sort+Limit, then classifies by the real outer AggIntent
(collect_agg_intents, now pub(crate) for this reuse).

Two things this surfaced:
- `(quantile_over_time(0.9, m[5m]))` (redundant wrapping parens) --
  the old leading-token sniff finds an empty token at a `(` and
  mis-defaults to Sum; real classification is unaffected by surface
  punctuation. New test pins this.
- `topk_over_time(...)` was in the old test's query list but isn't a
  real function this parser (or vanilla PromQL) recognizes at all --
  confirmed via grep, nowhere in query_parser/promql.rs or
  intent_algebra/lower.rs. A workload entry with that query_string
  would fail to parse anywhere else in the real pipeline too, so the
  old heuristic classifying it as Topk was itself the bug. Test
  updated to drop it, with an explanatory comment.

cargo build --workspace clean; control_plane 727/727 (one
pre-existing, unrelated skip as before), workload:: 33/33 (32 + 1 new
test).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix(control_plane): thread AccuracyTarget through derive_agg_role, fix histogram_quantile role

parse_query_expr_canonical now requires an AccuracyTarget (landed in
#428, merged after this branch was cut) -- thread the workload entry's
own accuracy_sla through via accuracy_target_from_legacy_accuracy_sla
rather than leaving this call site broken.

Also fixes a real misclassification #428 surfaced: the classic-bucket
histogram_quantile(0.99, rate(m_bucket[5m])) shape now lowers to the
real, exact-only AggIntent::HistogramQuantile (not the sketchable
Quantile the old local parser always substituted). derive_agg_role's
wildcard arm already routed this to AggRole::Other correctly -- only
the test's expectation was stale, asserting the old parser's behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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