FA-74281 / Feature flag rollout bucketing / Open access
Traffic then variant allocation: Traffic allocation admits one extra bucket · case 01
A 10 percent experiment enrols 11 percent of users.
ROOT CAUSE
Users are excluded only when t > traffic.
THE FAILURE
Users are excluded only when t > traffic.
Unsuccessful approach: Excluding from traffic - 1 drops the last legitimate traffic bucket.
Case contract
Stage 1: t = crc32(salt + ":traffic:" + user) % 100; users with t >= traffic (1..100) are not in the experiment. Stage 2 uses an independent v = crc32(salt + ":variant:" + user) % 100 and walks weights ([arm, percent of allocated users], summing to 100) cumulatively, half-open. Return [in_experiment, arm or None].
Why this case matters
Separating traffic allocation from the variant split keeps arms balanced when traffic changes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import zlib
N = 1
observations = []
def solve(salt, user, traffic, weights):
t = zlib.crc32((salt + ':traffic:' + user).encode()) % 100
if t > traffic:
return [False, None]
v = zlib.crc32((salt + ':variant:' + user).encode()) % 100
acc = 0
for arm, w in weights:
acc += w
if v < acc:
return [True, arm]
return [True, weights[-1][0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('allocation sample 1', ['exp2', 'u3390', 9, [['control', 20], ['treatment', 80]]], [False, None]),
('allocation sample 2', ['exp2', 'u2292', 50, [['control', 20], ['treatment', 80]]], [False, None]),
('allocation sample 3', ['exp2', 'u2623', 67, [['control', 20], ['treatment', 80]]], [True, 'control'])],
[('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 6', ['exp1', 'u2423', 50, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 22', ['exp2', 'u568', 88, [['control', 20], ['treatment', 80]]], [True, 'treatment']),
('allocation sample 49', ['exp1', 'u586', 13, [['control', 50], ['treatment', 50]]], [False, None])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 9', ['exp1', 'u3147', 77, [['a', 34], ['b', 33], ['c', 33]]], [True, 'a']),
('allocation sample 11', ['exp1', 'u2908', 30, [['a', 34], ['b', 33], ['c', 33]]], [False, None]),
('allocation sample 39', ['exp2', 'u1649', 12, [['control', 50], ['treatment', 50]]], [False, None])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 16', ['exp2', 'u2262', 53, [['control', 20], ['treatment', 80]]], [True, 'treatment']),
('allocation sample 38', ['exp1', 'u1107', 59, [['control', 50], ['treatment', 50]]], [False, None]),
('allocation sample 44', ['exp2', 'u1337', 52, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b'])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 18', ['exp1', 'u1356', 18, [['control', 50], ['treatment', 50]]], [False, None]),
('allocation sample 20', ['exp1', 'u1715', 57, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 21', ['exp1', 'u843', 100, [['control', 20], ['treatment', 80]]], [True, 'treatment'])]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| low traffic still fills every arm | [True, 'treatment'] | [True, 'treatment'] | Passed |
| low traffic second user | [True, 'treatment'] | [True, 'treatment'] | Passed |
| arm weights are relative to allocated users | [True, 'control'] | [True, 'control'] | Passed |
| traffic boundary excludes t equal to traffic | [True, 'b'] | [False, None] | Failed |
| traffic boundary includes t just below | [True, 'b'] | [True, 'b'] | Passed |
| allocation sample 1 | [True, 'control'] | [False, None] | Failed |
| allocation sample 2 | [False, None] | [False, None] | Passed |
| allocation sample 3 | [True, 'control'] | [True, 'control'] | Passed |
SHA-256 / a6ac77d5e235374daf22c6ecd3eebd5a67271e2e7f31556183a0dcec60e82ace
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import zlib
N = 1
observations = []
def solve(salt, user, traffic, weights):
t = zlib.crc32((salt + ':traffic:' + user).encode()) % 100
if t >= traffic - 1:
return [False, None]
v = zlib.crc32((salt + ':variant:' + user).encode()) % 100
acc = 0
for arm, w in weights:
acc += w
if v < acc:
return [True, arm]
return [True, weights[-1][0]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('allocation sample 1', ['exp2', 'u3390', 9, [['control', 20], ['treatment', 80]]], [False, None]),
('allocation sample 2', ['exp2', 'u2292', 50, [['control', 20], ['treatment', 80]]], [False, None]),
('allocation sample 3', ['exp2', 'u2623', 67, [['control', 20], ['treatment', 80]]], [True, 'control'])],
[('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 6', ['exp1', 'u2423', 50, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 22', ['exp2', 'u568', 88, [['control', 20], ['treatment', 80]]], [True, 'treatment']),
('allocation sample 49', ['exp1', 'u586', 13, [['control', 50], ['treatment', 50]]], [False, None])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 9', ['exp1', 'u3147', 77, [['a', 34], ['b', 33], ['c', 33]]], [True, 'a']),
('allocation sample 11', ['exp1', 'u2908', 30, [['a', 34], ['b', 33], ['c', 33]]], [False, None]),
('allocation sample 39', ['exp2', 'u1649', 12, [['control', 50], ['treatment', 50]]], [False, None])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('traffic boundary excludes t equal to traffic', ['exp1', 'm0', 14, [['a', 50], ['b', 50]]], [False, None]),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 16', ['exp2', 'u2262', 53, [['control', 20], ['treatment', 80]]], [True, 'treatment']),
('allocation sample 38', ['exp1', 'u1107', 59, [['control', 50], ['treatment', 50]]], [False, None]),
('allocation sample 44', ['exp2', 'u1337', 52, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b'])],
[('low traffic still fills every arm',
['exp1', 'm0', 20, [['control', 50], ['treatment', 50]]],
[True, 'treatment']),
('low traffic second user', ['exp1', 'm5', 20, [['control', 50], ['treatment', 50]]], [True, 'treatment']),
('arm weights are relative to allocated users',
['exp1', 'm8', 20, [['control', 20], ['treatment', 80]]],
[True, 'control']),
('traffic boundary includes t just below', ['exp1', 'm5', 6, [['a', 50], ['b', 50]]], [True, 'b']),
('full traffic control', ['exp2', 'n1', 100, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 18', ['exp1', 'u1356', 18, [['control', 50], ['treatment', 50]]], [False, None]),
('allocation sample 20', ['exp1', 'u1715', 57, [['a', 34], ['b', 33], ['c', 33]]], [True, 'b']),
('allocation sample 21', ['exp1', 'u843', 100, [['control', 20], ['treatment', 80]]], [True, 'treatment'])]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| low traffic still fills every arm | [True, 'treatment'] | [True, 'treatment'] | Passed |
| low traffic second user | [True, 'treatment'] | [True, 'treatment'] | Passed |
| arm weights are relative to allocated users | [True, 'control'] | [True, 'control'] | Passed |
| traffic boundary excludes t equal to traffic | [False, None] | [False, None] | Passed |
| traffic boundary includes t just below | [False, None] | [True, 'b'] | Failed |
| allocation sample 1 | [False, None] | [False, None] | Passed |
| allocation sample 2 | [False, None] | [False, None] | Passed |
| allocation sample 3 | [False, None] | [True, 'control'] | Failed |
SHA-256 / d1f607c64635841e0ffb7c2910f9ecdf84126331e699dfb5a03f203f8838af62
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic toy flag-evaluation model with a stipulated contract; it does not reproduce any vendor SDK byte for byte. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:55.185813+00:00.
Case digest / 64f22a63b518618da1af1fab8a8cd6cb0fa3e7a6be884d954c7761b69a03a3bd