Skip to content

refactor!: move pane construction out of the physical layer - #483

Merged
zzylol merged 5 commits into
mainfrom
refactor/physical-layer-no-panes
Oct 1, 2026
Merged

zzylol merged 5 commits into
mainfrom
refactor/physical-layer-no-panes

Conversation

@zzylol

@zzylol zzylol commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #475.

Why

Agreed layering: the Planner physical layer compiles computation over typed
input contracts; raw ingestion, pane construction and geometry, storage formats
and stored-state decoding belong to the deployment. The #462 split already moved
stored-state decoding out (#474/#475 have no stored_state), but pane
construction is still in the physical layer: compile_temporal_pane_candidate
decides pane width, count, offsets and entity guards, and the PaneInput
operator checks pane geometry at run time.

What

  • Remove physical_planner::temporal_panes (compile_temporal_pane_candidate,
    TemporalPaneMaintenance, TemporalEntityIdentity) and the PaneInput
    operator. ScopeTimestamp stays, moved to operators/scope_timestamp.rs.
  • Remove the e2e test that exercised the pane compiler
    (selected_temporal_lifecycle_compiles_panes_and_executes) and its helpers.
  • Design doc: one paragraph on what the physical layer does not own.

Computation stays: summary build, pane-state merge (e.g. KLL merge), sketch
estimates and exact finalization. The generic precompute/query split by timing
(#482, #479) is unchanged.

Before this PR

Planner physical layer: lifecycle + window → pane width/count/offsets → PaneInput guards → merge → quantile

After this PR

Deployment: builds panes, binds typed KLL states to input slots
Planner physical layer:                         merge → quantile

Assumptions for review

  • Pane merges and sketch estimates are computation and stay in Planner.
  • Compiled physical plans keep their own serialized form (plan handoff, not storage).
  • The backend takes over pane construction; the removed code and test are saved
    for that follow-up.

Validation

cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings pass;
cargo test --workspace --no-fail-fast: 1355 passed, 0 failed.

🤖 Generated with Claude Code

zzylol and others added 5 commits September 30, 2026 18:02
Start `asap-physical-operators` with thin summary kernels over
`asap_sketchlib`, the kernel capability checks and the typed value model.

The boundary is:
- `asap_sketchlib` owns sketch algorithms and their state encodings.
- Kernels hold one population's in-memory state. They expose `merge`, a
  typed sketch readout (`estimate(&SketchQuery)`) and memory accounting.
  Exact states answer a typed `ExactReadout`; empty MIN/MAX read as `None`.
- Group-by belongs to physical operators.
- Deployments own wire decoding, delta frames, edge sampling and storage
  statistics.

So wire decoding, `SerializableToSink`, `AggregationType`, `aux_stats`,
`reset_to_empty` and the keyed/sum/min/max kernels are not carried over from
ASAPQuery-backend. The `asap_sketch_codec` crate is not carried over either;
it moves to `asap_sketchlib`. Hydra KLL remains as the Hydra shared-grouping
kernel. HLL uses sketchlib's classic estimator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Rebased onto main: the Cargo.lock conflict with #478 (new asap-planner
crate) was resolved by regenerating workspace entries with
`cargo update -w --offline`.
Add the execution layer of `asap-physical-operators`:

- `plan`, `runtime` and `sources`: physical DAGs, run context, bounded
  backpressure, cancellation, memory reservations and raw-source scans.
- `expressions` and `operators`: relational/scalar operators, windows,
  temporal panes, current-series snapshots, and summary build, merge and
  readout. A readout is typed: a `SketchQuery`, or an `ExactReadout` whose
  counter lookback resolves to the run's evaluation range. Deserialized
  operators are validated before use.
- `readout`: readouts over merged exact summary states.

There is no physical planner yet; operators are built directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add `physical_planner`: reader-independent compilation of selected logical
candidates into precompute/query physical DAGs with typed materialization
frontiers, bounded frontier enumeration, workload cost selection, temporal
KLL pane compilation and PromQL row/value lowering. `dag` remains a
compatibility re-export.

Tests cover physical DAGs, plan recovery, precompute candidates and
populations, PromQL values and binaries, weighted TopK binding and
current-series heaps, plus Planner-to-execution integration tests. The design
doc describes the ownership boundary with deployments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pane geometry, pane population checks and per-pane scheduling are deployment
concerns. The physical layer keeps the computation the deployment binds:
per-input summary build, union, shared merge and readout.

- Remove `physical_planner::compile_temporal_pane_candidate` and its
  `TemporalPaneMaintenance`/`TemporalPaneCandidate`/`TemporalEntityIdentity`
  contract.
- Remove the `PaneInput` operator; `ScopeTimestamp` remains as a general
  operator in `operators/scope_timestamp`.
- Drop the `selected_temporal_lifecycle_compiles_panes_and_executes` E2E test
  and update the crate README and design doc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol force-pushed the split/462-f-physical-planner branch from bb1abdd to 0ced125 Compare September 30, 2026 18:26
@zzylol
zzylol force-pushed the refactor/physical-layer-no-panes branch from a4c82cc to fb92998 Compare September 30, 2026 18:27
zzylol added a commit that referenced this pull request Sep 30, 2026
Rebase note: #483 removed the pane test this test was appended after; the
new test is appended to the #483 version of the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzylol
zzylol changed the base branch from split/462-f-physical-planner to main October 1, 2026 22:24
@zzylol
zzylol merged commit 92915db into main Oct 1, 2026
3 checks passed
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