FAILURE MAP
← Case archive

FA-91586 / Digital signal filters / Open access

Stability test skips normalization by a0 · case 01

A denominator with a0 = 2 reports reflection coefficients twice too large and false instability.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The polynomial is used without dividing by a0.

VERIFIED REPAIR

Divide every coefficient by a0 first.

Unsuccessful approach: The attempted repair divides by |a0|, which flips every reflection coefficient sign when a0 < 0.

Case contract

Input the denominator [a0, a1, ..., an] as rational strings. Normalize by a0 ("bad-a0" if missing or 0), drop trailing zero coefficients, then step down: k = last coefficient, unstable if |k| >= 1, else a_i <- (a_i - k a_{p-i}) / (1 - k^2) for i < p. Return {"stable": bool, "reflection": [k strings so far]}.

Why this case matters

Checking IIR denominators for stability before deployment prevents runaway filters; step-down slips accept unstable designs.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a = [Fraction(v) for v in x]
    if not a or a[0] == 0:
        return 'bad-a0'
    while len(a) > 1 and a[-1] == 0:
        a.pop()
    ks = []
    while len(a) > 1:
        p = len(a) - 1
        k = a[p]
        ks.append(str(k))
        if abs(k) >= 1:
            return {'stable': False, 'reflection': ks}
        a = [(a[i] - k * a[p - i]) / (1 - k * k) for i in range(p)]
    return {'stable': True, 'reflection': ks}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['regression: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['control: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}]], [['regression: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}]], [['regression: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/4']}], ['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 28', ['-1', '1/8'], {'stable': True, 'reflection': ['-1/8']}], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}]], [['regression: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 52', ['-1', '3/4', '5/4', '-1'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['control: random denominator 15', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: negative leading coefficient{'reflection': ['-1/2', '2'], 'stable': False}{'reflection': ['1/4', '-2/5'], 'stable': True}Failed
regression: random denominator 3{'reflection': ['-1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Failed
regression: random denominator 4{'reflection': ['5/4'], 'stable': False}{'reflection': ['-5/4'], 'stable': False}Failed
control: marginal pole on unit circle{'reflection': ['-1'], 'stable': False}{'reflection': ['-1'], 'stable': False}Passed
control: stable second order{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: trailing zero coefficient{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
control: two trailing zeros{'reflection': ['-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}Passed

SHA-256 / d3eed9d08be75dec4ae60455e08a58be62869f4ab8434cd00a4b152e4a307448

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a = [Fraction(v) for v in x]
    if not a or a[0] == 0:
        return 'bad-a0'
    a = [v / abs(a[0]) for v in a]
    while len(a) > 1 and a[-1] == 0:
        a.pop()
    ks = []
    while len(a) > 1:
        p = len(a) - 1
        k = a[p]
        ks.append(str(k))
        if abs(k) >= 1:
            return {'stable': False, 'reflection': ks}
        a = [(a[i] - k * a[p - i]) / (1 - k * k) for i in range(p)]
    return {'stable': True, 'reflection': ks}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['regression: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['control: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}]], [['regression: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}]], [['regression: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/4']}], ['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 28', ['-1', '1/8'], {'stable': True, 'reflection': ['-1/8']}], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}]], [['regression: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 52', ['-1', '3/4', '5/4', '-1'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['control: random denominator 15', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: negative leading coefficient{'reflection': ['-1/4', '2/3'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Failed
regression: random denominator 3{'reflection': ['-1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Failed
regression: random denominator 4{'reflection': ['5/4'], 'stable': False}{'reflection': ['-5/4'], 'stable': False}Failed
control: marginal pole on unit circle{'reflection': ['-1'], 'stable': False}{'reflection': ['-1'], 'stable': False}Passed
control: stable second order{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: trailing zero coefficient{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
control: two trailing zeros{'reflection': ['-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}Passed

SHA-256 / e4a7feaa27208b4ed99d58a57d71c00db9e4e623ec468fce3bb3960d178a6d12

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a = [Fraction(v) for v in x]
    if not a or a[0] == 0:
        return 'bad-a0'
    a = [v / a[0] for v in a]
    while len(a) > 1 and a[-1] == 0:
        a.pop()
    ks = []
    while len(a) > 1:
        p = len(a) - 1
        k = a[p]
        ks.append(str(k))
        if abs(k) >= 1:
            return {'stable': False, 'reflection': ks}
        a = [(a[i] - k * a[p - i]) / (1 - k * k) for i in range(p)]
    return {'stable': True, 'reflection': ks}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['regression: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['control: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}]], [['regression: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}]], [['regression: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/4']}], ['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 28', ['-1', '1/8'], {'stable': True, 'reflection': ['-1/8']}], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}]], [['regression: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 52', ['-1', '3/4', '5/4', '-1'], {'stable': False, 'reflection': ['1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['control: random denominator 15', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: negative leading coefficient{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
regression: random denominator 3{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
regression: random denominator 4{'reflection': ['-5/4'], 'stable': False}{'reflection': ['-5/4'], 'stable': False}Passed
control: marginal pole on unit circle{'reflection': ['-1'], 'stable': False}{'reflection': ['-1'], 'stable': False}Passed
control: stable second order{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: trailing zero coefficient{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
control: two trailing zeros{'reflection': ['-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}Passed

SHA-256 / 50578328ff555ad91786d65fefb6e8c45defcdf140151693352b3f74e5596afc

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:51:37.482218+00:00.

Case digest / ef17257db0394896bc131591e90c42dcffc26fd1dbc615199fe8c927b3236c73