Repository navigation
Conversation
This was referenced Oct 7, 2026
Each plan root is compiled once with two kinds of inputs: stored outputs, bound at evaluation time T to their definition's pane ending at T - offset, and query-time raw ranges (TimeRange <- TimeShift* <- Scan), bound to the metric's samples in (T - offset - range, T - offset] fetched from Prometheus and filtered by the plan's Scan. An instant query whose text is a planned query is answered with a Prometheus vector and x-asap-execution: plan. Unplanned queries are forwarded; planned ones that cannot be answered (pane missing or off the pane grid, fetch or execution failure) are forwarded with x-asap-forward-reason.
zzylol
force-pushed
the
feat/precompute-engine
branch
from
October 18, 2026 15:40
eb8a314 to
f9c3343
Compare
zzylol
force-pushed
the
feat/query-engine
branch
from
October 18, 2026 15:40
6f7b53c to
b1b1e5a
Compare
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 4/5. Base: #820. Next: #822.
Why
Every query was forwarded to Prometheus, so the selected plan never answered anything.
What
A planned instant query is answered by running its root of the DAG at evaluation time
T:T − offset.TimeRange ← TimeShift* ← Scan): the data plane fetches(T − offset − range, T − offset]from Prometheus and filters it with the plan'sScan.x-asap-execution: plan. Any other query, including range queries, is forwarded withx-asap-execution: forwarded. A planned query that can't be answered gives its reason inx-asap-forward-reason: a missing pane,Toff the pane grid, or an unsupported shape.MatAtQuerynodes run likeNotMaterializedones: each instant query is its own evaluation, so there is nothing to share within it.How
Each root is compiled once at install time with
asap_executor::physical_planner::compile, its stored outputs and rawTimeRanges as bounded input contracts. At query time the engine thread checks the panes, the HTTP side fetches the raw ranges, and the engine instantiates the compiled root over both and runs it under query scope.Key code interfaces added / modified
Before this PR
Every query was forwarded to Prometheus.
After this PR
Example 4b without raw data answers
quantile_over_time(0.99, latency_ms[60m])at 70 min from six stored panes, reading no raw range; Example 1 answers both queries from raw ranges fetched from Prometheus.Usage
Over HTTP the same query returns a Prometheus vector with
x-asap-execution: plan(data_plane/tests/answers.rs).Limitations
Ton the pane grid.Verification
data_plane/tests/query.rs(3 tests): stored panes answer like one query-time build, query-time plans read raw ranges, unanswerable queries report why.data_plane/tests/answers.rs(2 tests) over HTTP against a stand-in Prometheus: Example 1 from raw samples, including the left-open range start, and Example 4b from panes built through Remote Write.cargo test -p control_plane -p data_plane, fmt, clippy on this PR's tree; Usage run on this PR's tree.