Skip to content

Manual windowing override (tumbling/sliding) in config.yaml #555

Description

@milindsrivastava1997

Problem

asap-planner-rs's live planner is hardcoded to always emit tumbling
windows. should_use_sliding_window() (planner/window.rs:11-14)
unconditionally returns false

WindowType::Sliding already exists in asap_types::enums and is exercised
by the offline optimizer/cost-model code (optimizer/candidate_gen.rs,
cost_model.rs), but never reachable from the live planner paths that
asap-tools/experiments actually drives.

What this issue covers

Add a manual windowing override to config.yaml, threaded through to the
planner, so an experiment can explicitly choose tumbling vs. sliding windows
(and a slide granularity) instead of always getting tumbling:

windowing:
  type: "tumbling"   # or "sliding"
  slide_divisor: 4    # only meaningful when type == "sliding";
                       # slide_interval_ms = window_size_ms / slide_divisor
  • Global override (not per-query-group) for now — matches
    sketch_parameters's existing global-only shape. Per-aggregation-id
    control is the ideal case but out of scope here (tracked separately).
  • PromQL + SQL paths: ControllerConfig/SingleQueryProcessor
    set_window_parameters(), and SQLControllerConfig/
    SQLSingleQueryProcessorcompute_sql_window(). ElasticDSL excluded —
    nothing in asap-tools/experiments generates its controller config today.
  • slide_divisor must evenly divide each query's computed window_size_ms
    (which varies per query — it's derived from that query's own t_repeat_ms
    /step_ms, not a global constant) — error loudly, never round.
  • Fail-fast: if any one query in the workload can't legally take a
    sliding window under the chosen divisor, plan generation aborts entirely
    rather than silently punting that query to the raw backend. This is a
    deliberate experiment setting, not an automatic optimizer decision — a
    silent fallback would quietly corrupt the cost/latency comparison the
    experiment exists to make.

Blocked by #554

Shipping this override before sliding-window queries can actually be served
correctly (beyond the narrow single-window-exact-match case) means
windowing.type: sliding would produce plans that fail at query time for
almost any real workload query. See #554 for why, and for the
execution-side work this depends on.

Definition of done

Related

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions