Skip to content

Add support for CountMinSketch to increment counter by a given number - #1

Closed
ruslan-dzhumakaliev wants to merge 3 commits into
jhurliman:masterfrom
criblio:master
Closed

Add support for CountMinSketch to increment counter by a given number#1
ruslan-dzhumakaliev wants to merge 3 commits into
jhurliman:masterfrom
criblio:master

Conversation

@ruslan-dzhumakaliev

Copy link
Copy Markdown

This new functionality serves the purpose of performing count-min sketch computation in distributed environment where output of multiple workers/mappers (map/reduce) needs to be merged into and aggregated centrally by reducer

@ruslan-dzhumakaliev ruslan-dzhumakaliev changed the title add support for CountMinSketch to increment counter by a given number Add support for CountMinSketch to increment counter by a given number Sep 8, 2023
jhurliman added a commit that referenced this pull request Sep 10, 2026
Stacked on #3 (`release/streamcount-validation`), which is stacked on
#2. Completes the remaining public declarations and distributed-package
validation, and prepares version 2.0.0.

Declarations cover every root export and the existing CountMinSketch,
HyperLogLog, MinHeap and PRNG deep imports. Tests install the tarball
independently, exercise CommonJS/ESM, and compile positive/negative
NodeNext and Node16 TypeScript consumers. The package includes its
format/migration documentation. Tests run before publishing; no
automatic publishing is configured.

Validation: 37 tests pass locally, including the signed-minimum hash
regression and all parent serialization/estimator tests. CI installs the
development dependencies on Node 22/24/26 and adds a separate Node 6
runtime-floor smoke test. Removes the obsolete Travis matrix identified
by the review of #2. npm publication and merging are not performed by
this PR.


Stacked follow-up: #6 adds validated weighted increments, superseding
#1. Merge this PR before #6.
jhurliman added a commit that referenced this pull request Sep 10, 2026
Stacked on #4. Supersedes #1's weighted-increment proposal, originally
contributed by Ruslan Dzhumakaliev, with `increment(key, incrementBy =
1)` and public TypeScript declarations.

Accept nonnegative uint32 integer weights; zero is a no-op, and invalid
weights or counter overflow reject before mutation. Raise all selected
buckets below the new minimum rather than only the old minimum buckets.
For example, buckets 5 and 7 become 15 and 15 after +10, matching ten
unit conservative updates; the original proposal produced 15 and 7 while
reporting 15.

Add collision-heavy comparisons against repeated unit updates, top-k
checks, uint32 boundary/atomicity checks, legacy/CMS2 roundtrips,
installed TypeScript consumer coverage and a Node 6 weighted-update
smoke check. Document that weighted observations do not implement full
distributed sketch merging or recover keys omitted from workers' top-k
lists.

Validation: all 44 tests pass locally. CI covers Node 22/24/26 and the
Node 6 runtime floor. No merge or publication is performed; #1 can be
closed as superseded once this replacement is accepted.
@jhurliman

Copy link
Copy Markdown
Owner

Functionality implemented via #6 thank you for your contribution!

@jhurliman jhurliman closed this Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants