FA-91571 / Digital signal filters / Open access
Stability test omits the offending reflection coefficient · case 01
An unstable first-order denominator reports an empty reflection list, hiding which stage failed.
ROOT CAUSE
The reflection coefficient is appended only after the stability check passes.
VERIFIED REPAIR
Record k before testing |k| >= 1 so the failing coefficient is reported.
Unsuccessful approach: The attempted repair records |k|, losing the sign of negative reflection coefficients.
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]
while len(a) > 1 and a[-1] == 0:
a.pop()
ks = []
while len(a) > 1:
p = len(a) - 1
k = a[p]
if abs(k) >= 1:
return {'stable': False, 'reflection': ks}
ks.append(str(k))
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: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['repair check: 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: bad a0', ['0', '1'], 'bad-a0'], ['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']}]], [['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['regression: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['repair check: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['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 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}]], [['regression: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 17', ['1', '1/8'], {'stable': True, 'reflection': ['1/8']}], ['control: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 23', ['1', '1/2', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 22', ['2', '1/8', '3/4'], {'stable': True, 'reflection': ['3/8', '1/22']}], ['control: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['control: random denominator 25', ['1', '3/4'], {'stable': True, 'reflection': ['3/4']}], ['control: random denominator 26', ['1', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 33', ['1', '5/4', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['repair check: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['control: random denominator 35', ['2', '1/8', '1/2', '1/3'], {'stable': True, 'reflection': ['1/6', '69/280', '6/349']}], ['control: random denominator 37', ['1', '1/2', '3/4'], {'stable': True, 'reflection': ['3/4', '2/7']}], ['control: random denominator 44', ['1', '1/2'], {'stable': True, 'reflection': ['1/2']}]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: marginal pole on unit circle | {'reflection': [], 'stable': False} | {'reflection': ['-1'], 'stable': False} | Failed |
| regression: pole at -1 | {'reflection': [], 'stable': False} | {'reflection': ['1'], 'stable': False} | Failed |
| repair check: 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: bad a0 | bad-a0 | bad-a0 | Passed |
| control: random denominator 0 | {'reflection': [], 'stable': True} | {'reflection': [], 'stable': True} | Passed |
| control: random denominator 1 | {'reflection': ['1/8', '1/9'], 'stable': True} | {'reflection': ['1/8', '1/9'], 'stable': True} | Passed |
SHA-256 / dcaa6c53a1ad8bc7e63a527947c9a71ecb04ac5f5e242e50a5988b37dd377228
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]
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(abs(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: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['repair check: 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: bad a0', ['0', '1'], 'bad-a0'], ['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']}]], [['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['regression: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['repair check: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['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 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}]], [['regression: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 17', ['1', '1/8'], {'stable': True, 'reflection': ['1/8']}], ['control: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 23', ['1', '1/2', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 22', ['2', '1/8', '3/4'], {'stable': True, 'reflection': ['3/8', '1/22']}], ['control: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['control: random denominator 25', ['1', '3/4'], {'stable': True, 'reflection': ['3/4']}], ['control: random denominator 26', ['1', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 33', ['1', '5/4', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['repair check: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['control: random denominator 35', ['2', '1/8', '1/2', '1/3'], {'stable': True, 'reflection': ['1/6', '69/280', '6/349']}], ['control: random denominator 37', ['1', '1/2', '3/4'], {'stable': True, 'reflection': ['3/4', '2/7']}], ['control: random denominator 44', ['1', '1/2'], {'stable': True, 'reflection': ['1/2']}]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: marginal pole on unit circle | {'reflection': ['1'], 'stable': False} | {'reflection': ['-1'], 'stable': False} | Failed |
| regression: pole at -1 | {'reflection': ['1'], 'stable': False} | {'reflection': ['1'], 'stable': False} | Passed |
| repair check: stable second order | {'reflection': ['1/4', '2/5'], 'stable': True} | {'reflection': ['1/4', '-2/5'], 'stable': True} | Failed |
| control: trailing zero coefficient | {'reflection': ['1/2'], 'stable': True} | {'reflection': ['1/2'], 'stable': True} | Passed |
| control: bad a0 | bad-a0 | bad-a0 | Passed |
| control: random denominator 0 | {'reflection': [], 'stable': True} | {'reflection': [], 'stable': True} | Passed |
| control: random denominator 1 | {'reflection': ['1/8', '1/9'], 'stable': True} | {'reflection': ['1/8', '1/9'], 'stable': True} | Passed |
SHA-256 / 291514be2b725799dc964901b413eaa24f0d229b1c82f3f204233d30bd3fea1d
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: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}], ['repair check: 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: bad a0', ['0', '1'], 'bad-a0'], ['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']}]], [['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['regression: random denominator 7', ['1', '3/4', '-1'], {'stable': False, 'reflection': ['-1']}], ['repair check: negative leading coefficient', ['-2', '1', '-1/2'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['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 5', ['1', '1/8', '1/3'], {'stable': True, 'reflection': ['1/3', '3/32']}], ['control: random denominator 6', ['1/2', '1/8'], {'stable': True, 'reflection': ['1/4']}]], [['regression: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 14', ['1', '1/8', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: random denominator 11', ['-1', '0', '-1/2'], {'stable': True, 'reflection': ['1/2', '0']}], ['control: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 17', ['1', '1/8'], {'stable': True, 'reflection': ['1/8']}], ['control: random denominator 18', ['1', '1/2', '0'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 21', ['1/2', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['regression: random denominator 23', ['1', '1/2', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['regression: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['control: random denominator 22', ['2', '1/8', '3/4'], {'stable': True, 'reflection': ['3/8', '1/22']}], ['control: random denominator 24', ['2', '1/2'], {'stable': True, 'reflection': ['1/4']}], ['control: random denominator 25', ['1', '3/4'], {'stable': True, 'reflection': ['3/4']}], ['control: random denominator 26', ['1', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14']}]], [['regression: random denominator 32', ['1/2', '-1/2'], {'stable': False, 'reflection': ['-1']}], ['regression: random denominator 33', ['1', '5/4', '5/4'], {'stable': False, 'reflection': ['5/4']}], ['repair check: random denominator 8', ['1', '-1/4'], {'stable': True, 'reflection': ['-1/4']}], ['control: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['control: random denominator 35', ['2', '1/8', '1/2', '1/3'], {'stable': True, 'reflection': ['1/6', '69/280', '6/349']}], ['control: random denominator 37', ['1', '1/2', '3/4'], {'stable': True, 'reflection': ['3/4', '2/7']}], ['control: random denominator 44', ['1', '1/2'], {'stable': True, 'reflection': ['1/2']}]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: marginal pole on unit circle | {'reflection': ['-1'], 'stable': False} | {'reflection': ['-1'], 'stable': False} | Passed |
| regression: pole at -1 | {'reflection': ['1'], 'stable': False} | {'reflection': ['1'], 'stable': False} | Passed |
| repair check: 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: bad a0 | bad-a0 | bad-a0 | Passed |
| control: random denominator 0 | {'reflection': [], 'stable': True} | {'reflection': [], 'stable': True} | Passed |
| control: random denominator 1 | {'reflection': ['1/8', '1/9'], 'stable': True} | {'reflection': ['1/8', '1/9'], 'stable': True} | Passed |
SHA-256 / 1603f458700e0323f6a6781453623f5d738b1504e369e11f33d24105e4cc5138
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.351809+00:00.
Case digest / 8da4026dd0efa20f221efca041fcc0745e4955b1efbaccb69a60990d6543e5a9