FAILURE MAP
← Case archive

FA-91346 / Digital signal filters / Open access

Streaming FIR shifts the old history instead of the new sample · case 01

Every output equals taps[0] times the current sample; past samples never enter the delay line.

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

ROOT CAUSE

The delay line is updated with taps[1:len(b)], i.e. the old history, dropping the current sample.

THE FAILURE

The delay line is updated with taps[1:len(b)], i.e. the old history, dropping the current sample.

Unsuccessful approach: The attempted repair keeps the last len(b)-1 entries of the tap vector, which again drops the current sample.

Case contract

Input [taps, blocks] of integers. Filter the concatenated stream with y[n] = sum_k taps[k] x[n-k] (zero initial history) while processing block by block; return the outputs grouped per input block.

Why this case matters

Block-based FIR processing must carry history across buffer boundaries or every block edge glitches.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    b, blocks = x
    hist = [0] * (len(b) - 1)
    outs = []
    for blk in blocks:
        ys = []
        for s in blk:
            taps = [s] + hist
            ys.append(sum(c * v for c, v in zip(b, taps)))
            hist = taps[1:len(b)]
        outs.append(ys)
    return outs
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: short blocks spanning history', [[1, 2, 3, 4], [[1], [0], [0, 5], [2]]], [[1], [2], [3, 9], [12]]], ['regression: asymmetric taps one block', [[1, -1, 2], [[1, 0, 0, 0]]], [[1, -1, 2, 0]]], ['regression: empty block in stream', [[2, 1], [[1, 2], [], [3]]], [[2, 5], [], [8]]], ['control: single tap', [[3], [[1, 2], [3]]], [[3, 6], [9]]], ['control: random stream 2', [[1, -3], [[]]], [[]]], ['control: random stream 3', [[-2], [[-5, 2, 0, 2], [-2, 3, -2, 5]]], [[10, -4, 0, -4], [4, -6, 4, -10]]], ['control: random stream 6', [[-3, 3, -1, 0], [[]]], [[]]]], [['regression: random stream 0', [[3, 1, 3, 3], [[3, 4, -2], [3], [5, 4, -3], []]], [[9, 15, 7], [28], [24, 20, 19], []]], ['regression: random stream 1', [[-1, -2, -3, 1], [[1, 2, 5, 4]]], [[-1, -4, -12, -19]]], ['regression: empty block in stream', [[2, 1], [[1, 2], [], [3]]], [[2, 5], [], [8]]], ['control: random stream 7', [[-2], [[], [1, 1, 1]]], [[], [-2, -2, -2]]], ['control: random stream 8', [[1], [[0, -4], [0, -5]]], [[0, -4], [0, -5]]], ['control: random stream 9', [[3, -3, -2, -2], [[]]], [[]]], ['control: random stream 10', [[0], [[5], [-2, 2, 3, -2], [1], [-4, 1, 1]]], [[0], [0, 0, 0, 0], [0], [0, 0, 0]]]], [['regression: random stream 5', [[3, -3, 2, -1, -1], [[-1, -5, -4, 4], []]], [[-3, -12, 1, 15], []]], ['regression: random stream 11', [[-3, -1], [[], [-3], [4, 5, 4]]], [[], [9], [-9, -19, -17]]], ['regression: random stream 1', [[-1, -2, -3, 1], [[1, 2, 5, 4]]], [[-1, -4, -12, -19]]], ['control: random stream 12', [[-3], [[2], [-5, 4]]], [[-6], [15, -12]]], ['control: random stream 13', [[3, -1, 0], [[]]], [[]]], ['control: random stream 14', [[-2], [[], [0, 0, 4, 2]]], [[], [0, 0, -8, -4]]], ['control: random stream 15', [[1, 0], [[-3, 5, -3], [-2, 4]]], [[-3, 5, -3], [-2, 4]]]], [['regression: random stream 20', [[1, 1, -2], [[-3, 2]]], [[-3, -1]]], ['regression: random stream 21', [[2, 2, 2], [[-5, -5, 2, 0], [-5, -5]]], [[-10, -20, -16, -6], [-6, -20]]], ['regression: random stream 5', [[3, -3, 2, -1, -1], [[-1, -5, -4, 4], []]], [[-3, -12, 1, 15], []]], ['control: random stream 17', [[-3], [[1], [1, 4], [-1, 3, -3]]], [[-3], [-3, -12], [3, -9, 9]]], ['control: random stream 18', [[-2], [[3, 5, 4], [-4, -1, -2, -2]]], [[-6, -10, -8], [8, 2, 4, 4]]], ['control: random stream 19', [[-3], [[2, -2, -5], [], [-1]]], [[-6, 6, 15], [], [3]]], ['control: random stream 24', [[0, 1, -3, 1], [[]]], [[]]]], [['regression: random stream 23', [[3, -1], [[], [-4, 1, -5], [4, -5, 4]]], [[], [-12, 7, -16], [17, -19, 17]]], ['regression: random stream 26', [[2, 2, 1, 0], [[3, -4, 3], [-5, -1, 4, -4], [-5, -2, -4], [4, 5, 2]]], [[6, -2, 1], [-8, -9, 1, -1], [-14, -18, -17], [-2, 14, 18]]], ['regression: random stream 16', [[2, -2], [[-2, 5, 1, 2], [-4, 1, -5, -4]]], [[-4, 14, -8, 2], [-12, 10, -12, 2]]], ['control: random stream 25', [[2], [[1, 0]]], [[2, 0]]], ['control: random stream 31', [[1, -1, -1], [[1]]], [[1]]], ['control: random stream 32', [[-2, -3, 3, 3], [[-3], [], []]], [[6], [], []]], ['control: random stream 35', [[-3, 0], [[2], [-2, 5, -5], [3, 4, 5], [0, 2, 0, 5]]], [[-6], [6, -15, 15], [-9, -12, -15], [0, -6, 0, -15]]]]]
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: short blocks spanning history[[1], [0], [0, 5], [2]][[1], [2], [3, 9], [12]]Failed
regression: asymmetric taps one block[[1, 0, 0, 0]][[1, -1, 2, 0]]Failed
regression: empty block in stream[[2, 4], [], [6]][[2, 5], [], [8]]Failed
control: single tap[[3, 6], [9]][[3, 6], [9]]Passed
control: random stream 2[[]][[]]Passed
control: random stream 3[[10, -4, 0, -4], [4, -6, 4, -10]][[10, -4, 0, -4], [4, -6, 4, -10]]Passed
control: random stream 6[[]][[]]Passed

SHA-256 / 819bfdc8a465325a303abcaabf3da87aae9f5e45f20ef32154a8cfe33aea504a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    b, blocks = x
    hist = [0] * (len(b) - 1)
    outs = []
    for blk in blocks:
        ys = []
        for s in blk:
            taps = [s] + hist
            ys.append(sum(c * v for c, v in zip(b, taps)))
            hist = taps[len(taps) - (len(b) - 1):]
        outs.append(ys)
    return outs
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: short blocks spanning history', [[1, 2, 3, 4], [[1], [0], [0, 5], [2]]], [[1], [2], [3, 9], [12]]], ['regression: asymmetric taps one block', [[1, -1, 2], [[1, 0, 0, 0]]], [[1, -1, 2, 0]]], ['regression: empty block in stream', [[2, 1], [[1, 2], [], [3]]], [[2, 5], [], [8]]], ['control: single tap', [[3], [[1, 2], [3]]], [[3, 6], [9]]], ['control: random stream 2', [[1, -3], [[]]], [[]]], ['control: random stream 3', [[-2], [[-5, 2, 0, 2], [-2, 3, -2, 5]]], [[10, -4, 0, -4], [4, -6, 4, -10]]], ['control: random stream 6', [[-3, 3, -1, 0], [[]]], [[]]]], [['regression: random stream 0', [[3, 1, 3, 3], [[3, 4, -2], [3], [5, 4, -3], []]], [[9, 15, 7], [28], [24, 20, 19], []]], ['regression: random stream 1', [[-1, -2, -3, 1], [[1, 2, 5, 4]]], [[-1, -4, -12, -19]]], ['regression: empty block in stream', [[2, 1], [[1, 2], [], [3]]], [[2, 5], [], [8]]], ['control: random stream 7', [[-2], [[], [1, 1, 1]]], [[], [-2, -2, -2]]], ['control: random stream 8', [[1], [[0, -4], [0, -5]]], [[0, -4], [0, -5]]], ['control: random stream 9', [[3, -3, -2, -2], [[]]], [[]]], ['control: random stream 10', [[0], [[5], [-2, 2, 3, -2], [1], [-4, 1, 1]]], [[0], [0, 0, 0, 0], [0], [0, 0, 0]]]], [['regression: random stream 5', [[3, -3, 2, -1, -1], [[-1, -5, -4, 4], []]], [[-3, -12, 1, 15], []]], ['regression: random stream 11', [[-3, -1], [[], [-3], [4, 5, 4]]], [[], [9], [-9, -19, -17]]], ['regression: random stream 1', [[-1, -2, -3, 1], [[1, 2, 5, 4]]], [[-1, -4, -12, -19]]], ['control: random stream 12', [[-3], [[2], [-5, 4]]], [[-6], [15, -12]]], ['control: random stream 13', [[3, -1, 0], [[]]], [[]]], ['control: random stream 14', [[-2], [[], [0, 0, 4, 2]]], [[], [0, 0, -8, -4]]], ['control: random stream 15', [[1, 0], [[-3, 5, -3], [-2, 4]]], [[-3, 5, -3], [-2, 4]]]], [['regression: random stream 20', [[1, 1, -2], [[-3, 2]]], [[-3, -1]]], ['regression: random stream 21', [[2, 2, 2], [[-5, -5, 2, 0], [-5, -5]]], [[-10, -20, -16, -6], [-6, -20]]], ['regression: random stream 5', [[3, -3, 2, -1, -1], [[-1, -5, -4, 4], []]], [[-3, -12, 1, 15], []]], ['control: random stream 17', [[-3], [[1], [1, 4], [-1, 3, -3]]], [[-3], [-3, -12], [3, -9, 9]]], ['control: random stream 18', [[-2], [[3, 5, 4], [-4, -1, -2, -2]]], [[-6, -10, -8], [8, 2, 4, 4]]], ['control: random stream 19', [[-3], [[2, -2, -5], [], [-1]]], [[-6, 6, 15], [], [3]]], ['control: random stream 24', [[0, 1, -3, 1], [[]]], [[]]]], [['regression: random stream 23', [[3, -1], [[], [-4, 1, -5], [4, -5, 4]]], [[], [-12, 7, -16], [17, -19, 17]]], ['regression: random stream 26', [[2, 2, 1, 0], [[3, -4, 3], [-5, -1, 4, -4], [-5, -2, -4], [4, 5, 2]]], [[6, -2, 1], [-8, -9, 1, -1], [-14, -18, -17], [-2, 14, 18]]], ['regression: random stream 16', [[2, -2], [[-2, 5, 1, 2], [-4, 1, -5, -4]]], [[-4, 14, -8, 2], [-12, 10, -12, 2]]], ['control: random stream 25', [[2], [[1, 0]]], [[2, 0]]], ['control: random stream 31', [[1, -1, -1], [[1]]], [[1]]], ['control: random stream 32', [[-2, -3, 3, 3], [[-3], [], []]], [[6], [], []]], ['control: random stream 35', [[-3, 0], [[2], [-2, 5, -5], [3, 4, 5], [0, 2, 0, 5]]], [[-6], [6, -15, 15], [-9, -12, -15], [0, -6, 0, -15]]]]]
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: short blocks spanning history[[1], [0], [0, 5], [2]][[1], [2], [3, 9], [12]]Failed
regression: asymmetric taps one block[[1, 0, 0, 0]][[1, -1, 2, 0]]Failed
regression: empty block in stream[[2, 4], [], [6]][[2, 5], [], [8]]Failed
control: single tap[[3, 6], [9]][[3, 6], [9]]Passed
control: random stream 2[[]][[]]Passed
control: random stream 3[[10, -4, 0, -4], [4, -6, 4, -10]][[10, -4, 0, -4], [4, -6, 4, -10]]Passed
control: random stream 6[[]][[]]Passed

SHA-256 / 9c36ef3d8ff976a636297739a61f898fb8017345d104996c4513ac282f196142

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

Case digest / 4fc91255751c5ba0cf4fe1449703456f16e1180015aa3dfdddad487e9885ca31