{"abstract":"For a length not divisible by D the final output sample is missing.","category":"Digital signal filters","checks":7,"contract":"Input [h, D, samples] (integers). Output y[m] = sum_k h[k] x[mD - k] for m = 0 .. ceil(len/D) - 1 with x = 0 outside the signal, computed through the polyphase split E_p[j] = h[jD + p].","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-polyphase-decimator","failed_approach":"The attempted repair uses len // D + 1, producing an extra sample when the length is divisible.","family":"w2-digital_signal_filters-polyphase-decimator-output-length","id":"FA-91546","implementations":{"attempt":{"sha256":"95c0027d973488dfb0622ec74e240bd7358a59b0d2b957c02fdca2976cc5757e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    h, D, xs = x\n    L = len(xs)\n    M = L // D + 1\n    phases = [h[p::D] for p in range(D)]\n    out = []\n    for m in range(M):\n        acc = 0\n        for p in range(D):\n            for j, c in enumerate(phases[p]):\n                idx = (m - j) * D - p\n                if 0 <= idx < L:\n                    acc += c * xs[idx]\n        out.append(acc)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: first sample matters', [[1], 3, [7, 1, 1, 1]], [7, 1]], ['repair check: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]]], [['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['repair check: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['repair check: random polyphase 13', [[1, 4], 2, [-4, 3, -1, 4]], [-4, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]], ['repair check: random polyphase 15', [[4, -2, -3, 1, 1, 3, 1], 4, [2, -2, -3, 5]], [8]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 11', [[-2, 1, 4, -2, -3], 4, [-1, -4, -2, 5, 4, 5, 3, 1, 0]], [2, 0, -9]], ['regression: random polyphase 16', [[-2, -1, -1, -1, 2, 0, -3], 4, [5, 5, 4, 1, 1, 2, 0, 1, -1]], [-10, -2, -11]], ['repair check: random polyphase 21', [[1, 1, -3], 4, [2, 2, -1, -1]], [2]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]]]\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":"cdd69b4cbcf5b9aa8cd70bb74992f5a8fd2f33a3655a4f28d6619a2cdf93f0aa","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    h, D, xs = x\n    L = len(xs)\n    M = L // D\n    phases = [h[p::D] for p in range(D)]\n    out = []\n    for m in range(M):\n        acc = 0\n        for p in range(D):\n            for j, c in enumerate(phases[p]):\n                idx = (m - j) * D - p\n                if 0 <= idx < L:\n                    acc += c * xs[idx]\n        out.append(acc)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: first sample matters', [[1], 3, [7, 1, 1, 1]], [7, 1]], ['repair check: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]]], [['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['repair check: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['repair check: random polyphase 13', [[1, 4], 2, [-4, 3, -1, 4]], [-4, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]], ['repair check: random polyphase 15', [[4, -2, -3, 1, 1, 3, 1], 4, [2, -2, -3, 5]], [8]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 11', [[-2, 1, 4, -2, -3], 4, [-1, -4, -2, 5, 4, 5, 3, 1, 0]], [2, 0, -9]], ['regression: random polyphase 16', [[-2, -1, -1, -1, 2, 0, -3], 4, [5, 5, 4, 1, 1, 2, 0, 1, -1]], [-10, -2, -11]], ['repair check: random polyphase 21', [[1, 1, -3], 4, [2, 2, -1, -1]], [2]], ['regression: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]]]\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-polyphase-decimator-output-length","generated_at":"2026-09-29T14:51:36.930245+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Polyphase decimators avoid computing discarded outputs; commutator and phase-split slips alias the output.","root_cause":"The output count is floor(len / D) instead of ceil(len / D).","sha256":"9e7c28abf4d7a14e3904795de8a4a7a477148f9153742a9efa8e5be1376a2f67","title":"Polyphase decimator drops the last partial output · 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":39.346,"exit_code":1,"observations":[{"actual":[1,3,0],"check":"regression: impulse through D=2","expected":[1,3,0],"passed":true},{"actual":[7,1],"check":"regression: first sample matters","expected":[7,1],"passed":true},{"actual":[1,5,4],"check":"repair check: length divisible","expected":[1,5],"passed":false},{"actual":[1,6,11],"check":"regression: long filter D=3","expected":[1,6,11],"passed":true},{"actual":[6,11,-4,-3],"check":"regression: random polyphase 0","expected":[6,11,-4,-3],"passed":true},{"actual":[-6,4],"check":"regression: random polyphase 1","expected":[-6,4],"passed":true},{"actual":[-15,6],"check":"regression: random polyphase 3","expected":[-15,6],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: impulse through D=2\", \"actual\": [1, 3, 0], \"expected\": [1, 3, 0], \"passed\": true}, {\"check\": \"regression: first sample matters\", \"actual\": [7, 1], \"expected\": [7, 1], \"passed\": true}, {\"check\": \"repair check: length divisible\", \"actual\": [1, 5, 4], \"expected\": [1, 5], \"passed\": false}, {\"check\": \"regression: long filter D=3\", \"actual\": [1, 6, 11], \"expected\": [1, 6, 11], \"passed\": true}, {\"check\": \"regression: random polyphase 0\", \"actual\": [6, 11, -4, -3], \"expected\": [6, 11, -4, -3], \"passed\": true}, {\"check\": \"regression: random polyphase 1\", \"actual\": [-6, 4], \"expected\": [-6, 4], \"passed\": true}, {\"check\": \"regression: random polyphase 3\", \"actual\": [-15, 6], \"expected\": [-15, 6], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.905,"exit_code":1,"observations":[{"actual":[1,3],"check":"regression: impulse through D=2","expected":[1,3,0],"passed":false},{"actual":[7],"check":"regression: first sample matters","expected":[7,1],"passed":false},{"actual":[1,5],"check":"repair check: length divisible","expected":[1,5],"passed":true},{"actual":[1,6],"check":"regression: long filter D=3","expected":[1,6,11],"passed":false},{"actual":[6,11,-4],"check":"regression: random polyphase 0","expected":[6,11,-4,-3],"passed":false},{"actual":[-6],"check":"regression: random polyphase 1","expected":[-6,4],"passed":false},{"actual":[-15],"check":"regression: random polyphase 3","expected":[-15,6],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: impulse through D=2\", \"actual\": [1, 3], \"expected\": [1, 3, 0], \"passed\": false}, {\"check\": \"regression: first sample matters\", \"actual\": [7], \"expected\": [7, 1], \"passed\": false}, {\"check\": \"repair check: length divisible\", \"actual\": [1, 5], \"expected\": [1, 5], \"passed\": true}, {\"check\": \"regression: long filter D=3\", \"actual\": [1, 6], \"expected\": [1, 6, 11], \"passed\": false}, {\"check\": \"regression: random polyphase 0\", \"actual\": [6, 11, -4], \"expected\": [6, 11, -4, -3], \"passed\": false}, {\"check\": \"regression: random polyphase 1\", \"actual\": [-6], \"expected\": [-6, 4], \"passed\": false}, {\"check\": \"regression: random polyphase 3\", \"actual\": [-15], \"expected\": [-15, 6], \"passed\": false}], \"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."}}