FAILURE MAP
← Case archive

FA-91621 / Digital signal filters / Open access

SOS cascade sections share one aliased state list · case 01

With two or more sections, each section reads the delay values written by the previous one.

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

ROOT CAUSE

The state table is built with list multiplication, so every section refers to the same list object.

VERIFIED REPAIR

Allocate an independent state list per section.

Unsuccessful approach: The attempted repair copies the zero list once before multiplying, which still aliases every entry.

Case contract

Input [gain, sections, limit, samples]; each section [b0, b1, b2, a1, a2] is a direct-form-I biquad (a0 = 1) with its own state. The input is scaled by gain, each section output is clamped to [-limit, limit] and the clamped value is both stored as that section's output state and fed to the next section. Return exact fraction strings.

Why this case matters

Cascaded second-order sections with per-stage saturation model fixed-point IIR hardware; state sharing or gain staging slips change clipping.

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):
    gain, secs, lim, xs = Fraction(x[0]), x[1], Fraction(x[2]), x[3]
    coefs = [[Fraction(v) for v in s] for s in secs]
    states = [[Fraction(0)] * 4] * len(coefs)
    out = []
    for v in xs:
        u = gain * v
        for k, (b0, b1, b2, a1, a2) in enumerate(coefs):
            st = states[k]
            y = b0 * u + b1 * st[0] + b2 * st[1] - a1 * st[2] - a2 * st[3]
            y = max(-lim, min(lim, y))
            st[:] = [u, st[0], y, st[2]]
            u = y
        out.append(str(u))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['regression: three sections', ['1/2', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4'], ['1', '0', '0', '-1/2', '0']], '5', [3, 0, -3, 1]], ['3', '5', '19/4', '9/8']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: random cascade 0', ['1/2', [['1', '1', '1', '-1/2', '1/4']], '100', [3, -1, 0, 2, -3, 3]], ['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']], ['control: random cascade 2', ['1/2', [['2', '0', '1', '0', '1/4']], '3', [3, 0]], ['3', '0']], ['control: random cascade 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']]], [['regression: random cascade 3', ['1', [['1', '0', '0', '-1/2', '0'], ['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0']], '2', [-1, 0, -3, 0, 0]], ['-2', '3/2', '-11/8', '11/32', '-11/128']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: random cascade 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['control: random cascade 6', ['3', [['1', '1', '1', '-1/2', '1/4']], '3', [-1, 2, 0, 1, 1, -1]], ['-3', '3/2', '3', '3', '3', '3']], ['control: random cascade 15', ['3', [['3', '0', '0', '0', '0']], '100', [-3, 0, 2]], ['-27', '0', '18']], ['control: random cascade 16', ['1/2', [['1', '-1', '0', '1/4', '0']], '100', [0, 1, -3, 0, -3, 1]], ['0', '1/2', '-17/8', '65/32', '-257/128', '1281/512']]], [['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['regression: random cascade 10', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-3, -1, 0]], ['-2', '1/2', '7/8']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['control: random cascade 17', ['3', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4']], '2', [1, 1, 0, 0]], ['2', '2', '2', '2']], ['control: random cascade 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 25', ['1', [['2', '0', '1', '0', '1/4']], '5', [-2, 3, -2, -2, 2]], ['-4', '5', '-5', '-9/4', '13/4']]], [['regression: random cascade 12', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -2, 1, 1]], ['-3/2', '2', '27/32', '-2', '2', '0']], ['regression: random cascade 13', ['1/2', [['2', '0', '1', '0', '1/4'], ['1/2', '1/2', '0', '0', '0']], '3', [-3, -3, 3, 1]], ['-3/2', '-3', '-3/8', '5/4']], ['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 26', ['1', [['1', '-1', '0', '1/4', '0']], '100', [-1, 1, -2, 1]], ['-1', '9/4', '-57/16', '249/64']], ['control: random cascade 31', ['3', [['1', '1', '1', '-1/2', '1/4']], '2', [-3, 0, 0, -2, 0, 1]], ['-2', '-2', '-2', '-2', '-2', '-2']], ['control: random cascade 33', ['3', [['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -3, -1, -1]], ['-2', '2', '2', '-2', '-2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-2']]], [['regression: random cascade 18', ['2', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-2, -3]], ['-2', '1/2']], ['regression: random cascade 21', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '100', [3, 0, 2, 2, 2, 0]], ['3', '6', '19/2', '87/8', '103/8', '101/8']], ['regression: random cascade 11', ['2', [['1', '1', '1', '-1/2', '1/4'], ['1', '0', '0', '-1/2', '0'], ['1', '0', '0', '-1/2', '0']], '2', [3, -2, 1, 0, 2, -2]], ['2', '2', '2', '1/2', '2', '2']], ['control: random cascade 36', ['2', [['1', '0', '0', '-1/2', '0']], '100', [0, 1, 2, 1, 3]], ['0', '2', '5', '9/2', '33/4']], ['control: random cascade 41', ['1/2', [['2', '0', '1', '0', '1/4']], '5', [0, -2, -3, -2]], ['0', '-2', '-3', '-5/2']], ['control: random cascade 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['control: random cascade 44', ['3', [['2', '0', '1', '0', '1/4']], '2', [-1, 3]], ['-2', '2']]]]
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: two sections saturating['4', '4', '-3', '-9/4']['4', '4', '-3', '3']Failed
regression: three sections['9/2', '5', '5', '5']['3', '5', '19/4', '9/8']Failed
regression: random cascade 1['0', '-5', '5', '35/16', '455/256', '5']['0', '5', '-5', '5', '-5', '5']Failed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 0['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']Passed
control: random cascade 2['3', '0']['3', '0']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed

SHA-256 / 0fedfd7659a34b0ff290c4114f20483917f967993f3a19684997937ece7b58a3

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):
    gain, secs, lim, xs = Fraction(x[0]), x[1], Fraction(x[2]), x[3]
    coefs = [[Fraction(v) for v in s] for s in secs]
    states = [list([Fraction(0)] * 4)] * len(coefs)
    out = []
    for v in xs:
        u = gain * v
        for k, (b0, b1, b2, a1, a2) in enumerate(coefs):
            st = states[k]
            y = b0 * u + b1 * st[0] + b2 * st[1] - a1 * st[2] - a2 * st[3]
            y = max(-lim, min(lim, y))
            st[:] = [u, st[0], y, st[2]]
            u = y
        out.append(str(u))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['regression: three sections', ['1/2', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4'], ['1', '0', '0', '-1/2', '0']], '5', [3, 0, -3, 1]], ['3', '5', '19/4', '9/8']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: random cascade 0', ['1/2', [['1', '1', '1', '-1/2', '1/4']], '100', [3, -1, 0, 2, -3, 3]], ['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']], ['control: random cascade 2', ['1/2', [['2', '0', '1', '0', '1/4']], '3', [3, 0]], ['3', '0']], ['control: random cascade 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']]], [['regression: random cascade 3', ['1', [['1', '0', '0', '-1/2', '0'], ['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0']], '2', [-1, 0, -3, 0, 0]], ['-2', '3/2', '-11/8', '11/32', '-11/128']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: random cascade 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['control: random cascade 6', ['3', [['1', '1', '1', '-1/2', '1/4']], '3', [-1, 2, 0, 1, 1, -1]], ['-3', '3/2', '3', '3', '3', '3']], ['control: random cascade 15', ['3', [['3', '0', '0', '0', '0']], '100', [-3, 0, 2]], ['-27', '0', '18']], ['control: random cascade 16', ['1/2', [['1', '-1', '0', '1/4', '0']], '100', [0, 1, -3, 0, -3, 1]], ['0', '1/2', '-17/8', '65/32', '-257/128', '1281/512']]], [['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['regression: random cascade 10', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-3, -1, 0]], ['-2', '1/2', '7/8']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['control: random cascade 17', ['3', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4']], '2', [1, 1, 0, 0]], ['2', '2', '2', '2']], ['control: random cascade 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 25', ['1', [['2', '0', '1', '0', '1/4']], '5', [-2, 3, -2, -2, 2]], ['-4', '5', '-5', '-9/4', '13/4']]], [['regression: random cascade 12', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -2, 1, 1]], ['-3/2', '2', '27/32', '-2', '2', '0']], ['regression: random cascade 13', ['1/2', [['2', '0', '1', '0', '1/4'], ['1/2', '1/2', '0', '0', '0']], '3', [-3, -3, 3, 1]], ['-3/2', '-3', '-3/8', '5/4']], ['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 26', ['1', [['1', '-1', '0', '1/4', '0']], '100', [-1, 1, -2, 1]], ['-1', '9/4', '-57/16', '249/64']], ['control: random cascade 31', ['3', [['1', '1', '1', '-1/2', '1/4']], '2', [-3, 0, 0, -2, 0, 1]], ['-2', '-2', '-2', '-2', '-2', '-2']], ['control: random cascade 33', ['3', [['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -3, -1, -1]], ['-2', '2', '2', '-2', '-2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-2']]], [['regression: random cascade 18', ['2', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-2, -3]], ['-2', '1/2']], ['regression: random cascade 21', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '100', [3, 0, 2, 2, 2, 0]], ['3', '6', '19/2', '87/8', '103/8', '101/8']], ['regression: random cascade 11', ['2', [['1', '1', '1', '-1/2', '1/4'], ['1', '0', '0', '-1/2', '0'], ['1', '0', '0', '-1/2', '0']], '2', [3, -2, 1, 0, 2, -2]], ['2', '2', '2', '1/2', '2', '2']], ['control: random cascade 36', ['2', [['1', '0', '0', '-1/2', '0']], '100', [0, 1, 2, 1, 3]], ['0', '2', '5', '9/2', '33/4']], ['control: random cascade 41', ['1/2', [['2', '0', '1', '0', '1/4']], '5', [0, -2, -3, -2]], ['0', '-2', '-3', '-5/2']], ['control: random cascade 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['control: random cascade 44', ['3', [['2', '0', '1', '0', '1/4']], '2', [-1, 3]], ['-2', '2']]]]
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: two sections saturating['4', '4', '-3', '-9/4']['4', '4', '-3', '3']Failed
regression: three sections['9/2', '5', '5', '5']['3', '5', '19/4', '9/8']Failed
regression: random cascade 1['0', '-5', '5', '35/16', '455/256', '5']['0', '5', '-5', '5', '-5', '5']Failed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 0['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']Passed
control: random cascade 2['3', '0']['3', '0']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed

SHA-256 / 3d14f42a8dcdda4ab5cfa7d80d60c6372f2e63a75fdb87b95212236caf902b44

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):
    gain, secs, lim, xs = Fraction(x[0]), x[1], Fraction(x[2]), x[3]
    coefs = [[Fraction(v) for v in s] for s in secs]
    states = [[Fraction(0)] * 4 for _ in coefs]
    out = []
    for v in xs:
        u = gain * v
        for k, (b0, b1, b2, a1, a2) in enumerate(coefs):
            st = states[k]
            y = b0 * u + b1 * st[0] + b2 * st[1] - a1 * st[2] - a2 * st[3]
            y = max(-lim, min(lim, y))
            st[:] = [u, st[0], y, st[2]]
            u = y
        out.append(str(u))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['regression: three sections', ['1/2', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4'], ['1', '0', '0', '-1/2', '0']], '5', [3, 0, -3, 1]], ['3', '5', '19/4', '9/8']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: random cascade 0', ['1/2', [['1', '1', '1', '-1/2', '1/4']], '100', [3, -1, 0, 2, -3, 3]], ['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']], ['control: random cascade 2', ['1/2', [['2', '0', '1', '0', '1/4']], '3', [3, 0]], ['3', '0']], ['control: random cascade 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']]], [['regression: random cascade 3', ['1', [['1', '0', '0', '-1/2', '0'], ['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0']], '2', [-1, 0, -3, 0, 0]], ['-2', '3/2', '-11/8', '11/32', '-11/128']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['regression: random cascade 1', ['3', [['2', '0', '1', '0', '1/4'], ['1', '-1', '0', '1/4', '0'], ['1', '-1', '0', '1/4', '0']], '5', [0, 2, -3, 0, 0, -2]], ['0', '5', '-5', '5', '-5', '5']], ['control: random cascade 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['control: random cascade 6', ['3', [['1', '1', '1', '-1/2', '1/4']], '3', [-1, 2, 0, 1, 1, -1]], ['-3', '3/2', '3', '3', '3', '3']], ['control: random cascade 15', ['3', [['3', '0', '0', '0', '0']], '100', [-3, 0, 2]], ['-27', '0', '18']], ['control: random cascade 16', ['1/2', [['1', '-1', '0', '1/4', '0']], '100', [0, 1, -3, 0, -3, 1]], ['0', '1/2', '-17/8', '65/32', '-257/128', '1281/512']]], [['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['regression: random cascade 10', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-3, -1, 0]], ['-2', '1/2', '7/8']], ['regression: random cascade 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['control: random cascade 17', ['3', [['1', '1', '1', '-1/2', '1/4'], ['2', '0', '1', '0', '1/4']], '2', [1, 1, 0, 0]], ['2', '2', '2', '2']], ['control: random cascade 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 25', ['1', [['2', '0', '1', '0', '1/4']], '5', [-2, 3, -2, -2, 2]], ['-4', '5', '-5', '-9/4', '13/4']]], [['regression: random cascade 12', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -2, 1, 1]], ['-3/2', '2', '27/32', '-2', '2', '0']], ['regression: random cascade 13', ['1/2', [['2', '0', '1', '0', '1/4'], ['1/2', '1/2', '0', '0', '0']], '3', [-3, -3, 3, 1]], ['-3/2', '-3', '-3/8', '5/4']], ['regression: random cascade 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 26', ['1', [['1', '-1', '0', '1/4', '0']], '100', [-1, 1, -2, 1]], ['-1', '9/4', '-57/16', '249/64']], ['control: random cascade 31', ['3', [['1', '1', '1', '-1/2', '1/4']], '2', [-3, 0, 0, -2, 0, 1]], ['-2', '-2', '-2', '-2', '-2', '-2']], ['control: random cascade 33', ['3', [['3', '0', '0', '0', '0']], '2', [-1, 3, 3, -3, -1, -1]], ['-2', '2', '2', '-2', '-2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-2']]], [['regression: random cascade 18', ['2', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '2', [-2, -3]], ['-2', '1/2']], ['regression: random cascade 21', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '100', [3, 0, 2, 2, 2, 0]], ['3', '6', '19/2', '87/8', '103/8', '101/8']], ['regression: random cascade 11', ['2', [['1', '1', '1', '-1/2', '1/4'], ['1', '0', '0', '-1/2', '0'], ['1', '0', '0', '-1/2', '0']], '2', [3, -2, 1, 0, 2, -2]], ['2', '2', '2', '1/2', '2', '2']], ['control: random cascade 36', ['2', [['1', '0', '0', '-1/2', '0']], '100', [0, 1, 2, 1, 3]], ['0', '2', '5', '9/2', '33/4']], ['control: random cascade 41', ['1/2', [['2', '0', '1', '0', '1/4']], '5', [0, -2, -3, -2]], ['0', '-2', '-3', '-5/2']], ['control: random cascade 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['control: random cascade 44', ['3', [['2', '0', '1', '0', '1/4']], '2', [-1, 3]], ['-2', '2']]]]
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: two sections saturating['4', '4', '-3', '3']['4', '4', '-3', '3']Passed
regression: three sections['3', '5', '19/4', '9/8']['3', '5', '19/4', '9/8']Passed
regression: random cascade 1['0', '5', '-5', '5', '-5', '5']['0', '5', '-5', '5', '-5', '5']Passed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 0['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']['3/2', '7/4', '3/2', '13/16', '-15/32', '9/16']Passed
control: random cascade 2['3', '0']['3', '0']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed

SHA-256 / b3b6084274afb1c2beb40d7f1217c6bcaea75100321a55fa22376abb6e02dc13

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

Case digest / 014909e9db63a7512253a406189733dbd2a6272276d2498ec640bb124a24cc22