Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1df3d47
refactor: define every stage's interfaces from #1207 and delete the o…
zzylol Nov 6, 2026
99245c1
refactor(types): CandidateForMemoGroupId.index -> index_in_group
zzylol Nov 6, 2026
940c88b
refactor(types): drop the physical schedule σ; PhysicalProperties { t…
zzylol Nov 6, 2026
cb6e9e1
refactor(types): theta must be listed, floors need not be; satisfies_…
zzylol Nov 6, 2026
ed44fc2
refactor(plan-selection): one evaluation context per schedule
zzylol Nov 6, 2026
9416f44
refactor(types): rename the #1207 interfaces as agreed (2026-11-06)
zzylol Nov 6, 2026
b05cec1
refactor(types): execution contexts reuse the workload's recurrence
zzylol Nov 6, 2026
868d2f8
refactor: naming sweep for the #1207 unit
zzylol Nov 6, 2026
f4c0397
refactor(types): Memo methods return Result; CandidateError (#1207 PR 0)
zzylol Nov 6, 2026
98f4eb2
refactor: Memo groups private behind groups(); Stage 0 through the Me…
zzylol Nov 6, 2026
f104f6f
refactor(types): a memo group is its expression and GroupProperties; …
zzylol Nov 6, 2026
0fe71dd
refactor(accuracy): delete size_for_all_readers and its shared-size h…
zzylol Nov 6, 2026
2a04c9f
refactor(types): InputOrTemporaryBuild; subquery groups in unlifted o…
zzylol Nov 6, 2026
ac7273d
refactor(types): 2026-11-07 interfaces: chains without a window count…
zzylol Nov 7, 2026
8a98866
refactor(types): IntervalConstraintLimit ends for Constraint::Interva…
zzylol Nov 7, 2026
31f25bb
refactor(types): PromQL ranges are (t - r, t] in the interval example…
zzylol Nov 8, 2026
0d992a1
refactor(types): 2026-11-08 interfaces: summary types, required accur…
zzylol Nov 8, 2026
d82c149
refactor(types): guarantees at a failure probability, AccuracyEvidenc…
zzylol Nov 9, 2026
5587607
refactor: delete Pass 1's test-support whole-workload composition and…
zzylol Nov 9, 2026
61541f7
test(sql): lower main's new ClickHouse tests without the removed accu…
zzylol Nov 10, 2026
fe1473c
refactor: organize the stage types by scope; name the memo query and …
zzylol Nov 10, 2026
7030d68
refactor: organize asap-types, asap-accuracy and asap-cost by scope (…
zzylol Nov 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 0 additions & 11 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/accuracy/src/budget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! step's slack. A lone approximate denominator over an exact numerator is
//! sized for the whole target, so its quotient's bound `ε/(1 − ε)` misses
//! it. Only equal splits are made.
use super::*;
use asap_types::accuracy::{AccuracyMetric, AccuracyTarget};

/// The target of one of `approximate_inputs` approximate inputs that
/// compose into a value with `target`, split equally in `metric`'s
Expand Down
16 changes: 13 additions & 3 deletions crates/accuracy/src/composition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
//! Stage 1 composes each candidate's guarantees with them
//! (`per_computation_candidates`); a rule that needs a statistic leaves an
//! `Unknown` leaf named by one of the constants below, which Stage 3 binds.
use super::*;
use asap_types::accuracy::{
AccuracyError, AccuracyGuarantee, AccuracyMetric, BoundExpr, CompositionOperator,
GuaranteeSource, ProbabilityExpr,
};

#[cfg(test)]
use crate::requirements::meets;
use crate::PropagationStats;

/// Rows an exact aggregation folds (per group): bounded by the series
/// count of the sources the query reads.
Expand Down Expand Up @@ -485,7 +492,10 @@ fn exact_division(

/// Whether `guarantee` is a sketch's distinct-count estimate.
fn estimates_distinct_count(guarantee: &AccuracyGuarantee) -> bool {
let cardinality = format!("{:?}", asap_types::ir::schema::SketchStatistic::Cardinality);
let cardinality = format!(
"{:?}",
asap_types::summary_type::SketchStatistic::Cardinality
);
guarantee.provenance.iter().any(|source| {
matches!(source, GuaranteeSource::SketchEvaluation { query, .. } if *query == cardinality)
})
Expand Down Expand Up @@ -1135,7 +1145,7 @@ mod tests {
s,
GuaranteeSource::UnavailableStatistic { statistic } if statistic == "input_row_count"
)));
assert!(!satisfies(&out, &AccuracyTarget::max_error(1.0)));
assert!(!meets(&out, 1.0, None));

let known = PropagationStats {
input_row_count: Some(4),
Expand Down
32 changes: 32 additions & 0 deletions crates/accuracy/src/error_propagation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! Each operator's local error propagation: the linear bound $g_c$ on a
//! consumer's output error from its inputs' errors (concepts doc, section 4).

use asap_types::accuracy::AccuracyMetric;
use asap_types::ir::Operator;
use asap_types::stages::MemoGroupId;

/// $g_c$'s linear bound for errors in `metric`, each input's and the
/// output's: $\beta_{c,i}$ and $b_{c,i}$ per input, read from the
/// operator and its arguments. `None` when the consumer has no error
/// contract for `metric`: an input whose error is in `metric` then gives
/// no edge (the metric rule). No factor is guessed.
pub fn error_propagation(
consumer: &Operator<MemoGroupId>,
metric: AccuracyMetric,
) -> Option<ErrorPropagation> {
let _ = (consumer, metric);
todo!("#1207 PR 4: the error contract of each operator, per metric")
}

/// The local error propagation of one consumer: its output error is at
/// most $\sum_i \beta_{c,i}\varepsilon_{c,i}$ while each input's error stays
/// within its validity cap (concepts doc, section 4; approved 2026-11-05).
#[derive(Debug, Clone, PartialEq)]
pub struct ErrorPropagation {
/// $\beta_{c,i}$ per input, for that input's metric.
pub factor_per_input: Vec<f64>,
/// $b_{c,i}$ per input: the cap under which the linear bound holds;
/// `None` when the bound holds everywhere (e.g. a ratio caps only its
/// denominator).
pub validity_cap_per_input: Vec<Option<f64>>,
}
Loading
Loading