{"abstract":"The first W-1 outputs are biased toward zero.","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 divides by max(n, 1) during warm-up, one sample short after the first output.","family":"w2-digital_signal_filters-running-sum-moving-average-warm-up-divisor","id":"FA-91406","implementations":{"attempt":{"sha256":"2223aa5a18847a8ca06e34c03c8f4c35e4dcf725fd0a0a2680a88861cc928e61","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, max(i, 1) if i < w else w)))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['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 one', [1, [3, 1, 4]], ['3', '1', '4']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 2', [1, [8, 4, 7]], ['8', '4', '7']], ['control: random average 4', [1, [9, 0, 5, -2, -3, 4]], ['9', '0', '5', '-2', '-3', '4']]], [['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['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 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']], ['control: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['control: random average 12', [3, [0]], ['0']], ['control: random average 14', [1, [1, 5, -1, 2, -3]], ['1', '5', '-1', '2', '-3']]], [['regression: random average 8', [2, [-4]], ['-4']], ['regression: random average 9', [4, [7]], ['7']], ['regression: random average 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']], ['control: random average 19', [1, [0, -2, 7, 4, 6, 6, -1]], ['0', '-2', '7', '4', '6', '6', '-1']], ['control: random average 20', [1, [3, 0, -3, 4, 8]], ['3', '0', '-3', '4', '8']], ['control: random average 33', [1, [0, -4, 4, 7, -1, 5]], ['0', '-4', '4', '7', '-1', '5']], ['control: random average 35', [1, [-3, 2]], ['-3', '2']]], [['regression: random average 11', [5, [-1, 3, 3]], ['-1', '1', '5/3']], ['regression: random average 13', [2, [-1]], ['-1']], ['regression: random average 15', [3, [-3, 9, -1, 5, 7, -4]], ['-3', '3', '5/3', '13/3', '11/3', '8/3']], ['control: random average 38', [1, [4, 5, 1, 6, 5, 9]], ['4', '5', '1', '6', '5', '9']], ['control: window one', [1, [3, 1, 4]], ['3', '1', '4']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 2', [1, [8, 4, 7]], ['8', '4', '7']]], [['regression: random average 16', [4, [6]], ['6']], ['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']], ['regression: random average 18', [3, [0, -3]], ['0', '-3/2']], ['control: random average 4', [1, [9, 0, 5, -2, -3, 4]], ['9', '0', '5', '-2', '-3', '4']], ['control: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['control: random average 12', [3, [0]], ['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":"a42eef6d80134bedd4f023411681b042f3782f14d45f9d8c65b41a930cbe5918","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, w)))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: window equals length', [3, [1, 2, 3]], ['1', '3/2', '2']], ['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 one', [1, [3, 1, 4]], ['3', '1', '4']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 2', [1, [8, 4, 7]], ['8', '4', '7']], ['control: random average 4', [1, [9, 0, 5, -2, -3, 4]], ['9', '0', '5', '-2', '-3', '4']]], [['regression: random average 1', [2, [-4, -1, -3, 5, -4]], ['-4', '-5/2', '-2', '1', '1/2']], ['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 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']], ['control: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['control: random average 12', [3, [0]], ['0']], ['control: random average 14', [1, [1, 5, -1, 2, -3]], ['1', '5', '-1', '2', '-3']]], [['regression: random average 8', [2, [-4]], ['-4']], ['regression: random average 9', [4, [7]], ['7']], ['regression: random average 7', [4, [-1, -2, 0, 7]], ['-1', '-3/2', '-1', '1']], ['control: random average 19', [1, [0, -2, 7, 4, 6, 6, -1]], ['0', '-2', '7', '4', '6', '6', '-1']], ['control: random average 20', [1, [3, 0, -3, 4, 8]], ['3', '0', '-3', '4', '8']], ['control: random average 33', [1, [0, -4, 4, 7, -1, 5]], ['0', '-4', '4', '7', '-1', '5']], ['control: random average 35', [1, [-3, 2]], ['-3', '2']]], [['regression: random average 11', [5, [-1, 3, 3]], ['-1', '1', '5/3']], ['regression: random average 13', [2, [-1]], ['-1']], ['regression: random average 15', [3, [-3, 9, -1, 5, 7, -4]], ['-3', '3', '5/3', '13/3', '11/3', '8/3']], ['control: random average 38', [1, [4, 5, 1, 6, 5, 9]], ['4', '5', '1', '6', '5', '9']], ['control: window one', [1, [3, 1, 4]], ['3', '1', '4']], ['control: bad window', [0, [1]], 'bad-window'], ['control: random average 2', [1, [8, 4, 7]], ['8', '4', '7']]], [['regression: random average 16', [4, [6]], ['6']], ['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']], ['regression: random average 18', [3, [0, -3]], ['0', '-3/2']], ['control: random average 4', [1, [9, 0, 5, -2, -3, 4]], ['9', '0', '5', '-2', '-3', '4']], ['control: random average 5', [1, [0, 1]], ['0', '1']], ['control: random average 6', [1, [-4, 1, 2, -3, 3]], ['-4', '1', '2', '-3', '3']], ['control: random average 12', [3, [0]], ['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-warm-up-divisor","generated_at":"2026-09-29T14:51:35.634492+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 divisor is always W, even before W samples have arrived.","sha256":"9538f8dae7e8cf0ef16dfe18b25ca081a148cf685c2ec2797f24fc3cf597261e","title":"Running average divides warm-up sums by the full window · 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.585,"exit_code":1,"observations":[{"actual":["1","3","3"],"check":"regression: window equals length","expected":["1","3/2","2"],"passed":false},{"actual":["3","3","3","3","3","5"],"check":"regression: window three long","expected":["3","3/2","2","3","3","5"],"passed":false},{"actual":["-4","-5","-2","1","1/2"],"check":"regression: random average 1","expected":["-4","-5/2","-2","1","1/2"],"passed":false},{"actual":["3","1","4"],"check":"control: window one","expected":["3","1","4"],"passed":true},{"actual":"bad-window","check":"control: bad window","expected":"bad-window","passed":true},{"actual":["8","4","7"],"check":"control: random average 2","expected":["8","4","7"],"passed":true},{"actual":["9","0","5","-2","-3","4"],"check":"control: random average 4","expected":["9","0","5","-2","-3","4"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window equals length\", \"actual\": [\"1\", \"3\", \"3\"], \"expected\": [\"1\", \"3/2\", \"2\"], \"passed\": false}, {\"check\": \"regression: window three long\", \"actual\": [\"3\", \"3\", \"3\", \"3\", \"3\", \"5\"], \"expected\": [\"3\", \"3/2\", \"2\", \"3\", \"3\", \"5\"], \"passed\": false}, {\"check\": \"regression: random average 1\", \"actual\": [\"-4\", \"-5\", \"-2\", \"1\", \"1/2\"], \"expected\": [\"-4\", \"-5/2\", \"-2\", \"1\", \"1/2\"], \"passed\": false}, {\"check\": \"control: window one\", \"actual\": [\"3\", \"1\", \"4\"], \"expected\": [\"3\", \"1\", \"4\"], \"passed\": true}, {\"check\": \"control: bad window\", \"actual\": \"bad-window\", \"expected\": \"bad-window\", \"passed\": true}, {\"check\": \"control: random average 2\", \"actual\": [\"8\", \"4\", \"7\"], \"expected\": [\"8\", \"4\", \"7\"], \"passed\": true}, {\"check\": \"control: random average 4\", \"actual\": [\"9\", \"0\", \"5\", \"-2\", \"-3\", \"4\"], \"expected\": [\"9\", \"0\", \"5\", \"-2\", \"-3\", \"4\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.505,"exit_code":1,"observations":[{"actual":["1/3","1","2"],"check":"regression: window equals length","expected":["1","3/2","2"],"passed":false},{"actual":["1","1","2","3","3","5"],"check":"regression: window three long","expected":["3","3/2","2","3","3","5"],"passed":false},{"actual":["-2","-5/2","-2","1","1/2"],"check":"regression: random average 1","expected":["-4","-5/2","-2","1","1/2"],"passed":false},{"actual":["3","1","4"],"check":"control: window one","expected":["3","1","4"],"passed":true},{"actual":"bad-window","check":"control: bad window","expected":"bad-window","passed":true},{"actual":["8","4","7"],"check":"control: random average 2","expected":["8","4","7"],"passed":true},{"actual":["9","0","5","-2","-3","4"],"check":"control: random average 4","expected":["9","0","5","-2","-3","4"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: window equals length\", \"actual\": [\"1/3\", \"1\", \"2\"], \"expected\": [\"1\", \"3/2\", \"2\"], \"passed\": false}, {\"check\": \"regression: window three long\", \"actual\": [\"1\", \"1\", \"2\", \"3\", \"3\", \"5\"], \"expected\": [\"3\", \"3/2\", \"2\", \"3\", \"3\", \"5\"], \"passed\": false}, {\"check\": \"regression: random average 1\", \"actual\": [\"-2\", \"-5/2\", \"-2\", \"1\", \"1/2\"], \"expected\": [\"-4\", \"-5/2\", \"-2\", \"1\", \"1/2\"], \"passed\": false}, {\"check\": \"control: window one\", \"actual\": [\"3\", \"1\", \"4\"], \"expected\": [\"3\", \"1\", \"4\"], \"passed\": true}, {\"check\": \"control: bad window\", \"actual\": \"bad-window\", \"expected\": \"bad-window\", \"passed\": true}, {\"check\": \"control: random average 2\", \"actual\": [\"8\", \"4\", \"7\"], \"expected\": [\"8\", \"4\", \"7\"], \"passed\": true}, {\"check\": \"control: random average 4\", \"actual\": [\"9\", \"0\", \"5\", \"-2\", \"-3\", \"4\"], \"expected\": [\"9\", \"0\", \"5\", \"-2\", \"-3\", \"4\"], \"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."}}