FAILURE MAP
← Case archive

FA-91591 / Digital signal filters / Open access

Stability test reports reflection coefficients for zero-padded orders · case 01

A padded denominator [1, 1/2, 0] reports an extra reflection coefficient 0.

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

ROOT CAUSE

Trailing zero coefficients are not removed before stepping down.

VERIFIED REPAIR

Drop all trailing zero coefficients first.

Unsuccessful approach: The attempted repair drops at most one trailing zero.

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'
    a = [v / a[0] for v in a]
    pass
    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: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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']}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['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']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['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']}], ['regression: random denominator 51', ['1', '0'], {'stable': True, 'reflection': []}]]]
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: trailing zero coefficient{'reflection': ['0', '1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Failed
regression: two trailing zeros{'reflection': ['0', '0', '-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}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: negative leading coefficient{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: pole at -1{'reflection': ['1'], 'stable': False}{'reflection': ['1'], 'stable': False}Passed
regression: random denominator 0{'reflection': ['0'], 'stable': True}{'reflection': [], 'stable': True}Failed

SHA-256 / 5424385cd72694bd571ddb6c45903c0d3e441bc2851e94ade7a9d451c3e3853a

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 / a[0] for v in a]
    if 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: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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']}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['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']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['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']}], ['regression: random denominator 51', ['1', '0'], {'stable': True, 'reflection': []}]]]
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: trailing zero coefficient{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
regression: two trailing zeros{'reflection': ['0', '-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}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: negative leading coefficient{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: pole at -1{'reflection': ['1'], 'stable': False}{'reflection': ['1'], 'stable': False}Passed
regression: random denominator 0{'reflection': [], 'stable': True}{'reflection': [], 'stable': True}Passed

SHA-256 / 1136d2aac85ecf87467370ffa2ca0731e37aad0343a480102740be926f2dc045

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: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['regression: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['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']}], ['control: random denominator 1', ['1', '1/8', '1/8'], {'stable': True, 'reflection': ['1/8', '1/9']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: random denominator 34', ['-1', '1/2', '-1', '0'], {'stable': False, 'reflection': ['1']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}], ['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']}]], [['regression: trailing zero coefficient', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}], ['regression: two trailing zeros', ['1', '-1/3', '0', '0'], {'stable': True, 'reflection': ['-1/3']}], ['control: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['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']}], ['regression: random denominator 51', ['1', '0'], {'stable': True, 'reflection': []}]]]
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: trailing zero coefficient{'reflection': ['1/2'], 'stable': True}{'reflection': ['1/2'], 'stable': True}Passed
regression: two trailing zeros{'reflection': ['-1/3'], 'stable': True}{'reflection': ['-1/3'], 'stable': True}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: negative leading coefficient{'reflection': ['1/4', '-2/5'], 'stable': True}{'reflection': ['1/4', '-2/5'], 'stable': True}Passed
control: pole at -1{'reflection': ['1'], 'stable': False}{'reflection': ['1'], 'stable': False}Passed
regression: random denominator 0{'reflection': [], 'stable': True}{'reflection': [], 'stable': True}Passed

SHA-256 / 16f740fb81d0977b09db2df6f0fbc784b3a2f3386d42b40235b88ffd98d57398

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.477642+00:00.

Case digest / b6b23a3dc0012de12c3eb9514f006742adf6166e93361c500b8d1165286fd125