Repository navigation
Conversation
The intent round loop's schedule, record and binding-step types, with the bodies left as todo!, and the tests of the spec: empty binding skip, chain of three, fan-out, diamond, duplicate values, upstream error and timeout, round overrun, group latency, accuracy against the issued binding, schedule validation, parameter-slot mode, and one round over a real installed plan. Every test fails at the todo!. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IntentLoop::new refuses an unknown upstream or latency-group member, a variable bound by two different upstream outputs, a variable read with no dependency (or bound with no slot), a rate other than 1, and a dependency cycle; it orders the queries topologically, keeping the schedule's order among ready queries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_round runs the queries in order: each variable's binding is the distinct values of its upstream answer's output column; a query is skipped when an upstream failed or was skipped, or when a binding is empty. The binding step (bind_and_run) filters the downstream query's grouped answer by the bound values (BindMode::FilterGroupedResult); BindMode::ParameterSlot fails with the reason until the plan has parameter slots. Each run is bounded by the query timeout; the round records each query's latency, bindings and answer, and each latency group's span. The engine answers like an HTTP instant query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_rounds starts round r at start + r x interval and evaluates it at first_evaluation_ms + r x interval. Rounds never overlap: a round ending after the next round's start is marked overrun, and the rounds whose start passed meanwhile are recorded as missed, not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --intent <schedule.json> and --intent-first-evaluation-ms, the data plane runs the intent round loop against its own engine while it ingests Remote Write as usual: round r starts --intent-delay-ms after its evaluation time and is written to --intent-out as one JSON line (per query status, latency, bindings and answer; per group its span). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The planner's intent output (IntentPlan, the SIL contract's final schema v1) types the round loop reads, with the adapter to the loop's schedule left as todo!; the end-to-end round now starts from that JSON. Group latency follows the contract: from the round's start to the last member's end (group_latency_runs_from_the_round_start fails: the loop still measures from the first member's start). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IntentSchedule::from_intent_plan reads one intent of the planner's IntentPlan: each query's text is plan.query_texts[query_index], and each dependency's output_position is resolved through the upstream root's output schema to a label name, or __value__ for the value column. Group latency is now measured from the round's start to the last member's end, as the contract defines L_G. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--intent now takes the planner's IntentPlan with --intent-name; the harness doc installs its plan and runs the named intent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ASAPPlanner#1553's head (3ef265d) plans SIL intents; its sketch library pin (c5f7866) now holds the merge-in-place DDSketch the backend patched in, so the patch goes. The executor's state view API was renamed: StateColumn::from_mapped -> from_views, family_has_mapped_form -> family_has_view_layout, and per-state view bytes now come from a state column (segment::column_views). SketchAlgorithm variants take the Planner's names (KLL, CountMinSketch, ...). Adds asap-frontend-sil as a dev-dependency for the intent end-to-end test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in three modes Failing tests for binding an intent query's holes in the plan: - placeholders: IN-lists and the rollup form `col = p0 OR ..` take the bound values; a comparison takes exactly one; values convert to the placeholder's type; a placeholder left in an unknown form is an error. - QueryTimeResults keeps a node's result under each binding apart. - The loop hands the runner each slot's placeholders and values (BindMode::ParameterSlot); a slot without placeholders fails. - intent_sil_modes: a SQL intent planned by the Planner as query-at-a-time, intent with on-demand holes and full intent, run two rounds each, answers exact; q2 bound to other hosts at one time. The unit tests fail at todo!; the end-to-end test fails because the data plane does not store SQL tables yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e plan placeholders::bind rewrites the serialized DAG for each slot: `col IN (p..)` and bare placeholder lists take the bound values, the rollup form `col = p0 OR ..` becomes `col IN (v..)`, a comparison takes its one value; values convert to the placeholder's type. It returns the nodes that changed, and refuses a placeholder left anywhere in the plan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A shared query-time node computed under an intent's binding is kept under (time, node, binding hash), apart from its unbound result and from its result under any other binding at the same time (QueryTimeResults::get_or_compute_bound). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Scan of a SQL table (Source::Table) reads the series whose __name__ is the table: its text columns are their labels, its time column their time and its `value` column their value. Before, the data plane refused any source but a PromQL time series, so no SQL plan (and no SIL intent) ran. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The planner API changes between 1d527bc and the SIL head, as the open planner-bump PR adapts them on the new crate layout, applied to this branch's layout in place of the partial adaptation in the pin commit: - storage: view bytes from each window batch's state column, cold reads via StateColumn::from_views, family_has_view_layout (VIEW_STATES). - state_codec: the compact DDSketch codec follows the new 64-byte DDSketch view head (no sum, min, max); FORMAT_VERSION 4 -> 5. - query: a shared query-time slot carries the plan's plan_id and a view_state_key, now required MaterializedView fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lightcone guard
The first three-mode workload planned identically in every mode (no
view, no shared node). Now q2 and q3 read `$Y` over the same table and
the declared data is at production scale: q1's per-host state is kept,
and the jointly planned modes share the query-time scan holding `$Y`'s
placeholders, so q2 bound to other hosts at one evaluation time checks
the binding keys that shared result. (Checked by mutation: with the key
ignoring the binding, q2 bound to {h0} answers the {h1, h3} result.)
A round listing one of the planner's lightcone queries is refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BindMode::ParameterSlot, now the default for --intent: each round the loop hands the engine each slot's placeholders and bound values (QueryRunner::answer_bound). The query engine binds a copy of the plan (placeholders::bind over the plan's serialized DAG; the DAG itself is not Send), compiles the runs of the nodes that depend on the binding over it with their usual view slots, keeps a shared one under the binding's key, reads every other node as usual, and bypasses the result cache (QueryEngine::evaluate_bound, EngineHandle::evaluate_bound). A slot without placeholders fails rather than running unbound; a round listing a lightcone query is refused. FilterGroupedResult stays as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s series Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pending planner-bump PR's fix to push_precompute_stores_the_window_paths_view_rows, which the new Planner pin makes fail on windows older than a view's retention that linger by timing: both sides are cut to the windows kept by retention. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
host IN $Y). The data plane answered one query at a time, ran no SQL plan, and had no way to bind one answer into the next query's plan.data_plane::intentruns the planner's intent output (IntentPlan, SIL contract final schema v1) round by round. The default binding substitutes each round's bound values for the planner's placeholder literals in a copy of the plan (BindMode::ParameterSlot,data_plane::placeholders). Bound runs are compiled per round, and a shared query-time node that holds a placeholder is cached under the binding's key. The data plane now stores a SQL table's rows as the series named after it.data_plane --intentruns an intent beside the server for the eval harness.every_planning_mode_answers_exactly_round_by_round):intent_on_demand_holes, holes filled at query time); and full intent (intent_full).sum(value), binding$Y; q2 and q3 = per-usersumandmaxoverhost IN $Y.Review guide
main. Draft. The ASAPPlanner pin is ASAPPlanner#1553's head (3ef265d), which is unmerged.a02149c9and the parity-test commit port chore: pin ASAPPlanner 566b35c and its asap_sketchlib d050037 (view format 5) #886's two migration commits (8c35cd1, 5f7b20c) onto this branch's layout, in place of my first partial adaptation.data_plane/src/placeholders.rs: the rewrite (bind,bind_json).QueryEngine::evaluate_bound/output_bound/run_boundindata_plane/src/query.rs: what is recompiled and what is cached under which key.bind_and_runindata_plane/src/intent.rs.stored_seriesindata_plane/src/store.rs.SketchAlgorithmrenames, theEngineHandleand worker plumbing forbound, and the docs.todo!or for the named missing capability), then the implementation.Behavior: before → after
The planner writes
intent_plan.json(itsIntentPlan):{"planning_mode": "intent_on_demand_holes", "plan": {...}, "lightcone_query_indices": [], "intent_rounds": [{"intent_name": "triage", "round_interval_ms": 10000, "queries": [ {"query_id": "q1", "query_index": 0, "depends_on": [], "bind_slots": [], "rate": 1.0, "skip_if_empty": false}, {"query_id": "q2", "query_index": 1, "depends_on": [{"variable": "Y", "upstream_query_id": "q1", "output_position": 1}], "bind_slots": [{"variable": "Y", "position": "in_list", "planned_value_count": 2, "placeholder_values": [{"Utf8": "__sil_Y_0"}, {"Utf8": "__sil_Y_1"}], "plan_node_ids": [...]}], "rate": 1.0, "skip_if_empty": true}, ...]}]}The plan's q2 is
... WHERE host IN ('__sil_Y_0', '__sil_Y_1') .... Each round, q1 answers{h1, h3}. The loop hands the engine the slot{placeholders: [__sil_Y_0, __sil_Y_1], values: {h1, h3}}. The engine binds a copy of the plan tohost IN ('h1', 'h3')and runs q2 over it.rounds.jsonlhas one line per round: per-query status, latency, bindings issued and answer; per-group latency (from round start to the last member's end); andoverrun/missed. A table's rows are sent by Remote Write as samples of{__name__="<table>", <text columns>...}with thevaluecolumn as the sample value.Interfaces
data_plane/src/placeholders.rs(new)data_plane/src/intent.rspub struct IntentPlan { pub plan: asap_planner::InstallablePlan, + /// Plan queries the planner added (lightcone queries): never issued; a round listing one is refused. + pub lightcone_query_indices: Vec<usize>, pub intent_rounds: Vec<PlannedIntent>, } pub struct PlannedBindSlot { pub variable: String, + pub position: SlotPosition, + /// The literals that stand for the hole in the plan. + pub placeholder_values: Vec<ScalarValue>, } pub struct BindSlot { pub variable: String, pub column: String, + /// Where the hole sits (ParameterSlot); default in_list. + pub position: SlotPosition, + /// The placeholders ParameterSlot replaces; default none. + pub placeholder_values: Vec<ScalarValue>, } pub enum BindMode { FilterGroupedResult, - /// Follow-up: fails with the reason. + /// Placeholders replaced by the bound values in a copy of the plan; the default for --intent. ParameterSlot, } pub trait QueryRunner: Sync { fn answer(&self, query: &str, time_ms: i64) -> impl Future<Output = Result<Answer, Unanswered>> + Send; + /// The answer with each slot's placeholders replaced by its values. + fn answer_bound(&self, query: &str, time_ms: i64, slots: &[SlotBinding]) -> impl Future<Output = Result<Answer, Unanswered>> + Send; }data_plane/src/query.rs,engine.rs,store.rsimpl QueryEngine { + /// `query` at `time_ms` over a bound copy of the plan: nodes depending on the binding are recompiled, + /// a shared one is cached under the binding's key, the others are read as usual; no result cache. + pub fn evaluate_bound(&self, query: &str, time_ms: i64, snapshot: &Snapshot, slots: &[SlotBinding]) -> Result<Answer, Unanswered>; } impl EngineHandle { + /// QueryEngine::evaluate_bound on a query worker. + pub async fn evaluate_bound(&self, query: String, time_ms: i64, slots: Vec<SlotBinding>) -> Result<Answer, Unanswered>; } +/// The binding key of a query-time result computed with no intent binding. +pub const UNBOUND: u64 = 0; impl<E: Clone> QueryTimeResults<E> { + /// get_or_compute under one binding (`binding` != UNBOUND): kept apart from other bindings' results at the same time. + pub fn get_or_compute_bound(&self, node: PhysicalASAPNodeId, time_ms: i64, binding: u64, watermark_ms: Option<i64>, compute: impl FnOnce() -> Result<Vec<Batch>, E>) -> Result<Arc<Vec<Batch>>, E>; }data_plane/src/main.rs:--intent-bind-modenow defaults toparameter-slot(filter-grouped-resultis the fallback).The interfaces from the first part of this PR (loop, records,
IntentSchedule::from_intent_plan,--intent*flags) are unchanged; see the commits.Usage (
data_plane/tests/intent_sil_modes.rs):Algorithm changes
Binding an intent query's holes (new)
host IN ('__sil_Y_0', '__sil_Y_1')). Run as installed, the query matches no row.placeholders::bindcopies the plan's serialized DAG and, per slot, rewrites every form it knows:col = p0 OR ...→col IN (v...);QueryEngine::evaluate_boundmarks the changed nodes and every node above them.(time, node, hash(binding)).{h0}, then{h2, h3}, then{h0}again at one evaluation time.{h0}answers 1530, the{h1, h3}result; exact is 165).SQL tables as series (new)
A
ScanofSource::Table { table_ref }reads the series whose__name__is the table: text columns are labels, the time column is the time, and thevaluecolumn is the value. This is the minimal mapping that lets SIL plans run. A table needs exactly one numeric column, namedvalue.Decisions and open questions
Needs reviewer decision
{__name__=table, labels...}with onevaluecolumn. Alternative: a real columnar table source in the store (more numeric columns, no series semantics).rate/WHEN, positional PromQL. Unchanged from the first part of this PR: rounds whose start passed are missed; group latency is measured from the round's actual start; a failed upstream skips its consumers; onlyrate == 1; position is resolved through the root's output schema.Decided
ParameterSlotis the default for--intent, andFilterGroupedResultstays as the fallback (coordinator).Verification
cargo clippy -p data_plane -p control_plane --all-targets -D warningscargo fmt --all --checkcargo test -p data_plane -p control_planeintent_sil_modesintent_roundsdata_plane --libWhat the modes planned for the test intent (all three plan q1's per-host state as a materialized view; none kept a lightcone query, since
intent_fulljudged it not cheaper):$Y)New tests:
placeholders::tests::*: each rewrite form, type conversion, the one-value comparison, and the leftover-placeholder error.store::tests::bound_results_are_keyed_by_their_binding: per-binding results at one time.intent::tests::parameter_slot_mode_binds_the_plan/parameter_slot_without_placeholders_fails.every_planning_mode_answers_exactly_round_by_round(above).Follow-ups
intent_fullkeeping per-host state for every value) end to end. This test's workload never makes it cheaper.rate < 1andWHENtriggers.run.pyarm driving--intentwith the paced feeder.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi