{"abstract":"Outputs have the opposite sign for odd N.","category":"Digital signal filters","checks":7,"contract":"Input [N, R, M, samples]: N integrator stages at the input rate, keep the integrator output at indices R-1, 2R-1, ... (whole blocks only), then N comb stages y = v - v[k-M] at the low rate with zero initial state; divide by the gain (R M)^N and return exact fraction strings.","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-cic-decimator","failed_approach":"The attempted repair takes the absolute difference, destroying the sign of negative inputs.","family":"w2-digital_signal_filters-cic-decimator-comb-subtraction-direction","id":"FA-91446","implementations":{"attempt":{"sha256":"434bc54fcc12c55eea6722613b3a992bb2e426cc1b3a533033f291e7142a9436","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    N, R, M, xs = x\n    ints = [0] * N\n    dec = []\n    for i, v in enumerate(xs):\n        acc = v\n        for k in range(N):\n            ints[k] += acc\n            acc = ints[k]\n        if i % R == R - 1:\n            dec.append(acc)\n    combs = [[0] * M for _ in range(N)]\n    out = []\n    for v in dec:\n        for k in range(N):\n            d = combs[k]\n            prev = d.pop(0)\n            d.append(v)\n            v = abs(v - prev)\n        out.append(str(Fraction(v, (R * M) ** N)))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: one stage R=2 M=1', [1, 2, 1, [1, 2, 3, 4, 5, 6]], ['3/2', '7/2', '11/2']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['control: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['control: random cic 13', [2, 3, 2, [0, 3, 3, -2, 4, -2, 2, 4, 1, 1]], ['1/4', '3/4', '7/6']], ['control: random cic 23', [2, 4, 2, [-3, 5, 5, 3, 0, 2, -3, 3, 4, 5, 0, -1, 0, 1, -1, 1, 1]], ['1/4', '59/64', '105/64', '101/64']], ['control: random cic 25', [2, 2, 2, [-1, 2, 5, -2, -1]], ['0', '5/8']]], [['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']], ['control: random cic 26', [2, 2, 1, [1, 5, -3, 3, -2, 1, -1, 4, 1, 2]], ['7/4', '1/2', '0', '3/4', '2']], ['control: random cic 27', [2, 4, 1, [-1, 3, 5, 4, -3, 3, 3, 2, 2]], ['19/16', '15/8']], ['control: random cic 35', [2, 4, 2, [4, 1, 2, 2, 5, 1, -1, -2, -2, 3, 3, -3, 2]], ['25/64', '5/4', '41/32']], ['control: random cic 40', [2, 4, 2, [4, -2, 4, 1, 3, -2, -3, 5, 1, 1]], ['19/64', '13/16']]], [['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['repair check: random cic 7', [2, 4, 1, [3, -2, 2, -1, 3, -1, 0, -1, 0, -2, -3, -2]], ['9/16', '7/16', '-9/8']], ['control: random cic 41', [2, 4, 1, [1, 4, 3, 3, 1, 1, -1, 0, -2, 5, 0, 3, 2, 4, 2, 4, 5, 5, 1, -2]], ['25/16', '3/2', '9/16', '21/8', '55/16']], ['control: random cic 47', [2, 4, 1, [-2, 0, 4, 0, -1, 5, -2, 4, 0, -2, -1]], ['0', '19/16']], ['control: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['control: random cic 13', [2, 3, 2, [0, 3, 3, -2, 4, -2, 2, 4, 1, 1]], ['1/4', '3/4', '7/6']]], [['regression: random cic 6', [1, 4, 1, [-2, 5, 3, -2, 5, -2, 1, 3, 0, -2, -3, 4, -2, -1, 5, 4, 2, 0, -2, 1]], ['1', '7/4', '-1/4', '3/2', '1/4']], ['regression: random cic 8', [3, 3, 1, [-1, 1, 5, 5, 3, 3, 0, -2, 2, 2, 1, 1, 1, -3]], ['2/27', '80/27', '55/27', '7/9']], ['regression: random cic 16', [3, 2, 2, [-1, 0, 1, 2, 5, 5, 3, -1, 5, -3]], ['-3/64', '-5/64', '15/32', '59/32', '181/64']], ['control: random cic 23', [2, 4, 2, [-3, 5, 5, 3, 0, 2, -3, 3, 4, 5, 0, -1, 0, 1, -1, 1, 1]], ['1/4', '59/64', '105/64', '101/64']], ['control: random cic 25', [2, 2, 2, [-1, 2, 5, -2, -1]], ['0', '5/8']], ['control: random cic 26', [2, 2, 1, [1, 5, -3, 3, -2, 1, -1, 4, 1, 2]], ['7/4', '1/2', '0', '3/4', '2']], ['control: random cic 27', [2, 4, 1, [-1, 3, 5, 4, -3, 3, 3, 2, 2]], ['19/16', '15/8']]], [['regression: random cic 10', [3, 2, 2, [-2, 3, -2, 1, 1, 0, 0]], ['-3/64', '-7/64', '1/64']], ['regression: random cic 11', [3, 2, 2, [1, -1, 2, 1, -2, 3]], ['1/32', '11/64', '23/64']], ['repair check: random cic 19', [2, 4, 1, [4, 4, 2, 0, -3, 0, -1, 5, 0, 3, -1, 1]], ['2', '-1/16', '21/16']], ['control: random cic 35', [2, 4, 2, [4, 1, 2, 2, 5, 1, -1, -2, -2, 3, 3, -3, 2]], ['25/64', '5/4', '41/32']], ['control: random cic 40', [2, 4, 2, [4, -2, 4, 1, 3, -2, -3, 5, 1, 1]], ['19/64', '13/16']], ['control: random cic 41', [2, 4, 1, [1, 4, 3, 3, 1, 1, -1, 0, -2, 5, 0, 3, 2, 4, 2, 4, 5, 5, 1, -2]], ['25/16', '3/2', '9/16', '21/8', '55/16']], ['control: random cic 47', [2, 4, 1, [-2, 0, 4, 0, -1, 5, -2, 4, 0, -2, -1]], ['0', '19/16']]]]\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":"f698cf5152d6fa401d5b838409b91779d66f0d2a196c10c9c058a998138cd78c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    N, R, M, xs = x\n    ints = [0] * N\n    dec = []\n    for i, v in enumerate(xs):\n        acc = v\n        for k in range(N):\n            ints[k] += acc\n            acc = ints[k]\n        if i % R == R - 1:\n            dec.append(acc)\n    combs = [[0] * M for _ in range(N)]\n    out = []\n    for v in dec:\n        for k in range(N):\n            d = combs[k]\n            prev = d.pop(0)\n            d.append(v)\n            v = prev - v\n        out.append(str(Fraction(v, (R * M) ** N)))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: one stage R=2 M=1', [1, 2, 1, [1, 2, 3, 4, 5, 6]], ['3/2', '7/2', '11/2']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['control: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['control: random cic 13', [2, 3, 2, [0, 3, 3, -2, 4, -2, 2, 4, 1, 1]], ['1/4', '3/4', '7/6']], ['control: random cic 23', [2, 4, 2, [-3, 5, 5, 3, 0, 2, -3, 3, 4, 5, 0, -1, 0, 1, -1, 1, 1]], ['1/4', '59/64', '105/64', '101/64']], ['control: random cic 25', [2, 2, 2, [-1, 2, 5, -2, -1]], ['0', '5/8']]], [['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']], ['control: random cic 26', [2, 2, 1, [1, 5, -3, 3, -2, 1, -1, 4, 1, 2]], ['7/4', '1/2', '0', '3/4', '2']], ['control: random cic 27', [2, 4, 1, [-1, 3, 5, 4, -3, 3, 3, 2, 2]], ['19/16', '15/8']], ['control: random cic 35', [2, 4, 2, [4, 1, 2, 2, 5, 1, -1, -2, -2, 3, 3, -3, 2]], ['25/64', '5/4', '41/32']], ['control: random cic 40', [2, 4, 2, [4, -2, 4, 1, 3, -2, -3, 5, 1, 1]], ['19/64', '13/16']]], [['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['repair check: random cic 7', [2, 4, 1, [3, -2, 2, -1, 3, -1, 0, -1, 0, -2, -3, -2]], ['9/16', '7/16', '-9/8']], ['control: random cic 41', [2, 4, 1, [1, 4, 3, 3, 1, 1, -1, 0, -2, 5, 0, 3, 2, 4, 2, 4, 5, 5, 1, -2]], ['25/16', '3/2', '9/16', '21/8', '55/16']], ['control: random cic 47', [2, 4, 1, [-2, 0, 4, 0, -1, 5, -2, 4, 0, -2, -1]], ['0', '19/16']], ['control: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['control: random cic 13', [2, 3, 2, [0, 3, 3, -2, 4, -2, 2, 4, 1, 1]], ['1/4', '3/4', '7/6']]], [['regression: random cic 6', [1, 4, 1, [-2, 5, 3, -2, 5, -2, 1, 3, 0, -2, -3, 4, -2, -1, 5, 4, 2, 0, -2, 1]], ['1', '7/4', '-1/4', '3/2', '1/4']], ['regression: random cic 8', [3, 3, 1, [-1, 1, 5, 5, 3, 3, 0, -2, 2, 2, 1, 1, 1, -3]], ['2/27', '80/27', '55/27', '7/9']], ['regression: random cic 16', [3, 2, 2, [-1, 0, 1, 2, 5, 5, 3, -1, 5, -3]], ['-3/64', '-5/64', '15/32', '59/32', '181/64']], ['control: random cic 23', [2, 4, 2, [-3, 5, 5, 3, 0, 2, -3, 3, 4, 5, 0, -1, 0, 1, -1, 1, 1]], ['1/4', '59/64', '105/64', '101/64']], ['control: random cic 25', [2, 2, 2, [-1, 2, 5, -2, -1]], ['0', '5/8']], ['control: random cic 26', [2, 2, 1, [1, 5, -3, 3, -2, 1, -1, 4, 1, 2]], ['7/4', '1/2', '0', '3/4', '2']], ['control: random cic 27', [2, 4, 1, [-1, 3, 5, 4, -3, 3, 3, 2, 2]], ['19/16', '15/8']]], [['regression: random cic 10', [3, 2, 2, [-2, 3, -2, 1, 1, 0, 0]], ['-3/64', '-7/64', '1/64']], ['regression: random cic 11', [3, 2, 2, [1, -1, 2, 1, -2, 3]], ['1/32', '11/64', '23/64']], ['repair check: random cic 19', [2, 4, 1, [4, 4, 2, 0, -3, 0, -1, 5, 0, 3, -1, 1]], ['2', '-1/16', '21/16']], ['control: random cic 35', [2, 4, 2, [4, 1, 2, 2, 5, 1, -1, -2, -2, 3, 3, -3, 2]], ['25/64', '5/4', '41/32']], ['control: random cic 40', [2, 4, 2, [4, -2, 4, 1, 3, -2, -3, 5, 1, 1]], ['19/64', '13/16']], ['control: random cic 41', [2, 4, 1, [1, 4, 3, 3, 1, 1, -1, 0, -2, 5, 0, 3, 2, 4, 2, 4, 5, 5, 1, -2]], ['25/16', '3/2', '9/16', '21/8', '55/16']], ['control: random cic 47', [2, 4, 1, [-2, 0, 4, 0, -1, 5, -2, 4, 0, -2, -1]], ['0', '19/16']]]]\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-cic-decimator-comb-subtraction-direction","generated_at":"2026-09-29T14:51:36.144535+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"CIC decimators front most digital down-converters; decimation phase, delay or gain slips distort the passband level.","root_cause":"The comb computes v[k-M] - v instead of v - v[k-M].","sha256":"d46d6d82b62913ea9f5764fd7e7a35b57bc1d628ea1dd3465bc1a3f5278b0089","title":"CIC comb subtracts the new sample from the delayed one · 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.595,"exit_code":1,"observations":[{"actual":["3/2","7/2","11/2"],"check":"regression: one stage R=2 M=1","expected":["3/2","7/2","11/2"],"passed":true},{"actual":["3"],"check":"regression: partial final block","expected":["3"],"passed":true},{"actual":["7/3","1","1/3"],"check":"regression: random cic 2","expected":["7/3","-1","1/3"],"passed":false},{"actual":["1/12","1/6","1/12","0"],"check":"control: two stages R=3 M=2","expected":["1/12","1/6","1/12","0"],"passed":true},{"actual":["1/4","3/4","7/6"],"check":"control: random cic 13","expected":["1/4","3/4","7/6"],"passed":true},{"actual":["1/4","59/64","105/64","101/64"],"check":"control: random cic 23","expected":["1/4","59/64","105/64","101/64"],"passed":true},{"actual":["0","5/8"],"check":"control: random cic 25","expected":["0","5/8"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: one stage R=2 M=1\", \"actual\": [\"3/2\", \"7/2\", \"11/2\"], \"expected\": [\"3/2\", \"7/2\", \"11/2\"], \"passed\": true}, {\"check\": \"regression: partial final block\", \"actual\": [\"3\"], \"expected\": [\"3\"], \"passed\": true}, {\"check\": \"regression: random cic 2\", \"actual\": [\"7/3\", \"1\", \"1/3\"], \"expected\": [\"7/3\", \"-1\", \"1/3\"], \"passed\": false}, {\"check\": \"control: two stages R=3 M=2\", \"actual\": [\"1/12\", \"1/6\", \"1/12\", \"0\"], \"expected\": [\"1/12\", \"1/6\", \"1/12\", \"0\"], \"passed\": true}, {\"check\": \"control: random cic 13\", \"actual\": [\"1/4\", \"3/4\", \"7/6\"], \"expected\": [\"1/4\", \"3/4\", \"7/6\"], \"passed\": true}, {\"check\": \"control: random cic 23\", \"actual\": [\"1/4\", \"59/64\", \"105/64\", \"101/64\"], \"expected\": [\"1/4\", \"59/64\", \"105/64\", \"101/64\"], \"passed\": true}, {\"check\": \"control: random cic 25\", \"actual\": [\"0\", \"5/8\"], \"expected\": [\"0\", \"5/8\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.315,"exit_code":1,"observations":[{"actual":["-3/2","-7/2","-11/2"],"check":"regression: one stage R=2 M=1","expected":["3/2","7/2","11/2"],"passed":false},{"actual":["-3"],"check":"regression: partial final block","expected":["3"],"passed":false},{"actual":["-7/3","1","-1/3"],"check":"regression: random cic 2","expected":["7/3","-1","1/3"],"passed":false},{"actual":["1/12","1/6","1/12","0"],"check":"control: two stages R=3 M=2","expected":["1/12","1/6","1/12","0"],"passed":true},{"actual":["1/4","3/4","7/6"],"check":"control: random cic 13","expected":["1/4","3/4","7/6"],"passed":true},{"actual":["1/4","59/64","105/64","101/64"],"check":"control: random cic 23","expected":["1/4","59/64","105/64","101/64"],"passed":true},{"actual":["0","5/8"],"check":"control: random cic 25","expected":["0","5/8"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: one stage R=2 M=1\", \"actual\": [\"-3/2\", \"-7/2\", \"-11/2\"], \"expected\": [\"3/2\", \"7/2\", \"11/2\"], \"passed\": false}, {\"check\": \"regression: partial final block\", \"actual\": [\"-3\"], \"expected\": [\"3\"], \"passed\": false}, {\"check\": \"regression: random cic 2\", \"actual\": [\"-7/3\", \"1\", \"-1/3\"], \"expected\": [\"7/3\", \"-1\", \"1/3\"], \"passed\": false}, {\"check\": \"control: two stages R=3 M=2\", \"actual\": [\"1/12\", \"1/6\", \"1/12\", \"0\"], \"expected\": [\"1/12\", \"1/6\", \"1/12\", \"0\"], \"passed\": true}, {\"check\": \"control: random cic 13\", \"actual\": [\"1/4\", \"3/4\", \"7/6\"], \"expected\": [\"1/4\", \"3/4\", \"7/6\"], \"passed\": true}, {\"check\": \"control: random cic 23\", \"actual\": [\"1/4\", \"59/64\", \"105/64\", \"101/64\"], \"expected\": [\"1/4\", \"59/64\", \"105/64\", \"101/64\"], \"passed\": true}, {\"check\": \"control: random cic 25\", \"actual\": [\"0\", \"5/8\"], \"expected\": [\"0\", \"5/8\"], \"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."}}