{"abstract":"The first full window contains W+1 samples summed but divided by W.","category":"Digital signal filters","checks":7,"contract":"Input [W, samples]; causal moving average using a running sum. During warm-up divide by the number of samples seen (min(n+1, W)). Return exact fraction strings; \"bad-window\" if W < 1.","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-running-sum-moving-average","failed_approach":"The attempted repair evicts from i >= w but removes xs[i - w + 1], a sample still inside the window.","family":"w2-digital_signal_filters-running-sum-moving-average-eviction-start-index","id":"FA-91401","implementations":{"attempt":{"sha256":"e6bce33a4e604a8dfd14be66efe3907d116525b3c9a94f512bf048f7e8807371","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    w, xs = x\n    if w < 1:\n        return 'bad-window'\n    acc = 0\n    out = []\n    for i, v in enumerate(xs):\n        acc += v\n        if i >= w:\n            acc -= xs[i - w + 1]\n        out.append(str(Fraction(acc, min(i + 1, w))))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: window one', [1, [3, 1, 4]], ['3', '1', '4']], ['regression: window three long', [3, [3, 0, 3, 6, 0, 9]], ['3', '3/2', '2', '3', '3', '5']], ['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['control: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 0', [4, [-2, 2]], ['-2', '0']], ['control: random average 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']]], [['regression: random average 2', [1, [8, 4, 7]], ['8', '4', '7']], ['regression: random average 3', [3, [5, 2, 8, 7, 6, 1, 1]], ['5', '7/2', '5', '17/3', '7', '14/3', '8/3']], ['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['control: random average 8', [2, [-4]], ['-4']], ['control: random average 9', [4, [7]], ['7']], ['control: random average 11', [5, [-1, 3, 3]], ['-1', '1', '5/3']], ['control: random average 12', [3, [0]], ['0']]], [['regression: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['regression: random average 10', [3, [9, 3, 6, 3, 5, 8]], ['9', '6', '6', '4', '14/3', '16/3']], ['regression: random average 3', [3, [5, 2, 8, 7, 6, 1, 1]], ['5', '7/2', '5', '17/3', '7', '14/3', '8/3']], ['control: random average 13', [2, [-1]], ['-1']], ['control: random average 16', [4, [6]], ['6']], ['control: random average 18', [3, [0, -3]], ['0', '-3/2']], ['control: random average 26', [2, [7]], ['7']]], [['regression: random average 15', [3, [-3, 9, -1, 5, 7, -4]], ['-3', '3', '5/3', '13/3', '11/3', '8/3']], ['regression: random average 17', [5, [-3, -2, -2, 6, 7, 9, -4, 5]], ['-3', '-5/2', '-7/3', '-1/4', '6/5', '18/5', '16/5', '23/5']], ['repair check: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 28', [3, [-1, 5, 1]], ['-1', '2', '5/3']], ['control: random average 29', [5, [1, 1]], ['1', '1']], ['control: random average 30', [4, [-4, -3, 2]], ['-4', '-7/2', '-5/3']], ['control: random average 36', [5, [6]], ['6']]], [['regression: random average 21', [5, [4, 8, 3, -3, 0, 3]], ['4', '6', '5', '3', '12/5', '11/5']], ['regression: random average 22', [3, [2, 0, 4, 3, -3, 1, 0]], ['2', '1', '2', '7/3', '4/3', '1/3', '-2/3']], ['regression: random average 10', [3, [9, 3, 6, 3, 5, 8]], ['9', '6', '6', '4', '14/3', '16/3']], ['control: random average 39', [3, [-4]], ['-4']], ['control: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 0', [4, [-2, 2]], ['-2', '0']]]]\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":"bc1b8f738f3c9d2a64b67b52b99588680679e76bc7d8538dd0b8a2911c54f0da","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    w, xs = x\n    if w < 1:\n        return 'bad-window'\n    acc = 0\n    out = []\n    for i, v in enumerate(xs):\n        acc += v\n        if i > w:\n            acc -= xs[i - w]\n        out.append(str(Fraction(acc, min(i + 1, w))))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: window one', [1, [3, 1, 4]], ['3', '1', '4']], ['regression: window three long', [3, [3, 0, 3, 6, 0, 9]], ['3', '3/2', '2', '3', '3', '5']], ['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['control: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 0', [4, [-2, 2]], ['-2', '0']], ['control: random average 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']]], [['regression: random average 2', [1, [8, 4, 7]], ['8', '4', '7']], ['regression: random average 3', [3, [5, 2, 8, 7, 6, 1, 1]], ['5', '7/2', '5', '17/3', '7', '14/3', '8/3']], ['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['control: random average 8', [2, [-4]], ['-4']], ['control: random average 9', [4, [7]], ['7']], ['control: random average 11', [5, [-1, 3, 3]], ['-1', '1', '5/3']], ['control: random average 12', [3, [0]], ['0']]], [['regression: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['regression: random average 10', [3, [9, 3, 6, 3, 5, 8]], ['9', '6', '6', '4', '14/3', '16/3']], ['regression: random average 3', [3, [5, 2, 8, 7, 6, 1, 1]], ['5', '7/2', '5', '17/3', '7', '14/3', '8/3']], ['control: random average 13', [2, [-1]], ['-1']], ['control: random average 16', [4, [6]], ['6']], ['control: random average 18', [3, [0, -3]], ['0', '-3/2']], ['control: random average 26', [2, [7]], ['7']]], [['regression: random average 15', [3, [-3, 9, -1, 5, 7, -4]], ['-3', '3', '5/3', '13/3', '11/3', '8/3']], ['regression: random average 17', [5, [-3, -2, -2, 6, 7, 9, -4, 5]], ['-3', '-5/2', '-7/3', '-1/4', '6/5', '18/5', '16/5', '23/5']], ['repair check: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 28', [3, [-1, 5, 1]], ['-1', '2', '5/3']], ['control: random average 29', [5, [1, 1]], ['1', '1']], ['control: random average 30', [4, [-4, -3, 2]], ['-4', '-7/2', '-5/3']], ['control: random average 36', [5, [6]], ['6']]], [['regression: random average 21', [5, [4, 8, 3, -3, 0, 3]], ['4', '6', '5', '3', '12/5', '11/5']], ['regression: random average 22', [3, [2, 0, 4, 3, -3, 1, 0]], ['2', '1', '2', '7/3', '4/3', '1/3', '-2/3']], ['regression: random average 10', [3, [9, 3, 6, 3, 5, 8]], ['9', '6', '6', '4', '14/3', '16/3']], ['control: random average 39', [3, [-4]], ['-4']], ['control: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 0', [4, [-2, 2]], ['-2', '0']]]]\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; exact rational arithmetic or fixed-decimal rounding keeps outputs strict JSON. It is not a production DSP library 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-digital_signal_filters-running-sum-moving-average-eviction-start-index","generated_at":"2026-09-29T14:51:35.635024+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Running-sum boxcars are the cheapest smoothing filter; eviction and warm-up slips bias every early or late sample.","root_cause":"The eviction condition is i > w, so the sample leaving the window at i == w is kept.","sha256":"f8f39622fee10cdca7d4ecec9d7bd5242dd6d81a9b53286d91c47bfffc383dbe","title":"Running average starts evicting one sample late · 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":44.641,"exit_code":1,"observations":[{"actual":["3","3","3"],"check":"regression: window one","expected":["3","1","4"],"passed":false},{"actual":["3","3/2","2","4","3","4"],"check":"regression: window three long","expected":["3","3/2","2","3","3","5"],"passed":false},{"actual":["-4","-5/2","-7/2","1/2","-4"],"check":"regression: random average 1","expected":["-4","-5/2","-2","1","1/2"],"passed":false},{"actual":["1","3/2","2"],"check":"control: window equals length","expected":["1","3/2","2"],"passed":true},{"actual":"bad-window","check":"control: bad window","expected":"bad-window","passed":true},{"actual":["-2","0"],"check":"control: random average 0","expected":["-2","0"],"passed":true},{"actual":["-1","-3/2","-1","1"],"check":"control: random average 7","expected":["-1","-3/2","-1","1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window one\", \"actual\": [\"3\", \"3\", \"3\"], \"expected\": [\"3\", \"1\", \"4\"], \"passed\": false}, {\"check\": \"regression: window three long\", \"actual\": [\"3\", \"3/2\", \"2\", \"4\", \"3\", \"4\"], \"expected\": [\"3\", \"3/2\", \"2\", \"3\", \"3\", \"5\"], \"passed\": false}, {\"check\": \"regression: random average 1\", \"actual\": [\"-4\", \"-5/2\", \"-7/2\", \"1/2\", \"-4\"], \"expected\": [\"-4\", \"-5/2\", \"-2\", \"1\", \"1/2\"], \"passed\": false}, {\"check\": \"control: window equals length\", \"actual\": [\"1\", \"3/2\", \"2\"], \"expected\": [\"1\", \"3/2\", \"2\"], \"passed\": true}, {\"check\": \"control: bad window\", \"actual\": \"bad-window\", \"expected\": \"bad-window\", \"passed\": true}, {\"check\": \"control: random average 0\", \"actual\": [\"-2\", \"0\"], \"expected\": [\"-2\", \"0\"], \"passed\": true}, {\"check\": \"control: random average 7\", \"actual\": [\"-1\", \"-3/2\", \"-1\", \"1\"], \"expected\": [\"-1\", \"-3/2\", \"-1\", \"1\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.748,"exit_code":1,"observations":[{"actual":["3","4","7"],"check":"regression: window one","expected":["3","1","4"],"passed":false},{"actual":["3","3/2","2","4","4","6"],"check":"regression: window three long","expected":["3","3/2","2","3","3","5"],"passed":false},{"actual":["-4","-5/2","-4","-1","-3/2"],"check":"regression: random average 1","expected":["-4","-5/2","-2","1","1/2"],"passed":false},{"actual":["1","3/2","2"],"check":"control: window equals length","expected":["1","3/2","2"],"passed":true},{"actual":"bad-window","check":"control: bad window","expected":"bad-window","passed":true},{"actual":["-2","0"],"check":"control: random average 0","expected":["-2","0"],"passed":true},{"actual":["-1","-3/2","-1","1"],"check":"control: random average 7","expected":["-1","-3/2","-1","1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window one\", \"actual\": [\"3\", \"4\", \"7\"], \"expected\": [\"3\", \"1\", \"4\"], \"passed\": false}, {\"check\": \"regression: window three long\", \"actual\": [\"3\", \"3/2\", \"2\", \"4\", \"4\", \"6\"], \"expected\": [\"3\", \"3/2\", \"2\", \"3\", \"3\", \"5\"], \"passed\": false}, {\"check\": \"regression: random average 1\", \"actual\": [\"-4\", \"-5/2\", \"-4\", \"-1\", \"-3/2\"], \"expected\": [\"-4\", \"-5/2\", \"-2\", \"1\", \"1/2\"], \"passed\": false}, {\"check\": \"control: window equals length\", \"actual\": [\"1\", \"3/2\", \"2\"], \"expected\": [\"1\", \"3/2\", \"2\"], \"passed\": true}, {\"check\": \"control: bad window\", \"actual\": \"bad-window\", \"expected\": \"bad-window\", \"passed\": true}, {\"check\": \"control: random average 0\", \"actual\": [\"-2\", \"0\"], \"expected\": [\"-2\", \"0\"], \"passed\": true}, {\"check\": \"control: random average 7\", \"actual\": [\"-1\", \"-3/2\", \"-1\", \"1\"], \"expected\": [\"-1\", \"-3/2\", \"-1\", \"1\"], \"passed\": true}], \"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."}}