FAILURE MAP
← Case archive

FA-91636 / Digital signal filters / Open access

SOS cascade stores the unclamped output in the feedback state · case 01

After a clip the recursive part continues from a value beyond the limit.

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

ROOT CAUSE

The feedback delay line receives the pre-saturation output.

VERIFIED REPAIR

Store the clamped output in the state.

Unsuccessful approach: The attempted repair stores the clamped output in both feedback slots, discarding y[n-1].

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 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]
            yc = max(-lim, min(lim, y))
            st[:] = [u, st[0], y, st[2]]
            y = yc
            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: 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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['repair check: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: 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 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']], ['control: random cascade 8', ['1', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '100', [-3, 3, -2, -2, 1]], ['-3/2', '-3/4', '1/8', '-31/16', '-47/32']]], [['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 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']], ['repair check: 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 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['repair check: 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']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 22', ['1/2', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '2', [-1, 2, 2, 2, 1]], ['-3/2', '5/4', '2', '2', '2']]], [['regression: 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 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['repair check: 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']], ['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 28', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '5', [0, 0, -1, -1, -3, -1]], ['0', '0', '-1/4', '-5/16', '-39/64', '-49/256']], ['control: random cascade 29', ['3', [['2', '0', '1', '0', '1/4'], ['1', '1', '1', '-1/2', '1/4']], '2', [2, 3, 3, -3]], ['2', '2', '2', '2']], ['control: random cascade 30', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [3, 0, 0, 2, 3]], ['3', '5', '5', '5', '5']]], [['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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['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 34', ['3', [['1/2', '1/2', '0', '0', '0'], ['3', '0', '0', '0', '0'], ['3', '0', '0', '0', '0']], '2', [3, -2, 0]], ['2', '2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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: three sections['3', '5', '5', '11/8']['3', '5', '19/4', '9/8']Failed
regression: random cascade 5['2', '2']['2', '1']Failed
repair check: two sections saturating['4', '4', '-3', '3']['4', '4', '-3', '3']Passed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 1['0', '5', '-5', '5', '-5', '5']['0', '5', '-5', '5', '-5', '5']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed
control: random cascade 8['-3/2', '-3/4', '1/8', '-31/16', '-47/32']['-3/2', '-3/4', '1/8', '-31/16', '-47/32']Passed

SHA-256 / fd9750261016362800483c4e1c75ce0bfa9b5e0a76c8c7f88e557a9535c4716b

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 = [[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, y]
            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: 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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['repair check: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: 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 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']], ['control: random cascade 8', ['1', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '100', [-3, 3, -2, -2, 1]], ['-3/2', '-3/4', '1/8', '-31/16', '-47/32']]], [['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 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']], ['repair check: 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 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['repair check: 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']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 22', ['1/2', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '2', [-1, 2, 2, 2, 1]], ['-3/2', '5/4', '2', '2', '2']]], [['regression: 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 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['repair check: 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']], ['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 28', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '5', [0, 0, -1, -1, -3, -1]], ['0', '0', '-1/4', '-5/16', '-39/64', '-49/256']], ['control: random cascade 29', ['3', [['2', '0', '1', '0', '1/4'], ['1', '1', '1', '-1/2', '1/4']], '2', [2, 3, 3, -3]], ['2', '2', '2', '2']], ['control: random cascade 30', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [3, 0, 0, 2, 3]], ['3', '5', '5', '5', '5']]], [['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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['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 34', ['3', [['1/2', '1/2', '0', '0', '0'], ['3', '0', '0', '0', '0'], ['3', '0', '0', '0', '0']], '2', [3, -2, 0]], ['2', '2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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: three sections['3', '9/2', '63/16', '53/32']['3', '5', '19/4', '9/8']Failed
regression: random cascade 5['2', '1']['2', '1']Passed
repair check: two sections saturating['4', '4', '-9/4', '4']['4', '4', '-3', '3']Failed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 1['0', '5', '-5', '5', '-5', '5']['0', '5', '-5', '5', '-5', '5']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed
control: random cascade 8['-3/2', '-3/4', '1/8', '-31/16', '-47/32']['-3/2', '-3/4', '1/8', '-31/16', '-47/32']Passed

SHA-256 / 1959c42b7735dda674d0a0b69ad94b27b77c4e4c575b470e160b975d8e9c168b

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: 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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['repair check: two sections saturating', ['1', [['2', '0', '1', '0', '1/4'], ['3', '0', '0', '0', '0']], '4', [2, 2, -1, 0]], ['4', '4', '-3', '3']], ['control: gain before saturation', ['3', [['1', '0', '0', '-1/2', '0']], '2', [1, 1, 1]], ['2', '2', '2']], ['control: 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 4', ['2', [['1', '-1', '0', '1/4', '0']], '2', [-3, -2, 2, 1, -2]], ['-2', '2', '2', '-2', '-2']], ['control: random cascade 8', ['1', [['1/2', '1/2', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '100', [-3, 3, -2, -2, 1]], ['-3/2', '-3/4', '1/8', '-31/16', '-47/32']]], [['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 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']], ['repair check: 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 9', ['3', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '100', [-2, 1]], ['-6', '15/2']], ['control: random cascade 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['repair check: 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']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: random cascade 22', ['1/2', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '2', [-1, 2, 2, 2, 1]], ['-3/2', '5/4', '2', '2', '2']]], [['regression: 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 43', ['1/2', [['2', '0', '1', '0', '1/4']], '2', [0, -3, -3, 2, -2]], ['0', '-2', '-2', '1', '-2']], ['repair check: 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']], ['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 28', ['1/2', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '5', [0, 0, -1, -1, -3, -1]], ['0', '0', '-1/4', '-5/16', '-39/64', '-49/256']], ['control: random cascade 29', ['3', [['2', '0', '1', '0', '1/4'], ['1', '1', '1', '-1/2', '1/4']], '2', [2, 3, 3, -3]], ['2', '2', '2', '2']], ['control: random cascade 30', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [3, 0, 0, 2, 3]], ['3', '5', '5', '5', '5']]], [['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 5', ['2', [['1', '0', '0', '-1/2', '0']], '2', [2, 0]], ['2', '1']], ['regression: random cascade 23', ['1/2', [['3', '0', '0', '0', '0'], ['1', '1', '1', '-1/2', '1/4']], '5', [2, 0, -3, 0, 3]], ['3', '9/2', '0', '-5', '-5/2']], ['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 34', ['3', [['1/2', '1/2', '0', '0', '0'], ['3', '0', '0', '0', '0'], ['3', '0', '0', '0', '0']], '2', [3, -2, 0]], ['2', '2', '-2']], ['control: random cascade 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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: three sections['3', '5', '19/4', '9/8']['3', '5', '19/4', '9/8']Passed
regression: random cascade 5['2', '1']['2', '1']Passed
repair check: two sections saturating['4', '4', '-3', '3']['4', '4', '-3', '3']Passed
control: gain before saturation['2', '2', '2']['2', '2', '2']Passed
control: random cascade 1['0', '5', '-5', '5', '-5', '5']['0', '5', '-5', '5', '-5', '5']Passed
control: random cascade 4['-2', '2', '2', '-2', '-2']['-2', '2', '2', '-2', '-2']Passed
control: random cascade 8['-3/2', '-3/4', '1/8', '-31/16', '-47/32']['-3/2', '-3/4', '1/8', '-31/16', '-47/32']Passed

SHA-256 / 66d105c6cee37acad60a7e4761ba126c5d9325ec449e2ba41d5d4741d9d4f52f

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

Case digest / c4ca552b9cd3d944f47368e801b76395309847aab7020741cf70757da608f52f