Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
43f78e2
test(data_plane): intent round loop interface and failing tests
zzylol Dec 3, 2026
149b5af
feat(data_plane): check an intent schedule and order its queries
zzylol Dec 3, 2026
5ef7d7b
feat(data_plane): run one intent round with the grouped-result binding
zzylol Dec 3, 2026
81cf577
feat(data_plane): run intent rounds on the interval grid
zzylol Dec 3, 2026
ae9fa9f
feat(data_plane): --intent runs an intent's rounds beside the server
zzylol Dec 3, 2026
4bb1906
docs(bench): run an intent workload end to end with the round loop
zzylol Dec 3, 2026
0035552
test(data_plane): intent rounds from the planner's final intent schema
zzylol Dec 3, 2026
db76eee
feat(data_plane): intent rounds from the planner's intent output
zzylol Dec 3, 2026
1229bf5
feat(data_plane): --intent reads the planner's intent output
zzylol Dec 3, 2026
0283e5a
chore(deps): pin ASAPPlanner to the SIL intent planner head (draft)
zzylol Dec 3, 2026
ea5b809
test(data_plane): parameter-slot binding, keyed results, SIL intents …
zzylol Dec 3, 2026
763ef25
feat(data_plane): bind an intent query's placeholders in a copy of th…
zzylol Dec 3, 2026
b73c4bb
feat(data_plane): key query-time results by intent binding
zzylol Dec 3, 2026
d5b2d39
feat(data_plane): store a SQL table's rows as the series named after it
zzylol Dec 3, 2026
a02149c
chore: port the Planner API migration of the pending planner bump
zzylol Dec 3, 2026
e925e61
test(data_plane): intent modes that differ, a shared bound node, the …
zzylol Dec 3, 2026
c67e249
feat(data_plane): run intent queries with their holes bound in the plan
zzylol Dec 3, 2026
2cda7af
style(test): elide a lifetime clippy flags
zzylol Dec 3, 2026
70e33a1
docs(bench): intent rounds bind placeholders by default; SQL tables a…
zzylol Dec 3, 2026
e7434ac
test(parity): compare each view's windows within its retention (port)
zzylol Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 30 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 4 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ version = "0.1.0"
# The backend depends on two Planner crates, at one immutable revision:
# `asap-planner` to plan and `asap-executor` to execute. Planner IR types
# are reached through `asap_executor::planner`.
asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "1d527bca445b6372f0eb72aafd725d04a3a77dfb" }
asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "1d527bca445b6372f0eb72aafd725d04a3a77dfb" }
asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" }
asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" }
# The sketch library the Planner's executor pins, for the byte encodings of
# the sketch states the data plane persists; keep it at the Planner's rev
# (here overridden below for the executor too).
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", rev = "389530ce23b121520f0218a4471e376db2c35945" }
# (draft: ASAPPlanner#1553 head, for SIL intents).
asap_sketchlib = { git = "https://github.com/ProjectASAP/asap_sketchlib", rev = "c5f786637766461532d5ee310436cae8bb61d152" }

serde = { version = "1.0", features = ["derive"] }
# `float_roundtrip`: a plan file reloads to the plan it was written from
Expand All @@ -30,10 +30,3 @@ tokio = { version = "1.0", features = ["full"] }
axum = "0.7"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
control_plane = { path = "control_plane" }

# asap_sketchlib#271's head, ahead of the Planner's pin (389530c): DDSketch
# view merges in place, with width-specialized loops (a 1 h quantile over
# cold windows 3x faster). Drop when the Planner's pin moves past it. The
# `www.` URL is a distinct source, so it may patch the one the Planner names.
[patch."https://github.com/ProjectASAP/asap_sketchlib"]
asap_sketchlib = { git = "https://www.github.com/ProjectASAP/asap_sketchlib", rev = "355093f48f2649df1b86f2d390c2faa145a5f0a0" }
39 changes: 39 additions & 0 deletions bench/demo/harness/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,42 @@ dashboards. `live/ingest_exporter.py` (port 19724) exports, per engine:
The asap-demo row "Ingestion while querying" shows these. The live setup gives
each engine 12 cores (ASAP 24-35, VictoriaMetrics 36-47). The feeders, the
query load, the proxies and the browser use 48-55.

# Intent workloads (round loop)

An intent is a set of planned queries where a downstream query reads the
values of an upstream query's output column (`host IN $Y`). The data plane
runs it round by round (`data_plane::intent`): queries in dependency order,
each binding the distinct values its upstream answered, a query skipped when
a binding is empty or an upstream failed, and every round written as one
JSON line.

Inputs: the planner's intent output (`intent_plan.json`, its `IntentPlan`:
the `plan` to install and the `intent_rounds`), and the data feed by Remote
Write as for any other arm (paced feeder, `stream_start_ms` S). A SQL
table's rows are sent as the samples of the series named after the table
(`__name__`), its text columns as labels and its `value` column as the
value. Each round, a downstream query's placeholders are replaced by the
values its upstream answered, in a copy of the plan (`--intent-bind-mode
parameter-slot`, the default); `filter-grouped-result` instead filters a
grouped answer by the values, for a downstream query planned grouped by the
label it is filtered on.

```sh
jq .plan intent_plan.json > plan.json
data_plane --plan plan.json --no-forward --stream-start-ms $S \
--intent intent_plan.json --intent-name triage --intent-out rounds.jsonl \
--intent-first-evaluation-ms $((S + LONGEST_LOOKBACK_MS)) --intent-rounds 30 \
--intent-delay-ms 6000
```

Output (`rounds.jsonl`, one line per round): `round`, `evaluation_ms`,
`status` (`ran` or `missed`: its start passed while the previous round still
ran), `start_lag_ms`, `duration_ms`, `overrun`; per query `status`
(`answered`, `skipped_empty_binding`, `skipped_upstream`, `failed`),
`latency_ms`, `bindings` (the values issued), `answer`, `error`; per latency
group `latency_ms` (round start to the last member's end, the queries run one
after another in round order), `complete`, `met`. A dependent query's
accuracy is judged against the exact grouped answer filtered by the binding
it was issued
(`data_plane::intent::filter_by_bindings`), not by the exact upstream's.
4 changes: 4 additions & 0 deletions data_plane/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ futures = "0.3"
form_urlencoded = "1"

[dev-dependencies]
# Parses SIL intents for the intent round loop's end-to-end test.
asap-frontend-sil = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" }
# Paused time for the intent loop's latency and overrun tests.
tokio = { workspace = true, features = ["test-util"] }
control_plane.workspace = true
tower = { version = "0.5", features = ["util"] }
http-body-util = "0.1"
11 changes: 9 additions & 2 deletions data_plane/examples/tier_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,15 @@ async fn main() {
let plan_text = serde_json::to_string(&plan).unwrap();
println!(
"plan states (mentions): {:?}",
["DDSketch", "\"Kll\"", "Hll", "Cms", "Counter", "Max"]
.map(|k| (k, plan_text.matches(k).count()))
[
"DDSketch",
"\"KLL\"",
"\"HLL\"",
"CountMinSketch",
"Counter",
"Max"
]
.map(|k| (k, plan_text.matches(k).count()))
);

let now_ms = std::time::SystemTime::now()
Expand Down
2 changes: 1 addition & 1 deletion data_plane/examples/view_read_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {
let _ = std::fs::remove_dir_all(&dir);

let family = match family_name {
"kll" => FieldDataType::Sketch(SketchAlgorithm::Kll),
"kll" => FieldDataType::Sketch(SketchAlgorithm::KLL),
"ddsketch" => FieldDataType::Sketch(SketchAlgorithm::DDSketch),
"counter" => FieldDataType::ExactAggregate(ExactKind::Counter, ExactParams::Counter),
other => panic!("unknown family {other}: kll, ddsketch or counter"),
Expand Down
30 changes: 27 additions & 3 deletions data_plane/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ use crate::ingestion::{
};
use crate::metrics::{Gauges, Metrics, PushMetrics, Timer};
use crate::persist::{plan_hash, ViewFiles, ViewRead};
use crate::placeholders::SlotBinding;
use crate::push::{Partial, PushGroup, PushShard};
use crate::query::{QueryEngine, Snapshot, Unanswered};
use crate::result_cache::{Answer, ResultCache};
Expand Down Expand Up @@ -709,13 +710,25 @@ impl EngineHandle {
pub async fn evaluate(&self, query: String, time_ms: i64) -> Result<Answer, Unanswered> {
let started = std::time::Instant::now();
let metrics = self.shared.metrics.query(&query);
let answer = self.run_on_worker(query, time_ms, None).await;
let answer = self.run_on_worker(query, time_ms, None, None).await;
if let Some(metrics) = metrics {
metrics.latency.observe(started.elapsed().as_secs_f64());
}
answer
}

/// Answers an intent's planned `query` at `time_ms` on a query worker
/// with its holes bound to `slots`' values
/// ([`QueryEngine::evaluate_bound`]); never from the result cache.
pub async fn evaluate_bound(
&self,
query: String,
time_ms: i64,
slots: Vec<SlotBinding>,
) -> Result<Answer, Unanswered> {
self.run_on_worker(query, time_ms, None, Some(slots)).await
}

/// Evaluates one step of a range query over `snapshot`, which every
/// step of the request reads ([`Self::snapshot`]): as
/// [`Self::evaluate`], counted as a range step rather than an instant
Expand All @@ -727,7 +740,8 @@ impl EngineHandle {
time_ms: i64,
snapshot: Arc<Snapshot>,
) -> Result<Answer, Unanswered> {
self.run_on_worker(query, time_ms, Some(snapshot)).await
self.run_on_worker(query, time_ms, Some(snapshot), None)
.await
}

/// The newest published store, for the steps of one range request.
Expand All @@ -746,6 +760,7 @@ impl EngineHandle {
query: String,
time_ms: i64,
range_step: Option<Arc<Snapshot>>,
bound: Option<Vec<SlotBinding>>,
) -> Result<Answer, Unanswered> {
let stopped = || Unanswered::Execution("the query workers have stopped".into());
let (reply, answer) = oneshot::channel();
Expand All @@ -754,6 +769,7 @@ impl EngineHandle {
query,
time_ms,
range_step,
bound,
reply,
})
.map_err(|_| stopped())?;
Expand Down Expand Up @@ -910,6 +926,9 @@ struct QueryJob {
time_ms: i64,
/// One step of a range query, and the snapshot every step reads.
range_step: Option<Arc<Snapshot>>,
/// An intent query's holes bound to these values
/// ([`QueryEngine::evaluate_bound`]); `None`: as planned.
bound: Option<Vec<SlotBinding>>,
reply: Reply<Answer>,
}

Expand Down Expand Up @@ -960,7 +979,12 @@ fn spawn_query_workers(
Some(snapshot) => snapshot.clone(),
None => Arc::new(query.snapshot(&shared.published)),
};
query.evaluate(&job.query, job.time_ms, &snapshot)
match &job.bound {
Some(slots) => {
query.evaluate_bound(&job.query, job.time_ms, &snapshot, slots)
}
None => query.evaluate(&job.query, job.time_ms, &snapshot),
}
}))
.unwrap_or_else(|panic| {
let reason = panic
Expand Down
Loading