{"abstract":"[0, 0, 1, 2, 1] reports a delay of 1 sample instead of 3.","category":"Digital signal filters","checks":7,"contract":"Input integer taps. Strip leading and trailing zeros (\"degenerate\" if all zero). The trimmed support of length N is type 1/2 if symmetric (odd/even N), type 3/4 if antisymmetric (odd/even N), otherwise not linear phase. Return {\"type\", \"group_delay\": leading zeros + (N-1)/2 as a fraction string} or both None.","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-linear-phase-classifier","failed_approach":"The attempted repair adds the number of trailing zeros instead.","family":"w2-digital_signal_filters-linear-phase-classifier-group-delay-offset","id":"FA-91646","implementations":{"attempt":{"sha256":"94564daf2697543dfd790afb4842e23e7a7e847f9da4ea1f3de8cb92229a4a90","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    h = list(x)\n    lead = 0\n    while lead < len(h) and h[lead] == 0:\n        lead += 1\n    if lead == len(h):\n        return 'degenerate'\n    end = len(h)\n    while h[end - 1] == 0:\n        end -= 1\n    g = h[lead:end]\n    N = len(g)\n    sym = all(g[i] == g[N - 1 - i] for i in range(N))\n    anti = all(g[i] == -g[N - 1 - i] for i in range(N))\n    if sym:\n        typ = 1 if N % 2 else 2\n    elif anti:\n        typ = 3 if N % 2 else 4\n    else:\n        return {'type': None, 'group_delay': None}\n    return {'type': typ, 'group_delay': str(len(h) - end + Fraction(N - 1, 2))}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: leading zeros symmetric', [0, 0, 1, 2, 1], {'type': 1, 'group_delay': '3'}], ['regression: padded type II', [0, 3, 3, 0, 0], {'type': 2, 'group_delay': '3/2'}], ['repair check: trailing zeros', [1, 2, 1, 0], {'type': 1, 'group_delay': '1'}], ['control: type III nonzero centre', [1, 2, -1], {'type': None, 'group_delay': None}], ['control: type III zero centre', [1, 0, -1], {'type': 3, 'group_delay': '1'}], ['control: type I', [1, 2, 1], {'type': 1, 'group_delay': '1'}], ['control: type II', [1, 1], {'type': 2, 'group_delay': '1/2'}]], [['regression: random linear phase 1', [0, 2, -2, 0, 0, 0], {'type': 4, 'group_delay': '3/2'}], ['regression: random linear phase 5', [0, 0, -3, -3, -2, -3, -3, 0], {'type': 1, 'group_delay': '4'}], ['regression: padded type II', [0, 3, 3, 0, 0], {'type': 2, 'group_delay': '3/2'}], ['control: type IV', [1, -1], {'type': 4, 'group_delay': '1/2'}], ['control: interior zero symmetric', [1, 0, 1], {'type': 1, 'group_delay': '1'}], ['control: all zero', [0, 0, 0], 'degenerate'], ['control: not linear phase', [1, 2, 3], {'type': None, 'group_delay': None}]], [['regression: random linear phase 10', [0, 0, 0, -1, 1, 0], {'type': 4, 'group_delay': '7/2'}], ['regression: random linear phase 11', [0, 0, 2, -2, 0], {'type': 4, 'group_delay': '5/2'}], ['repair check: random linear phase 0', [-1, -2, -1, 0, 1, 2, 1, 0], {'type': 3, 'group_delay': '3'}], ['control: type IV longer', [2, 1, -1, -2], {'type': 4, 'group_delay': '3/2'}], ['control: single tap', [5], {'type': 1, 'group_delay': '0'}], ['control: random linear phase 2', [0, 0, 2, 0, 2, 0, -2, 0, 0], {'type': None, 'group_delay': None}], ['control: random linear phase 4', [0, 1, -1, -1, 0], {'type': None, 'group_delay': None}]], [['regression: random linear phase 15', [0, 0, 1, -1, -1, 1, 0, 0], {'type': 2, 'group_delay': '7/2'}], ['regression: random linear phase 16', [0, -3, -1, 1, 3, 0, 0], {'type': 4, 'group_delay': '5/2'}], ['repair check: random linear phase 3', [1, 0, 1, 0], {'type': 1, 'group_delay': '1'}], ['control: random linear phase 6', [0, 3, 2, -3], {'type': None, 'group_delay': None}], ['control: random linear phase 7', [0, 0, 0, 0, 0], 'degenerate'], ['control: type III nonzero centre', [1, 2, -1], {'type': None, 'group_delay': None}], ['control: type III zero centre', [1, 0, -1], {'type': 3, 'group_delay': '1'}]], [['regression: random linear phase 18', [0, 0, 3, 3, 0, 0], {'type': 2, 'group_delay': '5/2'}], ['regression: random linear phase 20', [0, 2, -2, 2, 0, 0], {'type': 1, 'group_delay': '2'}], ['repair check: random linear phase 8', [2, -2, -2, 2, 2, -2, 0, 0], {'type': 4, 'group_delay': '5/2'}], ['control: type I', [1, 2, 1], {'type': 1, 'group_delay': '1'}], ['control: type II', [1, 1], {'type': 2, 'group_delay': '1/2'}], ['control: type IV', [1, -1], {'type': 4, 'group_delay': '1/2'}], ['control: interior zero symmetric', [1, 0, 1], {'type': 1, 'group_delay': '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":"1acd1a7f2623f11ff80ad0853921848d0e6cf0df63fb7afa8e0ef3a038717b5d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    h = list(x)\n    lead = 0\n    while lead < len(h) and h[lead] == 0:\n        lead += 1\n    if lead == len(h):\n        return 'degenerate'\n    end = len(h)\n    while h[end - 1] == 0:\n        end -= 1\n    g = h[lead:end]\n    N = len(g)\n    sym = all(g[i] == g[N - 1 - i] for i in range(N))\n    anti = all(g[i] == -g[N - 1 - i] for i in range(N))\n    if sym:\n        typ = 1 if N % 2 else 2\n    elif anti:\n        typ = 3 if N % 2 else 4\n    else:\n        return {'type': None, 'group_delay': None}\n    return {'type': typ, 'group_delay': str(Fraction(N - 1, 2))}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: leading zeros symmetric', [0, 0, 1, 2, 1], {'type': 1, 'group_delay': '3'}], ['regression: padded type II', [0, 3, 3, 0, 0], {'type': 2, 'group_delay': '3/2'}], ['repair check: trailing zeros', [1, 2, 1, 0], {'type': 1, 'group_delay': '1'}], ['control: type III nonzero centre', [1, 2, -1], {'type': None, 'group_delay': None}], ['control: type III zero centre', [1, 0, -1], {'type': 3, 'group_delay': '1'}], ['control: type I', [1, 2, 1], {'type': 1, 'group_delay': '1'}], ['control: type II', [1, 1], {'type': 2, 'group_delay': '1/2'}]], [['regression: random linear phase 1', [0, 2, -2, 0, 0, 0], {'type': 4, 'group_delay': '3/2'}], ['regression: random linear phase 5', [0, 0, -3, -3, -2, -3, -3, 0], {'type': 1, 'group_delay': '4'}], ['regression: padded type II', [0, 3, 3, 0, 0], {'type': 2, 'group_delay': '3/2'}], ['control: type IV', [1, -1], {'type': 4, 'group_delay': '1/2'}], ['control: interior zero symmetric', [1, 0, 1], {'type': 1, 'group_delay': '1'}], ['control: all zero', [0, 0, 0], 'degenerate'], ['control: not linear phase', [1, 2, 3], {'type': None, 'group_delay': None}]], [['regression: random linear phase 10', [0, 0, 0, -1, 1, 0], {'type': 4, 'group_delay': '7/2'}], ['regression: random linear phase 11', [0, 0, 2, -2, 0], {'type': 4, 'group_delay': '5/2'}], ['repair check: random linear phase 0', [-1, -2, -1, 0, 1, 2, 1, 0], {'type': 3, 'group_delay': '3'}], ['control: type IV longer', [2, 1, -1, -2], {'type': 4, 'group_delay': '3/2'}], ['control: single tap', [5], {'type': 1, 'group_delay': '0'}], ['control: random linear phase 2', [0, 0, 2, 0, 2, 0, -2, 0, 0], {'type': None, 'group_delay': None}], ['control: random linear phase 4', [0, 1, -1, -1, 0], {'type': None, 'group_delay': None}]], [['regression: random linear phase 15', [0, 0, 1, -1, -1, 1, 0, 0], {'type': 2, 'group_delay': '7/2'}], ['regression: random linear phase 16', [0, -3, -1, 1, 3, 0, 0], {'type': 4, 'group_delay': '5/2'}], ['repair check: random linear phase 3', [1, 0, 1, 0], {'type': 1, 'group_delay': '1'}], ['control: random linear phase 6', [0, 3, 2, -3], {'type': None, 'group_delay': None}], ['control: random linear phase 7', [0, 0, 0, 0, 0], 'degenerate'], ['control: type III nonzero centre', [1, 2, -1], {'type': None, 'group_delay': None}], ['control: type III zero centre', [1, 0, -1], {'type': 3, 'group_delay': '1'}]], [['regression: random linear phase 18', [0, 0, 3, 3, 0, 0], {'type': 2, 'group_delay': '5/2'}], ['regression: random linear phase 20', [0, 2, -2, 2, 0, 0], {'type': 1, 'group_delay': '2'}], ['repair check: random linear phase 8', [2, -2, -2, 2, 2, -2, 0, 0], {'type': 4, 'group_delay': '5/2'}], ['control: type I', [1, 2, 1], {'type': 1, 'group_delay': '1'}], ['control: type II', [1, 1], {'type': 2, 'group_delay': '1/2'}], ['control: type IV', [1, -1], {'type': 4, 'group_delay': '1/2'}], ['control: interior zero symmetric', [1, 0, 1], {'type': 1, 'group_delay': '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-linear-phase-classifier-group-delay-offset","generated_at":"2026-09-29T14:51:38.101502+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Linear-phase type determines which responses an FIR can realize (e.g. no highpass for type 2); misclassification picks the wrong design.","root_cause":"The delay is computed from the trimmed support only.","sha256":"80ca2f3ae48c31f5dcc03f3491f8fcc46135855eb7afffa1521b4e8a851a4f8c","title":"Linear-phase delay ignores leading zero taps · 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.775,"exit_code":1,"observations":[{"actual":{"group_delay":"1","type":1},"check":"regression: leading zeros symmetric","expected":{"group_delay":"3","type":1},"passed":false},{"actual":{"group_delay":"5/2","type":2},"check":"regression: padded type II","expected":{"group_delay":"3/2","type":2},"passed":false},{"actual":{"group_delay":"2","type":1},"check":"repair check: trailing zeros","expected":{"group_delay":"1","type":1},"passed":false},{"actual":{"group_delay":null,"type":null},"check":"control: type III nonzero centre","expected":{"group_delay":null,"type":null},"passed":true},{"actual":{"group_delay":"1","type":3},"check":"control: type III zero centre","expected":{"group_delay":"1","type":3},"passed":true},{"actual":{"group_delay":"1","type":1},"check":"control: type I","expected":{"group_delay":"1","type":1},"passed":true},{"actual":{"group_delay":"1/2","type":2},"check":"control: type II","expected":{"group_delay":"1/2","type":2},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: leading zeros symmetric\", \"actual\": {\"type\": 1, \"group_delay\": \"1\"}, \"expected\": {\"type\": 1, \"group_delay\": \"3\"}, \"passed\": false}, {\"check\": \"regression: padded type II\", \"actual\": {\"type\": 2, \"group_delay\": \"5/2\"}, \"expected\": {\"type\": 2, \"group_delay\": \"3/2\"}, \"passed\": false}, {\"check\": \"repair check: trailing zeros\", \"actual\": {\"type\": 1, \"group_delay\": \"2\"}, \"expected\": {\"type\": 1, \"group_delay\": \"1\"}, \"passed\": false}, {\"check\": \"control: type III nonzero centre\", \"actual\": {\"type\": null, \"group_delay\": null}, \"expected\": {\"type\": null, \"group_delay\": null}, \"passed\": true}, {\"check\": \"control: type III zero centre\", \"actual\": {\"type\": 3, \"group_delay\": \"1\"}, \"expected\": {\"type\": 3, \"group_delay\": \"1\"}, \"passed\": true}, {\"check\": \"control: type I\", \"actual\": {\"type\": 1, \"group_delay\": \"1\"}, \"expected\": {\"type\": 1, \"group_delay\": \"1\"}, \"passed\": true}, {\"check\": \"control: type II\", \"actual\": {\"type\": 2, \"group_delay\": \"1/2\"}, \"expected\": {\"type\": 2, \"group_delay\": \"1/2\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.267,"exit_code":1,"observations":[{"actual":{"group_delay":"1","type":1},"check":"regression: leading zeros symmetric","expected":{"group_delay":"3","type":1},"passed":false},{"actual":{"group_delay":"1/2","type":2},"check":"regression: padded type II","expected":{"group_delay":"3/2","type":2},"passed":false},{"actual":{"group_delay":"1","type":1},"check":"repair check: trailing zeros","expected":{"group_delay":"1","type":1},"passed":true},{"actual":{"group_delay":null,"type":null},"check":"control: type III nonzero centre","expected":{"group_delay":null,"type":null},"passed":true},{"actual":{"group_delay":"1","type":3},"check":"control: type III zero centre","expected":{"group_delay":"1","type":3},"passed":true},{"actual":{"group_delay":"1","type":1},"check":"control: type I","expected":{"group_delay":"1","type":1},"passed":true},{"actual":{"group_delay":"1/2","type":2},"check":"control: type II","expected":{"group_delay":"1/2","type":2},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: leading zeros symmetric\", \"actual\": {\"type\": 1, \"group_delay\": \"1\"}, \"expected\": {\"type\": 1, \"group_delay\": \"3\"}, \"passed\": false}, {\"check\": \"regression: padded type II\", \"actual\": {\"type\": 2, \"group_delay\": \"1/2\"}, \"expected\": {\"type\": 2, \"group_delay\": \"3/2\"}, \"passed\": false}, {\"check\": \"repair check: trailing zeros\", \"actual\": {\"type\": 1, \"group_delay\": \"1\"}, \"expected\": {\"type\": 1, \"group_delay\": \"1\"}, \"passed\": true}, {\"check\": \"control: type III nonzero centre\", \"actual\": {\"type\": null, \"group_delay\": null}, \"expected\": {\"type\": null, \"group_delay\": null}, \"passed\": true}, {\"check\": \"control: type III zero centre\", \"actual\": {\"type\": 3, \"group_delay\": \"1\"}, \"expected\": {\"type\": 3, \"group_delay\": \"1\"}, \"passed\": true}, {\"check\": \"control: type I\", \"actual\": {\"type\": 1, \"group_delay\": \"1\"}, \"expected\": {\"type\": 1, \"group_delay\": \"1\"}, \"passed\": true}, {\"check\": \"control: type II\", \"actual\": {\"type\": 2, \"group_delay\": \"1/2\"}, \"expected\": {\"type\": 2, \"group_delay\": \"1/2\"}, \"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."}}