Skip to content

8.12 CMS: support CELL_SIZE, fix CMS.INFO field parsing, cover negative INCRBY - #562

Open
mgravell wants to merge 3 commits into
masterfrom
marc/INITBYDIM
Open

mgravell wants to merge 3 commits into
masterfrom
marc/INITBYDIM

Conversation

@mgravell

@mgravell mgravell commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • CMS.INITBYDIM/CMS.INITBYPROB gain an optional cellSize parameter (1, 2, 4, or 8), sent as CELL_SIZE <n>.
  • Fix CmsInformation.CellSize parsing: the server reports the field as cell_size, not cell size (with a space) as previously coded, so the value was always -1.
  • CMS.INCRBY already passed negative increments through to the server unchanged; add test coverage for that path.
  • CMS.INCRBY's OOR SKIP|SAT|FAIL flag and CMS.MERGE across differing CELL_SIZE values are not yet supported client-side, pending server-side availability.

Test plan

  • dotnet build (Rebuild) on src/NRedisStack and tests/NRedisStack.Tests, 0 warnings/errors, PublicAPI analyzer clean
  • CmsTests suite passes against redislabs/client-libs-test:unstable-34786335206-debian, including new TestInitByDimCellSize(Async), TestInitByProbCellSize, TestInitByDimInvalidCellSize, TestIncrByNegative(Async)

Note

Low Risk
Additive public API and a targeted response-parser fix; CI depends on a pinned unstable 8.12 test image that may need updating at release.

Overview
Adds Redis 8.12 to integration CI (including a preview tests/dockers/.env.v8.12 image) so new CMS behavior can be exercised on PRs and nightly runs.

Count-Min Sketch gains optional cellSize (1, 2, 4, or 8) on InitByDim / InitByProb (sync and async), emitted as CELL_SIZE <n> with client-side validation. CMS.INFO parsing is corrected to read the cell_size field (underscore), so CmsInformation.CellSize is populated instead of staying at -1.

New tests cover cell-size initialization, invalid cellSize, and negative CMS.INCRBY increments (gated to Redis ≥ 8.12 where applicable). Public API entries are updated for the new overloads.

Reviewed by Cursor Bugbot for commit 8f65407. Bugbot is set up for automated code reviews on this repo. Configure here.

…NCRBY

- CMS.INITBYDIM/INITBYPROB take an optional cellSize (1, 2, 4, or 8 bytes)
  argument, sent as CELL_SIZE <n>.
- CmsInformation.CellSize now parses the "cell_size" field correctly;
  it previously looked for "cell size" (with a space) and always read -1.
- Add regression tests for CELL_SIZE and for negative CMS.INCRBY
  increments (already passed through unchanged, now covered).
InitByDim/InitByProb (and their Async/interface/builder counterparts)
keep their original 3-arg signatures; CELL_SIZE support is added via
new 4-arg overloads instead of an extra optional parameter on the
existing methods, so the existing compiled signatures are unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e940b7c2f9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/NRedisStack/CountMinSketch/CmsCommands.cs Outdated
Comment thread tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e940b7c. Configure here.

Comment thread tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ce6301acf

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tests/NRedisStack.Tests/CountMinSketch/CmsTests.cs
…x row

- CMS.INITBYDIM/INITBYPROB CELL_SIZE tests and CMS.INCRBY negative-increment
  tests are SkipIfRedisTheory-gated at 8.12.0, since older servers reject
  the CELL_SIZE argument (wrong number of arguments) and negative increments.
- Add tests/dockers/.env.v8.12, pinned to an unstable preview image pending
  an official 8.12 release, and add "8.12" to both the PR/push and nightly
  redis-version matrices in integration.yml.
@mgravell mgravell changed the title CMS: support CELL_SIZE, fix CMS.INFO field parsing, cover negative INCRBY 8.12 CMS: support CELL_SIZE, fix CMS.INFO field parsing, cover negative INCRBY Sep 14, 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.

1 participant