FAILURE MAP
← Case archive

FA-91746 / Digital signal filters / Open access

Feedback comb reads the most recently written slot · case 01

Echoes arrive after one sample regardless of D.

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

ROOT CAUSE

The delayed value is read from buf[pos - 1].

VERIFIED REPAIR

Read buf[pos] (the oldest slot) before overwriting it.

Unsuccessful approach: The attempted repair reads buf[(pos + 1) % D], giving a delay of D - 1.

Case contract

Input [D, g, samples]: y[n] = x[n] + g y[n-D] using a D-slot ring buffer with zero initial state; "bad-delay" if D < 1, "unstable" if |g| >= 1. Return exact fraction strings.

Why this case matters

Feedback combs build resonators and reverberators; ring-buffer indexing slips change the delay and the pitch.

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):
    D, g, xs = x[0], Fraction(x[1]), x[2]
    if D < 1:
        return 'bad-delay'
    if abs(g) >= 1:
        return 'unstable'
    buf = [Fraction(0)] * D
    pos = 0
    out = []
    for v in xs:
        delayed = buf[pos - 1]
        y = v + g * delayed
        buf[pos] = y
        pos = (pos + 1) % D
        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 delay 2', [2, '1/2', [1, 0, 0, 0, 0, 0]], ['1', '0', '1/2', '0', '1/4', '0']], ['regression: random comb 0', [2, '1/2', [-1, 3, 3, 0, 3, 2, -3, -1, -2]], ['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable'], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay']], [['regression: random comb 2', [4, '-2/3', [2, 2, -1, 3, -1, 2, 1]], ['2', '2', '-1', '3', '-7/3', '2/3', '5/3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']]], [['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['regression: random comb 6', [4, '-2/3', [1, 0, -3, 3]], ['1', '0', '-3', '3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable']], [['regression: random comb 8', [4, '-2/3', [1, 3, -2, -1]], ['1', '3', '-2', '-1']], ['regression: random comb 9', [3, '1/2', [-2, 0, -3, 1, -3, 0, 3, 1]], ['-2', '0', '-3', '0', '-3', '-3/2', '3', '-1/2']], ['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay'], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']]], [['regression: random comb 12', [3, '1/2', [2, 3, 0, -2, 3, 1]], ['2', '3', '0', '-1', '9/2', '1']], ['regression: random comb 13', [4, '-2/3', [3, -1, -3, -2, 3]], ['3', '-1', '-3', '-2', '1']], ['regression: random comb 7', [4, '-2/3', [1, 3, 3, -1, -1, 2, 3, -2, 2]], ['1', '3', '3', '-1', '-5/3', '0', '1', '-4/3', '28/9']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']]]]
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 delay 2['1', '1/2', '1/4', '1/8', '1/16', '1/32']['1', '0', '1/2', '0', '1/4', '0']Failed
regression: random comb 0['-1', '5/2', '17/4', '17/8', '65/16', '129/32', '-63/64', '-191/128', '-703/256']['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']Failed
regression: random comb 1['-3', '-7/2', '1/4', '-23/8', '9/16', '-23/32', '-215/64', '-471/128', '-1239/256']['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']Failed
control: delay 1['1', '-1/2', '1/4']['1', '-1/2', '1/4']Passed
control: unit gain rejectedunstableunstablePassed
control: negative unit gainunstableunstablePassed
control: bad delaybad-delaybad-delayPassed

SHA-256 / cc24ee6fbc456b05f1c0f675b7b3012c22fe2d7088c11b84dfa347555247db5a

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):
    D, g, xs = x[0], Fraction(x[1]), x[2]
    if D < 1:
        return 'bad-delay'
    if abs(g) >= 1:
        return 'unstable'
    buf = [Fraction(0)] * D
    pos = 0
    out = []
    for v in xs:
        delayed = buf[(pos + 1) % D]
        y = v + g * delayed
        buf[pos] = y
        pos = (pos + 1) % D
        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 delay 2', [2, '1/2', [1, 0, 0, 0, 0, 0]], ['1', '0', '1/2', '0', '1/4', '0']], ['regression: random comb 0', [2, '1/2', [-1, 3, 3, 0, 3, 2, -3, -1, -2]], ['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable'], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay']], [['regression: random comb 2', [4, '-2/3', [2, 2, -1, 3, -1, 2, 1]], ['2', '2', '-1', '3', '-7/3', '2/3', '5/3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']]], [['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['regression: random comb 6', [4, '-2/3', [1, 0, -3, 3]], ['1', '0', '-3', '3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable']], [['regression: random comb 8', [4, '-2/3', [1, 3, -2, -1]], ['1', '3', '-2', '-1']], ['regression: random comb 9', [3, '1/2', [-2, 0, -3, 1, -3, 0, 3, 1]], ['-2', '0', '-3', '0', '-3', '-3/2', '3', '-1/2']], ['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay'], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']]], [['regression: random comb 12', [3, '1/2', [2, 3, 0, -2, 3, 1]], ['2', '3', '0', '-1', '9/2', '1']], ['regression: random comb 13', [4, '-2/3', [3, -1, -3, -2, 3]], ['3', '-1', '-3', '-2', '1']], ['regression: random comb 7', [4, '-2/3', [1, 3, 3, -1, -1, 2, 3, -2, 2]], ['1', '3', '3', '-1', '-5/3', '0', '1', '-4/3', '28/9']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']]]]
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 delay 2['1', '1/2', '1/4', '1/8', '1/16', '1/32']['1', '0', '1/2', '0', '1/4', '0']Failed
regression: random comb 0['-1', '5/2', '17/4', '17/8', '65/16', '129/32', '-63/64', '-191/128', '-703/256']['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']Failed
regression: random comb 1['-3', '-2', '2', '-9/2', '1', '0', '-21/4', '-3/2', '-3']['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']Failed
control: delay 1['1', '-1/2', '1/4']['1', '-1/2', '1/4']Passed
control: unit gain rejectedunstableunstablePassed
control: negative unit gainunstableunstablePassed
control: bad delaybad-delaybad-delayPassed

SHA-256 / 2e76a426a146ee847c08cb2e81a095e787403852287dd4abd25b73196be3e82b

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):
    D, g, xs = x[0], Fraction(x[1]), x[2]
    if D < 1:
        return 'bad-delay'
    if abs(g) >= 1:
        return 'unstable'
    buf = [Fraction(0)] * D
    pos = 0
    out = []
    for v in xs:
        delayed = buf[pos]
        y = v + g * delayed
        buf[pos] = y
        pos = (pos + 1) % D
        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 delay 2', [2, '1/2', [1, 0, 0, 0, 0, 0]], ['1', '0', '1/2', '0', '1/4', '0']], ['regression: random comb 0', [2, '1/2', [-1, 3, 3, 0, 3, 2, -3, -1, -2]], ['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable'], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay']], [['regression: random comb 2', [4, '-2/3', [2, 2, -1, 3, -1, 2, 1]], ['2', '2', '-1', '3', '-7/3', '2/3', '5/3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['regression: random comb 1', [4, '1/2', [-3, -2, 2, -3, 2, -1, -3, -2, -3]], ['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']]], [['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['regression: random comb 6', [4, '-2/3', [1, 0, -3, 3]], ['1', '0', '-3', '3']], ['regression: random comb 3', [2, '1/2', [2, -1, -3]], ['2', '-1', '-2']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']], ['control: delay 1', [1, '-1/2', [1, 0, 0]], ['1', '-1/2', '1/4']], ['control: unit gain rejected', [3, '1', [1]], 'unstable']], [['regression: random comb 8', [4, '-2/3', [1, 3, -2, -1]], ['1', '3', '-2', '-1']], ['regression: random comb 9', [3, '1/2', [-2, 0, -3, 1, -3, 0, 3, 1]], ['-2', '0', '-3', '0', '-3', '-3/2', '3', '-1/2']], ['regression: random comb 5', [2, '-2/3', [-3, -3, -1, -3, -1]], ['-3', '-3', '1', '-1', '-5/3']], ['control: negative unit gain', [3, '-1', [1]], 'unstable'], ['control: bad delay', [0, '1/2', [1]], 'bad-delay'], ['control: random comb 11', [1, '3/4', [0, 1, 2, 0, -2, 1, 0]], ['0', '1', '11/4', '33/16', '-29/64', '169/256', '507/1024']], ['control: random comb 25', [1, '1/3', [0, -2, 2, 3, 0, 2, -2, -3]], ['0', '-2', '4/3', '31/9', '31/27', '193/81', '-293/243', '-2480/729']]], [['regression: random comb 12', [3, '1/2', [2, 3, 0, -2, 3, 1]], ['2', '3', '0', '-1', '9/2', '1']], ['regression: random comb 13', [4, '-2/3', [3, -1, -3, -2, 3]], ['3', '-1', '-3', '-2', '1']], ['regression: random comb 7', [4, '-2/3', [1, 3, 3, -1, -1, 2, 3, -2, 2]], ['1', '3', '3', '-1', '-5/3', '0', '1', '-4/3', '28/9']], ['control: random comb 29', [1, '1/2', [-3, 0, -3, -3, 2]], ['-3', '-3/2', '-15/4', '-39/8', '-7/16']], ['control: random comb 30', [1, '1/3', [1, 2, 1, -3, -1, 1, 2]], ['1', '7/3', '16/9', '-65/27', '-146/81', '97/243', '1555/729']], ['control: random comb 33', [1, '3/4', [-3, -3, -1, 2, -2, 0, 2, 1, 3]], ['-3', '-21/4', '-79/16', '-109/64', '-839/256', '-2517/1024', '641/4096', '18307/16384', '251529/65536']], ['control: random comb 39', [1, '1/2', [3, 3, -2, 0, 2, -2, -3, 0, -3]], ['3', '9/2', '1/4', '1/8', '33/16', '-31/32', '-223/64', '-223/128', '-991/256']]]]
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 delay 2['1', '0', '1/2', '0', '1/4', '0']['1', '0', '1/2', '0', '1/4', '0']Passed
regression: random comb 0['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']['-1', '3', '5/2', '3/2', '17/4', '11/4', '-7/8', '3/8', '-39/16']Passed
regression: random comb 1['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']['-3', '-2', '2', '-3', '1/2', '-2', '-2', '-7/2', '-11/4']Passed
control: delay 1['1', '-1/2', '1/4']['1', '-1/2', '1/4']Passed
control: unit gain rejectedunstableunstablePassed
control: negative unit gainunstableunstablePassed
control: bad delaybad-delaybad-delayPassed

SHA-256 / 8f561a1402b1a6785acbafb787ea1ead1c981125377c5552c5c69b6ab92046be

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

Case digest / 5d324ae7534ce78d74df3dec7a47d4e5a6cc5d347d1e24b3ed95e2d37bcbfe42