You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current fractional operation uses a 100-bucket system, limiting the smallest allocation to 1%. This is insufficient for high-throughput environments where 1% could represent millions of users. Use cases like gradual rollouts, precise A/B testing, and canary deployments require sub-percent granularity (e.g., 0.1% or 0.01%).
Proposal
Use math.MaxInt32 (2,147,483,647) as the maximum allowed weight sum, with pure integer arithmetic for bucket assignment. This replaces the current 100-bucket float-based approach.
This provides effectively unlimited precision (up to ~0.00000005%), eliminates floating-point issues, and naturally guarantees that any variant with weight >= 1 receives traffic.
Constraints
The sum of all variant weights must not exceed math.MaxInt32 (2,147,483,647)
Weights must be integers
Cross-language notes
The intermediate product (uint32 hash * int32 totalWeight) must fit in a 64-bit integer. Java's signed long is the most restrictive, which is why MaxInt32 (not MaxUint32) is the limit. JavaScript requires BigInt for the multiplication.
Language
Hash Type
Unsigned Conversion
64-bit Multiply
Right-Shift
Go
uint32
None
uint64(hash)
>> 32
Java
int (signed)
hash & 0xFFFFFFFFL
long
>>> 32
JavaScript
Number
BigInt(hash)
BigInt
>> 32n
Python
int
None
Native
>> 32
C#/.NET
uint
None
(ulong)
>> 32
API
No API changes. Existing fractional syntax is unchanged -- weights are just no longer limited to summing to 100.
changed the title [-][P1] Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/-][+]Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/+]on Mar 12, 2026
changed the title [-]Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/-][+]High resolution fractional bucketing[/+]on Mar 12, 2026
Activity
[-][P1] Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/-][+]Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/+][-]Support a much higher resolution of buckets (e.g. be able to have a probability of 0,0001 of selecting a bucket)[/-][+]High resolution fractional bucketing[/+]toddbaert commentedon Apr 1, 2026
Done!