Skip to content

Add safe weighted increments, superseding PR 1 - #6

Merged
jhurliman merged 1 commit into
release/streamcount-typesfrom
release/streamcount-weighted
Sep 10, 2026
Merged

Add safe weighted increments, superseding PR 1#6
jhurliman merged 1 commit into
release/streamcount-typesfrom
release/streamcount-weighted

Conversation

@jhurliman

Copy link
Copy Markdown
Owner

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T16:51:17.392593Z c4b4f47 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jhurliman
jhurliman added this pull request to stack #5 September 10, 2026 18:38
@jhurliman
jhurliman merged commit ffbc656 into master Sep 10, 2026
8 checks passed
@jhurliman
jhurliman deleted the release/streamcount-weighted branch September 10, 2026 18:40
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.
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.

1 participant