Repository navigation
docs: sketch analytics design - #253
Merged
Merged
Conversation
Each sketch's error bound, sizing, memory, and update/query/merge op counts, as big O and as formulas, plus the SketchAnalytics trait that exposes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… counts Rename the trait functions and the inherent estimated_memory_bytes to theoretical_*; map each sketch's symbols to the paper and the code's parameter names; recount ops under one rule and fix the bounds the technical review found wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GordonYuanyc
force-pushed
the
docs/sketch-analytics
branch
from
October 29, 2026 17:18
88ba54a to
7eaf30e
Compare
GordonYuanyc
marked this pull request as ready for review
October 29, 2026 17:18
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.
Design doc:
docs/sketch_analytics.mddefines the theoretical error, memory and time analytics asap_sketchlib provides for each sketch, as big O and as callable formulas, and theSketchAnalyticstrait (theoretical_memory_bytes,theoretical_update_ops,theoretical_query_ops,theoretical_merge_ops,theoretical_error,params_for) that exposes them. Each sketch section maps its symbols to the paper's and to the code's parameter names. Empirical measurements belong to sketch-bench.Only the doc changes; no code changes.
Where ASAPPlanner's formulas differ today
8kbytes; the update scans the kept hashes linearly, and the heap holds up to about2kslots (KMV update cost is not one operation per row ASAPPlanner#945).d + 1; it also re-estimates the key and sifts the heap.theoretical_memory_bytescounts the entry, digest, index and key bytes.λ(L)·(d + 1); it also writes row sums, re-estimates the key and updates each layer's heap.lg(c_b + 1)on average.theoretical_memory_bytesuses2(s + 126)slots per store.Classicbounded contract is also applied toErtl.apache_datasketches_kll_empirical_99_a9b42755072band..._delta_scaled_...becomekll_quantile_empirical_99_v1andkll_quantile_empirical_99_delta_scaled_v1, since the fit is measured on asap_sketchlib.Open questions
The two at the end of the doc: the Kll
rank()contract, and CountSketch sizing under ASAPv1's 20-row limit.🤖 Generated with Claude Code