Skip to content

Align rollouts assignments with split assignments#427

Merged
dferber90 merged 9 commits into
mainfrom
align-rollouts-assignments-with-split-assignments
Jul 9, 2026
Merged

Align rollouts assignments with split assignments#427
dferber90 merged 9 commits into
mainfrom
align-rollouts-assignments-with-split-assignments

Conversation

@dferber90

@dferber90 dferber90 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

What & why

Splits and rollouts hashed users into buckets with opposite conventions, so the same user could get a different variant depending on whether a flag was expressed as a split or a rollout. Switching a flag between the two (or "locking in" a rollout as a split) reassigned users even though the effective distribution was unchanged.

Changes

  • Unified splits, rollouts, and segment splits onto a single shared boundary function (boundaryFor) over the full 2**32 hash space — a rollout at promille p is now bit-for-bit identical to the equivalent split, so switching outcome type reassigns nobody.
  • Dropped the % 100_000 / float-scaling approaches: no modulo bias, and no off-by-one edge where the top-of-range hash fell through to the default.
  • Removed the now-dead findWeightedIndex / getScaledWeights helpers; split boundaries are precomputed once per outcome (integer, allocation-free per eval).

Reassignment impact

  • Splits: effectively unchanged — verified 0 differences over 12M evaluations; only a handful of exact boundary hash values differ (the top-of-range value now maps to a real variant instead of the default).
  • Rollouts & segment splits: one-time re-bucketing on release (acceptable), after which conversions never reassign.

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flags-playground Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm
flags-sdk-dev Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm
flags-sdk-snippets Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm
flags-sdk-sveltekit-snippets Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm
shirt-shop Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm
shirt-shop-api Ready Ready Preview, Comment, Open in v0 Jul 9, 2026 7:19pm

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.

2 participants