Skip to content

feat(engine): read precomputes from SketchIndex when attached - #159

Merged
zzylol merged 1 commit into
mainfrom
feat/engine-reads-sketch-index
May 13, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/engine-reads-sketch-index

Conversation

@zzylol

@zzylol zzylol commented May 13, 2026

Copy link
Copy Markdown
Contributor

Summary

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 agg_cfg is 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 legacy query_precomputed_output_exact.

Test plan

  • cargo test -p data_plane --lib — 804/806 (2 pre-existing schema_timeline_dispatch failures unrelated).
  • cargo check --workspace clean.

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, the Store trait, StoreOutputSink), retire DualWriteSink's store-side write, and rename SketchIndexSketchStore.

🤖 Generated with Claude Code

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>
@zzylol
zzylol merged commit 7c57f9a into main May 13, 2026
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>
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>
@zzylol
zzylol deleted the feat/engine-reads-sketch-index branch July 17, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant