refactor: migrate to asap_sketchlib module-restructure layout#335
Open
GordonYuanyc wants to merge 4 commits into
Open
refactor: migrate to asap_sketchlib module-restructure layout#335GordonYuanyc wants to merge 4 commits into
GordonYuanyc wants to merge 4 commits into
Conversation
asap_sketchlib reorganized in the refactor/module-restructure branch:
- Wire-format-aligned types (CountMinSketch, CountSketch, KllSketch,
HydraKllSketch, SetAggregator, DeltaResult, CmsHeapItem, etc.) moved
out of `sketches::*` submodules and now live in `wrapper::*`,
re-exported at the crate root.
- `sketches::delta_set_aggregator::{serialize,deserialize}_msgpack` shims
were dropped in favor of the `MessagePackCodec` trait on `DeltaResult`.
Changes:
- Pin asap_sketchlib to the refactor/module-restructure branch.
- Switch all `use asap_sketchlib::sketches::*` imports to the
crate-root re-exports (`use asap_sketchlib::CountMinSketch`, etc.).
- `delta_set_aggregator_accumulator` uses
`DeltaResult::{from_msgpack,to_msgpack}` directly through the
`MessagePackCodec` trait instead of the removed module-level shims.
No behavior change — the wire format and runtime semantics of the
underlying sketches are identical (locked in by sketchlib-go parity
goldens in asap_sketchlib's tests/sketches_go_parity_probe.rs).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Picks up the asap_sketchlib `bfe8f37` cleanup that deletes `mod wrapper` and moves all wire-format-aligned sketch types (`CountMinSketch`, `CountSketch`, `KllSketch`, `HllSketch`, `DdSketch`, `HydraKllSketch`, `CountMinSketchWithHeap`, `SetAggregator`, `DeltaResult`) into `asap_sketchlib::message_pack_format::portable::*`. The crate-root re-exports that this crate imports are preserved unchanged, so no source changes are needed on this side. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CountMinSketchAccumulator and DatasketchesKLLAccumulator previously
held the wire-format facade types (`asap_sketchlib::CountMinSketch`,
`asap_sketchlib::KllSketch`), each of which is a thin shim around an
underlying `sketches::*` runtime sketch. With Go byte parity proven
for the underlying types in `asap_sketchlib::tests::sketches_go_parity_probe`,
the facade layer is no longer required.
- New `precompute_operators::sketchlib_runtime` module exposes thin
adapters (`cms_*` / `kll_*`) that translate the accumulator surface
(string keys, `Vec<Vec<f64>>` matrices, Go-compatible MessagePack
envelopes) onto `sketches::CountMin<Vector2D<f64>, FastPath,
DefaultXxHasher>` and `sketches::KLL<f64>` directly.
- `CountMinSketchAccumulator.inner` becomes
`sketches::CountMin<.., FastPath>`; `DatasketchesKLLAccumulator.inner`
becomes `sketches::KLL<f64>`. JSON / msgpack / merge paths route
through the new helpers.
- Wire format stays unchanged: the `CountMinSketchWire { sketch,
row_num, col_num }` and `KllSketchData { k, sketch_bytes }`
envelopes are still emitted, just constructed inline instead of
through the facade's `to_msgpack`.
- A handful of `inner.k` field accesses change to `inner.k()` (KLL's
`k` is private in `sketches::*` and exposed via accessor).
- Bump `asap_sketchlib` pin to `aea7d05` for the new
`sketches::KLL::k()` accessor.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
asap_sketchlibpin to therefactor/module-restructurebranch and adapt to the new module layout.sketches::*types directly instead of going through the wire-format facade; serialization is centralized in a newsketchlib_runtimemodule.Status
Draft — pinned to a branch in
asap_sketchlib, not a tagged release. Holding as draft until the upstream branch lands on its target.Verification
cargo buildcleancargo test -p query_engine_rust sketch→ 41 passed, 0 failedcargo clippy -p query_engine_rust --libclean apart from 2 pre-existingneedless_range_loopstyle warnings insketchlib_runtime.rsTest plan
asap_sketchlibto a merged commit on its target branch before marking readysketchlib_runtime.rs🤖 Generated with Claude Code