Repository navigation
Conversation
|
Comparing this doc with PR 1213 (memo representation proposal). Four places where the models differ. 1. Accuracy
2. Sketch family
Also: the §2 decision tree shows 3. One operator per candidate
4. Producer variants: stored vs. derived
|
|
Yeah it should be under MemoGroup. |
For this, it has the possibility to not be each operand gets .005.
Yeah, agree, the sketch algorithm should be the candidate dimension. But it is like this PR's way because later if we want to model each operator as one group to avoid duplicated nodes in the plans, and being more flexible about choices, it may be easier to build one group for a sketch algorithm.
I thought per operator is its own group will give us more flexibility. Didn't quite get the example; it seems not to be comparing the same aggregation?
I don't see there is a difference. The difference in representation only comes from storing the producer vs storing the consumer in MemoGroup. |
Sure.
It's not 'PhysicalCandidateId', it's The name of a physical candidate that Stage 2 pruned. It names the pruned candidate by its content instead: They exist for DAG viewer tool to display.
Context comes from these: How often a candidate runs, and so what it costs, depends on its lifetime ℓ:
Row functions: one per constraint family, as see in the overleaf table. We should just call them constraints. |
Both use the same operator enum
Example: G3 = p95 of the KLL state. As an Why a candidate cannot reuse the group's
Two simplifications this question points to, proposed (not yet decided):
|
|
Done:
Kept as
Yes. Renamed to
Agreed. It matches
Agreed. The floor comes from the accuracy needed at that input; for a top-k reader, heap_size ≥ k is part of the same requirement.
Agreed on the meaning, without
Agreed.
Agreed:
Easy (the strictest of several floors of one family is their componentwise maximum), but not added now, because nothing would call it:
It becomes useful with requirement-driven (top-down) enumeration as in #1213; we add
Agreed: |
c298e10 to
2e0ad67
Compare
…y decision tree Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6br9PL4SDeVS1XpezKJ
…idates over existing IR Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… definitions with the code and #1200 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…earlier modeling section Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les per pass and stage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pruning caps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ary coverage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…mination, TimeBound coverage Logical properties are parameters only; tumbling windows are range-free chain groups read through TimeRange/TimeShift and merged by SummaryMerge. Pass 2 order: rollup from the finest common group, top-k reuse, reach and floors (set_input_requirements), dead-candidate elimination with root-cause traces, chain groups, logical edges. SelectionBox keeps only columns, with TimeBound intervals on the timestamp column; aggregate_coverage covers exact Aggregate groups too. evaluation_grid_ms is None without a phase. error_propagation takes a metric (b = 0.1, constant contracts for key-only Filters and abs/clamp/negation); floor_for_cap lives in asap-accuracy. Chain retention need is max(offset + range). Worked examples throughout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
… filtered builds, Stage 2 interface Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…ples Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…in instant queries; unified chain schema; UnivMon list product Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…ntexts, edge costs, one consumer per None producer Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…strongly connected components Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
Summary terminology (family, algorithm, summary type, parameters as
structure only); value sign as a group property; readout required
accuracy replacing parameter floors, with requirement levels for
composed queries and per-metric error bounds in (K); where node, input
and edge quantities live; edge costs in the Stage 3 baseline; Stage 3
builds PlanOutput { plan: PhysicalASAPDAG } with a Selection report;
executor time-indexed store; Stage 2 prune reasons and ingestion /
across-evaluation offers; @ end()/@ start() lifted above the anchored
subtree. asap-primitive-schema terminology table follows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…ries grid, DDSketch sign either way Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
… trait, MemoQuery
theoretical_guarantee and AccuracyEvidence::measured_guarantee take the
required failure probability and return the error bound at it (None when
θ cannot fail that rarely); AccuracyEvidence is a trait with
NoMeasuredGuarantees; a bound is compared through target_limit. The memo
holds its queries as one Vec<MemoQuery> { root, accuracy_target,
values_per_evaluation }, added by add_query(query).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…dates, evaluation grids of groups Count Sketch lists depths 47, 81, 117 and 155 per width (the median-of-rows δ levels 1e-2 … 1e-5); CMS keeps 5, 7, 10, 12. delivers_on takes &PhysicalASAPMemoCandidates, so Materialized(v) reads v. A stored result that is not a chain delivers by GroupProperties::depends_on_evaluation_time and LogicalASAPMemoCandidates::evaluation_grid_of_group, with the sum_over_time(m[5m]) read every 60 s and 120 s example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1M6bq8xVaGKyinf4ohK6q
…r counts, rates, comparisons and readouts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…rt() and merges; lineage and sign share one column layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…n in its refresh window's pipeline; delivers_on in Materialized(v); constraints per execution Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…cross evaluations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…e producers it may read; ingestion time reads one batch of raw data Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…er node, scan read window, @ T without horizon, reads_only_time_series - A candidate passing states on (SummaryMerge, Filter/TimeRange/TimeShift over states) carries the θ of the states it reads, one per θ, and reads only producers with that θ; elimination runs again after chain groups. - The metric rule is applied per edge from the metrics each group's output accepts; a readout whose metric its output does not accept reads no state; a candidate cut off from an input is eliminated too. - ValuesPerEvaluationUnknown: a whole-result δ with n_q unknown prunes the readouts it reaches. - Stage 2 offers no (IngestionTime, None) summary build and no materialized alternative under @ T without a horizon end; QueryTimeResultsNotRetained rejects only (QueryTime, AcrossEvaluations). - Query-time memory is held only while the node computes; query latency is left for later. A query-time Scan reads the largest offset + range of its selected consumers. - GroupProperties::reads_only_time_series. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…L distinct count from the memo's source facts (max_distinct_per_evaluation) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…t's consumers read (no read variable) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WviZ6FUmrMfBTvVbBauNM6
…er-value δ; raw rows a TimeShift materializes at ingestion time are retained like a Scan's
Names and interfaces as the memo code defines them: column_signs, AggregateCoverage / AggregateDefinition / CoverageError::NoCoverage, scanned_sources with Source::is_time_series, validate_expression_over_input_groups, number_of_values_per_query_evaluation, set_candidate_input_requirements; Memo::new(data) stores the data workload's source facts. Two-scope identity: the memo compares definitions with ==, the plan's ViewCoverage::definition_id is the content id of the expanded definition. Value sign: the NonNegative definition and the arithmetic, vector(s), quantile-range and Count Sketch / UnivMon readout rows. Code blocks copy the current definitions; file paths follow the scope layout and stage crates.
…n, sign-bit value signs Sync with the code on main: AggregateCoverage<R> / AggregateDefinition<R> (input) and their derivation in ir/properties/aggregate_coverage.rs, generic over OperatorInput::Reference, with map_references; ViewCoverage on PhysicalASAPDAGNode::view_coverage, built by stages::view_coverage; ValueSign as the IEEE sign bit; Memo::root_groups / queries_rooted_at; Operator::scanned_sources; point_counts_may_flip_sign.
22eef76 to
7eeff73
Compare
…t a grid; no AcrossEvaluations anywhere below an absolute @ T; Stage 2 function name The decision-tree row and the list of values not offered required a known grid for AcrossEvaluations, while the alignment table reads a time-independent result stored across evaluations at any time. The rule now follows the table. The @ T rule covers every group below the anchor (through any operator other than another @), not only the anchor's direct child, with an example. Stage 2's levels 3 and 4 are offered_physical_properties.
Summary
docs/design_docs/concepts/memo-groups-properties-requirements.md(1,821 lines), linked from the concepts index, in the formulation's terms (workloadaccuracy-models.mdandasap-primitive-schema.mdwith it.Review guide
main, rebased onto main69fc34a90(2026-11-10; feat(stage0, types): memo hash-consing, group properties (column_sign, depends_on_evaluation_time, aggregate_coverage), @ end()/@ start() above their subtree (#1207 PR 2) #1230 merged; the 65 doc commits replayed unchanged, so the diff is only this PR's three doc files; previous headsc298e1068and22eef766b, backupsbackup/1224-memo-group-model-c298e1068andbackup/1224-memo-group-model-22eef766b). The doc of the Tracking: implement the optimization formulation (memo candidates, properties, edges y_{u,c,i}, MILP) as named code per stage #1207 stack; the code PRs follow its names and stages. Head7eeff73ba. The doc matches main69fc34a90.asap-primitive-schema.md(family / algorithm / summary type / θ;SketchKindandGroupingStrategyreplaced byFieldDataType::Sketch(SketchAlgorithm), Hydra as an algorithm).accuracy-models.md's HLL distinct-count rule.Behavior: before → after
Documentation only; the "user" is a reviewer or paper author looking up a definition.
OperatorInput, Pass 1Memomethods)column_sign,SummaryCoverage,reads_only_time_series,values_per_evaluation,set_input_requirements) and old paths73785fa07, with their file pathsquantile_over_time(0.9, latency[1h]) / quantile_over_time(0.5, latency[1h]),latencynon-negative: value signUnknown)NonNegative(arithmetic row)max_distinct_per_evaluation9,636 precision 18 meets it; with 1,000,000 (outside the contract) or no bound, no HLL precision does (BelowRequiredAccuracy)Interfaces
None in code. The doc describes target interfaces as Rust sketches (not compilable); each names today's path or the issue that changes it. The code PRs of the stack implement them.
Algorithm changes
None in code. The doc specifies the algorithms the stack implements: Pass 2's reuse rules, dead-candidate elimination, Stage 2's physical expansion, the Stage 3 baseline MILP (with$t$ only on strongly connected components), error propagation and constraint (K), execution contexts, and Appendix A's enumeration of every logical DAG a memo group represents (one producer per consumer input, sharing and cycle checks; inspection tool, not a planning stage).
Decisions and open questions
Needs reviewer decision: None.
Decided:
69fc34a90(feat(stage0, types): memo hash-consing, group properties (column_sign, depends_on_evaluation_time, aggregate_coverage), @ end()/@ start() above their subtree (#1207 PR 2) #1230 merged), commit7eeff73ba:AggregateCoverage<R>/AggregateDefinition<R>(fieldinput, wasinput_group) andCoverageError, derived byOperator::aggregate_coverageinir/properties/aggregate_coverage.rs, generic overOperatorInput::Reference(reference()); the memo usesMemoGroupId;map_references. The sentence "exists only in the memo … no type parameter" is replaced.ViewCoverageonPhysicalASAPDAGNode::view_coverage(plan/physical_asap_dag.rs), built bystages::view_coverage(memo, group), which expands the memo's coverage; the plan does not re-derive it.ValueSignis the IEEE sign bit (-0.0isNonPositive); the arithmetic row states the XOR rationale; the literal row the sign bit;point_counts_may_flip_signfor the Count Sketch / UnivMon readout row.Memo::root_groups/queries_rooted_atmethods;Operator::scanned_sourcesin theOperatorInputand rules blocks.73785fa07), commits2e0ad6735,26ff01626(theSketchParams/parameter_listpath)0b8a365d5(lineage sentence without PR numbers) and22eef766b(no PR or issue numbers left in the concepts docs: the Extension label, the θ row, the lifetime row, Pass 1's intermediate-result sentence, the §4 and §5 headings):column_sign→column_signs;SummaryCoverage→AggregateCoverage(withAggregateDefinition,CoverageError::NoCoverage);reads_only_time_series→scanned_sources+Source::is_time_series; node-rule check →validate_expression_over_input_groups;values_per_evaluation→number_of_values_per_query_evaluation;set_input_requirements→set_candidate_input_requirements;CandidateError::Schema→NotValidOverInputGroups.Memo::new(data)stores the data workload's source facts at construction ("collects the facts of the sources the queries scan" deleted).AggregateDefinitionwith==; the plan'sViewCoverage::definition_idis the content id of the expanded definition (no group or node ids). The "executor reads onlydefinition_id" sentence and the plan node'ssummary_coveragefield are replaced accordingly.NonNegative= every non-NaN value ≥ 0; new rows for arithmetic (scalar and vector, one rule),vector(s), quantile only for 0 ≤ q ≤ 1, Count Sketch / UnivMon point-count and top-k readoutsUnknown(Count-Min keeps its sign); every row checked againstcolumn_properties.rsat73785fa07(added:absent_over_time, join / set-op / relabel / window rows, constant-weight states, readouts that drop the state layout).MemoGroup,GroupProperties,AggregateDefinition,AggregateCoverage,Memo,MemoQuery,OperatorInput,MemoGroupAsInput, Pass 1'sMemomethods,CandidateError) copy the73785fa07definitions; file paths follow the scope layout and stage crates.Memo::max_distinct_per_evaluationandGroupProperties::column_lineageare marked not yet in the code.SourceColumntype it named was removed).ErrorPropagationanderror_propagation(consumer, metric)(§4) as the source of the propagation factors β and the per-input validity caps. Current form:ErrorPropagation { factor_per_input: Vec<f64>, validity_cap_per_input: Vec<Option<f64>> };Nonewhen the consumer has no error contract for the metric (no factor guessed). Example:error_propagation(Divide, Relative)=Some { factor_per_input: [1.111, 1.111], validity_cap_per_input: [None, Some(0.1)] }; absolute and rank returnNone.Scanexecution reads the most its context's consumers read, with no read variable (A5);@ Twithout a horizon gives no materialized candidate (A7); HLL distinct count from the memo's source facts (A6); Pass 2 δ levels continue in powers of ten below the per-value δ (D1); raw rows aTimeShiftmaterializes at ingestion time are retained like aScan's (D3).Verification
crates/…path in the doc checked to exist at73785fa07(exceptReaderConstraint's former path, marked former).git diff --stat origin/mainlists onlyconcepts/README.md,concepts/accuracy-models.mdand the new concepts doc.Tests, screenshots and measurements: not applicable.
Follow-ups