Skip to content

Unify snapshot compilation under complete-cost selection - #698

Closed
zzylol wants to merge 2 commits into
mainfrom
refactor/single-planning-snapshot
Closed

Unify snapshot compilation under complete-cost selection#698
zzylol wants to merge 2 commits into
mainfrom
refactor/single-planning-snapshot

Conversation

@zzylol

@zzylol zzylol commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Why

Snapshot startup had two selection policies: unquoted v1 compatibility compilation and complete-cost selection. Deployment should use one evidence-required path.

What / how

  • Accept only snapshot schema 2. Candidate discovery can omit quotes; PromQL and MetricsQL snapshot deployment must select using valid complete workload cost evidence.
  • Consolidate selected-plan output in compile_workload_artifact, including logical selection and revision metadata; remove inspect_physical_dag.
  • Preserve required sketches when enumerating optional counter/max materializations, and retain whole-query native fallback for unsupported local residuals without discarding other workload summaries.
  • Migrate fixtures, process tests, demo input and documentation. Synthetic quotes exist only in tests.

Before this PR

An unquoted v1 snapshot could start a backend without complete-cost selection. Mixed candidate masks could discard DDSketch bindings; missing entropy evidence could also prevent an otherwise valid L2 summary plan.

After this PR

Export candidates → measure and attach quotes → compile/select → deploy. An unquoted snapshot fails deployment explicitly. Schema version 2 is a format marker, not a second compiler mode.

Verification

  • Control plane: 809 tests passed; 3 doc tests ignored.
  • Experiment/calibration Python tests: 56 passed.
  • Backend process suite: 12 passed; the remaining UnivMon case passed on a targeted rerun after its fix. The entire suite was not rerun after that final fix.
  • CLI: unquoted candidate export succeeds, unquoted deployment fails, test-priced deployment emits a selected artifact.
  • Rust formatting, shell syntax and diff checks passed.

Compatibility / limitations

This intentionally rejects schema 1 and unquoted snapshot deployment. Demo runs require ASAPQUERY_PLANNING_SNAPSHOT with valid quotes. Low-level physical binding and distributed publication APIs are outside this snapshot cleanup. Validation used Rust 1.98.0 and the CI-pinned sketchlib checkout. No new performance measurements or visual evidence apply.

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