feat(engine): read precomputes from SketchIndex when attached - #159
Merged
Merged
Conversation
Phase 5 M2.3.5b — `ASAPQueryEngine::execute_store_query` now prefers `SketchIndex::query_precomputes_by_agg` (sid-keyed) over the legacy `Store::query_precomputed_output*` (agg_id-keyed) whenever a `SketchIndex` is attached AND the agg config resolves. `DualWriteSink` (M2.3.4b) mirrors precompute writes to both stores, so the data is identical; this just moves the READ side off the legacy store. Production deploys (which always attach a SketchIndex) now read precomputes from `SketchIndex`. Tests without a SketchIndex keep the legacy read path; eviction races where the agg_cfg is gone from the snapshot also fall back to the legacy store. For sliding-window mode (`is_exact_query: true`), the SketchIndex range result is post-filtered to bit-exact `(start, end)` match — recovers the same semantics as the legacy `query_precomputed_output_exact`. 804/806 lib tests pass (2 pre-existing `schema_timeline_dispatch` failures unrelated to this change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
zzylol
added a commit
that referenced
this pull request
May 13, 2026
…hIndex only (#160) Phase 5 M2.3.6a — first step of the SketchStore retirement. The production OutputSink is now `SketchIndexSink` (renamed and slimmed-down successor to `DualWriteSink` from PR #156); it writes ONLY to `SketchIndex` via `append_precompute`. The legacy `SketchStore` agg_id-keyed write path is gone from `main.rs`. Reads have already migrated to `SketchIndex` in PR #159 (M2.3.5b), so the legacy store no longer participates in either side of the ingest / query loop. The `Store` trait, `store/{global,per_key, common}.rs`, and the eviction service still exist; subsequent M2.3.6 sub-PRs delete them and rename `SketchIndex → SketchStore`. Test fixtures and the schema eviction service kept their existing `Store` plumbing untouched (so this PR's blast radius stays contained). 804/806 lib tests pass — the 2 pre-existing `schema_timeline_dispatch` failures predate this change. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
zzylol
added a commit
that referenced
this pull request
May 13, 2026
…166) Phase 5 M2.3.6f — `ASAPQueryEngine::execute_store_query` now reads precomputes from `SketchIndex` exclusively. The legacy `Store::query_precomputed_output*` fallback (introduced in M2.3.5b PR #159 as a safety net) is gone now that the M2.3.6e backfill + M2.3.4 live-ingest paths both mirror writes into `SketchIndex` and `schema_timeline_dispatch_tests`'s `seed_sum_at` helper does too. The Engine's `Arc<dyn Store>` field stays for now (many tests still pass one); it's just unused on the read path. Subsequent M2.3.6 sub-PRs delete the field and the legacy `store/{global,per_key, common}.rs` modules. Test fixture migration: `schema_timeline_dispatch_tests`'s `build_engine` + `seed_sum_at` helpers take a `SketchIndex` Arc and mirror writes via the canonical `SketchIndex::ingest_precompute_for_agg_config` helper introduced in M2.3.6e. The three tests that previously appeared as "pre-existing failures" (because their fixtures never attached a SketchIndex) now pass cleanly: 811/811 lib tests green, zero failures. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 5 M2.3.5b —
ASAPQueryEngine::execute_store_querynow prefersSketchIndex::query_precomputes_by_agg(sid-keyed) over the legacyStore::query_precomputed_output*(agg_id-keyed) whenever aSketchIndexis attached AND the agg config resolves.DualWriteSink(M2.3.4b) mirrors precompute writes to both stores, so the data is identical; this just moves the READ side off the legacy store. Production deploys (which always attach a SketchIndex) now read precomputes fromSketchIndex. Tests without a SketchIndex keep the legacy read path; eviction races whereagg_cfgis gone from the snapshot also fall back.For sliding-window mode (
is_exact_query: true), the range result is post-filtered to bit-exact(start, end)match — recovers the same semantics as the legacyquery_precomputed_output_exact.Test plan
cargo test -p data_plane --lib— 804/806 (2 pre-existingschema_timeline_dispatchfailures unrelated).cargo check --workspaceclean.What's next
M2.3.6 — once the new read path is verified in production, delete the legacy SketchStore (
store/{global,per_key,common}.rs, theStoretrait,StoreOutputSink), retireDualWriteSink's store-side write, and renameSketchIndex→SketchStore.🤖 Generated with Claude Code