You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MergeableAccumulator<T>::merge_accumulators(accumulators: Vec<T>) (asap-query-engine/src/data_model/traits.rs) takes a plain, unordered Vec<T>. Every accumulator implemented against it today (Sum, KLL, HLL, CountMinSketch, MinMax, SetAggregator, ...) is commutative/order-insensitive, so this has never mattered.
DeltaSetAggregatorAccumulator breaks that assumption: its correct merge is a chronological fold over added/removed deltas, not a commutative union (see #586). But nothing in the trait signature — or at the call site — distinguishes "this accumulator's merge is order-sensitive" from "this one isn't":
The call site that gathers buckets for merging, merge_precomputed_outputs (asap-query-engine/src/engines/simple_engine/mod.rs), discards each bucket's timestamp before invoking merge (timestamped_buckets.iter().map(|(_, bucket)| bucket.clone_boxed_core())), so by the time any accumulator's merge logic runs, order information is already gone regardless of whether that accumulator type needs it.
There is no marker, trait bound, or naming convention that would make an order-sensitive accumulator's requirements visible to someone adding a new accumulator type, or to someone touching the merge call path.
This is a systemic gap, not specific to DeltaSetAggregator: any future accumulator that needs order-sensitive/stateful-over-time merging (e.g. other "delta"-style accumulators, counter-reset-aware rate tracking, etc.) will silently inherit the same class of bug, because the current interfaces give no way to express or enforce "this accumulator's merge must see buckets in chronological order with timestamps intact."
Related: #586 (the concrete DeltaSetAggregator bugs), #588 (DeltaSetAggregator's tumbling-window requirement, a related but separate contract that's also currently unenforced).
MergeableAccumulator<T>::merge_accumulators(accumulators: Vec<T>)(asap-query-engine/src/data_model/traits.rs) takes a plain, unorderedVec<T>. Every accumulator implemented against it today (Sum, KLL, HLL, CountMinSketch, MinMax, SetAggregator, ...) is commutative/order-insensitive, so this has never mattered.DeltaSetAggregatorAccumulatorbreaks that assumption: its correct merge is a chronological fold overadded/removeddeltas, not a commutative union (see #586). But nothing in the trait signature — or at the call site — distinguishes "this accumulator's merge is order-sensitive" from "this one isn't":merge_precomputed_outputs(asap-query-engine/src/engines/simple_engine/mod.rs), discards each bucket's timestamp before invoking merge (timestamped_buckets.iter().map(|(_, bucket)| bucket.clone_boxed_core())), so by the time any accumulator's merge logic runs, order information is already gone regardless of whether that accumulator type needs it.This is a systemic gap, not specific to DeltaSetAggregator: any future accumulator that needs order-sensitive/stateful-over-time merging (e.g. other "delta"-style accumulators, counter-reset-aware rate tracking, etc.) will silently inherit the same class of bug, because the current interfaces give no way to express or enforce "this accumulator's merge must see buckets in chronological order with timestamps intact."
Related: #586 (the concrete DeltaSetAggregator bugs), #588 (DeltaSetAggregator's tumbling-window requirement, a related but separate contract that's also currently unenforced).