Repository navigation
refactor(countsketch)!: ASAPv1 only — drop proto, portable and native formats - #165
Closed
GordonYuanyc wants to merge 2 commits into
Closed
GordonYuanyc wants to merge 2 commits into
GordonYuanyc wants to merge 2 commits into
Conversation
Count Sketch serializes as ASAPv1 only. Removes the portable CountSketch, CountSketchDelta and COUNT_SKETCH_TOPK_CAPACITY, the native MessagePackCodec shim for Count, the proto CountSketchDelta and CountSketchCell messages, and SketchEnvelope's count_sketch field (11, now reserved). CountSketchState stays: UnivMon and Hydra embed it. Tests that exercised Count Sketch through the removed formats are dropped (proto parity probe, msgpack round trip, xtest consumer case, portable e2e bound) or ported to the native Count (the four portable property laws). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Count<Vector2D<i64>, FastPath> fed the 25 k-a..k-e inserts must hold the 15 signed cells Go's CountSketch wrote for the same stream. Also rewords the CSHeap portable module doc and the features.md proto list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 2, 2026
Collaborator
Author
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.
Part of the ASAPv1-only series: one PR per sketch group, each off
main. This one removes Count Sketch's protobuf, portable msgpack and native-shim formats; ASAPv1 (0x04 0x00) is the only Count Sketch format left.Draft because of the open questions below.
Removed
CountSketchDelta,CountSketchCell;SketchEnvelope.count_sketch(11) is nowreserved 11; reserved "count_sketch";.CountSketchState/TopKState/HeapEntrystay becauseunivmon.protoandhydra.protoembed them; they go with those PRs or the final cleanup.message_pack_format::portable::countsketch:CountSketch,CountSketchDelta,COUNT_SKETCH_TOPK_CAPACITYand their crate-root re-exports, including the proto and msgpack delta codecs.message_pack_format::native::countsketch(theMessagePackCodecimpl forCount).tests/cs_envelope_golden.hexand the tests that only exercised the removed formats.Kept / ported
cs_i64_regular_2x4,cs_i64_fast_2x4,cs_i32_regular_2x4) are still checked through nativeCount.Count(merge = concatenation, linearity, negation, ASAPv1 round trip); mutation-checked.fast_path_string_keys_land_in_go_cellskeeps the only check that native fast-pathCountputs string keys in the same cells, with the same signs, as Go's Count Sketch (values taken from the deleted proto golden).Open questions
SketchEnvelope{CountSketchState}plus bareCountSketchDelta. After this PR Rust decodes neither, and ASAPv1 has no delta kind. Options: send full ASAPv1 state per window, or design an ASAPv1 Count Sketch delta first.counter_type"i32"/"i64"only; the removed portable type and Go's default use f64. Fractional or1/p-rescaled weights have no ASAPv1 representation unless the spec gains"f64"(as Count-Min has) or callers move to integer weights.Downstream
ASAPQuery-backend (via ASAPPlanner's codec crates) decodes the proto full state and deltas; ASAPPlanner/ASAPQuery name the portable type. Nothing outside this repo is changed here.
Verification (rustc 1.99)
cargo fmt --check; clippy-D warningsfor all four CI feature sets;RUSTDOCFLAGS="-D warnings" cargo doc; gen-proto drift clean; filtered tests for the touched areas (--lib -- countsketch,--test pbt -- count_sketch::,asapv1_golden,msgpack_compat,sketches_go_parity_probe,xtest_consumer). Implemented and reviewed by separate agents; review findings are addressed in the second commit.🤖 Generated with Claude Code