Repository navigation
docs(asapv1): peek_kind_id, SetAggregator/DeltaResult, sample_p and delta kinds - #213
Merged
Merged
Conversation
peek_kind_id checks the envelope rules 1-3 and the framing lengths, returns the kind_id bytes, and ignores bytes after the payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
§3.21 and §3.22 define the two payloads: metadata {metadata_version: 1},
payloads [values] and [added, removed], members as UTF-8 str in strictly
ascending byte order, added and removed disjoint. The registry gains the
designed status for rows whose payload is specified but not yet encoded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HLL, Count-Min, Count Sketch and DDSketch carry an optional f64 sample_p, written only when p < 1. Consumers multiply the listed estimates by 1/p; decode accepts 0 < p < 1; states merge only with equal sample_p. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The top bit of the variant byte marks a delta of the state variant. §3.23 defines the HLL Classic/Ertl, Count-Min, CMSHeap, Count Sketch, DDSketch and CSHeap deltas: sparse ascending indices with non-zero values, the state kind's metadata, heap kinds carrying the whole heap, and all-or-nothing apply rules. Co-Authored-By: Claude Opus 5.5 <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.
Closes #185, closes #184, closes #181, closes #180. Part of #179.
Spec only:
docs/asapv1_wire_format.md. One commit per issue.#185
peek_kind_idpeek_kind_idchecks only rules 1-3 and thatkind_id, both length fields, and themetadata_len + payload_lenbytes after them lie inside the buffer, then returns thekind_idbytes and ignores bytes after the payload. This is what Rustsplitand sketchlib-goSplitaccept today.#184 SetAggregator and DeltaResult (§3.21, §3.22)
{metadata_version: 1}; payloads[values]and[added, removed].strholding valid UTF-8, strictly ascending by UTF-8 bytes;addedandremovedare disjoint.0x08 0x00/0x09 0x00are designed: rows marked implemented or designed have a Section 3 payload.#181
sample_p(Section 2)p < 1; decode accepts0 < sample_p < 1and echoes it back.1/p: HLL cardinality; Count-Min key frequency and row total; Count Sketch key frequency; DDSketchcountandsum.1/pweight carries no key.sample_pare equal, absent counting as1.#180 delta kinds (§3.23)
0x80 | vis the delta of state variantv; Hydra's reserved range ends at0x07 0x7f.row * cols + col; HLL carries new register values (apply = max); heap kinds carry the producer's whole heap, which replaces the state's.[indices, deltas, negative_indices, negative_deltas, zero_count]; apply order and the representativer = (1 + alpha)·gamma^kare fixed; the index range is given as a formula.Open questions
sample_pmerge rule: ASAPPlanner today merges a sampled state into a reset base atp = 1, and p can differ by edge and epoch; under this rule those merges are rejected, so downstream must carry p across reset.🤖 Generated with Claude Code