feat(post-asap): compose exact operators with summary plans across explicit update/readout boundaries (#171) - #300
feat(post-asap): compose exact operators with summary plans across explicit update/readout boundaries (#171)#300zzylol wants to merge 1 commit into
Conversation
|
Current-main integration review: this PR is not ready to merge as-is after #295 and #299. The conflict is architectural rather than mechanical. #295 now owns the canonical recurrence vocabulary ( |
…ase boundaries (#171) Add phase-explicit post-ASAP nodes SummaryExpr::{ExactTransform, ExactPostProcess} carrying a non-exhaustive ExactOperator::Aggregate payload (never an intact QueryExpr subtree), plus an ExecutionAvailability {UpdateValue, SummaryState, ReadoutValue} derivation/validation (post_asap::phase) returning typed PhaseErrors at construction. construct_summary_agg now validates its edge, so a maintained summary over a query-time readout falls back conservatively instead of producing an unexecutable plan. Add ExactCompositionStrategy (registered in default_strategies) proposing Replacement::ExactComposition candidates that reference the child target rather than selecting a child; PlanSpace::global_selection commits the compatible parent/child pair using the issue's cost-units-per-second formulas (postprocess/pretransform vs raw-recompute baseline), counts shared child state once, and GlobalSelection::materialize links the committed decisions into one validated DAG with shared Rc identity. Cost hooks: CostModel::mixed_execution_capabilities and exact_composition_cost_inputs (unknowns stay None, never zero; missing statistics keep KeepPreAsap). DAG export gains explicit per-node stage, decision provenance, cost unit and child-decision links (additive). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aafad16 to
07ad2fa
Compare
Implements #171 on top of the end-to-end accuracy work merged in #303.
Summary
This PR adds explicit mixed exact/summary execution boundaries to the post-ASAP IR:
ExactTransform: an exact operator on the update path whose plain output may feed maintained summary state.ExactPostProcess: an exact operator over a finalized summary readout.Integration with #303 accuracy guarantees
The rebased implementation treats phase legality and accuracy legality as independent requirements, in this order:
An exact operator no longer erases an approximate child's guarantee:
sumuses the existingExactSumpropagation rule;min,max, and the supported exact average fold retain the modeled input error magnitude and conservatively compose failure probability through the existing extremum-style union-bound rule;AccuracyErrorinstead of being labeled exact;SummaryNode.guaranteeis preserved through relinking/materialization and exported alongside the execution stage. The global selector also retains #303 accuracy-reconciliation use propagation while adding exact-composition child commitments, and retains recurrence-aware CSE decisions.Phase model
SummaryAgg.childacceptsUpdateValueor supported exact-accumulator state, neverReadoutValue.SummaryEstimate:SummaryState -> ReadoutValue.ExactTransform:UpdateValue -> UpdateValue.ExactPostProcess:ReadoutValue -> ReadoutValue.ExactTransformcannot be a final root.KeepPreAsapreceives its phase from the validated incoming edge; incompatible shared uses are rejected as ambiguous.When ordinary summary construction encounters a phase conflict, the strategy reports one conservative
KeepPreAsapcandidate. Accuracy-rejected candidates remain recorded as rejections and are not confused with phase fallback.Selection and cost
A composition stores the child target rather than selecting a child locally.
PlanSpace::global_selectionevaluates compatible child candidates, commits the chosen pair, accounts for shared state, and compares a known cost-units-per-second rate with raw recomputation. Unknown cost inputs do not become zero and cannot make a composition win.GlobalSelection::materializethen links the selected groups into one phase-validated DAG and memoizes each target, so multiple parents share the same materialized child.Verification
cargo check --workspace— passed after rebase.cargo test -p asap-integration-tests --test exact_composition— 11 passed.cargo test --workspaceattempt was interrupted byNo space left on devicewhile linking the repository's broad test/binary matrix; no test assertion or source compilation failure preceded the environment error.Deferred
ExactOperatorpayloads beyondAggregate.