Repository navigation
docs(asapv1): f64 Count Sketch counters and heap counts; heap key order - #216
Merged
Merged
Conversation
Count Sketch and CSHeap take counter_type "f64", as Count-Min does. A CSHeap heap count is the estimate truncated toward zero, saturating at the i64 bounds, NaN as 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under counter_type "f64", CMSHeap and CSHeap carry heap_counts as f64, the estimate not rounded, ordered by f64::total_cmp; otherwise i64. A CMSHeap heap count can be negative as a CSHeap's can. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Heap entries tied on count are ordered by heap key order, stated once in §3.5: the key read as unsigned bits (two's complement for signed, IEEE-754 bits for floats, bytes lexicographically). Space-Saving, CMSHeap, CSHeap, UnivMon and the CMSHeap/CSHeap deltas reject entries out of emitted order. 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 #182, closes #183, closes #214. Part of #179.
Spec only:
docs/asapv1_wire_format.md. One commit per issue.#182 f64 counters for Count Sketch
counter_type"f64", as Count-Min does (§2, §3.6, §3.10, Section 5, Q-CS)."i32"/"i64", a CSHeap heap count is the median truncated toward zero, saturating at thei64bounds.#214 f64 heap counts for CMSHeap and CSHeap
"f64",heap_countsis f64: the estimate when the heap last updated the entry, not rounded; otherwisei64(§3.7, §3.10, Section 4).f64::total_cmp; a decoder accepts any f64 heap count,NaNand the infinities included.#183 heap key order within a count tie
Not in this PR
Rust and Go code and golden files are #192, #193 and #200. Today's Rust decoders accept heap entries in any order, and
Count::estimatesorts f64 cells withpartial_cmp().unwrap().🤖 Generated with Claude Code