Commit a3011ca
fix(query-engine): give range-query merges the CMS/KLL batch fast path (#614)
* fix(query-engine): give range-query merges the CMS/KLL batch fast path (#596)
NaiveMerger::merge_all (range path) only did a sequential merge_with
fold, never the merge_multiple batch fast path that
SimpleEngine::merge_accumulators (instant path) already had for
CountMinSketch/DatasketchesKLL. The two folds also disagreed on error
handling: SimpleEngine's warned and silently kept the partial result,
NaiveMerger's aborted via `?`.
Extract the shared "try batch merge, else fold" logic into
engines::merge_utils::merge_accumulators_batch and have both callers
delegate to it, so both now take the fast path and both abort on the
first merge_with failure instead of one of them dropping data
silently. Adds AccumulatorError::MergeFailed for the new abort case.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDS34V2EexpbihCfH9SDWh
* fix(query-engine): restore move-based single-accumulator path, dedupe test fixtures
Two follow-ups from review of the #596 fix:
- merge_accumulators_batch always cloned the first accumulator, even
for the common single-bucket case, regressing the move-based
shortcut SimpleEngine::merge_accumulators had before this refactor.
Restore it at the call site (NaiveMerger can't do the same since it
merges from a borrowed Vec it keeps for the next slide()).
- The new regression tests duplicated PoisonableAccumulator,
cms_from_matrix, and oracle_sequential_fold verbatim between
window_merger.rs and simple_engine/mod.rs; moved them into
tests::test_utilities::merge_fixtures, shared by both.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDS34V2EexpbihCfH9SDWh
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 313c386 commit a3011ca
7 files changed
Lines changed: 1023 additions & 56 deletions
File tree
- asap-query-engine/src
- engines
- simple_engine
- precompute_operators
- tests/test_utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
0 commit comments