{"abstract":"All-zero weights produce counts on the last outcome instead of \"no-support\".","category":"Quantum circuit simulation","checks":6,"contract":"Input [n, weights, uniforms]; weights are nonnegative integers for basis indices 0..2**n-1 and uniforms are exact decimal or fraction strings in [0, 1). Each uniform u selects the first index i with u * total < cumulative weight through i. Return counts {bitstring: count} with qubit n-1 leftmost. Errors: \"bad-length\", \"negative-weight\", \"no-support\", [\"bad-uniform\", position].","evaluation_group":"w2-quantum_circuit_simulation-shot-sampling-inverse-cdf","failed_approach":"The attempted repair checks total < 0, which can never trigger after the negative-weight guard.","family":"w2-quantum_circuit_simulation-shot-sampling-inverse-cdf-empty-support-guard","id":"FA-91141","implementations":{"attempt":{"sha256":"ea99e8d3373009610cdcbebf8227addd24245d591a1a78743ae92a35d3536f6f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    n, weights, us = x\n    if len(weights) != 1 << n:\n        return 'bad-length'\n    if any(w < 0 for w in weights):\n        return 'negative-weight'\n    total = sum(weights)\n    if total < 0:\n        return 'no-support'\n    counts = {}\n    for idx, s in enumerate(us):\n        u = Fraction(s)\n        if u < 0 or u >= 1:\n            return ['bad-uniform', idx]\n        target = u * total\n        cum = 0\n        for i, w in enumerate(weights):\n            cum += w\n            if target < cum:\n                break\n        key = format(i, '0%db' % n)\n        counts[key] = counts.get(key, 0) + 1\n    return counts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: boundary uniform on cumulative edge', [1, [1, 1], ['0.5']], {'1': 1}], ['control: zero weight first outcome', [2, [0, 1, 1, 2], ['0', '0.25']], {'01': 1, '10': 1}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight'], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}], ['control: bad length', [2, [1, 1], ['0.1']], 'bad-length'], ['control: random shots 0', [1, [0, 1], ['0/1', '0.952', '0/1']], {'1': 3}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 1', [3, [5, 0, 2, 0, 5, 3, 0, 1], ['9/16', '9/16']], {'100': 2}], ['control: random shots 2', [1, [0, 5], ['0.967', '0.119', '0.012', '1/5', '0.243', '0/5']], {'1': 6}], ['control: random shots 3', [1, [3, 5], ['0.916', '3/8', '0.642']], {'1': 3}], ['control: random shots 4', [2, [0, 2, 2, 2], ['0.248', '3/6', '0.126', '0.765', '0.379']], {'01': 2, '10': 2, '11': 1}], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 5', [3, [0, 0, 0, 0, 5, 5, 0, 3], ['8/13', '0.522', '0.318', '0.507', '0.577', '2/13']], {'101': 4, '100': 2}], ['control: random shots 6', [3, [1, 1, 0, 0, 0, 3, 3, 0], ['0.597', '5/8', '0.601']], {'101': 2, '110': 1}], ['control: random shots 7', [2, [0, 1, 0, 0], ['0/1', '0.123']], {'01': 2}], ['control: random shots 8', [2, [1, 0, 1, 3], ['0.813', '2/5', '4/5', '0.149', '0.53']], {'11': 4, '00': 1}], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight']], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 9', [3, [0, 3, 1, 1, 5, 2, 0, 1], ['0.993', '8/13']], {'111': 1, '100': 1}], ['control: random shots 10', [3, [3, 0, 1, 2, 0, 3, 0, 5], ['10/14', '0.687', '0.608']], {'111': 2, '101': 1}], ['control: random shots 11', [2, [1, 2, 0, 2], ['0.643', '0.519', '0.64', '0.875']], {'11': 3, '01': 1}], ['control: random shots 12', [3, [5, 5, 5, 5, 1, 3, 0, 0], ['14/24', '0/24', '0.202']], {'010': 1, '000': 2}], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]]]\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":"fa9ef100561b4210fafc18871fdaa59a83f1c641d416b937db18757286252683","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    n, weights, us = x\n    if len(weights) != 1 << n:\n        return 'bad-length'\n    if any(w < 0 for w in weights):\n        return 'negative-weight'\n    total = sum(weights)\n    if not weights:\n        return 'no-support'\n    counts = {}\n    for idx, s in enumerate(us):\n        u = Fraction(s)\n        if u < 0 or u >= 1:\n            return ['bad-uniform', idx]\n        target = u * total\n        cum = 0\n        for i, w in enumerate(weights):\n            cum += w\n            if target < cum:\n                break\n        key = format(i, '0%db' % n)\n        counts[key] = counts.get(key, 0) + 1\n    return counts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: boundary uniform on cumulative edge', [1, [1, 1], ['0.5']], {'1': 1}], ['control: zero weight first outcome', [2, [0, 1, 1, 2], ['0', '0.25']], {'01': 1, '10': 1}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight'], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}], ['control: bad length', [2, [1, 1], ['0.1']], 'bad-length'], ['control: random shots 0', [1, [0, 1], ['0/1', '0.952', '0/1']], {'1': 3}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 1', [3, [5, 0, 2, 0, 5, 3, 0, 1], ['9/16', '9/16']], {'100': 2}], ['control: random shots 2', [1, [0, 5], ['0.967', '0.119', '0.012', '1/5', '0.243', '0/5']], {'1': 6}], ['control: random shots 3', [1, [3, 5], ['0.916', '3/8', '0.642']], {'1': 3}], ['control: random shots 4', [2, [0, 2, 2, 2], ['0.248', '3/6', '0.126', '0.765', '0.379']], {'01': 2, '10': 2, '11': 1}], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 5', [3, [0, 0, 0, 0, 5, 5, 0, 3], ['8/13', '0.522', '0.318', '0.507', '0.577', '2/13']], {'101': 4, '100': 2}], ['control: random shots 6', [3, [1, 1, 0, 0, 0, 3, 3, 0], ['0.597', '5/8', '0.601']], {'101': 2, '110': 1}], ['control: random shots 7', [2, [0, 1, 0, 0], ['0/1', '0.123']], {'01': 2}], ['control: random shots 8', [2, [1, 0, 1, 3], ['0.813', '2/5', '4/5', '0.149', '0.53']], {'11': 4, '00': 1}], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight']], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 9', [3, [0, 3, 1, 1, 5, 2, 0, 1], ['0.993', '8/13']], {'111': 1, '100': 1}], ['control: random shots 10', [3, [3, 0, 1, 2, 0, 3, 0, 5], ['10/14', '0.687', '0.608']], {'111': 2, '101': 1}], ['control: random shots 11', [2, [1, 2, 0, 2], ['0.643', '0.519', '0.64', '0.875']], {'11': 3, '01': 1}], ['control: random shots 12', [3, [5, 5, 5, 5, 1, 3, 0, 0], ['14/24', '0/24', '0.202']], {'010': 1, '000': 2}], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]]]\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"},"fixed":{"sha256":"45c253040cfc764d2d9e7d85257648c5eacc74a1cc44cabf9da2f1616eb5e823","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    n, weights, us = x\n    if len(weights) != 1 << n:\n        return 'bad-length'\n    if any(w < 0 for w in weights):\n        return 'negative-weight'\n    total = sum(weights)\n    if total == 0:\n        return 'no-support'\n    counts = {}\n    for idx, s in enumerate(us):\n        u = Fraction(s)\n        if u < 0 or u >= 1:\n            return ['bad-uniform', idx]\n        target = u * total\n        cum = 0\n        for i, w in enumerate(weights):\n            cum += w\n            if target < cum:\n                break\n        key = format(i, '0%db' % n)\n        counts[key] = counts.get(key, 0) + 1\n    return counts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: boundary uniform on cumulative edge', [1, [1, 1], ['0.5']], {'1': 1}], ['control: zero weight first outcome', [2, [0, 1, 1, 2], ['0', '0.25']], {'01': 1, '10': 1}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight'], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}], ['control: bad length', [2, [1, 1], ['0.1']], 'bad-length'], ['control: random shots 0', [1, [0, 1], ['0/1', '0.952', '0/1']], {'1': 3}], ['control: uniform exactly one', [1, [1, 1], ['1']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 1', [3, [5, 0, 2, 0, 5, 3, 0, 1], ['9/16', '9/16']], {'100': 2}], ['control: random shots 2', [1, [0, 5], ['0.967', '0.119', '0.012', '1/5', '0.243', '0/5']], {'1': 6}], ['control: random shots 3', [1, [3, 5], ['0.916', '3/8', '0.642']], {'1': 3}], ['control: random shots 4', [2, [0, 2, 2, 2], ['0.248', '3/6', '0.126', '0.765', '0.379']], {'01': 2, '10': 2, '11': 1}], ['control: negative uniform', [1, [1, 1], ['-0.25']], ['bad-uniform', 0]]], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 5', [3, [0, 0, 0, 0, 5, 5, 0, 3], ['8/13', '0.522', '0.318', '0.507', '0.577', '2/13']], {'101': 4, '100': 2}], ['control: random shots 6', [3, [1, 1, 0, 0, 0, 3, 3, 0], ['0.597', '5/8', '0.601']], {'101': 2, '110': 1}], ['control: random shots 7', [2, [0, 1, 0, 0], ['0/1', '0.123']], {'01': 2}], ['control: random shots 8', [2, [1, 0, 1, 3], ['0.813', '2/5', '4/5', '0.149', '0.53']], {'11': 4, '00': 1}], ['control: negative weight', [1, [2, -1], ['0.5']], 'negative-weight']], [['regression: all zero weights', [1, [0, 0], ['0.5']], 'no-support'], ['control: random shots 9', [3, [0, 3, 1, 1, 5, 2, 0, 1], ['0.993', '8/13']], {'111': 1, '100': 1}], ['control: random shots 10', [3, [3, 0, 1, 2, 0, 3, 0, 5], ['10/14', '0.687', '0.608']], {'111': 2, '101': 1}], ['control: random shots 11', [2, [1, 2, 0, 2], ['0.643', '0.519', '0.64', '0.875']], {'11': 3, '01': 1}], ['control: random shots 12', [3, [5, 5, 5, 5, 1, 3, 0, 0], ['14/24', '0/24', '0.202']], {'010': 1, '000': 2}], ['control: high qubit outcome', [2, [0, 0, 1, 0], ['0.3', '0.9']], {'10': 2}]]]\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 bounded teaching model with a stipulated toy contract; amplitudes are rounded to fixed decimals for strict JSON output. It is not a production quantum SDK and claims no standards conformance. 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-quantum_circuit_simulation-shot-sampling-inverse-cdf-empty-support-guard","generated_at":"2026-09-29T14:51:33.113688+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Deterministic replay of sampled shots makes simulator results reproducible; CDF boundary slips bias counts toward impossible outcomes.","repair":"Return \"no-support\" whenever the total weight is zero.","root_cause":"The support guard tests whether the weights list is empty rather than whether its total is zero.","sha256":"01f2687deb972bdbdb50e863cc003103e49cc9d43b46223ff1ce3868f8efd171","title":"Shot sampler checks list emptiness instead of total weight · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.185,"exit_code":1,"observations":[{"actual":{"1":1},"check":"regression: all zero weights","expected":"no-support","passed":false},{"actual":{"1":1},"check":"control: boundary uniform on cumulative edge","expected":{"1":1},"passed":true},{"actual":{"01":1,"10":1},"check":"control: zero weight first outcome","expected":{"01":1,"10":1},"passed":true},{"actual":["bad-uniform",0],"check":"control: uniform exactly one","expected":["bad-uniform",0],"passed":true},{"actual":["bad-uniform",0],"check":"control: negative uniform","expected":["bad-uniform",0],"passed":true},{"actual":{"10":2},"check":"control: high qubit outcome","expected":{"10":2},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: all zero weights\", \"actual\": {\"1\": 1}, \"expected\": \"no-support\", \"passed\": false}, {\"check\": \"control: boundary uniform on cumulative edge\", \"actual\": {\"1\": 1}, \"expected\": {\"1\": 1}, \"passed\": true}, {\"check\": \"control: zero weight first outcome\", \"actual\": {\"01\": 1, \"10\": 1}, \"expected\": {\"01\": 1, \"10\": 1}, \"passed\": true}, {\"check\": \"control: uniform exactly one\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: negative uniform\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: high qubit outcome\", \"actual\": {\"10\": 2}, \"expected\": {\"10\": 2}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.055,"exit_code":1,"observations":[{"actual":{"1":1},"check":"regression: all zero weights","expected":"no-support","passed":false},{"actual":{"1":1},"check":"control: boundary uniform on cumulative edge","expected":{"1":1},"passed":true},{"actual":{"01":1,"10":1},"check":"control: zero weight first outcome","expected":{"01":1,"10":1},"passed":true},{"actual":["bad-uniform",0],"check":"control: uniform exactly one","expected":["bad-uniform",0],"passed":true},{"actual":["bad-uniform",0],"check":"control: negative uniform","expected":["bad-uniform",0],"passed":true},{"actual":{"10":2},"check":"control: high qubit outcome","expected":{"10":2},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: all zero weights\", \"actual\": {\"1\": 1}, \"expected\": \"no-support\", \"passed\": false}, {\"check\": \"control: boundary uniform on cumulative edge\", \"actual\": {\"1\": 1}, \"expected\": {\"1\": 1}, \"passed\": true}, {\"check\": \"control: zero weight first outcome\", \"actual\": {\"01\": 1, \"10\": 1}, \"expected\": {\"01\": 1, \"10\": 1}, \"passed\": true}, {\"check\": \"control: uniform exactly one\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: negative uniform\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: high qubit outcome\", \"actual\": {\"10\": 2}, \"expected\": {\"10\": 2}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.047,"exit_code":0,"observations":[{"actual":"no-support","check":"regression: all zero weights","expected":"no-support","passed":true},{"actual":{"1":1},"check":"control: boundary uniform on cumulative edge","expected":{"1":1},"passed":true},{"actual":{"01":1,"10":1},"check":"control: zero weight first outcome","expected":{"01":1,"10":1},"passed":true},{"actual":["bad-uniform",0],"check":"control: uniform exactly one","expected":["bad-uniform",0],"passed":true},{"actual":["bad-uniform",0],"check":"control: negative uniform","expected":["bad-uniform",0],"passed":true},{"actual":{"10":2},"check":"control: high qubit outcome","expected":{"10":2},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: all zero weights\", \"actual\": \"no-support\", \"expected\": \"no-support\", \"passed\": true}, {\"check\": \"control: boundary uniform on cumulative edge\", \"actual\": {\"1\": 1}, \"expected\": {\"1\": 1}, \"passed\": true}, {\"check\": \"control: zero weight first outcome\", \"actual\": {\"01\": 1, \"10\": 1}, \"expected\": {\"01\": 1, \"10\": 1}, \"passed\": true}, {\"check\": \"control: uniform exactly one\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: negative uniform\", \"actual\": [\"bad-uniform\", 0], \"expected\": [\"bad-uniform\", 0], \"passed\": true}, {\"check\": \"control: high qubit outcome\", \"actual\": {\"10\": 2}, \"expected\": {\"10\": 2}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}