From 53b670ec1c461dd76921505cd0ff1274f45fe0c0 Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 3 Dec 2026 17:00:53 +0000 Subject: [PATCH 1/5] test(intent): trigger rate != 1 runs a query every k-th round (failing) Tests for running planned_rate = 1/k deterministically: a query runs in rounds r % k == 0 (from the first evaluation), is recorded not_triggered otherwise, downstream k must be a multiple of upstream k, when_condition is recorded not evaluated, and group latency covers the members that ran. Adds only the interface stubs the tests need; the 10 new tests fail until the loop implements them. Co-Authored-By: Claude Opus 5.5 --- data_plane/src/intent.rs | 365 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 365 insertions(+) diff --git a/data_plane/src/intent.rs b/data_plane/src/intent.rs index 465b9cf63..df81bcabf 100644 --- a/data_plane/src/intent.rs +++ b/data_plane/src/intent.rs @@ -65,6 +65,12 @@ pub struct IntentQuery { /// Fraction of rounds it runs in; only 1 (every round) is supported. #[serde(default = "every_round")] pub rate: f64, + /// `1/k`: the planner costed it as running every k-th round. + #[serde(default = "every_round")] + pub planned_rate: f64, + /// The opaque text of its `WHEN cond`: recorded, never evaluated. + #[serde(default)] + pub when_condition: Option, /// Skip the query in a round where one of its bindings is empty /// (default true, as the contract requires). #[serde(default = "skip_if_empty")] @@ -180,6 +186,8 @@ pub enum QueryStatus { SkippedUpstream, /// Its run failed or timed out (`error` says which). Failed, + /// Not its round: it runs every k-th round (`planned_rate = 1/k`). + NotTriggered, } /// One answer row. @@ -201,6 +209,8 @@ pub struct QueryRecord { pub bindings: Bindings, pub answer: Vec, pub error: Option, + /// The query's `WHEN cond`, as written (never evaluated). + pub when_condition: Option, } /// One latency group in one round. @@ -211,6 +221,8 @@ pub struct GroupRecord { /// From the round's start to the last member that ran ending; `None` /// when none ran. pub latency_ms: Option, + /// The members that ran this round. + pub ran_query_ids: Vec, /// Whether every member ran. pub complete: bool, /// Every member ran and `latency_ms <= max_latency_ms`. @@ -279,6 +291,9 @@ pub struct PlannedIntentQuery { #[serde(default)] pub bind_slots: Vec, pub rate: f64, + pub planned_rate: f64, + #[serde(default)] + pub when_condition: Option, pub skip_if_empty: bool, } @@ -387,6 +402,8 @@ impl IntentSchedule { depends_on, bind_slots, rate: query.rate, + planned_rate: 1.0, + when_condition: None, skip_if_empty: query.skip_if_empty, }) }) @@ -531,6 +548,7 @@ impl IntentLoop { bindings: Bindings::new(), answer: vec![], error: None, + when_condition: None, }; let mut upstream_missing = false; for dependency in &query.depends_on { @@ -608,6 +626,7 @@ impl IntentLoop { query_ids: group.query_ids.clone(), max_latency_ms: group.max_latency_ms, latency_ms, + ran_query_ids: vec![], complete, met: complete && latency_ms.is_some_and(|l| l <= group.max_latency_ms), } @@ -918,6 +937,8 @@ mod tests { }) .collect(), rate: 1.0, + planned_rate: 1.0, + when_condition: None, skip_if_empty: true, } } @@ -1344,4 +1365,348 @@ mod tests { ); assert_eq!(runner.calls(), vec!["q1"]); } + + // ---- Trigger rate != 1 (planned_rate = 1/k: every k-th round) ---- + + /// `query` set to run every `k`-th round (rate = planned_rate = 1/k). + fn every(mut query: IntentQuery, k: u32) -> IntentQuery { + query.rate = 1.0 / f64::from(k); + query.planned_rate = 1.0 / f64::from(k); + query + } + + fn intent_with(queries: Vec, groups: Vec) -> IntentLoop { + let mut schedule = schedule(queries); + schedule.group_latency_ms = groups; + IntentLoop::new( + schedule, + BindMode::FilterGroupedResult, + Duration::from_secs(10), + ) + .unwrap() + } + + /// Each round's status of query `id`, in round order (missed rounds + /// have no query records and are left out). + fn statuses(rounds: &[RoundRecord], id: &str) -> Vec<(u64, QueryStatus)> { + rounds + .iter() + .filter(|r| r.status == RoundStatus::Ran) + .map(|r| (r.round, record(r, id).status)) + .collect() + } + + /// drill_cnt with q2 at rate 0.1 (k = 10): q2 runs in rounds 0, 10, 20 + /// (round index from the first evaluation, phase 0) and is recorded as + /// not triggered, with no latency, binding or answer, in the others; q1 + /// runs every round. + #[tokio::test(start_paused = true)] + async fn sampled_query_runs_every_kth_round() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 9.0)]) + .with("q2", &[(&[("host", "a"), ("user", "u1")], 1.0)]); + let intent = intent_with( + vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 10)], + vec![], + ); + let mut rounds = Vec::new(); + intent + .run_rounds(&runner, 10_000, 21, Instant::now(), |r| rounds.push(r)) + .await; + assert_eq!(rounds.len(), 21); + let ran: Vec = statuses(&rounds, "q2") + .into_iter() + .filter(|(_, s)| *s == QueryStatus::Answered) + .map(|(r, _)| r) + .collect(); + assert_eq!(ran, vec![0, 10, 20]); + for (round, status) in statuses(&rounds, "q2") { + if round % 10 != 0 { + assert_eq!(status, QueryStatus::NotTriggered, "round {round}"); + } + } + let q2 = record(&rounds[3], "q2"); + assert_eq!(q2.latency_ms, None); + assert!(q2.bindings.is_empty(), "{q2:?}"); + assert!(q2.answer.is_empty()); + let calls = runner.calls(); + assert_eq!(calls.iter().filter(|c| *c == "q1").count(), 21); + assert_eq!(calls.iter().filter(|c| *c == "q2").count(), 3); + } + + /// Chain q1 (k = 2) -> q2 (k = 4) and an independent q3 (k = 1): q2 + /// runs only in rounds where q1 ran (0, 4), q1 in 0, 2, 4, 6, q3 every + /// round. Not triggered is not "skipped upstream". + #[tokio::test] + async fn downstream_runs_only_in_rounds_its_upstream_ran() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 9.0)]) + .with("q2", &[(&[("host", "a")], 1.0)]) + .with("q3", &[(&[("x", "1")], 1.0)]); + let queries = vec![ + every(query("q1", &[], &[]), 2), + every(query("q2", &[("Y", "q1", "host")], &[("Y", "host")]), 4), + query("q3", &[], &[]), + ]; + let intent = intent_with(queries, vec![]); + let mut rounds = Vec::new(); + for round in 0..8 { + rounds.push(intent.run_round(&runner, round, 1_000 * round as i64).await); + } + let ran = |id: &str| -> Vec { + statuses(&rounds, id) + .into_iter() + .filter(|(_, s)| *s == QueryStatus::Answered) + .map(|(r, _)| r) + .collect() + }; + assert_eq!(ran("q1"), vec![0, 2, 4, 6]); + assert_eq!(ran("q2"), vec![0, 4]); + assert_eq!(ran("q3"), (0..8).collect::>()); + assert_eq!(record(&rounds[2], "q2").status, QueryStatus::NotTriggered); + assert_eq!(record(&rounds[1], "q2").status, QueryStatus::NotTriggered); + } + + /// "Not triggered" (not its round) is a status of its own, distinct + /// from "skipped: empty binding" (its round, but nothing to bind), and + /// serializes as `not_triggered`. + #[tokio::test] + async fn not_triggered_is_distinct_from_empty_binding() { + let runner = FakeRunner::default().with("q1", &[]); + let intent = intent_with( + vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], + vec![], + ); + let round0 = intent.run_round(&runner, 0, 1_000).await; + let round1 = intent.run_round(&runner, 1, 2_000).await; + assert_eq!( + record(&round0, "q2").status, + QueryStatus::SkippedEmptyBinding + ); + assert_eq!(record(&round1, "q2").status, QueryStatus::NotTriggered); + let json = serde_json::to_value(record(&round1, "q2")).unwrap(); + assert_eq!(json["status"], "not_triggered"); + } + + /// A missed round is not caught up: with q1 overrunning (rounds 0, 3, + /// 6, 9 run), q2 (k = 2) runs in 0 and 6 only; 3 and 9 are not its + /// rounds, and its rounds 2, 4, 8 were missed. + #[tokio::test(start_paused = true)] + async fn missed_rounds_are_not_caught_up() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 1.0)]) + .delay("q1", 2_500) + .with("q2", &[(&[("host", "a")], 1.0)]); + let intent = intent_with( + vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], + vec![], + ); + let mut rounds = Vec::new(); + intent + .run_rounds(&runner, 10_000, 10, Instant::now(), |r| rounds.push(r)) + .await; + assert_eq!( + statuses(&rounds, "q2"), + vec![ + (0, QueryStatus::Answered), + (3, QueryStatus::NotTriggered), + (6, QueryStatus::Answered), + (9, QueryStatus::NotTriggered), + ] + ); + } + + /// Group latency over the members that ran: q1 (300 ms, every round), + /// q2 (200 ms, k = 2). Round 0: both ran, 500 ms > 400 -> not met. + /// Round 1: only q1 ran (q2 not triggered, which is not incomplete), + /// 300 ms -> met. A group none of whose members was triggered has no + /// record that round. + #[tokio::test(start_paused = true)] + async fn group_latency_counts_the_members_that_ran() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 1.0)]) + .delay("q1", 300) + .with("q2", &[(&[("host", "a")], 1.0)]) + .delay("q2", 200); + let groups = vec![ + GroupLatency { + query_ids: vec!["q1".into(), "q2".into()], + max_latency_ms: 400.0, + }, + GroupLatency { + query_ids: vec!["q2".into()], + max_latency_ms: 600.0, + }, + ]; + let intent = intent_with( + vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], + groups, + ); + let summary = |round: &RoundRecord| -> Vec<(Vec, Option, bool, bool)> { + round + .groups + .iter() + .map(|g| (g.ran_query_ids.clone(), g.latency_ms, g.complete, g.met)) + .collect() + }; + let round0 = intent.run_round(&runner, 0, 1_000).await; + assert_eq!( + summary(&round0), + vec![ + (vec!["q1".into(), "q2".into()], Some(500.0), true, false), + (vec!["q2".into()], Some(500.0), true, true), + ] + ); + let round1 = intent.run_round(&runner, 1, 2_000).await; + assert_eq!( + summary(&round1), + vec![(vec!["q1".into()], Some(300.0), true, true)] + ); + } + + /// A failed member still makes its group incomplete, as before; only + /// "not triggered" members are left out of completeness. + #[tokio::test] + async fn failed_member_still_makes_the_group_incomplete() { + let runner = FakeRunner::default().error("q1", "pane missing"); + let groups = vec![GroupLatency { + query_ids: vec!["q1".into(), "q2".into()], + max_latency_ms: 400.0, + }]; + let intent = intent_with( + vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], + groups, + ); + let round1 = intent.run_round(&runner, 1, 2_000).await; + let group = &round1.groups[0]; + assert!(group.ran_query_ids.is_empty(), "{group:?}"); + assert!(!group.complete); + assert!(!group.met); + } + + /// `WHEN cond` is copied to every record of the query and never + /// evaluated: the query runs on its rate alone. + #[tokio::test] + async fn when_condition_is_recorded_not_evaluated() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 1.0)]) + .with("q2", &[(&[("host", "a")], 1.0)]); + let mut queries = host_pair(); + queries[1].when_condition = Some("max(c) > 1000000".into()); + let intent = intent_with(queries, vec![]); + let round = intent.run_round(&runner, 0, 1_000).await; + let q2 = record(&round, "q2"); + assert_eq!(q2.status, QueryStatus::Answered); + assert_eq!(q2.when_condition.as_deref(), Some("max(c) > 1000000")); + assert_eq!(record(&round, "q1").when_condition, None); + } + + /// Rates the loop can run deterministically are accepted: k = 10 alone, + /// and a chain whose downstream k (4) is a multiple of its upstream's (2). + #[test] + fn compatible_rates_are_accepted() { + let accepted = |queries: Vec| { + IntentLoop::new( + schedule(queries), + BindMode::FilterGroupedResult, + Duration::from_secs(1), + ) + .map(|_| ()) + .map_err(|e| e.to_string()) + }; + assert_eq!( + accepted(vec![ + host_pair()[0].clone(), + every(host_pair()[1].clone(), 10) + ]), + Ok(()) + ); + assert_eq!( + accepted(vec![ + every(host_pair()[0].clone(), 2), + every(host_pair()[1].clone(), 4) + ]), + Ok(()) + ); + // rate 0.15 rounds to k = 7; planned_rate 1/7 is what the planner costed. + let mut q2 = host_pair()[1].clone(); + q2.rate = 0.15; + q2.planned_rate = 1.0 / 7.0; + assert_eq!(accepted(vec![host_pair()[0].clone(), q2]), Ok(())); + } + + /// Plans the loop cannot run as costed are refused at load with the + /// reason. + #[test] + fn incompatible_rates_are_refused() { + let refused = |queries: Vec, reason: &str| { + let error = IntentLoop::new( + schedule(queries), + BindMode::FilterGroupedResult, + Duration::from_secs(1), + ) + .unwrap_err() + .to_string(); + assert!(error.contains(reason), "{error:?} lacks {reason:?}"); + }; + let with_rates = |rate: f64, planned_rate: f64| { + let mut q2 = host_pair()[1].clone(); + q2.rate = rate; + q2.planned_rate = planned_rate; + vec![host_pair()[0].clone(), q2] + }; + // planned_rate is not 1/k for an integer k. + refused(with_rates(0.3, 0.3), "planned_rate"); + // planned_rate disagrees with rate (round(1/0.1) = 10, not 2). + refused(with_rates(0.1, 0.5), "planned_rate"); + // rate outside (0, 1]. + refused(with_rates(0.0, 1.0), "rate"); + refused(with_rates(1.5, 1.0), "rate"); + refused(with_rates(f64::NAN, 1.0), "rate"); + // Downstream k (2) is not a multiple of its upstream's (3). + refused( + vec![ + every(host_pair()[0].clone(), 3), + every(host_pair()[1].clone(), 2), + ], + "multiple", + ); + // Downstream more often than its upstream (k 1 vs 10). + refused( + vec![every(host_pair()[0].clone(), 10), host_pair()[1].clone()], + "multiple", + ); + } + + /// The planner's `planned_rate` and `when_condition` reach the loop's + /// schedule. + #[test] + fn from_intent_plan_reads_rate_and_condition() { + let intent_plan: IntentPlan = serde_json::from_value(serde_json::json!({ + "planning_mode": "intent_full", + "plan": {"wire_version": 1, "dag": {"nodes": [], "edges": [], "roots": [], "scalar_roots": []}, + "query_texts": ["SELECT 1"]}, + "lightcone_query_indices": [], + "intent_rounds": [{ + "intent_name": "drill_cnt", + "round_interval_ms": 10_000, + "round_phase_ms": 0, + "queries": [ + {"query_id": "q2", "query_index": 0, "plan_root": 0, + "output_variables": [], "depends_on": [], "bind_slots": [], + "rate": 0.1, "planned_rate": 0.1, "when_condition": "max(c) > 100", + "skip_if_empty": false, "accuracy": null, "max_latency_ms": null} + ], + "group_latency_ms": [] + }] + })) + .unwrap(); + let schedule = IntentSchedule::from_intent_plan(&intent_plan, "drill_cnt").unwrap(); + assert_eq!(schedule.queries[0].rate, 0.1); + assert_eq!(schedule.queries[0].planned_rate, 0.1); + assert_eq!( + schedule.queries[0].when_condition.as_deref(), + Some("max(c) > 100") + ); + } } From 80b05f6896b282405ff5140f4e3ee583a2ad811a Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 3 Dec 2026 17:18:08 +0000 Subject: [PATCH 2/5] Revert "test(intent): trigger rate != 1 runs a query every k-th round (failing)" This reverts commit 53b670ec. Superseded (user, 2026-12-03): the data plane never reads the trigger rate; a dependent query is triggered iff its bound input set is non-empty in that round, so there is no every-k-th-round schedule to test. Co-Authored-By: Claude Opus 5.5 --- data_plane/src/intent.rs | 365 --------------------------------------- 1 file changed, 365 deletions(-) diff --git a/data_plane/src/intent.rs b/data_plane/src/intent.rs index df81bcabf..465b9cf63 100644 --- a/data_plane/src/intent.rs +++ b/data_plane/src/intent.rs @@ -65,12 +65,6 @@ pub struct IntentQuery { /// Fraction of rounds it runs in; only 1 (every round) is supported. #[serde(default = "every_round")] pub rate: f64, - /// `1/k`: the planner costed it as running every k-th round. - #[serde(default = "every_round")] - pub planned_rate: f64, - /// The opaque text of its `WHEN cond`: recorded, never evaluated. - #[serde(default)] - pub when_condition: Option, /// Skip the query in a round where one of its bindings is empty /// (default true, as the contract requires). #[serde(default = "skip_if_empty")] @@ -186,8 +180,6 @@ pub enum QueryStatus { SkippedUpstream, /// Its run failed or timed out (`error` says which). Failed, - /// Not its round: it runs every k-th round (`planned_rate = 1/k`). - NotTriggered, } /// One answer row. @@ -209,8 +201,6 @@ pub struct QueryRecord { pub bindings: Bindings, pub answer: Vec, pub error: Option, - /// The query's `WHEN cond`, as written (never evaluated). - pub when_condition: Option, } /// One latency group in one round. @@ -221,8 +211,6 @@ pub struct GroupRecord { /// From the round's start to the last member that ran ending; `None` /// when none ran. pub latency_ms: Option, - /// The members that ran this round. - pub ran_query_ids: Vec, /// Whether every member ran. pub complete: bool, /// Every member ran and `latency_ms <= max_latency_ms`. @@ -291,9 +279,6 @@ pub struct PlannedIntentQuery { #[serde(default)] pub bind_slots: Vec, pub rate: f64, - pub planned_rate: f64, - #[serde(default)] - pub when_condition: Option, pub skip_if_empty: bool, } @@ -402,8 +387,6 @@ impl IntentSchedule { depends_on, bind_slots, rate: query.rate, - planned_rate: 1.0, - when_condition: None, skip_if_empty: query.skip_if_empty, }) }) @@ -548,7 +531,6 @@ impl IntentLoop { bindings: Bindings::new(), answer: vec![], error: None, - when_condition: None, }; let mut upstream_missing = false; for dependency in &query.depends_on { @@ -626,7 +608,6 @@ impl IntentLoop { query_ids: group.query_ids.clone(), max_latency_ms: group.max_latency_ms, latency_ms, - ran_query_ids: vec![], complete, met: complete && latency_ms.is_some_and(|l| l <= group.max_latency_ms), } @@ -937,8 +918,6 @@ mod tests { }) .collect(), rate: 1.0, - planned_rate: 1.0, - when_condition: None, skip_if_empty: true, } } @@ -1365,348 +1344,4 @@ mod tests { ); assert_eq!(runner.calls(), vec!["q1"]); } - - // ---- Trigger rate != 1 (planned_rate = 1/k: every k-th round) ---- - - /// `query` set to run every `k`-th round (rate = planned_rate = 1/k). - fn every(mut query: IntentQuery, k: u32) -> IntentQuery { - query.rate = 1.0 / f64::from(k); - query.planned_rate = 1.0 / f64::from(k); - query - } - - fn intent_with(queries: Vec, groups: Vec) -> IntentLoop { - let mut schedule = schedule(queries); - schedule.group_latency_ms = groups; - IntentLoop::new( - schedule, - BindMode::FilterGroupedResult, - Duration::from_secs(10), - ) - .unwrap() - } - - /// Each round's status of query `id`, in round order (missed rounds - /// have no query records and are left out). - fn statuses(rounds: &[RoundRecord], id: &str) -> Vec<(u64, QueryStatus)> { - rounds - .iter() - .filter(|r| r.status == RoundStatus::Ran) - .map(|r| (r.round, record(r, id).status)) - .collect() - } - - /// drill_cnt with q2 at rate 0.1 (k = 10): q2 runs in rounds 0, 10, 20 - /// (round index from the first evaluation, phase 0) and is recorded as - /// not triggered, with no latency, binding or answer, in the others; q1 - /// runs every round. - #[tokio::test(start_paused = true)] - async fn sampled_query_runs_every_kth_round() { - let runner = FakeRunner::default() - .with("q1", &[(&[("host", "a")], 9.0)]) - .with("q2", &[(&[("host", "a"), ("user", "u1")], 1.0)]); - let intent = intent_with( - vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 10)], - vec![], - ); - let mut rounds = Vec::new(); - intent - .run_rounds(&runner, 10_000, 21, Instant::now(), |r| rounds.push(r)) - .await; - assert_eq!(rounds.len(), 21); - let ran: Vec = statuses(&rounds, "q2") - .into_iter() - .filter(|(_, s)| *s == QueryStatus::Answered) - .map(|(r, _)| r) - .collect(); - assert_eq!(ran, vec![0, 10, 20]); - for (round, status) in statuses(&rounds, "q2") { - if round % 10 != 0 { - assert_eq!(status, QueryStatus::NotTriggered, "round {round}"); - } - } - let q2 = record(&rounds[3], "q2"); - assert_eq!(q2.latency_ms, None); - assert!(q2.bindings.is_empty(), "{q2:?}"); - assert!(q2.answer.is_empty()); - let calls = runner.calls(); - assert_eq!(calls.iter().filter(|c| *c == "q1").count(), 21); - assert_eq!(calls.iter().filter(|c| *c == "q2").count(), 3); - } - - /// Chain q1 (k = 2) -> q2 (k = 4) and an independent q3 (k = 1): q2 - /// runs only in rounds where q1 ran (0, 4), q1 in 0, 2, 4, 6, q3 every - /// round. Not triggered is not "skipped upstream". - #[tokio::test] - async fn downstream_runs_only_in_rounds_its_upstream_ran() { - let runner = FakeRunner::default() - .with("q1", &[(&[("host", "a")], 9.0)]) - .with("q2", &[(&[("host", "a")], 1.0)]) - .with("q3", &[(&[("x", "1")], 1.0)]); - let queries = vec![ - every(query("q1", &[], &[]), 2), - every(query("q2", &[("Y", "q1", "host")], &[("Y", "host")]), 4), - query("q3", &[], &[]), - ]; - let intent = intent_with(queries, vec![]); - let mut rounds = Vec::new(); - for round in 0..8 { - rounds.push(intent.run_round(&runner, round, 1_000 * round as i64).await); - } - let ran = |id: &str| -> Vec { - statuses(&rounds, id) - .into_iter() - .filter(|(_, s)| *s == QueryStatus::Answered) - .map(|(r, _)| r) - .collect() - }; - assert_eq!(ran("q1"), vec![0, 2, 4, 6]); - assert_eq!(ran("q2"), vec![0, 4]); - assert_eq!(ran("q3"), (0..8).collect::>()); - assert_eq!(record(&rounds[2], "q2").status, QueryStatus::NotTriggered); - assert_eq!(record(&rounds[1], "q2").status, QueryStatus::NotTriggered); - } - - /// "Not triggered" (not its round) is a status of its own, distinct - /// from "skipped: empty binding" (its round, but nothing to bind), and - /// serializes as `not_triggered`. - #[tokio::test] - async fn not_triggered_is_distinct_from_empty_binding() { - let runner = FakeRunner::default().with("q1", &[]); - let intent = intent_with( - vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], - vec![], - ); - let round0 = intent.run_round(&runner, 0, 1_000).await; - let round1 = intent.run_round(&runner, 1, 2_000).await; - assert_eq!( - record(&round0, "q2").status, - QueryStatus::SkippedEmptyBinding - ); - assert_eq!(record(&round1, "q2").status, QueryStatus::NotTriggered); - let json = serde_json::to_value(record(&round1, "q2")).unwrap(); - assert_eq!(json["status"], "not_triggered"); - } - - /// A missed round is not caught up: with q1 overrunning (rounds 0, 3, - /// 6, 9 run), q2 (k = 2) runs in 0 and 6 only; 3 and 9 are not its - /// rounds, and its rounds 2, 4, 8 were missed. - #[tokio::test(start_paused = true)] - async fn missed_rounds_are_not_caught_up() { - let runner = FakeRunner::default() - .with("q1", &[(&[("host", "a")], 1.0)]) - .delay("q1", 2_500) - .with("q2", &[(&[("host", "a")], 1.0)]); - let intent = intent_with( - vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], - vec![], - ); - let mut rounds = Vec::new(); - intent - .run_rounds(&runner, 10_000, 10, Instant::now(), |r| rounds.push(r)) - .await; - assert_eq!( - statuses(&rounds, "q2"), - vec![ - (0, QueryStatus::Answered), - (3, QueryStatus::NotTriggered), - (6, QueryStatus::Answered), - (9, QueryStatus::NotTriggered), - ] - ); - } - - /// Group latency over the members that ran: q1 (300 ms, every round), - /// q2 (200 ms, k = 2). Round 0: both ran, 500 ms > 400 -> not met. - /// Round 1: only q1 ran (q2 not triggered, which is not incomplete), - /// 300 ms -> met. A group none of whose members was triggered has no - /// record that round. - #[tokio::test(start_paused = true)] - async fn group_latency_counts_the_members_that_ran() { - let runner = FakeRunner::default() - .with("q1", &[(&[("host", "a")], 1.0)]) - .delay("q1", 300) - .with("q2", &[(&[("host", "a")], 1.0)]) - .delay("q2", 200); - let groups = vec![ - GroupLatency { - query_ids: vec!["q1".into(), "q2".into()], - max_latency_ms: 400.0, - }, - GroupLatency { - query_ids: vec!["q2".into()], - max_latency_ms: 600.0, - }, - ]; - let intent = intent_with( - vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], - groups, - ); - let summary = |round: &RoundRecord| -> Vec<(Vec, Option, bool, bool)> { - round - .groups - .iter() - .map(|g| (g.ran_query_ids.clone(), g.latency_ms, g.complete, g.met)) - .collect() - }; - let round0 = intent.run_round(&runner, 0, 1_000).await; - assert_eq!( - summary(&round0), - vec![ - (vec!["q1".into(), "q2".into()], Some(500.0), true, false), - (vec!["q2".into()], Some(500.0), true, true), - ] - ); - let round1 = intent.run_round(&runner, 1, 2_000).await; - assert_eq!( - summary(&round1), - vec![(vec!["q1".into()], Some(300.0), true, true)] - ); - } - - /// A failed member still makes its group incomplete, as before; only - /// "not triggered" members are left out of completeness. - #[tokio::test] - async fn failed_member_still_makes_the_group_incomplete() { - let runner = FakeRunner::default().error("q1", "pane missing"); - let groups = vec![GroupLatency { - query_ids: vec!["q1".into(), "q2".into()], - max_latency_ms: 400.0, - }]; - let intent = intent_with( - vec![host_pair()[0].clone(), every(host_pair()[1].clone(), 2)], - groups, - ); - let round1 = intent.run_round(&runner, 1, 2_000).await; - let group = &round1.groups[0]; - assert!(group.ran_query_ids.is_empty(), "{group:?}"); - assert!(!group.complete); - assert!(!group.met); - } - - /// `WHEN cond` is copied to every record of the query and never - /// evaluated: the query runs on its rate alone. - #[tokio::test] - async fn when_condition_is_recorded_not_evaluated() { - let runner = FakeRunner::default() - .with("q1", &[(&[("host", "a")], 1.0)]) - .with("q2", &[(&[("host", "a")], 1.0)]); - let mut queries = host_pair(); - queries[1].when_condition = Some("max(c) > 1000000".into()); - let intent = intent_with(queries, vec![]); - let round = intent.run_round(&runner, 0, 1_000).await; - let q2 = record(&round, "q2"); - assert_eq!(q2.status, QueryStatus::Answered); - assert_eq!(q2.when_condition.as_deref(), Some("max(c) > 1000000")); - assert_eq!(record(&round, "q1").when_condition, None); - } - - /// Rates the loop can run deterministically are accepted: k = 10 alone, - /// and a chain whose downstream k (4) is a multiple of its upstream's (2). - #[test] - fn compatible_rates_are_accepted() { - let accepted = |queries: Vec| { - IntentLoop::new( - schedule(queries), - BindMode::FilterGroupedResult, - Duration::from_secs(1), - ) - .map(|_| ()) - .map_err(|e| e.to_string()) - }; - assert_eq!( - accepted(vec![ - host_pair()[0].clone(), - every(host_pair()[1].clone(), 10) - ]), - Ok(()) - ); - assert_eq!( - accepted(vec![ - every(host_pair()[0].clone(), 2), - every(host_pair()[1].clone(), 4) - ]), - Ok(()) - ); - // rate 0.15 rounds to k = 7; planned_rate 1/7 is what the planner costed. - let mut q2 = host_pair()[1].clone(); - q2.rate = 0.15; - q2.planned_rate = 1.0 / 7.0; - assert_eq!(accepted(vec![host_pair()[0].clone(), q2]), Ok(())); - } - - /// Plans the loop cannot run as costed are refused at load with the - /// reason. - #[test] - fn incompatible_rates_are_refused() { - let refused = |queries: Vec, reason: &str| { - let error = IntentLoop::new( - schedule(queries), - BindMode::FilterGroupedResult, - Duration::from_secs(1), - ) - .unwrap_err() - .to_string(); - assert!(error.contains(reason), "{error:?} lacks {reason:?}"); - }; - let with_rates = |rate: f64, planned_rate: f64| { - let mut q2 = host_pair()[1].clone(); - q2.rate = rate; - q2.planned_rate = planned_rate; - vec![host_pair()[0].clone(), q2] - }; - // planned_rate is not 1/k for an integer k. - refused(with_rates(0.3, 0.3), "planned_rate"); - // planned_rate disagrees with rate (round(1/0.1) = 10, not 2). - refused(with_rates(0.1, 0.5), "planned_rate"); - // rate outside (0, 1]. - refused(with_rates(0.0, 1.0), "rate"); - refused(with_rates(1.5, 1.0), "rate"); - refused(with_rates(f64::NAN, 1.0), "rate"); - // Downstream k (2) is not a multiple of its upstream's (3). - refused( - vec![ - every(host_pair()[0].clone(), 3), - every(host_pair()[1].clone(), 2), - ], - "multiple", - ); - // Downstream more often than its upstream (k 1 vs 10). - refused( - vec![every(host_pair()[0].clone(), 10), host_pair()[1].clone()], - "multiple", - ); - } - - /// The planner's `planned_rate` and `when_condition` reach the loop's - /// schedule. - #[test] - fn from_intent_plan_reads_rate_and_condition() { - let intent_plan: IntentPlan = serde_json::from_value(serde_json::json!({ - "planning_mode": "intent_full", - "plan": {"wire_version": 1, "dag": {"nodes": [], "edges": [], "roots": [], "scalar_roots": []}, - "query_texts": ["SELECT 1"]}, - "lightcone_query_indices": [], - "intent_rounds": [{ - "intent_name": "drill_cnt", - "round_interval_ms": 10_000, - "round_phase_ms": 0, - "queries": [ - {"query_id": "q2", "query_index": 0, "plan_root": 0, - "output_variables": [], "depends_on": [], "bind_slots": [], - "rate": 0.1, "planned_rate": 0.1, "when_condition": "max(c) > 100", - "skip_if_empty": false, "accuracy": null, "max_latency_ms": null} - ], - "group_latency_ms": [] - }] - })) - .unwrap(); - let schedule = IntentSchedule::from_intent_plan(&intent_plan, "drill_cnt").unwrap(); - assert_eq!(schedule.queries[0].rate, 0.1); - assert_eq!(schedule.queries[0].planned_rate, 0.1); - assert_eq!( - schedule.queries[0].when_condition.as_deref(), - Some("max(c) > 100") - ); - } } From 0bcd8cb0c5bb421ba06f2a2695d6f1b27fa87ab0 Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 3 Dec 2026 17:23:36 +0000 Subject: [PATCH 3/5] test(intent): dependents triggered by the upstream's result; one round loop per clock (failing) Tests for: the loop never reads the trigger rate (a planning input); a dependent query with an empty binding, or below a not-triggered query, is not_triggered; a not-triggered member leaves its latency group complete; one schedule per intent_rounds entry (clock); round records name their clock; every clock covers the fastest clock's span; clocks run concurrently. The rate row of invalid_schedules_are_refused goes. Interface stubs only: QueryStatus::NotTriggered (unused), RoundRecord::round_interval_ms (0), per_clock_from_intent_plan (the first schedule only), rounds_per_clock (rounds for every clock), run_clocks (the first clock only). Co-Authored-By: Claude Opus 5.5 --- data_plane/src/intent.rs | 228 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 221 insertions(+), 7 deletions(-) diff --git a/data_plane/src/intent.rs b/data_plane/src/intent.rs index 465b9cf63..96dc3f841 100644 --- a/data_plane/src/intent.rs +++ b/data_plane/src/intent.rs @@ -180,6 +180,9 @@ pub enum QueryStatus { SkippedUpstream, /// Its run failed or timed out (`error` says which). Failed, + /// A binding it reads is empty, or an upstream was not triggered: the + /// upstream's result did not trigger it this round. + NotTriggered, } /// One answer row. @@ -229,6 +232,9 @@ pub enum RoundStatus { /// One round: its queries and groups. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct RoundRecord { + /// The interval of the clock this round belongs to (an intent's queries + /// may run on several clocks; `(round_interval_ms, round)` names a round). + pub round_interval_ms: u64, pub round: u64, pub evaluation_ms: i64, pub status: RoundStatus, @@ -399,6 +405,42 @@ impl IntentSchedule { } } +impl IntentSchedule { + /// One schedule per clock of the intent `intent_name`: each of its + /// `intent_rounds` entries, in order. + pub fn per_clock_from_intent_plan( + intent_plan: &IntentPlan, + intent_name: &str, + ) -> anyhow::Result> { + Ok(vec![Self::from_intent_plan(intent_plan, intent_name)?]) + } +} + +/// The rounds each clock runs so that every clock covers the span of +/// `rounds` rounds of the fastest one: `ceil(rounds × min / interval)`. +pub fn rounds_per_clock(intervals_ms: &[u64], rounds: u64) -> Vec { + vec![rounds; intervals_ms.len()] +} + +/// Runs every clock's rounds concurrently from `first_evaluation_ms` and +/// `start` ([`IntentLoop::run_rounds`]), each clock as many rounds as +/// [`rounds_per_clock`] gives for `rounds`; `emit` gets every round of +/// every clock as it ends. +pub async fn run_clocks( + loops: &[IntentLoop], + runner: &R, + first_evaluation_ms: i64, + rounds: u64, + start: Instant, + emit: impl FnMut(RoundRecord) + Send, +) { + if let Some(first) = loops.first() { + first + .run_rounds(runner, first_evaluation_ms, rounds, start, emit) + .await; + } +} + impl IntentLoop { /// Checks `schedule` and orders its queries. Refused (bad input): an /// unknown upstream or group member, a variable bound by more than one @@ -614,6 +656,7 @@ impl IntentLoop { }) .collect(); RoundRecord { + round_interval_ms: 0, round, evaluation_ms: time_ms, status: RoundStatus::Ran, @@ -653,6 +696,7 @@ impl IntentLoop { let mut next = round + 1; while next < rounds && scheduled(next) < ended { emit(RoundRecord { + round_interval_ms: 0, round: next, evaluation_ms: first_evaluation_ms + (next * interval_ms) as i64, status: RoundStatus::Missed, @@ -968,19 +1012,21 @@ mod tests { ] } - /// A downstream query whose binding is empty is skipped, not run, and - /// the empty binding is recorded. + /// B2: a downstream query whose binding is empty is not triggered: not + /// run, the empty binding recorded, `not_triggered` in the JSON. #[tokio::test] - async fn empty_binding_skips_the_downstream_query() { + async fn empty_binding_is_not_triggered() { let runner = FakeRunner::default() .with("q1", &[]) .with("q2", &[(&[("host", "a")], 1.0)]); let round = intent(host_pair()).run_round(&runner, 0, 1_000).await; let q2 = record(&round, "q2"); - assert_eq!(q2.status, QueryStatus::SkippedEmptyBinding); + assert_eq!(q2.status, QueryStatus::NotTriggered); assert_eq!(q2.latency_ms, None); assert_eq!(q2.bindings["Y"], values(&[])); assert_eq!(runner.calls(), vec!["q1"]); + let json = serde_json::to_value(q2).unwrap(); + assert_eq!(json["status"], "not_triggered"); } /// q1 -> q2 -> q3: each runs after its upstream, filtered by the values @@ -1286,9 +1332,6 @@ mod tests { vec![query("q1", &[], &[]), query("q2", &[], &[("Y", "host")])], "no dependency binds", ); - let mut sampled = host_pair(); - sampled[1].rate = 0.5; - refused(sampled, "rate"); } /// Parameter-slot binding hands the runner each slot's placeholders @@ -1344,4 +1387,175 @@ mod tests { ); assert_eq!(runner.calls(), vec!["q1"]); } + + // ---- Triggering by the upstream's result; clocks ---- + + /// B1: the trigger rate is a planning input the loop never reads: a + /// schedule giving q2 rate 0.1 loads, and q2 runs in every round where + /// q1 binds a value. + #[tokio::test] + async fn rate_is_not_read() { + let schedule: IntentSchedule = serde_json::from_value(serde_json::json!({ + "round_interval_ms": 1_000, + "queries": [ + {"query_id": "q1", "query": "q1"}, + {"query_id": "q2", "query": "q2", "rate": 0.1, + "depends_on": [{"variable": "Y", "upstream_query_id": "q1", "output_column": "host"}], + "bind_slots": [{"variable": "Y", "column": "host"}]} + ] + })) + .unwrap(); + let intent = IntentLoop::new( + schedule, + BindMode::FilterGroupedResult, + Duration::from_secs(1), + ) + .expect("a rate does not refuse the schedule"); + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 1.0)]) + .with("q2", &[(&[("host", "a")], 2.0)]); + for round in 0..3 { + let record = intent.run_round(&runner, round, 1_000).await; + assert_eq!(record.queries[1].status, QueryStatus::Answered); + } + assert_eq!(runner.calls().iter().filter(|c| *c == "q2").count(), 3); + } + + /// B3: a query below a not-triggered query is not triggered either + /// (nothing upstream failed). + #[tokio::test] + async fn not_triggered_upstream_does_not_trigger_its_dependents() { + let runner = FakeRunner::default().with("q1", &[]); + let queries = vec![ + query("q1", &[], &[]), + query("q2", &[("Y", "q1", "host")], &[("Y", "host")]), + query("q3", &[("Z", "q2", "user")], &[("Z", "user")]), + ]; + let round = intent(queries).run_round(&runner, 0, 1_000).await; + assert_eq!(record(&round, "q2").status, QueryStatus::NotTriggered); + assert_eq!(record(&round, "q3").status, QueryStatus::NotTriggered); + assert_eq!(runner.calls(), vec!["q1"]); + } + + /// B4: a member the upstream's result did not trigger leaves its group + /// complete; the latency covers the members that ran. + #[tokio::test(start_paused = true)] + async fn not_triggered_member_keeps_the_group_complete() { + let runner = FakeRunner::default().with("q1", &[]).delay("q1", 300); + let mut schedule = schedule(host_pair()); + schedule.group_latency_ms = vec![GroupLatency { + query_ids: vec!["q1".into(), "q2".into()], + max_latency_ms: 400.0, + }]; + let intent = IntentLoop::new( + schedule, + BindMode::FilterGroupedResult, + Duration::from_secs(10), + ) + .unwrap(); + let round = intent.run_round(&runner, 0, 1_000).await; + let group = &round.groups[0]; + assert_eq!( + (group.latency_ms, group.complete, group.met), + (Some(300.0), true, true) + ); + } + + /// B5: an intent whose queries run on two clocks gives two schedules, + /// one per `intent_rounds` entry; another intent's entry is left out. + #[test] + fn per_clock_from_intent_plan_gives_one_schedule_per_clock() { + let query = |id: &str, index: usize| { + serde_json::json!({"query_id": id, "query_index": index, "plan_root": null, + "output_variables": [], "depends_on": [], "bind_slots": [], + "rate": 1.0, "skip_if_empty": false, "accuracy": null, "max_latency_ms": null}) + }; + let clock = |name: &str, interval: u64, queries: Vec| { + serde_json::json!({"intent_name": name, "round_interval_ms": interval, + "round_phase_ms": 0, "queries": queries, "group_latency_ms": []}) + }; + let intent_plan: IntentPlan = serde_json::from_value(serde_json::json!({ + "planning_mode": "intent_full", + "plan": {"wire_version": 1, "dag": {"nodes": [], "edges": [], "roots": [], "scalar_roots": []}, + "query_texts": ["SELECT 1", "SELECT 2", "SELECT 3", "SELECT 4"]}, + "lightcone_query_indices": [], + "intent_rounds": [ + clock("triage", 10_000, vec![query("q1", 0), query("q2", 1)]), + clock("triage", 60_000, vec![query("q3", 2)]), + clock("other", 10_000, vec![query("q4", 3)]), + ] + })) + .unwrap(); + let schedules = IntentSchedule::per_clock_from_intent_plan(&intent_plan, "triage").unwrap(); + let clocks: Vec<(u64, Vec<&str>)> = schedules + .iter() + .map(|s| { + ( + s.round_interval_ms, + s.queries.iter().map(|q| q.query_id.as_str()).collect(), + ) + }) + .collect(); + assert_eq!( + clocks, + vec![(10_000, vec!["q1", "q2"]), (60_000, vec!["q3"])] + ); + assert!(IntentSchedule::per_clock_from_intent_plan(&intent_plan, "none").is_err()); + } + + /// B6: a round's record names its clock. + #[tokio::test] + async fn round_records_name_their_clock() { + let runner = FakeRunner::default(); + let round = intent(vec![query("q1", &[], &[])]) + .run_round(&runner, 0, 1_000) + .await; + assert_eq!(round.round_interval_ms, 1_000); + } + + /// B7: every clock covers the span of the fastest clock's rounds. + #[test] + fn rounds_per_clock_cover_the_same_span() { + assert_eq!(rounds_per_clock(&[10_000, 60_000], 12), vec![12, 2]); + assert_eq!(rounds_per_clock(&[10_000, 25_000], 5), vec![5, 2]); + assert_eq!(rounds_per_clock(&[60_000, 10_000], 2), vec![1, 2]); + } + + /// B8: two clocks run concurrently, each round at its own evaluation + /// time: q1 every 1 s for 6 rounds, q3 every 3 s for 2 rounds. + #[tokio::test(start_paused = true)] + async fn clocks_run_concurrently_each_on_its_own_rounds() { + let runner = FakeRunner::default() + .with("q1", &[(&[("host", "a")], 1.0)]) + .with("q3", &[(&[("host", "a")], 1.0)]); + let fast = intent(vec![query("q1", &[], &[])]); + let mut slow = schedule(vec![query("q3", &[], &[])]); + slow.round_interval_ms = 3_000; + let slow = + IntentLoop::new(slow, BindMode::FilterGroupedResult, Duration::from_secs(1)).unwrap(); + let mut rounds = Vec::new(); + run_clocks(&[fast, slow], &runner, 10_000, 6, Instant::now(), |r| { + rounds.push(r) + }) + .await; + let mut seen: Vec<(u64, u64, i64, String)> = rounds + .iter() + .map(|r| { + ( + r.round_interval_ms, + r.round, + r.evaluation_ms, + r.queries[0].query_id.clone(), + ) + }) + .collect(); + seen.sort(); + let mut expected: Vec<(u64, u64, i64, String)> = (0..6) + .map(|r| (1_000, r, 10_000 + 1_000 * r as i64, "q1".to_string())) + .collect(); + expected.push((3_000, 0, 10_000, "q3".into())); + expected.push((3_000, 1, 13_000, "q3".into())); + expected.sort(); + assert_eq!(seen, expected); + } } From c30ebf698b97d0be5a7634010dd7d38486e05b90 Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 3 Dec 2026 17:37:44 +0000 Subject: [PATCH 4/5] feat(intent): one round loop per clock; dependents triggered by the upstream's result The planner's intent output now has one intent_rounds entry per clock (an intent's queries on one interval). per_clock_from_intent_plan (replacing from_intent_plan) gives one schedule per entry, and run_clocks runs their round loops concurrently from one first evaluation time, each clock covering the fastest clock's span (--intent-rounds counts the fastest clock's rounds). Round records name their clock (round_interval_ms). The trigger rate is a planner cost input only: the loop no longer reads or refuses it. A dependent query is not_triggered (was skipped_empty_binding) when a binding is empty or an upstream was not triggered; such a member leaves its latency group complete, and a group with no triggered member has no record that round. Pins ASAPPlanner 61679203 (#1553 head: per-query intervals, one entry per clock). New e2e: an intent on two clocks planned jointly answers exactly on each. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 46 ++++----- Cargo.toml | 4 +- bench/demo/harness/README.md | 16 ++- data_plane/Cargo.toml | 2 +- data_plane/src/intent.rs | 147 ++++++++++++++++----------- data_plane/src/main.rs | 46 ++++++--- data_plane/tests/intent_rounds.rs | 16 +-- data_plane/tests/intent_sil_modes.rs | 63 +++++++++++- 8 files changed, 226 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ce9ebe9e..779b151ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "asap-accuracy" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", "asap_sketchlib", @@ -344,7 +344,7 @@ dependencies = [ [[package]] name = "asap-cost" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", "asap_sketchlib", @@ -356,7 +356,7 @@ dependencies = [ [[package]] name = "asap-executor" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "ahash", "arrow", @@ -374,7 +374,7 @@ dependencies = [ [[package]] name = "asap-frontend-common" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", "serde", @@ -384,7 +384,7 @@ dependencies = [ [[package]] name = "asap-frontend-metricsql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-frontend-common", "asap-types", @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "asap-frontend-promql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-frontend-common", "asap-types", @@ -405,7 +405,7 @@ dependencies = [ [[package]] name = "asap-frontend-sil" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", "serde", @@ -415,7 +415,7 @@ dependencies = [ [[package]] name = "asap-frontend-sql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-frontend-common", "asap-sql-function-catalog", @@ -427,7 +427,7 @@ dependencies = [ [[package]] name = "asap-planner" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-accuracy", "asap-cost", @@ -450,12 +450,12 @@ dependencies = [ [[package]] name = "asap-sql-function-catalog" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" [[package]] name = "asap-stage0-memo" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", ] @@ -463,7 +463,7 @@ dependencies = [ [[package]] name = "asap-stage1-pass1-per-computation-candidates" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", "thiserror 2.0.20", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "asap-stage1-pass2-reuse-candidates" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-accuracy", "asap-types", @@ -482,7 +482,7 @@ dependencies = [ [[package]] name = "asap-stage2-physical-optimization" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-types", ] @@ -490,7 +490,7 @@ dependencies = [ [[package]] name = "asap-stage3-plan-selection" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap-accuracy", "asap-cost", @@ -505,7 +505,7 @@ dependencies = [ [[package]] name = "asap-types" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "asap_sketchlib", "serde", @@ -1647,7 +1647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2489,7 +2489,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "metricsql_common" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "chrono", ] @@ -2497,7 +2497,7 @@ dependencies = [ [[package]] name = "metricsql_parser" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=3ef265d20e74679bcb8cb3d2bed8de6c59fb690f#3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" dependencies = [ "ahash", "chrono", @@ -2944,7 +2944,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3192,7 +3192,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3549,7 +3549,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -4107,7 +4107,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index aa7010d59..88898ed76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ 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 = "3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" } -asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "3ef265d20e74679bcb8cb3d2bed8de6c59fb690f" } +asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "6167920359627343ce3ac23e2926ca47adf15e11" } +asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "6167920359627343ce3ac23e2926ca47adf15e11" } # 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 # (draft: ASAPPlanner#1553 head, for SIL intents). diff --git a/bench/demo/harness/README.md b/bench/demo/harness/README.md index 34215def8..73208b6aa 100644 --- a/bench/demo/harness/README.md +++ b/bench/demo/harness/README.md @@ -264,13 +264,23 @@ data_plane --plan plan.json --no-forward --stream-start-ms $S \ --intent-delay-ms 6000 ``` -Output (`rounds.jsonl`, one line per round): `round`, `evaluation_ms`, +Each clock of the intent (its queries on one interval: a query reading no +variable has its own `EVERY`, a dependent query runs on its upstream's) runs +its own round loop, concurrently; `--intent-rounds` counts the fastest clock's +rounds and every clock covers the same span. The planner's trigger rates are +not read: a dependent query runs in a round iff its bindings are non-empty. + +Output (`rounds.jsonl`, one line per round of each clock): +`round_interval_ms` (the clock), `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`), +(`answered`, `not_triggered`: a binding was empty or an upstream was not +triggered, `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 +after another in round order), `complete` (every member ran or was not +triggered), `met`; a group none of whose members was triggered has no record +that round. 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. diff --git a/data_plane/Cargo.toml b/data_plane/Cargo.toml index edb6161ed..029e8e86e 100644 --- a/data_plane/Cargo.toml +++ b/data_plane/Cargo.toml @@ -37,7 +37,7 @@ 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" } +asap-frontend-sil = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "6167920359627343ce3ac23e2926ca47adf15e11" } # Paused time for the intent loop's latency and overrun tests. tokio = { workspace = true, features = ["test-util"] } control_plane.workspace = true diff --git a/data_plane/src/intent.rs b/data_plane/src/intent.rs index 96dc3f841..73cc98da3 100644 --- a/data_plane/src/intent.rs +++ b/data_plane/src/intent.rs @@ -2,16 +2,21 @@ //! //! An intent is a set of planned queries with dependencies: a downstream //! query reads a variable (`$Y`) bound to the values of one output column of -//! an upstream query's answer. At each round's evaluation time `T` the loop -//! runs the queries in topological order, binds each upstream answer's -//! column values into the downstream queries that read them, skips a query -//! whose binding is empty, and records each query's latency, each latency -//! group's latency, the bindings issued and the answers. +//! an upstream query's answer. Its queries run on one or more clocks: a +//! query reading no variable on its own interval, a downstream query on its +//! upstream's. One round loop runs per clock ([`run_clocks`]): at each +//! round's evaluation time `T` it runs the clock's queries in topological +//! order, binds each upstream answer's column values into the downstream +//! queries that read them, does not trigger a query whose binding is empty +//! (the upstream's result is the trigger), and records each query's +//! latency, each latency group's latency, the bindings issued and the +//! answers. //! //! The planner's intent output ([`IntentPlan`], the SIL contract's final -//! schema v1) is read into the loop's [`IntentSchedule`] -//! ([`IntentSchedule::from_intent_plan`]). No planning happens here: each -//! query is answered by the installed plan, as an HTTP query is. +//! schema) is read into one [`IntentSchedule`] per clock +//! ([`IntentSchedule::per_clock_from_intent_plan`]). No planning happens +//! here, and the planner's trigger rates are not read: each query is +//! answered by the installed plan, as an HTTP query is. //! //! How a bound value reaches the plan is the binding step //! ([`BindMode`]): today the downstream query's answer, grouped by the @@ -62,19 +67,12 @@ pub struct IntentQuery { /// Where each variable it reads is applied. #[serde(default)] pub bind_slots: Vec, - /// Fraction of rounds it runs in; only 1 (every round) is supported. - #[serde(default = "every_round")] - pub rate: f64, /// Skip the query in a round where one of its bindings is empty /// (default true, as the contract requires). #[serde(default = "skip_if_empty")] pub skip_if_empty: bool, } -fn every_round() -> f64 { - 1.0 -} - fn skip_if_empty() -> bool { true } @@ -174,9 +172,7 @@ pub struct IntentLoop { #[serde(rename_all = "snake_case")] pub enum QueryStatus { Answered, - /// A binding it reads was empty: not run. - SkippedEmptyBinding, - /// An upstream query failed or was skipped: not run. + /// An upstream query failed or was skipped for a failure: not run. SkippedUpstream, /// Its run failed or timed out (`error` says which). Failed, @@ -214,7 +210,7 @@ pub struct GroupRecord { /// From the round's start to the last member that ran ending; `None` /// when none ran. pub latency_ms: Option, - /// Whether every member ran. + /// Whether every member ran or was not triggered. pub complete: bool, /// Every member ran and `latency_ms <= max_latency_ms`. pub met: bool, @@ -284,7 +280,6 @@ pub struct PlannedIntentQuery { /// for [`BindMode::ParameterSlot`]. #[serde(default)] pub bind_slots: Vec, - pub rate: f64, pub skip_if_empty: bool, } @@ -306,17 +301,15 @@ pub struct PlannedBindSlot { } impl IntentSchedule { - /// The rounds of the intent `intent_name` of `intent_plan`: each query's - /// text from the plan, and each `output_position` resolved to the - /// column of the upstream root's output schema (its value column: - /// [`VALUE_COLUMN`]). [`BindMode::FilterGroupedResult`] filters on the - /// bound upstream column's name. - pub fn from_intent_plan(intent_plan: &IntentPlan, intent_name: &str) -> anyhow::Result { - let intent = intent_plan - .intent_rounds - .iter() - .find(|intent| intent.intent_name == intent_name) - .ok_or_else(|| anyhow::anyhow!("the plan has no intent {intent_name:?}"))?; + /// The schedule of one clock (`intent_rounds` entry) of `intent_plan`: + /// each query's text from the plan, and each `output_position` resolved + /// to the column of the upstream root's output schema (its value + /// column: [`VALUE_COLUMN`]). [`BindMode::FilterGroupedResult`] filters + /// on the bound upstream column's name. + fn from_planned_clock( + intent_plan: &IntentPlan, + intent: &PlannedIntent, + ) -> anyhow::Result { let plan = &intent_plan.plan; let query_text = |index: usize| { plan.query_texts @@ -392,7 +385,6 @@ impl IntentSchedule { query: query_text(query.query_index)?, depends_on, bind_slots, - rate: query.rate, skip_if_empty: query.skip_if_empty, }) }) @@ -407,19 +399,32 @@ impl IntentSchedule { impl IntentSchedule { /// One schedule per clock of the intent `intent_name`: each of its - /// `intent_rounds` entries, in order. + /// `intent_rounds` entries, in order. Error when it has none. pub fn per_clock_from_intent_plan( intent_plan: &IntentPlan, intent_name: &str, ) -> anyhow::Result> { - Ok(vec![Self::from_intent_plan(intent_plan, intent_name)?]) + let schedules = intent_plan + .intent_rounds + .iter() + .filter(|clock| clock.intent_name == intent_name) + .map(|clock| Self::from_planned_clock(intent_plan, clock)) + .collect::>>()?; + if schedules.is_empty() { + anyhow::bail!("the plan has no intent {intent_name:?}"); + } + Ok(schedules) } } /// The rounds each clock runs so that every clock covers the span of /// `rounds` rounds of the fastest one: `ceil(rounds × min / interval)`. pub fn rounds_per_clock(intervals_ms: &[u64], rounds: u64) -> Vec { - vec![rounds; intervals_ms.len()] + let fastest = intervals_ms.iter().copied().min().unwrap_or(1); + intervals_ms + .iter() + .map(|&interval| (rounds * fastest).div_ceil(interval.max(1))) + .collect() } /// Runs every clock's rounds concurrently from `first_evaluation_ms` and @@ -434,18 +439,26 @@ pub async fn run_clocks( start: Instant, emit: impl FnMut(RoundRecord) + Send, ) { - if let Some(first) = loops.first() { - first - .run_rounds(runner, first_evaluation_ms, rounds, start, emit) - .await; - } + let intervals: Vec = loops + .iter() + .map(|intent| intent.schedule.round_interval_ms) + .collect(); + let emit = std::sync::Mutex::new(emit); + let emit = &emit; + futures::future::join_all(loops.iter().zip(rounds_per_clock(&intervals, rounds)).map( + |(intent, rounds)| { + intent.run_rounds(runner, first_evaluation_ms, rounds, start, move |round| { + (emit.lock().expect("an emit did not panic"))(round) + }) + }, + )) + .await; } impl IntentLoop { /// Checks `schedule` and orders its queries. Refused (bad input): an /// unknown upstream or group member, a variable bound by more than one - /// dependency or read without one, a dependency cycle, or a rate other - /// than 1. + /// dependency or read without one, or a dependency cycle. pub fn new( schedule: IntentSchedule, mode: BindMode, @@ -456,13 +469,6 @@ impl IntentLoop { // Each variable's one binding: (upstream, output column). let mut bound_by: BTreeMap<&str, (&str, &str)> = BTreeMap::new(); for query in queries { - if query.rate != 1.0 { - anyhow::bail!( - "query {}: rate {} is not supported (only 1: every round)", - query.query_id, - query.rate - ); - } for dependency in &query.depends_on { if index_of(&dependency.upstream_query_id).is_none() { anyhow::bail!( @@ -575,6 +581,7 @@ impl IntentLoop { error: None, }; let mut upstream_missing = false; + let mut upstream_not_triggered = false; for dependency in &query.depends_on { let upstream = queries .iter() @@ -587,13 +594,21 @@ impl IntentLoop { binding_values(answer, &dependency.output_column), ); } + None if records[upstream] + .as_ref() + .is_some_and(|r| r.status == QueryStatus::NotTriggered) => + { + upstream_not_triggered = true + } None => upstream_missing = true, } } if upstream_missing { record.status = QueryStatus::SkippedUpstream; - } else if query.skip_if_empty && record.bindings.values().any(BTreeSet::is_empty) { - record.status = QueryStatus::SkippedEmptyBinding; + } else if upstream_not_triggered + || (query.skip_if_empty && record.bindings.values().any(BTreeSet::is_empty)) + { + record.status = QueryStatus::NotTriggered; } else { let started = Instant::now(); let result = tokio::time::timeout( @@ -634,29 +649,40 @@ impl IntentLoop { .schedule .group_latency_ms .iter() - .map(|group| { - let members: Vec> = group + .filter_map(|group| { + let members: Vec = group .query_ids .iter() .map(|id| { let i = queries.iter().position(|q| &q.query_id == id); - ends[i.expect("checked in new")] + i.expect("checked in new") }) .collect(); - let ran: Vec = members.iter().flatten().copied().collect(); + let not_triggered = |&i: &usize| { + records[i] + .as_ref() + .is_some_and(|r| r.status == QueryStatus::NotTriggered) + }; + // No member triggered: no latency sample this round. + if members.iter().all(not_triggered) { + return None; + } + let ran: Vec = members.iter().filter_map(|&i| ends[i]).collect(); let latency_ms = ran.iter().max().map(|&last| millis(last - round_start)); - let complete = ran.len() == members.len(); - GroupRecord { + let complete = members + .iter() + .all(|i| ends[*i].is_some() || not_triggered(i)); + Some(GroupRecord { query_ids: group.query_ids.clone(), max_latency_ms: group.max_latency_ms, latency_ms, complete, met: complete && latency_ms.is_some_and(|l| l <= group.max_latency_ms), - } + }) }) .collect(); RoundRecord { - round_interval_ms: 0, + round_interval_ms: self.schedule.round_interval_ms, round, evaluation_ms: time_ms, status: RoundStatus::Ran, @@ -696,7 +722,7 @@ impl IntentLoop { let mut next = round + 1; while next < rounds && scheduled(next) < ended { emit(RoundRecord { - round_interval_ms: 0, + round_interval_ms: interval_ms, round: next, evaluation_ms: first_evaluation_ms + (next * interval_ms) as i64, status: RoundStatus::Missed, @@ -961,7 +987,6 @@ mod tests { placeholder_values: vec![placeholder(variable)], }) .collect(), - rate: 1.0, skip_if_empty: true, } } diff --git a/data_plane/src/main.rs b/data_plane/src/main.rs index 5b74f09d6..c04a9c238 100644 --- a/data_plane/src/main.rs +++ b/data_plane/src/main.rs @@ -21,7 +21,7 @@ static malloc_conf: &[u8] = b"background_thread:true,dirty_decay_ms:1000,muzzy_decay_ms:0,narenas:8\0"; use data_plane::engine::{EngineOptions, PrecomputeMode}; use data_plane::ingestion::IngestionOptions; -use data_plane::intent::{BindMode, IntentLoop, IntentPlan, IntentSchedule}; +use data_plane::intent::{run_clocks, BindMode, IntentLoop, IntentPlan, IntentSchedule}; use data_plane::persist::ViewRead; use data_plane::{router, DataPlane, DEFAULT_FORWARD_TIMEOUT}; @@ -173,22 +173,25 @@ struct Args { view_read: ViewRead, /// The planner's intent output (`IntentPlan` JSON): its intent /// `--intent-name` is run round by round against the installed plan, - /// beside serving as usual. `--plan` must install its `plan`. + /// one round loop per clock (interval) of the intent, beside serving as + /// usual. `--plan` must install its `plan`. #[arg(long, requires_all = ["intent_first_evaluation_ms", "intent_name"])] intent: Option, /// Which of the output's intents to run. #[arg(long)] intent_name: Option, - /// Where each intent round is written, one JSON line per round: per + /// Where each intent round is written, one JSON line per round of each + /// clock (`round_interval_ms` names it): per /// query its status, latency, bindings and answer; per latency group /// its span. #[arg(long, default_value = "intent_rounds.jsonl")] intent_out: PathBuf, - /// The first round's evaluation time (ms since the epoch); round r - /// evaluates at this + r x the round interval. + /// The first round's evaluation time of every clock (ms since the + /// epoch); round r evaluates at this + r x the clock's interval. #[arg(long)] intent_first_evaluation_ms: Option, - /// How many rounds to run. + /// How many rounds the fastest clock runs; every clock covers the + /// same span. #[arg(long, default_value_t = 10)] intent_rounds: u64, /// How long after its evaluation time (wall clock) a round starts, so @@ -274,12 +277,17 @@ async fn main() -> anyhow::Result<()> { .intent_name .as_deref() .expect("clap requires it with --intent"); - let schedule = IntentSchedule::from_intent_plan(&intent_plan, name)?; - let intent = IntentLoop::new( - schedule, - args.intent_bind_mode, - Duration::from_millis(args.intent_query_timeout_ms), - )?; + // One round loop per clock of the intent. + let clocks = IntentSchedule::per_clock_from_intent_plan(&intent_plan, name)? + .into_iter() + .map(|schedule| { + IntentLoop::new( + schedule, + args.intent_bind_mode, + Duration::from_millis(args.intent_query_timeout_ms), + ) + }) + .collect::>>()?; let first_evaluation_ms = args .intent_first_evaluation_ms .expect("clap requires it with --intent"); @@ -290,8 +298,13 @@ async fn main() -> anyhow::Result<()> { let mut out = std::io::BufWriter::new(std::fs::File::create(&args.intent_out)?); let (state, rounds) = (state.clone(), args.intent_rounds); tokio::spawn(async move { - intent - .run_rounds(&state.engine, first_evaluation_ms, rounds, start, |round| { + run_clocks( + &clocks, + &state.engine, + first_evaluation_ms, + rounds, + start, + |round| { use std::io::Write; let written = serde_json::to_writer(&mut out, &round) .map_err(std::io::Error::from) @@ -300,8 +313,9 @@ async fn main() -> anyhow::Result<()> { if let Err(error) = written { tracing::error!(%error, "writing an intent round"); } - }) - .await; + }, + ) + .await; tracing::info!(rounds, "intent rounds done"); }); } diff --git a/data_plane/tests/intent_rounds.rs b/data_plane/tests/intent_rounds.rs index 0b5f2d178..23f0be8f5 100644 --- a/data_plane/tests/intent_rounds.rs +++ b/data_plane/tests/intent_rounds.rs @@ -152,7 +152,7 @@ async fn round_over_installed_plan_filters_by_upstream_answer() { {"query_id": "q1", "query_index": index(UPSTREAM), "plan_root": plan.dag.roots[index(UPSTREAM)], "output_variables": [null, "R"], "depends_on": [], "bind_slots": [], - "rate": 1.0, "planned_rate": 1.0, "when_condition": null, + "skip_if_empty": false, "accuracy": null, "max_latency_ms": null}, {"query_id": "q2", "query_index": index(DOWNSTREAM), "plan_root": plan.dag.roots[index(DOWNSTREAM)], @@ -160,23 +160,25 @@ async fn round_over_installed_plan_filters_by_upstream_answer() { "depends_on": [{"variable": "R", "upstream_query_id": "q1", "output_position": 1}], "bind_slots": [{"variable": "R", "position": "in_list", "planned_value_count": 1, "placeholder_values": [{"Utf8": "__sil_R_0"}], "plan_node_ids": []}], - "rate": 1.0, "planned_rate": 1.0, "when_condition": null, + "skip_if_empty": true, "accuracy": null, "max_latency_ms": null} ], "group_latency_ms": [{"query_ids": ["q1", "q2"], "max_latency_ms": 60_000.0}] }] })) .unwrap(); - let schedule = IntentSchedule::from_intent_plan(&intent_plan, "triage").unwrap(); + let schedule = IntentSchedule::per_clock_from_intent_plan(&intent_plan, "triage") + .unwrap() + .remove(0); assert_eq!(schedule.queries[0].query, UPSTREAM); assert_eq!(schedule.queries[1].depends_on[0].output_column, "region"); assert_eq!(schedule.queries[1].bind_slots[0].column, "region"); - assert!(IntentSchedule::from_intent_plan(&intent_plan, "other").is_err()); + assert!(IntentSchedule::per_clock_from_intent_plan(&intent_plan, "other").is_err()); // A lightcone query of the planner's is never issued: a round that // lists one is refused. let mut with_lightcone = intent_plan.clone(); with_lightcone.lightcone_query_indices = vec![index(UPSTREAM)]; - let error = IntentSchedule::from_intent_plan(&with_lightcone, "triage").unwrap_err(); + let error = IntentSchedule::per_clock_from_intent_plan(&with_lightcone, "triage").unwrap_err(); assert!(error.to_string().contains("lightcone"), "{error}"); let intent = IntentLoop::new( schedule, @@ -219,7 +221,9 @@ async fn round_over_installed_plan_filters_by_upstream_answer() { // Position 0 of `topk`'s output is its value column. let mut by_value = intent_plan.clone(); by_value.intent_rounds[0].queries[1].depends_on[0].output_position = 0; - let schedule = IntentSchedule::from_intent_plan(&by_value, "triage").unwrap(); + let schedule = IntentSchedule::per_clock_from_intent_plan(&by_value, "triage") + .unwrap() + .remove(0); assert_eq!( schedule.queries[1].depends_on[0].output_column, VALUE_COLUMN diff --git a/data_plane/tests/intent_sil_modes.rs b/data_plane/tests/intent_sil_modes.rs index e5cefff8b..1b55e3c24 100644 --- a/data_plane/tests/intent_sil_modes.rs +++ b/data_plane/tests/intent_sil_modes.rs @@ -161,6 +161,11 @@ fn rows_of(round: &RoundRecord, id: &str) -> Vec<(BTreeMap, f64) /// The planner's plan of [`INTENT`] in `mode`, as the data plane reads it. async fn planned(mode: IntentPlanningMode) -> IntentPlan { + planned_text(INTENT, mode).await +} + +/// The planner's plan of the SIL program `text` in `mode`. +async fn planned_text(text: &str, mode: IntentPlanningMode) -> IntentPlan { let catalog = SqlCatalog::new().with_table("flows", table_schema()); // Declared at production scale, so that keeping state pays off. let data = serde_json::from_value(serde_json::json!({ @@ -174,7 +179,7 @@ async fn planned(mode: IntentPlanningMode) -> IntentPlan { let models = PlanningModels::builtin() .with_deployment_capabilities(&inputs.deployment_capabilities) .with_cost_inputs(&inputs.cost_inputs); - let intents = asap_frontend_sil::parse_intents(INTENT).unwrap(); + let intents = asap_frontend_sil::parse_intents(text).unwrap(); let options = IntentPlanningOptions { mode, ..IntentPlanningOptions::default() @@ -250,7 +255,9 @@ async fn every_planning_mode_answers_exactly_round_by_round() { IntentPlanningMode::IntentFull, ] { let plan = planned(mode).await; - let schedule = IntentSchedule::from_intent_plan(&plan, "triage").unwrap(); + let schedule = IntentSchedule::per_clock_from_intent_plan(&plan, "triage") + .unwrap() + .remove(0); let issued: Vec<&str> = schedule.queries.iter().map(|q| q.query.as_str()).collect(); for &index in &plan.lightcone_query_indices { let lightcone = plan.plan.query_texts[index].trim(); @@ -323,3 +330,55 @@ async fn every_planning_mode_answers_exactly_round_by_round() { state.engine.stop(); } } + +/// The intent on two clocks: q1 (every 10 s) binds the top hosts, q2 +/// counts them per user, triggered whenever q1 binds a host (its planned +/// rate 0.2 is not read here); q3 (every 20 s, reading no variable) takes +/// the largest value per user over every host. +const TWO_CLOCKS: &str = "INTENT triage; +q1 EVERY 10s: ($Y, _) := SELECT host, sum(value) AS s FROM flows + WHERE ts > $now - INTERVAL '100 seconds' GROUP BY host ORDER BY s DESC LIMIT 2 + REQUIRE EXACT; +q2: WITH RATE 0.2 SELECT user, sum(value) AS s FROM flows + WHERE host IN $Y AND ts > $now - INTERVAL '100 seconds' GROUP BY user + REQUIRE EXACT; +q3 EVERY 20s: SELECT user, max(value) AS m FROM flows + WHERE ts > $now - INTERVAL '100 seconds' GROUP BY user + REQUIRE EXACT;"; + +/// Planned jointly, the intent's two clocks become two round loops over +/// one installed plan, each answering exactly at its own evaluation time. +#[tokio::test(flavor = "multi_thread")] +async fn each_clock_runs_its_queries_exactly() { + let tables = tables(); + let plan = planned_text(TWO_CLOCKS, IntentPlanningMode::IntentFull).await; + let schedules = IntentSchedule::per_clock_from_intent_plan(&plan, "triage").unwrap(); + let clocks: Vec<(u64, Vec<&str>)> = schedules + .iter() + .map(|s| { + ( + s.round_interval_ms, + s.queries.iter().map(|q| q.query_id.as_str()).collect(), + ) + }) + .collect(); + assert_eq!(clocks, [(10_000, vec!["q1", "q2"]), (20_000, vec!["q3"])]); + let state = install(&plan, &tables).await; + let loops: Vec = schedules + .into_iter() + .map(|s| IntentLoop::new(s, BindMode::ParameterSlot, Duration::from_secs(30)).unwrap()) + .collect(); + let fast = loops[0].run_round(&state.engine, 0, EVALUATION_MS).await; + assert_eq!(fast.round_interval_ms, 10_000); + let top = exact_q1(&tables, EVALUATION_MS); + assert_answers("q1", &rows_of(&fast, "q1"), "host", &top); + let bound: BTreeSet = top.keys().cloned().collect(); + let exact = exact_per_user(&tables, EVALUATION_MS, &bound, false); + assert_answers("q2", &rows_of(&fast, "q2"), "user", &exact); + let slow = loops[1].run_round(&state.engine, 0, EVALUATION_MS).await; + assert_eq!(slow.round_interval_ms, 20_000); + let every_host: BTreeSet = tables["flows"].iter().map(|r| r.host.clone()).collect(); + let exact = exact_per_user(&tables, EVALUATION_MS, &every_host, true); + assert_answers("q3", &rows_of(&slow, "q3"), "user", &exact); + state.engine.stop(); +} From fb773b89bf3b95ae31d6aec4c1c310abbaed30b9 Mon Sep 17 00:00:00 2001 From: zzylol Date: Thu, 3 Dec 2026 19:29:40 +0000 Subject: [PATCH 5/5] chore: pin ASAPPlanner b9c7fdfa (#1553 head: binder column fix, Int64 exact SUM/MIN/MAX) Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 46 +++++++++++++++++++++---------------------- Cargo.toml | 4 ++-- data_plane/Cargo.toml | 2 +- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 779b151ec..92ede5a0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "asap-accuracy" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", "asap_sketchlib", @@ -344,7 +344,7 @@ dependencies = [ [[package]] name = "asap-cost" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", "asap_sketchlib", @@ -356,7 +356,7 @@ dependencies = [ [[package]] name = "asap-executor" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "ahash", "arrow", @@ -374,7 +374,7 @@ dependencies = [ [[package]] name = "asap-frontend-common" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", "serde", @@ -384,7 +384,7 @@ dependencies = [ [[package]] name = "asap-frontend-metricsql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-frontend-common", "asap-types", @@ -395,7 +395,7 @@ dependencies = [ [[package]] name = "asap-frontend-promql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-frontend-common", "asap-types", @@ -405,7 +405,7 @@ dependencies = [ [[package]] name = "asap-frontend-sil" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", "serde", @@ -415,7 +415,7 @@ dependencies = [ [[package]] name = "asap-frontend-sql" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-frontend-common", "asap-sql-function-catalog", @@ -427,7 +427,7 @@ dependencies = [ [[package]] name = "asap-planner" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-accuracy", "asap-cost", @@ -450,12 +450,12 @@ dependencies = [ [[package]] name = "asap-sql-function-catalog" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" [[package]] name = "asap-stage0-memo" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", ] @@ -463,7 +463,7 @@ dependencies = [ [[package]] name = "asap-stage1-pass1-per-computation-candidates" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", "thiserror 2.0.20", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "asap-stage1-pass2-reuse-candidates" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-accuracy", "asap-types", @@ -482,7 +482,7 @@ dependencies = [ [[package]] name = "asap-stage2-physical-optimization" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-types", ] @@ -490,7 +490,7 @@ dependencies = [ [[package]] name = "asap-stage3-plan-selection" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap-accuracy", "asap-cost", @@ -505,7 +505,7 @@ dependencies = [ [[package]] name = "asap-types" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "asap_sketchlib", "serde", @@ -1647,7 +1647,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2489,7 +2489,7 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "metricsql_common" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "chrono", ] @@ -2497,7 +2497,7 @@ dependencies = [ [[package]] name = "metricsql_parser" version = "0.1.0" -source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=6167920359627343ce3ac23e2926ca47adf15e11#6167920359627343ce3ac23e2926ca47adf15e11" +source = "git+https://github.com/ProjectASAP/ASAPPlanner?rev=b9c7fdfa09f8854d4ae201183637038ee0f6bd36#b9c7fdfa09f8854d4ae201183637038ee0f6bd36" dependencies = [ "ahash", "chrono", @@ -2944,7 +2944,7 @@ dependencies = [ "once_cell", "socket2", "tracing", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3192,7 +3192,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3549,7 +3549,7 @@ dependencies = [ "getrandom 0.4.3", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -4107,7 +4107,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 88898ed76..f0aed1d6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ 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 = "6167920359627343ce3ac23e2926ca47adf15e11" } -asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "6167920359627343ce3ac23e2926ca47adf15e11" } +asap-planner = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b9c7fdfa09f8854d4ae201183637038ee0f6bd36" } +asap-executor = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b9c7fdfa09f8854d4ae201183637038ee0f6bd36" } # 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 # (draft: ASAPPlanner#1553 head, for SIL intents). diff --git a/data_plane/Cargo.toml b/data_plane/Cargo.toml index 029e8e86e..ec7bf0b61 100644 --- a/data_plane/Cargo.toml +++ b/data_plane/Cargo.toml @@ -37,7 +37,7 @@ 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 = "6167920359627343ce3ac23e2926ca47adf15e11" } +asap-frontend-sil = { git = "https://github.com/ProjectASAP/ASAPPlanner", rev = "b9c7fdfa09f8854d4ae201183637038ee0f6bd36" } # Paused time for the intent loop's latency and overrun tests. tokio = { workspace = true, features = ["test-util"] } control_plane.workspace = true