Skip to content

test(analyzer): α — 18-query parity catalog for analyzer unification - #188

Merged
zzylol merged 1 commit into
mainfrom
feat/analyzer-parity-alpha
May 14, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/analyzer-parity-alpha

Conversation

@zzylol

@zzylol zzylol commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

PR α of the analyzer-unification chain (α→β→γ→δ→ε). Pure additive
baseline that freezes what each PromQL → warm-tier analyzer answers
today, so β/γ have a verifiable parity contract before they start
collapsing the two surfaces.

  • analyzer_parity_tests inline #[cfg(test)] mod in
    data_plane/src/query_engines/asap_query_engine/engine.rs: 18-query
    corpus covering quantile_over_time, sum-by, topk,
    count_over_time, histogram_quantile, bare selectors,
    rate/irate/increase, sum(rate(...)), and unparseable input.
    Single assert_eq! against an embedded golden-master captured on
    origin/main@6557fb8.
  • controller/docs/analyzer-parity-matrix.md (168 lines): human
    catalog of the same 18 rows. Documents the 5 controller-rejects-but-
    engine-accepts divergences the chain is meant to resolve — D1
    sum_by(m), D2 topk(k, m), D3 count_over_time(m[r]),
    D4 rate/increase, D5 sum(rate(m[r])) — plus β/γ/δ/ε
    amendment rules and pointers to both pipelines' source files.

Findings worth flagging (caught by the corpus)

Scope / risk

  • 255 LOC additive in engine.rs, 168 LOC new doc. Zero production
    code edits, zero visibility changes, zero new deps.
  • parse_and_match_promql and build_query_requirements_promql stay
    private — the test lives in the same module and reaches them via
    super::*.
  • Branch built off origin/main@6557fb8 so it rebases cleanly onto
    the in-flight feat/schema-retire-final-* slices.

Test plan

  • cargo build -p data_plane --lib clean (6 pre-existing warnings)
  • cargo test -p data_plane --lib analyzer_parity_tests → 1 passed
  • cargo test -p controller --lib warm_tier_analysis → 19 passed (unaffected)
  • Reviewer: open controller/docs/analyzer-parity-matrix.md
    alongside the golden in engine.rs and confirm each row's
    D{1..5} annotation matches your expectations before β starts.
  • Reviewer: confirm the chosen 18 queries cover the shapes you
    want γ to preserve. Anything to add now (cheap) vs in ε
    (expensive — diff churn against the embedded golden)?

🤖 Generated with Claude Code

…engine analyzers

PR α of the analyzer-unification chain (α→β→γ→δ→ε). Pure additive
baseline that freezes what each PromQL → asap-tier analyzer answers
today, so β/γ have a verifiable parity contract before they start
collapsing the two surfaces.

Rebased onto origin/main (post-PR #211): doc moved to
control_plane/docs/ and the controller→control_plane / warm_tier→
asap_tier renames swept through. Golden master re-verified
byte-for-byte against the new base.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol force-pushed the feat/analyzer-parity-alpha branch from 1e39d86 to 321982d Compare May 14, 2026 14:35
@zzylol
zzylol merged commit 5f5580f into main May 14, 2026
zzylol added a commit that referenced this pull request May 14, 2026
…gg routing change (#236)

PR #232 changed `control_plane::asap_tier_analysis`: `rate` / `irate` /
`increase` / `sum` and bare selectors now lower to `AggIntent::Sum`,
which `capability_for` maps to `Capability::ExactAgg(Sum)` — so they are
ASAP-tier-answerable from exact-precompute state instead of being
archive-routed. `data_plane` consumes that analyzer, and two of its
tests pinned the old behaviour:

  * `analyzer_parity_18_query_corpus` — the 18-query golden master
    (PR #188). The `ctrl` rows for q04–q07, q12–q17 (and the q08 label
    `count_over_time` → `count`) shifted to `OK [... ExactAgg(Sum) ...]`
    / candidate rows. `GOLDEN` regenerated from the new actual; the
    `engine` rows — the actual parity contract — are unchanged.

  * `execute_rejects_bare_selector_via_analyzer` → renamed
    `execute_bare_selector_falls_over_to_archive`. A bare selector is no
    longer rejected with `NoCallNodeFound`; it binds to an
    `ExactAgg(Sum)` candidate that finds no matching policy in the
    test's DDSketch-only `SketchStore`, so it still `CapabilityMiss`es
    to the archive engine — same routing outcome, different detail.

No behaviour change here — `data_plane`'s test expectations catching up
to the intentional #232 analyzer change. 768 lib tests pass.

Pre-existing unrelated failure: `kll_envelope_round_trip_through_backend_adapter`
(KLL sketch byte serialization) fails on clean `main` too — untouched
by this change.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol deleted the feat/analyzer-parity-alpha branch July 17, 2026 20:05
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