{"abstract":"The interval is mirrored, so improvements appear as regressions.","category":"Experiment statistics","checks":8,"contract":"rng = random.Random(seed). Each of reps replicates resamples control then treatment with replacement (rng.choices, same sizes) and records mean(t) - mean(c). After sorting, the interval is diffs[floor((1 - level)/2 * reps)] to diffs[ceil((1 + level)/2 * reps) - 1]. Return both ends rounded to 6.","contract_signature":"control, treatment, reps, seed, level","evaluation_group":"w2-experiment-statistics-bootstrap-ci","failed_approach":"Taking the absolute difference folds negative replicates onto positive ones.","family":"w2-experiment-statistics-bootstrap-ci-difference-direction","id":"FA-74661","implementations":{"attempt":{"sha256":"c036dcdb7cbf47bf9881090be582ed2da37602d0fb084468531b5037db46ccfe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport random\nN = 1\nobservations = []\ndef solve(control, treatment, reps, seed, level):\n    rng = random.Random(seed)\n    diffs = []\n    for _ in range(reps):\n        c = rng.choices(control, k=len(control))\n        t = rng.choices(treatment, k=len(treatment))\n        diffs.append(abs(sum(t) / len(t) - sum(c) / len(c)))\n    diffs.sort()\n    lo = diffs[math.floor((1 - level) / 2 * reps)]\n    hi = diffs[math.ceil((1 + level) / 2 * reps) - 1]\n    return [round(lo, 6), round(hi, 6)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 1', [[6, 3, 2, 7], [7, 9, 2, 9, 7], 200, 662, 0.9], [-0.35, 4.95]),\n  ('bootstrap sample 2', [[4, 4, 4, 8, 2], [10, 9, 6, 3, 2], 50, 548, 0.8], [-0.4, 3.0]),\n  ('bootstrap sample 3', [[6, 9, 2, 1], [3, 3, 11, 8, 2], 50, 269, 0.9], [-2.15, 4.35]),\n  ('bootstrap sample 4', [[4, 6, 4], [3, 11], 200, 10, 0.9], [-2.333333, 7.0])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 4', [[4, 6, 4], [3, 11], 200, 10, 0.9], [-2.333333, 7.0]),\n  ('bootstrap sample 5', [[5, 1, 3, 1, 5], [8, 0, 1, 5], 50, 479, 0.95], [-2.9, 3.45]),\n  ('bootstrap sample 6', [[9, 8], [11, 10, 6], 50, 172, 0.95], [-3.0, 2.5]),\n  ('bootstrap sample 7', [[5, 7, 2, 9], [1, 10], 41, 416, 0.9], [-6.0, 5.5])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 11', [[7, 5, 6, 7, 6], [6, 4, 6, 3], 41, 117, 0.9], [-2.9, -0.3]),\n  ('bootstrap sample 12', [[3, 5, 5, 0, 4], [5, 8], 41, 271, 0.95], [1.0, 5.6]),\n  ('bootstrap sample 13', [[4, 8, 1, 1], [8, 8], 200, 78, 0.9], [2.0, 7.0]),\n  ('bootstrap sample 14', [[2, 0, 8, 3], [4, 6, 7], 99, 617, 0.95], [-0.333333, 5.416667])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 16', [[3, 4], [5, 7, 7, 7], 101, 604, 0.95], [2.0, 4.0]),\n  ('bootstrap sample 17', [[0, 1], [10, 2, 5, 8, 11], 50, 644, 0.8], [4.5, 8.7]),\n  ('bootstrap sample 18', [[3, 4, 9], [0, 8], 101, 541, 0.95], [-9.0, 4.666667]),\n  ('bootstrap sample 26', [[5, 9, 9], [7, 0, 8], 200, 180, 0.8], [-5.333333, 0.333333])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 21', [[2, 6, 8, 0, 8], [9, 10, 5, 7, 10], 41, 153, 0.8], [1.2, 5.2]),\n  ('bootstrap sample 22', [[8, 3], [0, 7, 11, 7, 1], 99, 38, 0.8], [-4.0, 3.4]),\n  ('bootstrap sample 25', [[5, 9, 1, 0], [7, 6, 11, 8], 41, 751, 0.8], [2.0, 6.25]),\n  ('bootstrap sample 34', [[2, 8, 4, 3, 9], [3, 3, 9, 7], 41, 878, 0.95], [-3.2, 3.3])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"913eaa14646511cfbd34b487db359e5a7bd95f5dcc855e852546104c6cc96556","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport random\nN = 1\nobservations = []\ndef solve(control, treatment, reps, seed, level):\n    rng = random.Random(seed)\n    diffs = []\n    for _ in range(reps):\n        c = rng.choices(control, k=len(control))\n        t = rng.choices(treatment, k=len(treatment))\n        diffs.append(sum(c) / len(c) - sum(t) / len(t))\n    diffs.sort()\n    lo = diffs[math.floor((1 - level) / 2 * reps)]\n    hi = diffs[math.ceil((1 + level) / 2 * reps) - 1]\n    return [round(lo, 6), round(hi, 6)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 1', [[6, 3, 2, 7], [7, 9, 2, 9, 7], 200, 662, 0.9], [-0.35, 4.95]),\n  ('bootstrap sample 2', [[4, 4, 4, 8, 2], [10, 9, 6, 3, 2], 50, 548, 0.8], [-0.4, 3.0]),\n  ('bootstrap sample 3', [[6, 9, 2, 1], [3, 3, 11, 8, 2], 50, 269, 0.9], [-2.15, 4.35]),\n  ('bootstrap sample 4', [[4, 6, 4], [3, 11], 200, 10, 0.9], [-2.333333, 7.0])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 4', [[4, 6, 4], [3, 11], 200, 10, 0.9], [-2.333333, 7.0]),\n  ('bootstrap sample 5', [[5, 1, 3, 1, 5], [8, 0, 1, 5], 50, 479, 0.95], [-2.9, 3.45]),\n  ('bootstrap sample 6', [[9, 8], [11, 10, 6], 50, 172, 0.95], [-3.0, 2.5]),\n  ('bootstrap sample 7', [[5, 7, 2, 9], [1, 10], 41, 416, 0.9], [-6.0, 5.5])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 11', [[7, 5, 6, 7, 6], [6, 4, 6, 3], 41, 117, 0.9], [-2.9, -0.3]),\n  ('bootstrap sample 12', [[3, 5, 5, 0, 4], [5, 8], 41, 271, 0.95], [1.0, 5.6]),\n  ('bootstrap sample 13', [[4, 8, 1, 1], [8, 8], 200, 78, 0.9], [2.0, 7.0]),\n  ('bootstrap sample 14', [[2, 0, 8, 3], [4, 6, 7], 99, 617, 0.95], [-0.333333, 5.416667])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 16', [[3, 4], [5, 7, 7, 7], 101, 604, 0.95], [2.0, 4.0]),\n  ('bootstrap sample 17', [[0, 1], [10, 2, 5, 8, 11], 50, 644, 0.8], [4.5, 8.7]),\n  ('bootstrap sample 18', [[3, 4, 9], [0, 8], 101, 541, 0.95], [-9.0, 4.666667]),\n  ('bootstrap sample 26', [[5, 9, 9], [7, 0, 8], 200, 180, 0.8], [-5.333333, 0.333333])],\n [('ninety percent interval', [[1, 2, 3, 4], [2, 3, 5, 8], 101, 7, 0.9], [0.0, 4.5]),\n  ('eighty percent interval', [[0, 0, 1, 5], [1, 1, 2], 50, 11, 0.8], [-2.333333, 1.083333]),\n  ('treatment larger than control', [[1, 2], [6, 9, 7], 41, 3, 0.9], [4.833333, 7.0]),\n  ('ninety-five percent interval', [[3, 1, 4, 1, 5], [9, 2, 6, 5], 200, 42, 0.95], [-0.2, 5.65]),\n  ('bootstrap sample 21', [[2, 6, 8, 0, 8], [9, 10, 5, 7, 10], 41, 153, 0.8], [1.2, 5.2]),\n  ('bootstrap sample 22', [[8, 3], [0, 7, 11, 7, 1], 99, 38, 0.8], [-4.0, 3.4]),\n  ('bootstrap sample 25', [[5, 9, 1, 0], [7, 6, 11, 8], 41, 751, 0.8], [2.0, 6.25]),\n  ('bootstrap sample 34', [[2, 8, 4, 3, 9], [3, 3, 9, 7], 41, 878, 0.95], [-3.2, 3.3])]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic toy experiment-analysis model with a stipulated contract; results are rounded and are not a substitute for a validated statistics package. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-experiment-statistics-bootstrap-ci-difference-direction","generated_at":"2026-09-29T14:48:58.917741+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Bootstrap intervals are the fallback for skewed metrics; reproducibility and indexing must be exact.","root_cause":"Each replicate stores mean(c) - mean(t).","sha256":"0a90725a23f6b086961b6a748bbe44570b7b21e238350a76df10eb8f8ac6c323","title":"Bootstrap difference interval: Replicates record control minus treatment · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.363,"exit_code":1,"observations":[{"actual":[0.25,4.5],"check":"ninety percent interval","expected":[0.0,4.5],"passed":false},{"actual":[0.083333,2.0],"check":"eighty percent interval","expected":[-2.333333,1.083333],"passed":false},{"actual":[4.833333,7.0],"check":"treatment larger than control","expected":[4.833333,7.0],"passed":true},{"actual":[0.3,5.65],"check":"ninety-five percent interval","expected":[-0.2,5.65],"passed":false},{"actual":[0.35,4.95],"check":"bootstrap sample 1","expected":[-0.35,4.95],"passed":false},{"actual":[0.2,3.0],"check":"bootstrap sample 2","expected":[-0.4,3.0],"passed":false},{"actual":[0.1,4.35],"check":"bootstrap sample 3","expected":[-2.15,4.35],"passed":false},{"actual":[1.0,7.0],"check":"bootstrap sample 4","expected":[-2.333333,7.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ninety percent interval\", \"actual\": [0.25, 4.5], \"expected\": [0.0, 4.5], \"passed\": false}, {\"check\": \"eighty percent interval\", \"actual\": [0.083333, 2.0], \"expected\": [-2.333333, 1.083333], \"passed\": false}, {\"check\": \"treatment larger than control\", \"actual\": [4.833333, 7.0], \"expected\": [4.833333, 7.0], \"passed\": true}, {\"check\": \"ninety-five percent interval\", \"actual\": [0.3, 5.65], \"expected\": [-0.2, 5.65], \"passed\": false}, {\"check\": \"bootstrap sample 1\", \"actual\": [0.35, 4.95], \"expected\": [-0.35, 4.95], \"passed\": false}, {\"check\": \"bootstrap sample 2\", \"actual\": [0.2, 3.0], \"expected\": [-0.4, 3.0], \"passed\": false}, {\"check\": \"bootstrap sample 3\", \"actual\": [0.1, 4.35], \"expected\": [-2.15, 4.35], \"passed\": false}, {\"check\": \"bootstrap sample 4\", \"actual\": [1.0, 7.0], \"expected\": [-2.333333, 7.0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.01,"exit_code":1,"observations":[{"actual":[-4.5,0.0],"check":"ninety percent interval","expected":[0.0,4.5],"passed":false},{"actual":[-1.083333,2.0],"check":"eighty percent interval","expected":[-2.333333,1.083333],"passed":false},{"actual":[-7.0,-4.833333],"check":"treatment larger than control","expected":[4.833333,7.0],"passed":false},{"actual":[-5.65,0.2],"check":"ninety-five percent interval","expected":[-0.2,5.65],"passed":false},{"actual":[-4.95,0.25],"check":"bootstrap sample 1","expected":[-0.35,4.95],"passed":false},{"actual":[-3.0,0.4],"check":"bootstrap sample 2","expected":[-0.4,3.0],"passed":false},{"actual":[-4.35,2.15],"check":"bootstrap sample 3","expected":[-2.15,4.35],"passed":false},{"actual":[-7.0,2.333333],"check":"bootstrap sample 4","expected":[-2.333333,7.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ninety percent interval\", \"actual\": [-4.5, 0.0], \"expected\": [0.0, 4.5], \"passed\": false}, {\"check\": \"eighty percent interval\", \"actual\": [-1.083333, 2.0], \"expected\": [-2.333333, 1.083333], \"passed\": false}, {\"check\": \"treatment larger than control\", \"actual\": [-7.0, -4.833333], \"expected\": [4.833333, 7.0], \"passed\": false}, {\"check\": \"ninety-five percent interval\", \"actual\": [-5.65, 0.2], \"expected\": [-0.2, 5.65], \"passed\": false}, {\"check\": \"bootstrap sample 1\", \"actual\": [-4.95, 0.25], \"expected\": [-0.35, 4.95], \"passed\": false}, {\"check\": \"bootstrap sample 2\", \"actual\": [-3.0, 0.4], \"expected\": [-0.4, 3.0], \"passed\": false}, {\"check\": \"bootstrap sample 3\", \"actual\": [-4.35, 2.15], \"expected\": [-2.15, 4.35], \"passed\": false}, {\"check\": \"bootstrap sample 4\", \"actual\": [-7.0, 2.333333], \"expected\": [-2.333333, 7.0], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}