{"abstract":"A negative full-scale burst reports zero saturations.","category":"Digital signal filters","checks":7,"contract":"Input [coeffs, samples] as Q15 integers. Each output accumulates the full-precision products c_k x[n-k] (zero history) in a wide accumulator, then rounds once (add 2**14, arithmetic shift 15) and saturates to int16. Return {\"y\": outputs, \"saturations\": number of clipped outputs}.","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-q15-fir-wide-accumulator","failed_approach":"The attempted repair counts outputs that exactly reach +32767 as saturated as well.","family":"w2-digital_signal_filters-q15-fir-wide-accumulator-negative-overflow-accounting","id":"FA-91796","implementations":{"attempt":{"sha256":"8cd569e0df27fef8d1fd4835b578f31b969dfe017babcec80b1bdcf3455f564f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    coefs, xs = x\n    hist = [0] * len(coefs)\n    out = []\n    sat = 0\n    for v in xs:\n        hist = [v] + hist[:-1]\n        acc = sum(c * s for c, s in zip(coefs, hist))\n        y = (acc + (1 << 14)) >> 15\n        if y >= 32767:\n            y = 32767\n            sat += 1\n        elif y < -32768:\n            y = -32768\n            sat += 1\n        out.append(y)\n    return {'y': out, 'saturations': sat}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: small products lost', [[1000, 1000, 1000], [100, 100, 100, 100]], {'y': [3, 6, 9, 9], 'saturations': 0}], ['control: positive overflow', [[32767, 32767], [32767, 32767]], {'y': [32766, 32767], 'saturations': 1}], ['control: asymmetric taps', [[16384, 8192, 0, -4096], [1000, 0, 0, 0, 0]], {'y': [500, 250, 0, -125, 0], 'saturations': 0}], ['control: random q15 fir 0', [[-32619, -22239, 2111], [244, -26104, -17179, -16]], {'y': [-243, 25820, 32767, 9993], 'saturations': 1}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 1', [[-2422, 8115, -26238], [81, -19840, 164, 18, -31318, 26443]], {'y': [-6, 1487, -4990, 15926, 2188, -9725], 'saturations': 0}], ['control: random q15 fir 2', [[-1074, -846, 29231], [-7102, 287, 18053, 24830, -286, 148]], {'y': [233, 174, -6935, -1024, 15473, 22152], 'saturations': 0}], ['control: random q15 fir 3', [[24688, -1728, 10280], [279, -1240, 3294, -90, 31560, -27759]], {'y': [210, -949, 2635, -631, 24816, -22607], 'saturations': 0}], ['control: random q15 fir 4', [[375, 13267], [120, 1419, -3648]], {'y': [1, 65, 533], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 5', [[21007, -2568, -1633], [-267, 32265, 7287, 49]], {'y': [-171, 20705, 2156, -2148], 'saturations': 0}], ['control: random q15 fir 6', [[2221], [-13506, -128, -3471, -275, -20285]], {'y': [-915, -9, -235, -19, -1375], 'saturations': 0}], ['control: random q15 fir 7', [[-2335, 2343], [-158, -4249, -3825, -225]], {'y': [11, 291, -31, -257], 'saturations': 0}], ['control: random q15 fir 8', [[-249, 2187, 304], [24116, 6453, 6219, -174, -23699]], {'y': [-183, 1561, 607, 476, 226], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 9', [[-2404, -24823], [-43, 254, -254, -25264]], {'y': [3, 14, -174, 2046], 'saturations': 0}], ['control: random q15 fir 10', [[17726], [-261, 178, -17320, 220]], {'y': [-141, 96, -9369, 119], 'saturations': 0}], ['control: random q15 fir 11', [[-1511], [227, 17400]], {'y': [-10, -802], 'saturations': 0}], ['control: random q15 fir 12', [[-2850, 430, -493, -1196], [-47, 154, -218, -4698, -203]], {'y': [4, -14, 22, 405, -46], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 13', [[-2749, -1952, 11064], [29305, 10126]], {'y': [-2458, -2595], 'saturations': 0}], ['control: random q15 fir 14', [[2191], [5955, -128]], {'y': [398, -9], 'saturations': 0}], ['control: random q15 fir 15', [[7820, -2373, 744], [14902, 174, -178, 7258, -26936]], {'y': [3556, -1038, 283, 1749, -6958], 'saturations': 0}], ['control: random q15 fir 16', [[-1447], [-227, 108]], {'y': [10, -5], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 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":"6b8ec1755670fab257940de402596048ad2862c3fa8e9a01d405035d94985c22","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    coefs, xs = x\n    hist = [0] * len(coefs)\n    out = []\n    sat = 0\n    for v in xs:\n        hist = [v] + hist[:-1]\n        acc = sum(c * s for c, s in zip(coefs, hist))\n        y = (acc + (1 << 14)) >> 15\n        if y > 32767:\n            y = 32767\n            sat += 1\n        elif y < -32768:\n            y = -32768\n        out.append(y)\n    return {'y': out, 'saturations': sat}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: small products lost', [[1000, 1000, 1000], [100, 100, 100, 100]], {'y': [3, 6, 9, 9], 'saturations': 0}], ['control: positive overflow', [[32767, 32767], [32767, 32767]], {'y': [32766, 32767], 'saturations': 1}], ['control: asymmetric taps', [[16384, 8192, 0, -4096], [1000, 0, 0, 0, 0]], {'y': [500, 250, 0, -125, 0], 'saturations': 0}], ['control: random q15 fir 0', [[-32619, -22239, 2111], [244, -26104, -17179, -16]], {'y': [-243, 25820, 32767, 9993], 'saturations': 1}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 1', [[-2422, 8115, -26238], [81, -19840, 164, 18, -31318, 26443]], {'y': [-6, 1487, -4990, 15926, 2188, -9725], 'saturations': 0}], ['control: random q15 fir 2', [[-1074, -846, 29231], [-7102, 287, 18053, 24830, -286, 148]], {'y': [233, 174, -6935, -1024, 15473, 22152], 'saturations': 0}], ['control: random q15 fir 3', [[24688, -1728, 10280], [279, -1240, 3294, -90, 31560, -27759]], {'y': [210, -949, 2635, -631, 24816, -22607], 'saturations': 0}], ['control: random q15 fir 4', [[375, 13267], [120, 1419, -3648]], {'y': [1, 65, 533], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 5', [[21007, -2568, -1633], [-267, 32265, 7287, 49]], {'y': [-171, 20705, 2156, -2148], 'saturations': 0}], ['control: random q15 fir 6', [[2221], [-13506, -128, -3471, -275, -20285]], {'y': [-915, -9, -235, -19, -1375], 'saturations': 0}], ['control: random q15 fir 7', [[-2335, 2343], [-158, -4249, -3825, -225]], {'y': [11, 291, -31, -257], 'saturations': 0}], ['control: random q15 fir 8', [[-249, 2187, 304], [24116, 6453, 6219, -174, -23699]], {'y': [-183, 1561, 607, 476, 226], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 9', [[-2404, -24823], [-43, 254, -254, -25264]], {'y': [3, 14, -174, 2046], 'saturations': 0}], ['control: random q15 fir 10', [[17726], [-261, 178, -17320, 220]], {'y': [-141, 96, -9369, 119], 'saturations': 0}], ['control: random q15 fir 11', [[-1511], [227, 17400]], {'y': [-10, -802], 'saturations': 0}], ['control: random q15 fir 12', [[-2850, 430, -493, -1196], [-47, 154, -218, -4698, -203]], {'y': [4, -14, 22, 405, -46], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 0}]], [['regression: negative overflow', [[32767, 32767], [-32768, -32768]], {'y': [-32767, -32768], 'saturations': 1}], ['repair check: exact positive rail', [[16384, 16384], [32767, 32767, 0]], {'y': [16384, 32767, 16384], 'saturations': 0}], ['control: random q15 fir 13', [[-2749, -1952, 11064], [29305, 10126]], {'y': [-2458, -2595], 'saturations': 0}], ['control: random q15 fir 14', [[2191], [5955, -128]], {'y': [398, -9], 'saturations': 0}], ['control: random q15 fir 15', [[7820, -2373, 744], [14902, 174, -178, 7258, -26936]], {'y': [3556, -1038, 283, 1749, -6958], 'saturations': 0}], ['control: random q15 fir 16', [[-1447], [-227, 108]], {'y': [10, -5], 'saturations': 0}], ['repair check: exact rail then negative overflow', [[16384, 16384, 32767], [32767, 32767, -32768, -32768]], {'y': [16384, 32767, 32766, -2], 'saturations': 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-q15-fir-wide-accumulator-negative-overflow-accounting","generated_at":"2026-09-29T14:51:39.434356+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"DSP MAC units keep guard bits and round once; per-product rounding or missing overflow accounting degrades fixed-point FIRs.","root_cause":"The negative clipping branch does not increment the counter.","sha256":"667273b830fc3f874f8510d4558cd95b9c412b9e2692714fde47d5d5313b2f8f","title":"Q15 FIR clips negative overflow without counting it · 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":41.355,"exit_code":1,"observations":[{"actual":{"saturations":1,"y":[-32767,-32768]},"check":"regression: negative overflow","expected":{"saturations":1,"y":[-32767,-32768]},"passed":true},{"actual":{"saturations":1,"y":[16384,32767,16384]},"check":"repair check: exact positive rail","expected":{"saturations":0,"y":[16384,32767,16384]},"passed":false},{"actual":{"saturations":0,"y":[3,6,9,9]},"check":"control: small products lost","expected":{"saturations":0,"y":[3,6,9,9]},"passed":true},{"actual":{"saturations":1,"y":[32766,32767]},"check":"control: positive overflow","expected":{"saturations":1,"y":[32766,32767]},"passed":true},{"actual":{"saturations":0,"y":[500,250,0,-125,0]},"check":"control: asymmetric taps","expected":{"saturations":0,"y":[500,250,0,-125,0]},"passed":true},{"actual":{"saturations":1,"y":[-243,25820,32767,9993]},"check":"control: random q15 fir 0","expected":{"saturations":1,"y":[-243,25820,32767,9993]},"passed":true},{"actual":{"saturations":1,"y":[16384,32767,32766,-2]},"check":"repair check: exact rail then negative overflow","expected":{"saturations":0,"y":[16384,32767,32766,-2]},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative overflow\", \"actual\": {\"y\": [-32767, -32768], \"saturations\": 1}, \"expected\": {\"y\": [-32767, -32768], \"saturations\": 1}, \"passed\": true}, {\"check\": \"repair check: exact positive rail\", \"actual\": {\"y\": [16384, 32767, 16384], \"saturations\": 1}, \"expected\": {\"y\": [16384, 32767, 16384], \"saturations\": 0}, \"passed\": false}, {\"check\": \"control: small products lost\", \"actual\": {\"y\": [3, 6, 9, 9], \"saturations\": 0}, \"expected\": {\"y\": [3, 6, 9, 9], \"saturations\": 0}, \"passed\": true}, {\"check\": \"control: positive overflow\", \"actual\": {\"y\": [32766, 32767], \"saturations\": 1}, \"expected\": {\"y\": [32766, 32767], \"saturations\": 1}, \"passed\": true}, {\"check\": \"control: asymmetric taps\", \"actual\": {\"y\": [500, 250, 0, -125, 0], \"saturations\": 0}, \"expected\": {\"y\": [500, 250, 0, -125, 0], \"saturations\": 0}, \"passed\": true}, {\"check\": \"control: random q15 fir 0\", \"actual\": {\"y\": [-243, 25820, 32767, 9993], \"saturations\": 1}, \"expected\": {\"y\": [-243, 25820, 32767, 9993], \"saturations\": 1}, \"passed\": true}, {\"check\": \"repair check: exact rail then negative overflow\", \"actual\": {\"y\": [16384, 32767, 32766, -2], \"saturations\": 1}, \"expected\": {\"y\": [16384, 32767, 32766, -2], \"saturations\": 0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.903,"exit_code":1,"observations":[{"actual":{"saturations":0,"y":[-32767,-32768]},"check":"regression: negative overflow","expected":{"saturations":1,"y":[-32767,-32768]},"passed":false},{"actual":{"saturations":0,"y":[16384,32767,16384]},"check":"repair check: exact positive rail","expected":{"saturations":0,"y":[16384,32767,16384]},"passed":true},{"actual":{"saturations":0,"y":[3,6,9,9]},"check":"control: small products lost","expected":{"saturations":0,"y":[3,6,9,9]},"passed":true},{"actual":{"saturations":1,"y":[32766,32767]},"check":"control: positive overflow","expected":{"saturations":1,"y":[32766,32767]},"passed":true},{"actual":{"saturations":0,"y":[500,250,0,-125,0]},"check":"control: asymmetric taps","expected":{"saturations":0,"y":[500,250,0,-125,0]},"passed":true},{"actual":{"saturations":1,"y":[-243,25820,32767,9993]},"check":"control: random q15 fir 0","expected":{"saturations":1,"y":[-243,25820,32767,9993]},"passed":true},{"actual":{"saturations":0,"y":[16384,32767,32766,-2]},"check":"repair check: exact rail then negative overflow","expected":{"saturations":0,"y":[16384,32767,32766,-2]},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: negative overflow\", \"actual\": {\"y\": [-32767, -32768], \"saturations\": 0}, \"expected\": {\"y\": [-32767, -32768], \"saturations\": 1}, \"passed\": false}, {\"check\": \"repair check: exact positive rail\", \"actual\": {\"y\": [16384, 32767, 16384], \"saturations\": 0}, \"expected\": {\"y\": [16384, 32767, 16384], \"saturations\": 0}, \"passed\": true}, {\"check\": \"control: small products lost\", \"actual\": {\"y\": [3, 6, 9, 9], \"saturations\": 0}, \"expected\": {\"y\": [3, 6, 9, 9], \"saturations\": 0}, \"passed\": true}, {\"check\": \"control: positive overflow\", \"actual\": {\"y\": [32766, 32767], \"saturations\": 1}, \"expected\": {\"y\": [32766, 32767], \"saturations\": 1}, \"passed\": true}, {\"check\": \"control: asymmetric taps\", \"actual\": {\"y\": [500, 250, 0, -125, 0], \"saturations\": 0}, \"expected\": {\"y\": [500, 250, 0, -125, 0], \"saturations\": 0}, \"passed\": true}, {\"check\": \"control: random q15 fir 0\", \"actual\": {\"y\": [-243, 25820, 32767, 9993], \"saturations\": 1}, \"expected\": {\"y\": [-243, 25820, 32767, 9993], \"saturations\": 1}, \"passed\": true}, {\"check\": \"repair check: exact rail then negative overflow\", \"actual\": {\"y\": [16384, 32767, 32766, -2], \"saturations\": 0}, \"expected\": {\"y\": [16384, 32767, 32766, -2], \"saturations\": 0}, \"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."}}