Skip to content

Experiments: results banner declares a winner at any probability, docs say 95% / 5% #9133

Backlog

Description

@NadyKor15

How are you running Flagsmith

  • SaaS at flagsmith.com

Describe the bug

The recommendation banner at the top of the experiment results page names a winner and suggests a rollout at any probability. The docs only call a result when a variant's chance to beat control is above 95% (winning) or below 5% (losing). Both sides of that rule are missing in the code:

  1. Green banner below 95%. At a 64% chance to win the page says "64% Winner Probability Confirmed. Variant_1 is outperforming Control by +20.3% with 64% probability of being the best variant. Consider rolling out Variant_1 to all users." The credible interval in the table on the same page is [-89.6%, 130.2%].
  2. Yellow "Control is the winner" banner while the variant is above 5%. With the variant at 38% (control 62%) the page says "Control is the winner. Control has shown the best performance, with 62% probability of being the best arm. No variant has outperformed it. Consider rolling out Control to all users." The interval is [-82.4%, 60.1%].

For comparison, at 98% with the interval [14.2%, 400.5%] the page shows the same green "Winner Probability Confirmed" banner, which is correct by the docs. Apart from the number, the banner at 64% and at 98% is identical: same colour, same "Confirmed", same rollout suggestion. Only the table tells them apart.

What the docs say (both pages re-read on 26 Nov 2026):

64% and 38% are both in the inconclusive range, and in both cases the page recommends rolling something out to all users.

Impact: the banner and the complete-experiment dialog are where a user decides whether to ship. The docs describe that flow: end the experiment "when you have a conclusive result", then "update the flag so every user gets the winning variation". Today the page suggests a rollout before the result is conclusive, so it can lead a team to ship a variant that has not won, or to keep control and drop a variant that may be better. Since #9021 (merged 23 Nov), the same leader is also pre-selected as the rollout choice in the dialog, again with no threshold. The WeMakeDevs guide for the Toggle Wars hackathon runs into this in its worked example: "Flagsmith calls Variant_1 the winner at 84% and suggests rolling it out", while the credible interval is -14.1% to 44.0% and the author recommends leaving the experiment running (https://www.wemakedevs.org/blogs/how-to-run-a-real-ab-test-with-flagsmith-experimentation).

Where it happens (main at 98fa536, 26 Nov 2026):

The comment at derive.ts L213 says chance_to_win is the pairwise P(variant beats control), which is the number the docs put the 95% and 5% thresholds on.

Steps To Reproduce

  1. Flagsmith Cloud (v2.294.0 at the time), Experiments with the built-in Flagsmith warehouse. A multivariate flag with control and one variant, 50/50 split, 100% rollout, one occurrence metric ("purchase", should increase).
  2. Send exposures and events for synthetic identities with @flagsmith/nodejs 9.3.0: 140 identities, Control 64 exposures and 7 purchases (10.9%), Variant_1 76 exposures and 10 purchases (13.2%). Click Refresh on the results page.
  3. The page shows "64% Winner Probability Confirmed" with the interval [-89.6%, 130.2%] (screenshot 1).
  4. A second experiment set up the same way, 140 identities: Control 56 exposures (16.1%), Variant_1 84 exposures (14.3%). The page shows "Control is the winner" at 62% (screenshot 2).
  5. A third experiment, 300 identities: Control 163 exposures (7.4%), Variant_1 137 exposures (22.6%). The page shows "98% Winner Probability Confirmed" (screenshot 3). Here the banner agrees with the docs.

The results were computed on 21 Nov 2026. ExperimentRecommendation.tsx was last changed on 15 Oct (b6824ac), and getBestTreatment / getWinningVariant in derive.ts are unchanged on today's main, so current main should behave the same way.

Expected behavior

The page follows the rule in the docs:

  • The green "winner" banner and the rollout suggestion appear only when a variant's chance to beat control is above 95%.
  • "Control is the winner" appears only when every variant is below 5%.
  • In between, show a neutral banner, for example "64% chance, not enough evidence yet. Variant_1 is ahead of Control by +20.3%, but the true effect could be anywhere from -89.6% to +130.2%. Keep the experiment running; a winner is called at 95%." The "Winning variation" scorecard shows "No winner yet".
  • In the complete-experiment dialog, control stays pre-selected until the result is conclusive, with the existing "No variant has a clear lead yet, so control is selected." message.

I can open a PR for this if the approach looks right to you.

Screenshots

  1. 64%, green "Winner Probability Confirmed":

64% green banner

  1. Variant 38% / control 62%, yellow "Control is the winner":

Control is the winner at 62%

  1. 98%, green banner (the correct case):

98% green banner

The screenshots were taken on Flagsmith Cloud on 21 Nov 2026.

Activity

  1. NadyKor15 commented on Nov 26, 2026

    @NadyKor15
    Author

    Adding two annotated images in case they make this quicker to review: the current results screen with the four relevant spots marked, and a mockup of the same screen following the 95% / 5% rule, next to the rules table from the docs.

    Current results screen, annotated

    Suggested screen with the 95% rule, and the rules table from the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions