Skip to content

feat(asapv1)!: delta kinds, f64 Count Sketch and heap counts, one DDSketch encoding, SetAggregator - #232

Merged
GordonYuanyc merged 7 commits into
mainfrom
asapv1-p2/counters
Oct 16, 2026
Merged

GordonYuanyc merged 7 commits into
mainfrom
asapv1-p2/counters

Conversation

@GordonYuanyc

Copy link
Copy Markdown
Collaborator

Closes #200, #201. Part of #179, #190, #191, #192, #193, #195 (their Go side comes in sketchlib-go). One commit per issue: ASAPv1 delta kinds for Count-Min, Count Sketch, CMSHeap, CSHeap, HLL Classic/Ertl and DDSketch (*Delta::new, codec, merge_delta), f64 Count Sketch counters and f64 heap counts, decode-side heap order check, k→heap_size, one DDSketch encoding, and SetAggregator/DeltaResult codecs.

Bytes change for CMSHeap/CSHeap (heap_size) and positive-only/empty DDSketch; goldens are bumped to sketchlib-golden-bytes 26d2a7c. The pbt and e2e targets compile but were not run locally.

🤖 Generated with Claude Code

GordonYuanyc and others added 7 commits October 16, 2026 05:30
CountMinDelta carries changed cells as ascending indices and non-zero
deltas under the state's metadata; CountMin::merge_delta applies one
all or nothing. A crate-private delta module holds the cell rules and
the checked add that the other delta kinds reuse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 80)

Count Sketch takes counter_type "f64"; estimate orders rows with
total_cmp. CountSketchDelta carries changed cells under the state's
metadata and Count::merge_delta applies one all or nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p delta (03 80)

HHHeap and HHItem are generic over the count (i64 by default; f64 ranks
by total_cmp), so an f64 CMSHeap inserts and merges with unrounded heap
counts. Heap decoders reject entries out of emitted order. The CMSHeap
and CSHeap metadata key k is heap_size. CMSHeapDelta adds cells and
replaces the heap, all or nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An f64 CSHeap keeps the unrounded median as its heap count; integer
counters truncate toward zero and saturate (CsHeapCounter). CSHeapDelta
adds cells and replaces the heap, all or nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HyperLogLogDelta carries changed registers as ascending indices and a
bin of non-zero ranks under the state's metadata; merge_delta takes the
register-wise max.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SetAggregator encodes as 08 00 and DeltaResult as 08 80: metadata
{metadata_version: 1}, members as strictly ascending str arrays, added
and removed disjoint. Goldens bumped to the 08 80 DeltaResult fixtures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DDSketch encodes as metadata_version 1 with all eight payload fields.
DDSketchDelta carries bucket counts for both stores and the zero count;
DDSketch::merge_delta applies one all or nothing, rejecting a delta
whose stores would span past i32.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GordonYuanyc
GordonYuanyc merged commit b43e661 into main Oct 16, 2026
6 checks passed
@GordonYuanyc
GordonYuanyc deleted the asapv1-p2/counters branch October 16, 2026 17:13
This was referenced Oct 18, 2026
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.

ASAPv1 alignment: CMSHeap (Rust only)

1 participant