FA-91576 / Digital signal filters / Open access
Stability step-down pairs coefficients with themselves · case 01
Higher-order denominators get wrong reflection coefficients after the first step.
ROOT CAUSE
The recursion uses k a_i instead of k a_{p-i}.
VERIFIED REPAIR
Use the reversed polynomial term a_{p-i}.
Unsuccessful approach: The attempted repair uses a_{p-1-i}, shifted by one.
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]
ks.append(str(k))
if abs(k) >= 1:
return {'stable': False, 'reflection': ks}
a = [(a[i] - k * a[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: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}]], [['regression: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['regression: random denominator 31', ['1', '1/8', '-1', '-1/4'], {'stable': False, 'reflection': ['-1/4', '-31/30']}], ['regression: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 38', ['-1', '1/2', '5/4', '1/3'], {'stable': False, 'reflection': ['-1/3', '-51/32']}], ['regression: random denominator 40', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['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']}]], [['regression: random denominator 49', ['1', '1/2', '-1/2', '1/2'], {'stable': False, 'reflection': ['1/2', '-1']}], ['regression: random denominator 50', ['1', '1/3', '3/4', '1/8'], {'stable': True, 'reflection': ['1/8', '136/189', '46/325']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}]], [['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['repair check: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 16', ['1/2', '-1', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['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']}], ['control: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: third order | {'reflection': ['-1/5', '5/12', '-15/34'], 'stable': True} | {'reflection': ['-1/5', '35/144', '-65/179'], 'stable': True} | Failed |
| regression: random denominator 10 | {'reflection': ['-1/2', '1/4', '-2/5'], 'stable': True} | {'reflection': ['-1/2', '0', '-1/4'], 'stable': True} | Failed |
| repair check: stable second order | {'reflection': ['1/4', '-2/5'], 'stable': True} | {'reflection': ['1/4', '-2/5'], 'stable': True} | Passed |
| control: marginal pole on unit circle | {'reflection': ['-1'], 'stable': False} | {'reflection': ['-1'], 'stable': False} | 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 |
| control: pole at -1 | {'reflection': ['1'], 'stable': False} | {'reflection': ['1'], 'stable': False} | Passed |
SHA-256 / 71b7e5cfc5e44563052e3af9289401ec90db835a6b9efb1a90b74f316bd0b137
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(k))
if abs(k) >= 1:
return {'stable': False, 'reflection': ks}
a = [(a[i] - k * a[p - 1 - 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: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}]], [['regression: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['regression: random denominator 31', ['1', '1/8', '-1', '-1/4'], {'stable': False, 'reflection': ['-1/4', '-31/30']}], ['regression: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 38', ['-1', '1/2', '5/4', '1/3'], {'stable': False, 'reflection': ['-1/3', '-51/32']}], ['regression: random denominator 40', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['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']}]], [['regression: random denominator 49', ['1', '1/2', '-1/2', '1/2'], {'stable': False, 'reflection': ['1/2', '-1']}], ['regression: random denominator 50', ['1', '1/3', '3/4', '1/8'], {'stable': True, 'reflection': ['1/8', '136/189', '46/325']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}]], [['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['repair check: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 16', ['1/2', '-1', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['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']}], ['control: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: third order | {'reflection': ['-1/5', '5/9', '-115/64'], 'stable': False} | {'reflection': ['-1/5', '35/144', '-65/179'], 'stable': True} | Failed |
| regression: random denominator 10 | {'reflection': ['-1/2', '5/6', '-11/2'], 'stable': False} | {'reflection': ['-1/2', '0', '-1/4'], 'stable': True} | Failed |
| repair check: stable second order | {'reflection': ['1/4', '-4/5'], 'stable': True} | {'reflection': ['1/4', '-2/5'], 'stable': True} | Failed |
| control: marginal pole on unit circle | {'reflection': ['-1'], 'stable': False} | {'reflection': ['-1'], 'stable': False} | 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 |
| control: pole at -1 | {'reflection': ['1'], 'stable': False} | {'reflection': ['1'], 'stable': False} | Passed |
SHA-256 / 9c3ca2ba85861d7bed7885b13edfa540afd3dbb7e19d55453d48b3ba924c7648
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: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: stable second order', ['1', '-1/2', '1/4'], {'stable': True, 'reflection': ['1/4', '-2/5']}], ['control: marginal pole on unit circle', ['1', '0', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}], ['control: pole at -1', ['1', '1'], {'stable': False, 'reflection': ['1']}]], [['regression: random denominator 30', ['1', '1/3', '1/2', '1/3'], {'stable': True, 'reflection': ['1/3', '7/16', '3/23']}], ['regression: random denominator 31', ['1', '1/8', '-1', '-1/4'], {'stable': False, 'reflection': ['-1/4', '-31/30']}], ['regression: third order', ['1', '-1/2', '1/3', '-1/5'], {'stable': True, 'reflection': ['-1/5', '35/144', '-65/179']}], ['control: unstable first order', ['1', '-3/2'], {'stable': False, 'reflection': ['-3/2']}], ['control: bad a0', ['0', '1'], 'bad-a0'], ['control: random denominator 0', ['-1', '0'], {'stable': True, 'reflection': []}], ['control: random denominator 3', ['-1', '-1/2'], {'stable': True, 'reflection': ['1/2']}]], [['regression: random denominator 38', ['-1', '1/2', '5/4', '1/3'], {'stable': False, 'reflection': ['-1/3', '-51/32']}], ['regression: random denominator 40', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['repair check: random denominator 2', ['1', '1/3', '1/3'], {'stable': True, 'reflection': ['1/3', '1/4']}], ['control: random denominator 4', ['-1', '0', '5/4'], {'stable': False, 'reflection': ['-5/4']}], ['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']}]], [['regression: random denominator 49', ['1', '1/2', '-1/2', '1/2'], {'stable': False, 'reflection': ['1/2', '-1']}], ['regression: random denominator 50', ['1', '1/3', '3/4', '1/8'], {'stable': True, 'reflection': ['1/8', '136/189', '46/325']}], ['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['control: random denominator 9', ['1', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['control: random denominator 12', ['1', '5/4', '-1', '-1'], {'stable': False, 'reflection': ['-1']}], ['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']}]], [['regression: random denominator 10', ['1', '-1/4', '1/8', '-1/2'], {'stable': True, 'reflection': ['-1/2', '0', '-1/4']}], ['regression: random denominator 27', ['2', '1/3', '-1/2', '1/8'], {'stable': True, 'reflection': ['1/16', '-40/153', '28/113']}], ['repair check: random denominator 13', ['1', '1/8', '1/8', '3/4'], {'stable': True, 'reflection': ['3/4', '1/14', '1/15']}], ['control: random denominator 16', ['1/2', '-1', '3/4'], {'stable': False, 'reflection': ['3/2']}], ['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']}], ['control: random denominator 19', ['-1', '3/4'], {'stable': True, 'reflection': ['-3/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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: third order | {'reflection': ['-1/5', '35/144', '-65/179'], 'stable': True} | {'reflection': ['-1/5', '35/144', '-65/179'], 'stable': True} | Passed |
| regression: random denominator 10 | {'reflection': ['-1/2', '0', '-1/4'], 'stable': True} | {'reflection': ['-1/2', '0', '-1/4'], 'stable': True} | Passed |
| repair check: stable second order | {'reflection': ['1/4', '-2/5'], 'stable': True} | {'reflection': ['1/4', '-2/5'], 'stable': True} | Passed |
| control: marginal pole on unit circle | {'reflection': ['-1'], 'stable': False} | {'reflection': ['-1'], 'stable': False} | 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 |
| control: pole at -1 | {'reflection': ['1'], 'stable': False} | {'reflection': ['1'], 'stable': False} | Passed |
SHA-256 / b7084fa09d50f18b2b65e277511bf9d42e1e64cc4492f4b36dd6a30627c4b1b0
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.434379+00:00.
Case digest / 18dd1a6a032a713c83a7f282b2fa47d5b444ffd3eeaea26c18dbca1c55c5d414