Repository navigation
Conversation
This was referenced Oct 5, 2026
…ge 1 The sketch_coverage devtool and the frontend, integration and executor tests that drove ASAPStrategies / search_workload / retain_exact now take their candidates from Stage 1 (Pass 1 inventory and composition) or the stage pipeline. Tests that only pinned legacy search behaviour are deleted, among them integration-tests/tests/cse.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zzylol
force-pushed
the
stack/cleanup-7-stage1-helpers
branch
from
October 5, 2026 06:21
a35b447 to
c41b508
Compare
zzylol
force-pushed
the
stack/cleanup-8-port-legacy-callers
branch
from
October 5, 2026 06:21
94a6d35 to
b0b37f1
Compare
This was referenced Oct 5, 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.
Stack: #574 → #620 → #618 → #621 → #627 → #625 → #628 → #632 → #634 → #616 → #617 → #622 → #624 → #629 → #630 → #631 → #633 → #635 → #636 → #637
Rebased:
univmon_candidates.rskeeps #621's assertion that only L2 is certified (RelativeValue), on the Stage 1 candidates.Problem
The legacy search (
ASAPStrategies,search_workload*,explain_replacements,retain_exact) still had callers outside logical-optimizer: one devtool and a set of frontend, integration and executor tests. It cannot be deleted (Q68 (a), step 7c) until they move to Stage 1 or are deleted.Changes
One decision per file. Shared helpers:
stage1_candidates(root)inexecutor/tests/common/mod.rsandfrontend-promql/tests/support.rscomposes every Pass 1 choice for one query (up to 4096) and skips those that do not compose.stage1_plan(root)in the frontend-promql support composes the first summarized choice, or else the pass-through choice.devtools/src/bin/sketch_coverage.rsenumerate_local_logical_candidatesper lowered query. It prints the sketch alternatives Pass 1 offers for each query (a Hydra alternative prints asHydra(<algorithm>)), and per corpus the fraction of lowered queries with at least one. The CSE-shareable metric is dropped: Stage 1's identical-expression sharing is a workload variant, not a per-query replacement. Over every corpus: 135/2178 lowered queries get a sketch alternative at ε = 0.01.frontend-promql/tests/observability/promql_corpus.rs,metrics_observability.rsstage1_plan). Pass 1 must accept every lowered query, and the query must compose to a candidate. Totals: docs 19 summarized / 28 unchanged / 0 errors; testdata 354 / 721 / 0; every metrics-observability corpus 0 errors. A choice can legitimately fail to compose, for example a Top-K heap over a closed schema or a summary over two sources. Selection skips such choices, so the probe does not count them as errors.frontend-promql/tests/count_planning.rsgrouped_count_offers_hydra_but_selection_keeps_per_group_state). Its input carries the series identity: Hydra hashes a non-null item, and PromQL labels are nullable.frontend-promql/tests/univmon_candidates.rsAccuracyModelis gone. The shared count is lowered at an approximate target, because Pass 1 offers no UnivMon for an exact count (the legacy search did). Stage 1 nodes carry no guarantee, so the "no calibrated bound" check usesDefaultAccuracyModel::local_guarantee.integration-tests/tests/promql_numeric_regressions.rsplantakes each target's first alternative other than pass-through; the weighted-heap test takes the heap that absorbs the inner aggregate. Dropped: the node-guarantee assertions (Stage 1 sets none; the ratio-certification gap is listed in #623) and the Top-K evidence provider. The two-metric guarded expression becameavg_over_time(a[5m]) + avg_over_time(a[5m] offset 5m): Pass 1 offers no summary over two sources. A signed sum's Count-Min heap is now checked to carry no non-negative proof, not to be absent; Stage 3 rejects it.integration-tests/tests/precompute_raw_samples.rsintegration-tests/tests/cse.rspass2::identical_expressions's tests.frontend-sql/tests/pearson_corr.rscorr. The exact-guarantee assertion is dropped.executor/tests/weighted_topk_binding.rs#[ignore]), direct per-series rate heap with dynamic labels, maintained rate heap. These run on Count Sketch only, because Stage 1 proves no sign for rate values and the executor rejects a Count-Min heap without one. The evaluation-timestamp assertions are dropped, because Stage 1's heap evaluation outputs no timestamp column. Deleted:physical_binding_does_not_impose_an_accuracy_acceptance_policy(it only varied legacy evidence),spatial_topk_exposes_signed_heap_candidate_over_complete_snapshot(legacycurrent_series_topk_candidatesonly), anddirect_rate_topk_exposes_heap_candidates_with_complete_series_identity(a closed catalog schema with no series identity has no Top-K item in Stage 1).executor/tests/planspace_series_identity_heap.rsselection_never_commits_a_series_identity_heap(already onplan_stages). Deleted the four tests of the legacy search's whole-root proposals.executor/tests/precompute_candidates.rsexecutor/tests/deployment_computation.rscount(up)candidate comes from Stage 1.executor/tests/current_series_heap.rs,deployment_computation.rs(population_dag),precompute_candidates.rs(population_topk_*),frontend-sql/tests/maintained_population.rs,frontend-promql/tests/maintained_population_horizon.rsMaintainedPopulationStrategy::candidatedirectly, not the search. The plan for 7c is to keepcandidateand drop only itsReplacementStrategyimpl.Findings: Stage 1 gaps these ports exposed (not fixed here)
topk by(job)(k, sum by(service, job)(rate(...)))) keeps the outer top-k's partition keys. Those keys index the inner aggregate's output, but the heap is built over the raw rates. Hereby(job)became key 0 =ts, and the output schema losesjob. The legacy search remapped the keys.planner_weighted_topk_binds_at_either_deployment_phaseis#[ignore]d with this reason.Stacked on #631.
Test plan
cargo fmt --all --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --locked: 1508 passed, 0 failed, 15 ignored (after the rebase on main d4869a7; was 1484 passed, 23 ignored)cargo run -p asap-devtools --bin sketch_coverage -- --data-ingestion-interval-ms 1000runs🤖 Generated with Claude Code