FAILURE MAP
← Case archive

FA-91836 / Digital signal filters / Open access

Allpass swaps the input and output delay slots · case 01

The impulse response differs from the allpass kernel after the first sample.

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

ROOT CAUSE

The state update stores y in x[n-1] and x in y[n-1].

THE FAILURE

The state update stores y in x[n-1] and x in y[n-1].

Unsuccessful approach: The attempted repair stores y in both delay slots.

Case contract

Input [a, samples]: y[n] = a x[n] + x[n-1] - a y[n-1] with zero state, "unstable" if |a| >= 1. Return exact fraction strings.

Why this case matters

Allpass sections build phase equalizers and fractional delays; any coefficient slip breaks the unit-magnitude property.

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, xs = Fraction(x[0]), x[1]
    if abs(a) >= 1:
        return 'unstable'
    x1 = y1 = Fraction(0)
    out = []
    for v in xs:
        y = a * v + x1 - a * y1
        x1, y1 = y, v
        out.append(str(y))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: impulse a=1/2', ['1/2', [1, 0, 0, 0]], ['1/2', '3/4', '-3/8', '3/16']], ['regression: negative coefficient', ['-1/3', [2, -1, 0]], ['-2/3', '19/9', '-8/27']], ['regression: a zero is delay', ['0', [1, 2, 3]], ['0', '1', '2']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']]], [['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['regression: a zero is delay', ['0', [1, 2, 3]], ['0', '1', '2']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']]], [['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']], ['regression: random allpass 4', ['1/2', [4, 2, -3, 0, 3, -3]], ['2', '4', '-3/2', '-9/4', '21/8', '3/16']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']]], [['regression: random allpass 6', ['-1/2', [-3, 3, 3, 2]], ['3/2', '-15/4', '-3/8', '29/16']], ['regression: random allpass 7', ['-2/3', [4, 3, 3, -3]], ['-8/3', '2/9', '31/27', '467/81']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']]], [['regression: random allpass 9', ['1/4', [1, -3, 3, 2, -1, 4]], ['1/4', '3/16', '-147/64', '1043/256', '749/1024', '-749/4096']], ['regression: random allpass 10', ['1/4', [-3, 4, 3, 2, -3]], ['-3/4', '-29/16', '333/64', '563/256', '717/1024']], ['regression: random allpass 5', ['-1/2', [3, 4, -2, 1, -1]], ['-3/2', '1/4', '41/8', '1/16', '49/32']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']]]]
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: impulse a=1/2['1/2', '0', '0', '0']['1/2', '3/4', '-3/8', '3/16']Failed
regression: negative coefficient['-2/3', '1/3', '0']['-2/3', '19/9', '-8/27']Failed
regression: a zero is delay['0', '0', '0']['0', '1', '2']Failed
control: unstableunstableunstablePassed
control: random allpass 27['0', '-8/3']['0', '-8/3']Passed
regression: random allpass 0['1/4', '1/2', '1/2', '1']['1/4', '23/16', '137/64', '631/256']Failed
regression: random allpass 1['0', '-1/2', '-1/2', '0']['0', '-1/2', '-5/4', '-3/8']Failed

SHA-256 / a2a99e5da55fb34f4d75c7c2d57a06ea21a7de990c360f8d412e132bac927de6

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, xs = Fraction(x[0]), x[1]
    if abs(a) >= 1:
        return 'unstable'
    x1 = y1 = Fraction(0)
    out = []
    for v in xs:
        y = a * v + x1 - a * y1
        x1 = y1 = y
        out.append(str(y))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: impulse a=1/2', ['1/2', [1, 0, 0, 0]], ['1/2', '3/4', '-3/8', '3/16']], ['regression: negative coefficient', ['-1/3', [2, -1, 0]], ['-2/3', '19/9', '-8/27']], ['regression: a zero is delay', ['0', [1, 2, 3]], ['0', '1', '2']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']]], [['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['regression: a zero is delay', ['0', [1, 2, 3]], ['0', '1', '2']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']]], [['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']], ['regression: random allpass 4', ['1/2', [4, 2, -3, 0, 3, -3]], ['2', '4', '-3/2', '-9/4', '21/8', '3/16']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 0', ['1/4', [1, 2, 2, 4]], ['1/4', '23/16', '137/64', '631/256']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']]], [['regression: random allpass 6', ['-1/2', [-3, 3, 3, 2]], ['3/2', '-15/4', '-3/8', '29/16']], ['regression: random allpass 7', ['-2/3', [4, 3, 3, -3]], ['-8/3', '2/9', '31/27', '467/81']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 1', ['1/2', [0, -1, -1, 0]], ['0', '-1/2', '-5/4', '-3/8']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']]], [['regression: random allpass 9', ['1/4', [1, -3, 3, 2, -1, 4]], ['1/4', '3/16', '-147/64', '1043/256', '749/1024', '-749/4096']], ['regression: random allpass 10', ['1/4', [-3, 4, 3, 2, -3]], ['-3/4', '-29/16', '333/64', '563/256', '717/1024']], ['regression: random allpass 5', ['-1/2', [3, 4, -2, 1, -1]], ['-3/2', '1/4', '41/8', '1/16', '49/32']], ['control: unstable', ['1', [1]], 'unstable'], ['control: random allpass 27', ['-2/3', [0, 4]], ['0', '-8/3']], ['regression: random allpass 2', ['-1/2', [-2, -1, -3, 3]], ['1', '-1', '0', '-9/2']], ['regression: random allpass 3', ['3/5', [1, -1, 0, 4, 1, 4]], ['3/5', '1/25', '-128/125', '1884/625', '8723/3125', '26956/15625']]]]
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: impulse a=1/2['1/2', '1/4', '1/8', '1/16']['1/2', '3/4', '-3/8', '3/16']Failed
regression: negative coefficient['-2/3', '-5/9', '-20/27']['-2/3', '19/9', '-8/27']Failed
regression: a zero is delay['0', '0', '0']['0', '1', '2']Failed
control: unstableunstableunstablePassed
control: random allpass 27['0', '-8/3']['0', '-8/3']Passed
regression: random allpass 0['1/4', '11/16', '65/64', '451/256']['1/4', '23/16', '137/64', '631/256']Failed
regression: random allpass 1['0', '-1/2', '-3/4', '-3/8']['0', '-1/2', '-5/4', '-3/8']Failed

SHA-256 / a4bf0213fd26c7fe208093a2fd3eebb9cf9720e9d30411f7cc77cf9ee2c6add1

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / c2f483971299e713a1028da969d0e84bc5f9d819e4a5a9d9362e787f82b98702