FAILURE MAP
← Case archive

FA-91431 / Digital signal filters / Open access

CIC integrators all integrate the raw input · case 01

A multi-stage CIC behaves like a single-stage one with a scaled gain.

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

ROOT CAUSE

Inside the stage loop the running value is not replaced by the stage output, so each stage sees the input.

THE FAILURE

Inside the stage loop the running value is not replaced by the stage output, so each stage sees the input.

Unsuccessful approach: The attempted repair accumulates the stage output into the running value instead of replacing it.

Case contract

Input [N, R, M, samples]: N integrator stages at the input rate, keep the integrator output at indices R-1, 2R-1, ... (whole blocks only), then N comb stages y = v - v[k-M] at the low rate with zero initial state; divide by the gain (R M)^N and return exact fraction strings.

Why this case matters

CIC decimators front most digital down-converters; decimation phase, delay or gain slips distort the passband level.

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):
    N, R, M, xs = x
    ints = [0] * N
    dec = []
    for i, v in enumerate(xs):
        acc = v
        for k in range(N):
            ints[k] += acc
        if i % R == R - 1:
            dec.append(acc)
    combs = [[0] * M for _ in range(N)]
    out = []
    for v in dec:
        for k in range(N):
            d = combs[k]
            prev = d.pop(0)
            d.append(v)
            v = v - prev
        out.append(str(Fraction(v, (R * M) ** N)))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: one stage R=2 M=1', [1, 2, 1, [1, 2, 3, 4, 5, 6]], ['3/2', '7/2', '11/2']], ['regression: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']]], [['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']]], [['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']]], [['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']], ['regression: random cic 6', [1, 4, 1, [-2, 5, 3, -2, 5, -2, 1, 3, 0, -2, -3, 4, -2, -1, 5, 4, 2, 0, -2, 1]], ['1', '7/4', '-1/4', '3/2', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']]], [['regression: random cic 8', [3, 3, 1, [-1, 1, 5, 5, 3, 3, 0, -2, 2, 2, 1, 1, 1, -3]], ['2/27', '80/27', '55/27', '7/9']], ['regression: random cic 9', [3, 2, 2, [5, 2, 5, -2, 0, 0, 0, 3, 5, 1, 2]], ['17/64', '75/64', '61/32', '89/64', '55/64']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']]]]
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: one stage R=2 M=1['1', '1', '1']['3/2', '7/2', '11/2']Failed
regression: two stages R=3 M=2['0', '0', '0', '0']['1/12', '1/6', '1/12', '0']Failed
regression: partial final block['1']['3']Failed
regression: step three stages['1/8', '-1/4', '1/8', '0', '0']['1/2', '1', '1', '1', '1']Failed
regression: random cic 0['1/6', '2/3', '2/3']['1', '13/6', '5/2']Failed
regression: random cic 1['1', '-3/2', '-1/4', '3/4']['2', '5/4', '1/4', '1/4']Failed
regression: random cic 2['1', '-5/3', '-1/3']['7/3', '-1', '1/3']Failed

SHA-256 / d9b7f972cd039ff343c197508e5b7d660614b691bed367f88e06e01c34c8c508

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):
    N, R, M, xs = x
    ints = [0] * N
    dec = []
    for i, v in enumerate(xs):
        acc = v
        for k in range(N):
            ints[k] += acc
            acc += ints[k]
        if i % R == R - 1:
            dec.append(acc)
    combs = [[0] * M for _ in range(N)]
    out = []
    for v in dec:
        for k in range(N):
            d = combs[k]
            prev = d.pop(0)
            d.append(v)
            v = v - prev
        out.append(str(Fraction(v, (R * M) ** N)))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: one stage R=2 M=1', [1, 2, 1, [1, 2, 3, 4, 5, 6]], ['3/2', '7/2', '11/2']], ['regression: two stages R=3 M=2', [2, 3, 2, [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], ['1/12', '1/6', '1/12', '0']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']]], [['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: partial final block', [1, 3, 1, [3, 3, 3, 3, 3]], ['3']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']]], [['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: step three stages', [3, 2, 1, [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], ['1/2', '1', '1', '1', '1']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']]], [['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']], ['regression: random cic 6', [1, 4, 1, [-2, 5, 3, -2, 5, -2, 1, 3, 0, -2, -3, 4, -2, -1, 5, 4, 2, 0, -2, 1]], ['1', '7/4', '-1/4', '3/2', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 0', [1, 3, 2, [4, 1, 1, 5, -2, 4, -1, 4, 5]], ['1', '13/6', '5/2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']]], [['regression: random cic 8', [3, 3, 1, [-1, 1, 5, 5, 3, 3, 0, -2, 2, 2, 1, 1, 1, -3]], ['2/27', '80/27', '55/27', '7/9']], ['regression: random cic 9', [3, 2, 2, [5, 2, 5, -2, 0, 0, 0, 3, 5, 1, 2]], ['17/64', '75/64', '61/32', '89/64', '55/64']], ['regression: random cic 4', [1, 2, 2, [-3, 1, 4, 2, 4, 2, -3, 5]], ['-1/2', '1', '3', '2']], ['regression: random cic 1', [1, 4, 1, [2, -1, 3, 4, 5, -3, 5, -2, 3, -1, 2, -3, -3, 0, 4, 0, 2, 4, 1]], ['2', '5/4', '1/4', '1/4']], ['regression: random cic 2', [1, 3, 1, [2, 2, 3, -2, 1, -2, 3, 1, -3]], ['7/3', '-1', '1/3']], ['regression: random cic 3', [3, 2, 2, [3, -3, 3, 5, -2, 3, 2, 4, 2, 2, 0]], ['3/32', '13/32', '57/64', '23/16', '63/32']], ['regression: random cic 5', [3, 2, 2, [-2, 2, -3, 2, -2, -3, 3, -3, -1]], ['-1/16', '-15/64', '-27/64', '-9/16']]]]
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: one stage R=2 M=1['5/2', '9/2', '13/2']['3/2', '7/2', '11/2']Failed
regression: two stages R=3 M=2['5/36', '2/9', '1/36', '-1/18']['1/12', '1/6', '1/12', '0']Failed
regression: partial final block['4']['3']Failed
regression: step three stages['5/2', '3/8', '9/8', '1', '1']['1/2', '1', '1', '1', '1']Failed
regression: random cic 0['7/6', '17/6', '19/6']['1', '13/6', '5/2']Failed
regression: random cic 1['3', '-1/4', '0', '1']['2', '5/4', '1/4', '1/4']Failed
regression: random cic 2['10/3', '-8/3', '0']['7/3', '-1', '1/3']Failed

SHA-256 / bafa70bf2a3bda9302df8b64d479063f0e05d7b9570c9334c8c1cfecebd49dd4

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

Case digest / 3cfd565d6ac2dea508a81f1cc24ffdaa1c317c46abb45e3e922a70bc3364fb55