Repository navigation
refactor(cms)!: ASAPv1 only — drop proto, portable and native formats - #168
Closed
GordonYuanyc wants to merge 2 commits into
Closed
GordonYuanyc wants to merge 2 commits into
GordonYuanyc wants to merge 2 commits into
Conversation
CountMin serializes to ASAPv1 only. Removes the CountMinDelta and CountMinCell proto messages and SketchEnvelope's count_min field (10, now reserved), portable::countminsketch (CountMinSketch, CountMinSketchDelta, CountMinSketchWire, SketchlibCms and the sketchlib_cms_* helpers), the native MessagePackCodec shim for CountMin, and the cms_envelope_golden.hex proto golden. CountMinState stays as the nested Count-Min state of HydraCell and ElasticState. The Count-Min property laws that ran through the portable type now run on CountMin<Vector2D<f64>, FastPath> over string keys, with the ASAPv1 round trip and CountMin::apply_delta in the sequence law. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds cm_f64_fast_path_places_keys_in_go_cells: the 40 non-zero cells of
sketchlib-go's 4x2048 Count-Min after 50 inserts of flow-{i % 10}, listed
inline, reproduced by CountMin<Vector2D<f64>, FastPath, DefaultXxHasher>.
Records in the CHANGELOG that Count-Min deltas, hh_keys and the envelope
sample_p have no ASAPv1 carrier, and drops stale CountMin mentions from
the sample_p proto doc and xtest_consumer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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-Min's protobuf, portable msgpack and native-shim formats; ASAPv1 (0x02 0x00) is the only Count-Min format left. Count-Min-with-heap is a separate PR.Draft because of the open questions below.
Removed
CountMinDelta,CountMinCell;SketchEnvelope.count_min(10) is nowreserved 10; reserved "count_min";.CountMinStatestays becausehydra.protoandelasticsketch.protoembed it; it goes with those PRs or the final cleanup.message_pack_format::portable::countminsketch:CountMinSketch,CountMinSketchDelta,CountMinSketchWire,SketchlibCmsand thesketchlib_cms_*/new_sketchlib_cms/matrix_from_sketchlib_cmshelpers, the proto and msgpack delta codecs,aggregate_count,from_legacy_matrix; crate-root re-exportsCountMinSketch,CountMinSketchDelta.message_pack_format::native::countminsketch.src/sketches/testdata/cms_envelope_golden.hexand the tests that only exercised the removed formats.Kept / ported
cms_i64_regular_2x3,cms_f64_fast_2x3) are checked through nativeCountMin.CountMin<Vector2D<f64>, FastPath>with the ASAPv1 round trip (mutation-checked).cm_f64_fast_path_places_keys_in_go_cellskeeps the check that Rust's fast-path f64CountMinputs theflow-*keys in the same cells as Go (cells taken from the deleted proto golden).Open questions
Production (ASAPCollector Go → ASAPQuery-backend) uses three things ASAPv1 has no carrier for:
CountMinDeltaframes, including thehh_keysheavy-hitter channel.sample_p: the envelope-level sample rate used to rescale sampled CMS.sketch_state == Noneand no error.Options: design ASAPv1 delta / sampling metadata first, or land this as a hard cut together with a coordinated collector/backend change.
Verification (rustc 1.99)
cargo fmt --check; clippy-D warningsfor all four CI feature sets;RUSTDOCFLAGS="-D warnings" cargo doc; gen-proto drift clean;--lib,--doc, and filteredasapv1_golden,pbt -- count_min::,e2e -- frequency::,msgpack_compat,sketches_go_parity_probe,xtest_consumer(against the real Go producer). Implemented and reviewed by separate agents; review findings are addressed in the second commit.🤖 Generated with Claude Code