Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
60b8c13
feat(ir): define joint summary observation coverage
zzylol Oct 3, 2026
c788556
refactor(ir): name represented observations ObservationExtent
zzylol Oct 3, 2026
17173ea
refactor(ir): rename observation extent to SummaryCoverage and trim i…
zzylol Oct 3, 2026
f968661
docs(ir): describe coverage source as any observation data source
zzylol Oct 3, 2026
6f129a0
feat(ir): require coverage on summary nodes; allow regions without ti…
zzylol Oct 3, 2026
feca0d5
docs: explain the summary coverage problem with examples
zzylol Oct 3, 2026
ea7e659
refactor(ir): keep only time and population in SummaryCoverage
zzylol Oct 3, 2026
3fb464b
refactor(cost): rename SourceCoverage to ScanSelection
zzylol Oct 3, 2026
6b6dff9
docs: turn summary coverage into a design document
zzylol Oct 3, 2026
e529855
docs: design doc for ASAP primitive schema and summary semantics
zzylol Oct 3, 2026
cb055c6
Update asap-primitive-schema.md
zzylol Oct 3, 2026
4a4627f
Update asap-primitive-schema.md
zzylol Oct 3, 2026
0febdae
Update asap-primitive-schema.md
zzylol Oct 3, 2026
d113b3a
Update asap-primitive-schema.md
zzylol Oct 3, 2026
87b4635
docs: add code interfaces and per-operator examples to the ASAP primi…
zzylol Oct 3, 2026
02833d1
docs: move the ASAP primitive schema design to #573
zzylol Oct 3, 2026
1653cb4
feat(ir): define compatible logical summary merges
zzylol Oct 3, 2026
182160a
feat(ir): require disjoint coverage for summary merges
zzylol Oct 3, 2026
05df2fb
refactor(ir): use SummaryCoverage names in summary merges
zzylol Oct 3, 2026
9440d33
feat(ir): check merge update/reduction on producers; test documented …
zzylol Oct 3, 2026
a116058
test(ir): point coverage examples at the design document
zzylol Oct 3, 2026
f2b7b3f
test(ir): point coverage examples at the ASAP primitive schema design…
zzylol Oct 3, 2026
a9da6df
feat(ir): add logical sub-DAG sharing and phase-free export
zzylol Oct 3, 2026
bf148a1
feat(ir): require summary coverage in logical transport
zzylol Oct 3, 2026
4a48b04
test(ir): use typed coverage source in logical export
zzylol Oct 3, 2026
3e9b01e
docs(ir): describe logical export as having no execution timing assigned
zzylol Oct 3, 2026
fa9c414
feat(ir): export a query batch as one DAG with one root per query
zzylol Oct 3, 2026
ba05ce8
feat: lower SQL through unified operators and scalars
zzylol Oct 2, 2026
c664f59
fix: integrate with #614 (DataFusion 54) in the unified SQL lowering
zzylol Oct 5, 2026
13e9585
feat(promql): lower queries to unified operator and scalar IR
zzylol Oct 2, 2026
e5d3cff
feat(ir): restore execution timing assignment for physical plans
zzylol Oct 3, 2026
59c30ac
feat(ir): export timed plans as PhysicalASAPDAG
zzylol Oct 3, 2026
70ee3ff
feat(runtime): compile unified operator and scalar graphs
zzylol Oct 2, 2026
c818819
feat(ir): give physical ASAP DAGs one root per batch query
zzylol Oct 3, 2026
672a187
fix: integrate with #614 (DataFusion 54): let chrono resolve to DF 54…
zzylol Oct 5, 2026
6272362
refactor(planner): plan one shared unified workload DAG
zzylol Oct 3, 2026
0dd65e7
feat(planner): declare whole-source coverage on planned summary states
zzylol Oct 3, 2026
0c62c4a
feat(planner): export a planned workload as one physical ASAP DAG
zzylol Oct 3, 2026
8a49e06
refactor(ir): remove the legacy QueryExpr and SummaryExpr IRs
zzylol Oct 3, 2026
5be51a2
docs: describe the unified operator IR instead of the removed legacy IRs
zzylol Oct 3, 2026
8238723
chore(tools): align the DAG viewer with the unified operator kinds
zzylol Oct 3, 2026
b00817e
refactor(planner): remove the summary maintenance lifecycle
zzylol Oct 3, 2026
68df715
refactor(ir): default to query-time materialization
zzylol Oct 3, 2026
d83ad48
docs: drop the summary maintenance lifecycle and document the query-t…
zzylol Oct 3, 2026
10ef511
chore(tools): name OperatorNode in viewer comments
zzylol Oct 3, 2026
2c6a4b1
feat(planner): enumerate phase-free local logical alternatives
zzylol Oct 3, 2026
849e483
docs(planner): say local candidates have no execution timing assigned
zzylol Oct 3, 2026
488c6eb
test(planner): call the promoted PromQL workload lowering
zzylol Oct 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
14 changes: 14 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"crates/asap-physical-operators",
"crates/types",
"crates/frontend-common",
"crates/sql-function-catalog",
"crates/asap-aware-mapping",
"crates/frontend-promql",
Expand Down
6 changes: 2 additions & 4 deletions crates/asap-aware-mapping/src/accuracy/composition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,7 @@ fn composed_provenance(
}

pub(super) fn exact_operation_rule(operation: &ExactOperation) -> Option<CompositionOperator> {
let ExactOperation::Aggregate { measures, .. } = operation else {
return None;
};
let ExactOperation::Aggregate { measures, .. } = operation;
match measures.as_slice() {
[intent] => crate::function_rules::function_rules(intent).map(|rules| rules.accuracy),
// The remaining functions are exact over exact samples, but have
Expand Down Expand Up @@ -1035,8 +1033,8 @@ mod tests {
reduction: asap_types::pre_asap::Reduction::PerEntity,
measures: vec![intent],
output_names: vec![],
having: None,
filters: vec![],
having: None,
};
assert_eq!(
DefaultAccuracyModel.exact_operation_rule(&operation(AggIntent::Rate)),
Expand Down
2 changes: 1 addition & 1 deletion crates/asap-aware-mapping/src/accuracy/estimators/cms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mod tests {
}

#[test]
fn heap_readout_retains_frequency_metric() {
fn heap_evaluation_retains_frequency_metric() {
use asap_types::post_asap::{GroupingStrategy, SketchKind};
let cms_heap = SketchParams::CmsWithHeap {
width: 272,
Expand Down
8 changes: 4 additions & 4 deletions crates/asap-aware-mapping/src/accuracy/estimators/hll.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Estimator-specific confidence for classic HLL's linear-counting branch.
//!
//! This is conditional on independent uniform bucket hashes and an enforced
//! upper bound on distinct items in the complete readout population (including
//! upper bound on distinct items in the complete evaluation population (including
//! all merged panes). It is not an RSE-to-normal conversion or an ERP fit.

use super::*;
Expand Down Expand Up @@ -56,13 +56,13 @@ impl ClassicHllConfidence {
value: self.relative_error,
},
failure_probability: ProbabilityExpr::Constant { value: delta },
provenance: vec![GuaranteeSource::SketchReadout {
provenance: vec![GuaranteeSource::SketchEvaluation {
algorithm: "Hll".into(),
contract: "classic_hll_linear_counting_collision_bound_v1".into(),
params: serde_json::json!({"precision": precision,
"max_distinct": self.max_distinct, "relative_error": self.relative_error,
"hash_assumption": "independent_uniform_buckets",
"population_scope": "complete_readout_including_merged_panes"}),
"population_scope": "complete_evaluation_including_merged_panes"}),
query: "Cardinality".into(),
}],
})
Expand Down Expand Up @@ -187,7 +187,7 @@ mod tests {
}
}
}
/// The model's readout formula matches the actual classic estimator after merge.
/// The model's evaluation formula matches the actual classic estimator after merge.
#[test]
fn native_classic_estimator_and_merged_registers_use_the_same_contract() {
use asap_sketchlib::sketches::hll::{Classic, HyperLogLogP16};
Expand Down
2 changes: 1 addition & 1 deletion crates/asap-aware-mapping/src/accuracy/estimators/kll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mod tests {
assert_eq!(g.approximate_layer_count(), 1);
assert!(g.provenance.iter().any(|source| matches!(
source,
GuaranteeSource::SketchReadout { contract, .. }
GuaranteeSource::SketchEvaluation { contract, .. }
if contract == "apache_datasketches_kll_empirical_99_a9b42755072b"
)));
}
Expand Down
6 changes: 3 additions & 3 deletions crates/asap-aware-mapping/src/accuracy/estimators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn bounded_guarantee(
metric,
bound: BoundExpr::Constant { value: bound },
failure_probability: delta,
provenance: vec![GuaranteeSource::SketchReadout {
provenance: vec![GuaranteeSource::SketchEvaluation {
algorithm: format!("{algorithm:?}"),
contract: contract.into(),
params: serde_json::to_value(params).unwrap_or(serde_json::Value::Null),
Expand Down Expand Up @@ -169,9 +169,9 @@ impl<'a> EstimatorAccuracy<'a> {

fn hll(&self) -> Option<hll::ClassicHllConfidence> {
let EstimatorContract::ClassicHll {
max_distinct_per_readout,
max_distinct_per_evaluation,
} = self.contract?;
hll::ClassicHllConfidence::new(max_distinct_per_readout, self.epsilon)
hll::ClassicHllConfidence::new(max_distinct_per_evaluation, self.epsilon)
}

pub(crate) fn size_params(&self, algorithm: &SketchAlgorithm) -> Option<SketchParams> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! UnivMon currently certifies only its exact unit-update total readout.
//! UnivMon currently certifies only its exact unit-update total evaluation.
use super::*;

pub(super) fn guarantee(query: &SketchStatistic) -> Option<ResultGuarantee> {
Expand Down
25 changes: 8 additions & 17 deletions crates/asap-aware-mapping/src/accuracy/evidence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
use super::*;

/// A trusted source assertion scoped by `AccuracyEvidenceProvider` to one
/// complete readout. Choosing this variant asserts the estimator and hash
/// complete evaluation. Choosing this variant asserts the estimator and hash
/// assumptions; it must not be inferred from sampled population statistics.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EstimatorContract {
/// Classic HLL with independent uniform bucket hashing, including merged panes.
ClassicHll { max_distinct_per_readout: u32 },
ClassicHll { max_distinct_per_evaluation: u32 },
}

/// An enforced domain for every sample of a direct quantile operand, in every
Expand All @@ -18,7 +18,7 @@ pub enum EstimatorContract {
pub struct QuantileInputDomain {
pub lower: f64,
pub upper: f64,
/// Upper bound on samples per evaluation, matching the pinned readout's
/// Upper bound on samples per evaluation, matching the pinned evaluation's
/// exact Float64 rank limit. The population must also be nonempty.
pub max_samples: u64,
pub contract: String,
Expand Down Expand Up @@ -87,31 +87,22 @@ pub struct PropagationStats {
/// Supplies typed planning-time evidence required by propagation rules.
pub trait AccuracyEvidenceProvider {
/// Trusted estimator contract for this complete aggregate expression,
/// including source, filters, grouping and all panes in each readout.
/// including source, filters, grouping and all panes in each evaluation.
/// An observed cardinality is not an enforced population bound.
fn estimator_contract(
&self,
_expression: &asap_types::pre_asap::QueryExpr,
) -> Option<EstimatorContract> {
fn estimator_contract(&self, _expression: &OperatorNode) -> Option<EstimatorContract> {
None
}

/// Enforced upper bound on distinct (partition, item) identities across a
/// complete TopK readout. Used to union-bound score errors for adaptively
/// complete TopK evaluation. Used to union-bound score errors for adaptively
/// selected candidates. Observed cardinality is not sufficient evidence.
fn topk_max_distinct_items(
&self,
_expression: &asap_types::pre_asap::QueryExpr,
) -> Option<u64> {
fn topk_max_distinct_items(&self, _expression: &OperatorNode) -> Option<u64> {
None
}

/// Proof scoped to this complete quantile expression, including its source,
/// filters, grouping and window. `None` means unknown, including emptiness.
fn quantile_input_domain(
&self,
_operand: &asap_types::pre_asap::query_expr::QueryExpr,
) -> Option<QuantileInputDomain> {
fn quantile_input_domain(&self, _operand: &OperatorNode) -> Option<QuantileInputDomain> {
None
}

Expand Down
12 changes: 7 additions & 5 deletions crates/asap-aware-mapping/src/accuracy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ pub use evidence::{
QuantileInputDomain, WorkloadAccuracyEvidence,
};

use asap_types::ir::OperatorNode;
use asap_types::post_asap::{
AccuracyError, BoundExpr, CompositionOperator, ErrorMetric, ExactOperation, FieldDataType,
GuaranteeSource, ProbabilityExpr, ResultGuarantee, SketchAlgorithm, SketchParams,
SketchStatistic,
AccuracyError, BoundExpr, CompositionOperator, ErrorMetric, FieldDataType, GuaranteeSource,
ProbabilityExpr, ResultGuarantee, SketchAlgorithm, SketchParams, SketchStatistic,
};
use asap_types::types::AccuracyTarget;

use crate::exact_composition::ExactOperation;

/// The deployment-extensible accuracy algebra. `asap-aware-mapping` ships
/// [`DefaultAccuracyModel`]; a deployment with a proof for a composition the
/// default rejects (a registered cross-metric conversion, say) implements
/// this trait and passes it to
/// [`crate::replacement::SketchAlgorithmStrategy::new_with_planning_inputs`].
/// [`crate::replacement::ASAPStrategies::new_with_planning_inputs`].
pub trait AccuracyModel {
/// The definition-registered rule for applying `operation` to an
/// approximate input. `None` means the function is exact only over exact
Expand Down Expand Up @@ -78,7 +80,7 @@ pub struct DefaultAccuracyModel;
const SATISFACTION_TOLERANCE: f64 = 1e-9;

impl DefaultAccuracyModel {
/// Derive the guarantee for the committed estimator parameters and readout.
/// Derive the guarantee for the committed estimator parameters and evaluation.
pub fn sketch_guarantee(
algorithm: &SketchAlgorithm,
params: &SketchParams,
Expand Down
Loading