Repository navigation
sketch-bench: seeded KLL, rank error at chosen quantiles, stream statistics, top-k count error, Bloom, and lib rows for every non-windowed asap_sketchlib type - #235
Merged
Conversation
…tics, top-k count error, and 27 more asap_sketchlib rows - KLL: `seed` knob on kll and hydra-kll (lib builds with `with_k_and_seed`; oxide refuses a nonzero seed). - `--quantiles q1,q2`: quantile rows asked at those fractions, one error per fraction (`rank_err_q*`, `relative_value_error_q*`, grouped `mean_/max_rank_err_q*`); omitted keeps the 101-point grid. - frequency, top-k and heavy-hitter comparators report `stream_items`, `stream_distinct`, `stream_l2`; top-k also reports `max_count_err` and `mean_count_err` over the reported keys. - `--per-group-out` adds `d_q` and `l2_q` per group. - New lib rows through one generic driver (`wrappers/row_bodies.rs`): hll-ertl, kmv, kll-dynamic, uniform-sampling, space-saving(-topk), elastic(-topk), coco, count-min/count-sketch-space-saving(-topk), count-min/count-sketch-fold(-topk), count-sketch-l2-norm, count-min-hll, univmon-two-tier-*, univmon-q-*. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eSaving/fold matrices - Drop the generic row driver and the row macros; the kept rows are written out per type as the other wrappers and rows are. - Drop the rows for KllDynamic, UniformSampling, Elastic, Coco, CountSketchWithL2Norm, CountMinHll, UnivMonTwoTier and UnivMonQ. - Per-fraction errors only in RankErrorGT; RelativeValueErrorGT and the grouped comparators are back to main. `--quantiles` is refused unless the row is scored by rank error. - `answered_k` parses the new vocabularies instead of reading `topk_k` out of raw JSON. - The top-k k is checked only when a top-k is asked, so a frequency row builds at any capacity. - `--per-group-out` is gated on a subpopulation capability, not the `hydra-` name prefix. - The top-k truth keeps its exact map instead of copying it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate over keys absent from the stream) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…types
count-sketch-l2-norm, count-min-hll, elastic(-topk), coco, kll-dynamic,
uniform-sampling, univmon-two-tier-{cardinality,l1-norm,l2-norm,entropy},
univmon-q-{quantile,cardinality,frequency,topk}, nitro-count-min and
nitro-count-sketch, each written out per type as the other wrappers are.
Elastic and Coco build at --dtype string only, NitroBatch at i64 only, as
their APIs take. SetAggregator (exact) and the windowed types are left out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- count-sketch-l2-norm refuses a shape past the 128-bit key hash instead of letting the library panic; bloom refuses a non-power-of-two `cols` and `rows * cols` past BLOOM_MAX_BITS. - univmon-q cardinality, frequency and top-k build at --dtype f64 only: UnivMonQ keeps values as f64, so an integer key past 2^53 came back as another key. - `topk_row` takes k from the row's wrapper; `answered_k` is back to main. - Elastic's String clones and CountMinHll's subset keys are made outside the timed loops (`write_subset_key` reuses one buffer). - Nitro rows offer no latency: per item they would run a different path from the one-batch insert. The refusal for a metric other than accuracy now says the row does not measure it. - `seed` is optional everywhere (KLL, hydra-kll, KllDynamic, Coco, UniformSampling, Nitro): absent keeps the library's own unseeded construction, so existing KLL runs behave as before. - The new rows live in files named by family (count_matrix, nitro, string_keyed, uniform_sampling, kll, univmon). - Tests for the shape refusals and the KLL seed. 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 the sketch-bench side of the characterization gaps: G-6, G-3, G-7, the Hydra per-group statistics, and G-8 for every non-windowed
SketchAnalyticstype exceptSetAggregator.What changed
kllandhydra-klltake an optionalseedknob (--config 'k=200 seed=7'). With it the lib rows build withwith_k_and_seed; without it they build as before, unseeded. The oxide KLL takes no seed, so it refuses one. KllDynamic, Coco, UniformSampling and Nitro take the same optionalseed.--quantiles 0.5,0.99asks a rank-error row at those fractions and reportsrank_err_q*for each one. Without the flag the 101-point grid stays.stream_items,stream_distinctandstream_l2.max_count_errandmean_count_errover the keys the sketch returned.--per-group-outwritesgroup_key,n_q,error,d_q,l2_q. The flag is gated on a subpopulation capability instead of thehydra-name prefix.fpr,fnr(always 0 for a Bloom filter) andstream_distinct.librows, written out per type like the existing wrappers:hll-ertlkmvbloom:colsmust be a power of two, where the FPR bound holdsspace-saving,space-saving-topkcount-min-space-saving,count-min-space-saving-topkcount-sketch-space-saving,count-sketch-space-saving-topkcount-min-fold,count-min-fold-topkcount-sketch-fold,count-sketch-fold-topkcount-sketch-l2-normcount-min-hll: each record goes into every label subsetelastic,elastic-topk:--dtype stringonlycoco:--dtype stringonlykll-dynamic(seeded)uniform-samplingunivmon-two-tier-{cardinality,l1-norm,l2-norm,entropy}univmon-q-{quantile,cardinality,frequency,topk}: all but quantile at--dtype f64only, since UnivMonQ keeps values as f64nitro-count-min,nitro-count-sketch: i64 only, the whole stream in one batch, no per-item latencyThe top-k
kis checked only when a top-k question is asked, so a frequency row builds at any capacity.topk_rowtakeskfrom the row's own wrapper.Not included
SetAggregator: it is exact, so its error is always 0.MicroCm,ExponentialHistogram,EhBucketSketch,ExponentialHistogramUnivMonandTumblingWindow.docs/sketch-bench.mdis not updated with the new rows or flags.Verification
cargo fmt --check,cargo clippy --workspace --all-targets --all-features -D warningsandcargo test --workspaceall pass.🤖 Generated with Claude Code