Skip to content

test: select plans through plan_stages instead of global_selection - #629

Draft
zzylol wants to merge 1 commit into
stack/cleanup-4-ir-binsfrom
stack/cleanup-5-port-selection-tests
Draft

zzylol wants to merge 1 commit into
stack/cleanup-4-ir-binsfrom
stack/cleanup-5-port-selection-tests

Conversation

@zzylol

@zzylol zzylol commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Stack: #574 → #620 → #618 → #621 → #627 → #625 → #628 → #632 → #634 → #616 → #617 → #622 → #624 → #629 → #630 → #631 → #633 → #635 → #636 → #637

Problem

Many tests used the legacy candidate_selection::global_selection (plus assemble_selected_dag) only to get a selected DAG to execute or inspect (Q52). That kept the legacy selection alive and tested plans the planner no longer selects.

Changes

These tests now take the plan the #509 stage pipeline selects (plan_stages, one root, run once over a continuously ingested source, with the built-in models). The selection goes through a small selected_dag(root, accuracy) helper in each test crate's existing shared module:

  • executor/tests/common (reference-executor capabilities)
  • integration-tests/tests/executor_models
  • frontend-promql/tests/support.rs
  • the cfg(test) fixture in executor/src/physical_planner/candidates.rs, which calls plan_stages inline

Ported: executor deployment_computation, planspace_series_identity_heap, precompute_candidates, promql_fallback, tumbling_pane_merge, physical_planner/candidates.rs; frontend-promql count_planning, univmon_candidates; integration-tests operator_sharing, precompute_raw_samples, sql_to_physical; planner summary_sharing.

Legacy search calls (search_workload*, ASAPStrategies) that these files use for other assertions are untouched. They belong to the legacy-search deletion (Q52 step 7).

Assertions that only held for legacy behaviour

  • deployment_computation::per_series_average_divides_stored_sum_by_count: Stage 1 has no avg → sum/count rewrite (that was the legacy AvgToSumOverCountStrategy), so avg_over_time now selects the raw PromQL fallback. The test now plans sum_over_time(m[5m]) / count_over_time(m[5m]), which still divides stored per-series sum and count states and drops the name. The overflow assertion is dropped: it checked the avg accumulator's checked division, which a Stage 1 plan never reaches (inf / n is inf, not an error).
  • promql_fallback::histogram_quantile_selection_keeps_the_exact_fallback: the legacy search kept histogram_quantile whole. Stage 3 keeps it exact (no sketch, still asserted for both targets), but under sum by (le, job) it selects an exact Sum accumulator below the quantile. This whole-expression fallback harness can't bind that plan, so only the raw-bucket query is executed (still 1.75).
  • count_planning / univmon_candidates: "the chosen candidate never has missing accuracy evidence" becomes "the selected plan contains no Hydra state" and "no UnivMon state", the families whose candidates lacked evidence.
  • operator_sharing::each_side_of_union_all_holds_a_summary_estimate: now #[ignore]d with the same reason as the other Pass 2 sharing and Stage 1 coverage parity with the retired MajorPass #580 ignores. Stage 3 selects the raw plan, because query-time summaries never cost less until Stage 2 plans materialization.
  • planner/tests/summary_sharing::certified_frequency_evaluations_share_one_univmon_state: deleted. It ran the legacy search and selection with a UnivMon-preferring cost model, and its stage-pipeline counterpart frequency_moments_share_one_univmon_in_the_stage_pipeline already covers the behaviour. PREFER_UNIVMON goes with it.

Stacked on #624.

Test plan

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace: 1610 passed, 0 failed, 14 ignored (after the rebase on main d4869a7; was 1607 passed, 14 ignored)

🤖 Generated with Claude Code

Tests that used the legacy global_selection only to obtain a selected
DAG to execute or inspect now take the plan the #509 stage pipeline
selects, through a small per-crate selected_dag helper.

Co-Authored-By: Claude Opus 5.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