{"abstract":"K = 2 silently produces a three-sample window instead of \"bad-window\".","category":"Digital signal filters","checks":6,"contract":"Input [K, mode, samples]; K must be odd (\"bad-window\"). Centered moving average over indices i-K//2..i+K//2 with edge mode \"shrink\" (average available samples), \"zero\" (missing samples count as 0, divide by K), \"replicate\" (clamp index) or \"reflect\" (mirror without repeating the edge: -1 -> 1, n -> n-2). Return exact fraction strings.","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-centered-average-edges","failed_approach":"The attempted repair only rejects even windows larger than 2.","family":"w2-digital_signal_filters-centered-average-edges-odd-window-validation","id":"FA-91421","implementations":{"attempt":{"sha256":"6db72b70983c663e8094b0bf8ee9d2d66134c79426d78f9b320f2cc47112935d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    k, mode, xs = x\n    if k < 1 or k % 2 == 0 and k > 2:\n        return 'bad-window'\n    n = len(xs)\n    h = k // 2\n    out = []\n    for i in range(n):\n        vals = []\n        for j in range(i - h, i + h + 1):\n            if 0 <= j < n:\n                vals.append(xs[j])\n            elif mode == 'zero':\n                vals.append(0)\n            elif mode == 'replicate':\n                vals.append(xs[min(max(j, 0), n - 1)])\n            elif mode == 'reflect':\n                jj = -j if j < 0 else 2 * (n - 1) - j\n                vals.append(xs[jj])\n        out.append(str(Fraction(sum(vals), len(vals))))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: reflect edges', [3, 'reflect', [1, 5, 2, 8]], ['11/3', '8/3', '5', '4']], ['control: reflect wide', [5, 'reflect', [4, 0, 2, 6, 1]], ['8/5', '12/5', '13/5', '3', '17/5']], ['control: zero padding', [3, 'zero', [3, 3, 3]], ['2', '3', '2']], ['control: shrink edges', [3, 'shrink', [2, 4, 6]], ['3', '4', '5']]], [['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['control: replicate', [5, 'replicate', [1, 2, 3, 10]], ['8/5', '17/5', '26/5', '7']], ['control: random centered 0', [3, 'zero', [6, -1, 8]], ['5/3', '13/3', '7/3']], ['control: random centered 1', [3, 'shrink', [-4, 0, 9]], ['-2', '5/3', '9/2']], ['control: random centered 2', [5, 'replicate', [3, 1, 0, 6, 1, 3]], ['2', '13/5', '11/5', '11/5', '13/5', '16/5']]], [['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: random centered 3', [3, 'reflect', [-2, 3, 6]], ['4/3', '7/3', '4']], ['control: random centered 4', [5, 'zero', [-5, 1, -2]], ['-6/5', '-6/5', '-6/5']], ['control: random centered 5', [5, 'zero', [-2, 7, -2]], ['3/5', '3/5', '3/5']], ['control: random centered 6', [3, 'shrink', [0, 8, -5, -4, 8, 9]], ['4', '1', '-1/3', '-1/3', '13/3', '17/2']]], [['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['control: random centered 7', [3, 'shrink', [0, 4, -2, -2, 2, -3]], ['2', '2/3', '0', '-2/3', '-1', '-1/2']], ['control: random centered 8', [3, 'shrink', [3, -3, 2, -2]], ['0', '2/3', '-1', '0']], ['control: random centered 9', [3, 'replicate', [8, 2, 4, 4, 6]], ['6', '14/3', '10/3', '14/3', '16/3']], ['control: random centered 10', [5, 'reflect', [-1, -5, 8]], ['1', '-8/5', '-4/5']]], [['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: random centered 11', [3, 'shrink', [-1, -3, -4, 4, 1]], ['-2', '-8/3', '-1', '1/3', '5/2']], ['control: random centered 12', [5, 'replicate', [-4, 2, -1, 3, 0, -4]], ['-11/5', '-4/5', '0', '0', '-6/5', '-9/5']], ['control: random centered 13', [3, 'replicate', [3, 1, 2, 4, -3]], ['7/3', '2', '7/3', '1', '-2/3']], ['control: random centered 14', [1, 'zero', [7, 5, 6, 0, 8]], ['7', '5', '6', '0', '8']]]]\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":"86eb3370c6474f3a611a15013d80b59c31f6483379694f612193e3ec551720d0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    k, mode, xs = x\n    if k < 1:\n        return 'bad-window'\n    n = len(xs)\n    h = k // 2\n    out = []\n    for i in range(n):\n        vals = []\n        for j in range(i - h, i + h + 1):\n            if 0 <= j < n:\n                vals.append(xs[j])\n            elif mode == 'zero':\n                vals.append(0)\n            elif mode == 'replicate':\n                vals.append(xs[min(max(j, 0), n - 1)])\n            elif mode == 'reflect':\n                jj = -j if j < 0 else 2 * (n - 1) - j\n                vals.append(xs[jj])\n        out.append(str(Fraction(sum(vals), len(vals))))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: reflect edges', [3, 'reflect', [1, 5, 2, 8]], ['11/3', '8/3', '5', '4']], ['control: reflect wide', [5, 'reflect', [4, 0, 2, 6, 1]], ['8/5', '12/5', '13/5', '3', '17/5']], ['control: zero padding', [3, 'zero', [3, 3, 3]], ['2', '3', '2']], ['control: shrink edges', [3, 'shrink', [2, 4, 6]], ['3', '4', '5']]], [['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['control: replicate', [5, 'replicate', [1, 2, 3, 10]], ['8/5', '17/5', '26/5', '7']], ['control: random centered 0', [3, 'zero', [6, -1, 8]], ['5/3', '13/3', '7/3']], ['control: random centered 1', [3, 'shrink', [-4, 0, 9]], ['-2', '5/3', '9/2']], ['control: random centered 2', [5, 'replicate', [3, 1, 0, 6, 1, 3]], ['2', '13/5', '11/5', '11/5', '13/5', '16/5']]], [['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: random centered 3', [3, 'reflect', [-2, 3, 6]], ['4/3', '7/3', '4']], ['control: random centered 4', [5, 'zero', [-5, 1, -2]], ['-6/5', '-6/5', '-6/5']], ['control: random centered 5', [5, 'zero', [-2, 7, -2]], ['3/5', '3/5', '3/5']], ['control: random centered 6', [3, 'shrink', [0, 8, -5, -4, 8, 9]], ['4', '1', '-1/3', '-1/3', '13/3', '17/2']]], [['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['control: random centered 7', [3, 'shrink', [0, 4, -2, -2, 2, -3]], ['2', '2/3', '0', '-2/3', '-1', '-1/2']], ['control: random centered 8', [3, 'shrink', [3, -3, 2, -2]], ['0', '2/3', '-1', '0']], ['control: random centered 9', [3, 'replicate', [8, 2, 4, 4, 6]], ['6', '14/3', '10/3', '14/3', '16/3']], ['control: random centered 10', [5, 'reflect', [-1, -5, 8]], ['1', '-8/5', '-4/5']]], [['regression: even window', [2, 'shrink', [1, 2, 3]], 'bad-window'], ['regression: even window four', [4, 'zero', [1, 2, 3, 4]], 'bad-window'], ['control: random centered 11', [3, 'shrink', [-1, -3, -4, 4, 1]], ['-2', '-8/3', '-1', '1/3', '5/2']], ['control: random centered 12', [5, 'replicate', [-4, 2, -1, 3, 0, -4]], ['-11/5', '-4/5', '0', '0', '-6/5', '-9/5']], ['control: random centered 13', [3, 'replicate', [3, 1, 2, 4, -3]], ['7/3', '2', '7/3', '1', '-2/3']], ['control: random centered 14', [1, 'zero', [7, 5, 6, 0, 8]], ['7', '5', '6', '0', '8']]]]\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-centered-average-edges-odd-window-validation","generated_at":"2026-09-29T14:51:35.727443+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Offline smoothing needs explicit edge handling; mirror and padding conventions differ between tools and are easy to mix up.","root_cause":"The odd-length check is missing, so K//2 rounds an even window up to K+1 taps.","sha256":"fca701eb854c87fccb450a857e72e15721e0bfa7e54c42e6f1fcd09871e3aac1","title":"Centered average accepts an even 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":43.027,"exit_code":1,"observations":[{"actual":["3/2","2","5/2"],"check":"regression: even window","expected":"bad-window","passed":false},{"actual":"bad-window","check":"regression: even window four","expected":"bad-window","passed":true},{"actual":["11/3","8/3","5","4"],"check":"control: reflect edges","expected":["11/3","8/3","5","4"],"passed":true},{"actual":["8/5","12/5","13/5","3","17/5"],"check":"control: reflect wide","expected":["8/5","12/5","13/5","3","17/5"],"passed":true},{"actual":["2","3","2"],"check":"control: zero padding","expected":["2","3","2"],"passed":true},{"actual":["3","4","5"],"check":"control: shrink edges","expected":["3","4","5"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: even window\", \"actual\": [\"3/2\", \"2\", \"5/2\"], \"expected\": \"bad-window\", \"passed\": false}, {\"check\": \"regression: even window four\", \"actual\": \"bad-window\", \"expected\": \"bad-window\", \"passed\": true}, {\"check\": \"control: reflect edges\", \"actual\": [\"11/3\", \"8/3\", \"5\", \"4\"], \"expected\": [\"11/3\", \"8/3\", \"5\", \"4\"], \"passed\": true}, {\"check\": \"control: reflect wide\", \"actual\": [\"8/5\", \"12/5\", \"13/5\", \"3\", \"17/5\"], \"expected\": [\"8/5\", \"12/5\", \"13/5\", \"3\", \"17/5\"], \"passed\": true}, {\"check\": \"control: zero padding\", \"actual\": [\"2\", \"3\", \"2\"], \"expected\": [\"2\", \"3\", \"2\"], \"passed\": true}, {\"check\": \"control: shrink edges\", \"actual\": [\"3\", \"4\", \"5\"], \"expected\": [\"3\", \"4\", \"5\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.99,"exit_code":1,"observations":[{"actual":["3/2","2","5/2"],"check":"regression: even window","expected":"bad-window","passed":false},{"actual":["6/5","2","2","9/5"],"check":"regression: even window four","expected":"bad-window","passed":false},{"actual":["11/3","8/3","5","4"],"check":"control: reflect edges","expected":["11/3","8/3","5","4"],"passed":true},{"actual":["8/5","12/5","13/5","3","17/5"],"check":"control: reflect wide","expected":["8/5","12/5","13/5","3","17/5"],"passed":true},{"actual":["2","3","2"],"check":"control: zero padding","expected":["2","3","2"],"passed":true},{"actual":["3","4","5"],"check":"control: shrink edges","expected":["3","4","5"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: even window\", \"actual\": [\"3/2\", \"2\", \"5/2\"], \"expected\": \"bad-window\", \"passed\": false}, {\"check\": \"regression: even window four\", \"actual\": [\"6/5\", \"2\", \"2\", \"9/5\"], \"expected\": \"bad-window\", \"passed\": false}, {\"check\": \"control: reflect edges\", \"actual\": [\"11/3\", \"8/3\", \"5\", \"4\"], \"expected\": [\"11/3\", \"8/3\", \"5\", \"4\"], \"passed\": true}, {\"check\": \"control: reflect wide\", \"actual\": [\"8/5\", \"12/5\", \"13/5\", \"3\", \"17/5\"], \"expected\": [\"8/5\", \"12/5\", \"13/5\", \"3\", \"17/5\"], \"passed\": true}, {\"check\": \"control: zero padding\", \"actual\": [\"2\", \"3\", \"2\"], \"expected\": [\"2\", \"3\", \"2\"], \"passed\": true}, {\"check\": \"control: shrink edges\", \"actual\": [\"3\", \"4\", \"5\"], \"expected\": [\"3\", \"4\", \"5\"], \"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."}}