Skip to content

feat!: fractional bucketing improvements#622

Merged
toddbaert merged 7 commits intomainfrom
feat/fractional-updates
Apr 1, 2026
Merged

feat!: fractional bucketing improvements#622
toddbaert merged 7 commits intomainfrom
feat/fractional-updates

Conversation

@toddbaert
Copy link
Copy Markdown
Member

@toddbaert toddbaert commented Mar 30, 2026

High-precision and nested fractional

This is a coordinated feature across flagd and all flagd providers.

  • fractional now supports up to max-int32 total weight and 1/max-int32 resolution as described in the high-precision fractional bucketing ADR
  • fractional now supports computed (nested JSONLogic) variants and weights as described in the fractional ADR
  • Includes e2e tests from the flagd-testbed v3.1.0...v3.4.0 to validate consistent fractional bucketing across all provider implementations
  • ⚠️ Pseudorandom hash assignments will change with this release due to changes in the hashing algorithm; update flagd and your providers to ensure fractional assignment is consistent across all workloads

Related PRs

Component PR
flagd open-feature/flagd#1909
java-sdk-contrib open-feature/java-sdk-contrib#1740
js-sdk-contrib open-feature/js-sdk-contrib#1501
python-sdk-contrib open-feature/python-sdk-contrib#373
dotnet-sdk-contrib #622
flagd-schemas open-feature/flagd-schemas#207

Warning
@toddbaert will coordinate the release across flagd and all providers. Do not merge without coordination.
@toddbaert will update the RPC mode tests accordingly once the associated flagd PR is merged and an up-to-date flagd-testbed image is available.


Original PR description

  • allows bucketing weights summing up to MaxInt32 (=2,147,483,647)
  • allows nesting of and within the fractional operator
  • allows all primitives as bucket variants

Fixes: #607
Fixes: #608

@toddbaert toddbaert requested review from a team as code owners March 30, 2026 18:05
@github-actions github-actions bot requested a review from bacherfl March 30, 2026 18:06
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the v2 fractional bucketing algorithm, which supports multiple variant types and uses 64-bit arithmetic for improved precision. The changes include updated E2E test hooks and new unit tests. A potential overflow bug was identified in the weight resolution logic where casting a double to an integer before clamping could lead to incorrect values for inputs outside the 32-bit range.

@toddbaert toddbaert changed the title feat: high-precision and nested fractional feat!: fractional bucketing improvements Mar 31, 2026
Copy link
Copy Markdown
Member

@askpt askpt left a comment

Choose a reason for hiding this comment

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

LGTM! Just a minor request.

I noticed you added this is a "breaking change". Could you please explain the motivation to make it so? It might be worth to add that information to the Changelog file.

@toddbaert
Copy link
Copy Markdown
Member Author

toddbaert commented Apr 1, 2026

It's only this. It's just a behavioral change in "random" assignments, not API surface change. I debated not making it breaking at all, but in some cases users will want to keep things consistent WRT random assignment across workloads, so they will have to update flagd deps to do that.

  • ⚠️ Pseudorandom hash assignments will change with this release due to changes in the hashing algorithm; update flagd and your providers to ensure fractional assignment is consistent across all workloads

toddbaert and others added 6 commits April 1, 2026 12:17
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
…tomEvaluators/FractionalRule.cs

Co-authored-by: André Silva <2493377+askpt@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
This was referenced Apr 2, 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.

[FEATURE] High-resolution fractional bucketing in flagd provider [FEATURE] Nested fractional Argument Evaluation in flagd provider

6 participants