Skip to content

refactor(query-engine): split precompute pipeline from build specification - #940

Draft
milindsrivastava1997 wants to merge 2 commits into
refactor/query-result-variantsfrom
refactor/precompute-pipeline-split
Draft

milindsrivastava1997 wants to merge 2 commits into
refactor/query-result-variantsfrom
refactor/precompute-pipeline-split

Conversation

@milindsrivastava1997

Copy link
Copy Markdown
Contributor

Plan step 4 of .design_docs/asapplanner-engine-boundaries.md (I9), stacked on #938 (step 3), #937 and #936.

Change

PrecomputeEngine is split into a generic pipeline and the build specification it is given:

  • Pipeline: series routing, workers, windows, watermark and late-data policy, backpressure.
  • Build specification: what to build for each series and where to write it.

The existing engine supplies an AggregationConfig-based specification. The plan-based one comes in step 8.

Only asap-query-engine/src/precompute_engine/ changes (9 files).

Suggested review order

  1. build_spec.rs: the seam traits WindowedBuild, SeriesRouting and BuildSpec, plus 3 seam tests.
  2. aggregation_spec.rs: the AggregationConfig / RoutingConfigSet implementations. This is mostly existing code moved here, so review it with git diff --color-moved.
  3. worker.rs, series_router.rs: now generic over the spec.
  4. pipeline.rs, engine.rs: PrecomputePipeline, and PrecomputeEngine on top of it.

The second commit updates precompute_engine_design_doc.md to describe the pipeline and the build specification.

Log wording (the only user-visible change)

Two worker log messages are now worded generally because the pipeline no longer knows the aggregation type:

  • Late-sample drop: Dropping late DeltaSetAggregator sample for evicted pane (..]: ForwardToStore is unsupported for stateful key deltas → Dropping late sample for evicted pane (..]: ForwardToStore is unsupported for agg_id={}
  • Finalize failure: Worker {}: failed to finalize DeltaSetAggregator ... → Worker {}: failed to finalize window ...

Anything that greps logs for the old strings needs updating.

Verification

After the rebase onto step 3:

  • cargo fmt --all -- --check and cargo clippy --workspace --all-targets --all-features --locked -D warnings pass.
  • cargo test --workspace --locked: 1549 passed (1546 + 3 new seam tests).
  • Existing tests changed only in imports.

🤖 Generated with Claude Code

milindsrivastava1997 and others added 2 commits November 24, 2026 11:21
…ation

PrecomputePipeline<R: SeriesRouting> now owns routing to workers, windows,
watermarks, late-data policy and backpressure; what it builds comes from a
BuildSpec { routing: R, builds: HashMap<u64, Arc<R::Build>> } where each
build is a WindowedBuild. PrecomputeEngine is the pipeline given the
AggregationConfig-based spec (RoutingConfigSet + AggregationConfig).

No behavior change; existing tests change only imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qhwq4jq8TFcKGchhF7Hfb
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