Skip to content

feat(cost): select abstract summary window frameworks - #338

Merged
zzylol merged 8 commits into
mainfrom
feat/cost-window-framework-selection
Sep 4, 2026
Merged

zzylol merged 8 commits into
mainfrom
feat/cost-window-framework-selection

Conversation

@zzylol

@zzylol zzylol commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Why

Incremental maintenance determines when state changes, but does not determine the abstract window algorithm used to cover and retain the query range. Tumbling, sliding/panes, and exponential histograms have different resource and accuracy behavior and therefore belong in Planner's candidate space.

What

  • Add the reusable SummaryWindowFramework enum with Tumbling, Sliding, ExponentialHistogram, and validated extension values.
  • Add complete per-SummaryAgg framework assignments to streaming physical candidates.
  • Rank physical alternative × lifecycle × framework combinations while preserving the provider physical_plan_id.
  • Export the selected framework per summary deployment.
  • Keep planner-owned window-framework IR separate from the provider-owned physical_plan_id; the latter is provenance and a downstream compilation handle, not planner IR.

Correctness rules

  • Every reachable SummaryAgg has exactly one assignment; duplicates, omissions, empty extension IDs, and aliases across incompatible framework assignments fail closed.
  • Generic physical alternatives and structured window candidates cannot be mixed for the same logical candidate.
  • Exact tumbling/sliding choices add no window error and preserve the summary guarantee.
  • Exponential-histogram accuracy is available only for the registered PromSketch EHKLL rank and EHUniv/GSum value compositions. The window bound is composed with the actual underlying summary guarantee; unknown combinations are unavailable.
  • Old unbound logical CSE rewrites cannot re-enter selection after lifecycle comparison; complete physical evidence remains mandatory.

Validation

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check

Stack: depends on #337.

Source organization

The summary-maintenance layer is split into evidence.rs, estimator.rs, window.rs, and model.rs. Window-framework assignment and EH accuracy composition are isolated from resource formulas and lifecycle ranking while reusing the existing workload, lifecycle, and window enums.

@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 93cdcdc to 4c92e8e Compare September 3, 2026 16:29
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 081b7ef to 2845b70 Compare September 3, 2026 16:29
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 4c92e8e to 2c60c11 Compare September 3, 2026 16:45
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 2845b70 to 64f0e9a Compare September 3, 2026 16:45
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 2c60c11 to f81669f Compare September 3, 2026 16:50
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 64f0e9a to 156ee2e Compare September 3, 2026 16:50
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from f81669f to 6f11aaa Compare September 3, 2026 16:57
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 156ee2e to cae4c8c Compare September 3, 2026 16:57
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 6f11aaa to af31303 Compare September 3, 2026 17:05
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from cae4c8c to 739753e Compare September 3, 2026 17:05
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from af31303 to c1d5718 Compare September 4, 2026 00:50
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 739753e to 000fe98 Compare September 4, 2026 01:04
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from c1d5718 to 6029671 Compare September 4, 2026 02:26
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 000fe98 to cb1e2e4 Compare September 4, 2026 02:26
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 6029671 to 03bda42 Compare September 4, 2026 03:04
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from cb1e2e4 to 334ac1b Compare September 4, 2026 03:13
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from 03bda42 to bccb146 Compare September 4, 2026 03:31
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 45ea342 to 1d19224 Compare September 4, 2026 03:33
@zzylol
zzylol force-pushed the refactor/cost-window-boundary branch from bccb146 to 5c4a62d Compare September 4, 2026 04:02
@zzylol
zzylol force-pushed the feat/cost-window-framework-selection branch from 1d19224 to 48c01f7 Compare September 4, 2026 04:02
@zzylol
zzylol changed the base branch from refactor/cost-window-boundary to main September 4, 2026 11:29
@zzylol
zzylol merged commit ac1db93 into main Sep 4, 2026
3 checks passed
@zzylol
zzylol deleted the feat/cost-window-framework-selection branch September 7, 2026 15:51
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