Merged
Conversation
Made-with: Cursor
zzylol
reviewed
Mar 31, 2026
| use crate::common::input::sketch_input_to_f64; | ||
| use crate::{SketchInput, Vector1D}; | ||
|
|
||
| const MAX_LEVELS: usize = 61; |
Contributor
There was a problem hiding this comment.
Is the intent to use const variables, or avoid them?
Collaborator
Author
There was a problem hiding this comment.
Yes, this is intentional for speed/performance.
Theoretically, this seems to be large enough (2^60 insertions or more).
Contributor
There was a problem hiding this comment.
What will be the user API of configuring the e.g., K in KLL?
Collaborator
Author
There was a problem hiding this comment.
this one:
pub fn init(k: usize, m: usize) -> Self
k is bottom compactor size and m is minimum compactor size
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.
Summary
Remove unused infrastructure, clean up core sketch APIs, add OctoSketch multi-threaded framework.
Removed: orchestrator, Locher, Microscope, benchmarks
sketch_framework/orchestrator/module (6 files, ~1480 lines) —NodeOrchestrator,NodeCatalog, and all node types (EHNode,HashlayerNode,NitroNode,SketchNode).sketches/locher.rsandsketches/microscope.rs.benches/files (9 benchmark harnesses) and removed thecriteriondev-dependency.core_affinityandcrossbeam-channeldependencies (used by Octo).HashLayer: user-facing API
HashLayer<H>groups sketches that share a compatible hash. It hashes each input once and fans the result out to every sketch in the layer.Accepted sketch types (only prehashed fast-path):
CountMin<_, FastPath, _>— Count-Min SketchCount<_, FastPath, _>— Count SketchHyperLogLog<DataFusion>/HyperLogLog<Regular>/HyperLogLogHIPAll matrix-backed sketches in one layer must have the same dimensions (rows x cols). HLL can coexist because it only consumes the lower 64 bits of the shared hash.
Example usage:
Full API:
new(Vec<HashLayerSketch>)push(sketch)insert(&SketchInput)insert_with_hash(&hash)insert_at(&[usize], &SketchInput)insert_at_with_hash(&[usize], &hash)bulk_insert,bulk_insert_with_hashesbulk_insert_at,bulk_insert_at_with_hashesestimate(index, &SketchInput)estimate_with_hash(index, &hash)cardinality(index)hash_input(&SketchInput)get/get_mut/len/is_emptyAlso cleaned up
sketch_catalog.rs: removed all unused catalog enums (FreqSketch,CardinalitySketch,QuantileSketch, etc.). Only the adapter traits (CountMinFastOps,CountFastOps, etc.) used byHashLayerremain.HLL: adjustable register storage
HllBucketListtypes are now backed byBox<[u8; N]>with aHllRegisterStoragetrait providingPRECISION,REGISTER_BITS,NUM_REGISTERS, and slice access. Three precisions are supported: P12 (4096 registers), P14 (16384), P16 (65536).KLL: rearranged memory layout for speed
Box<[f64]>) with level offsets instead of per-levelVecs.MAX_LEVELS = 61hard cap withcompute_max_capacitysizing.randomly_halve_upandmerge_sorted_runswith a reusable scratch buffer — avoids allocations during compaction.OctoSketch: multi-threaded sketch framework
New
sketch_framework/octo.rsmodule implementing the OctoSketch pattern — pin workers to cores, each with a local small sketch, and promote deltas to a shared parent sketch when local counters overflow.OctoWorker/OctoAggregatortraits for custom sketch types.CmOctoWorker,CountOctoWorker,HllOctoWorker.OctoRuntimemanages worker threads withcore_affinitypinning andcrossbeam-channelcommunication.OctoReadHandlefor lock-free reads of the parent sketch during ingestion.sketches/octo_delta.rs:CmDelta,CountDelta,HllDeltawith configurable promotion thresholds.FastPath/RegularPath.