feat!: fractional bucketing improvements#622
Conversation
There was a problem hiding this comment.
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.
src/OpenFeature.Contrib.Providers.Flagd/Resolver/InProcess/CustomEvaluators/FractionalRule.cs
Outdated
Show resolved
Hide resolved
c820127 to
c466e42
Compare
askpt
left a comment
There was a problem hiding this comment.
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.
src/OpenFeature.Contrib.Providers.Flagd/Resolver/InProcess/CustomEvaluators/FractionalRule.cs
Outdated
Show resolved
Hide resolved
|
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.
|
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>
b561973 to
a1fd486
Compare
High-precision and nested fractional
This is a coordinated feature across flagd and all flagd providers.
fractionalnow supports up to max-int32 total weight and 1/max-int32 resolution as described in the high-precision fractional bucketing ADRfractionalnow supports computed (nested JSONLogic) variants and weights as described in the fractional ADRRelated PRs
Original PR description
Fixes: #607
Fixes: #608