FAILURE MAP
← Case archive

FA-91631 / Digital signal filters / Open access

SOS cascade clamps only the final output · case 01

Intermediate stages exceed the limit, so later stages see values the hardware could never produce.

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

ROOT CAUSE

The per-section saturation is missing and a single clamp is applied at the output.

VERIFIED REPAIR

Clamp every section output.

Unsuccessful approach: The attempted repair clamps the first section only.

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]
            st[:] = [u, st[0], y, st[2]]
            u = y
        out.append(str(max(-lim, min(lim, 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 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']], ['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 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 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['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']], ['repair check: 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 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 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']], ['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 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 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 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: 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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: 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 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']], ['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 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']]], [['regression: random cascade 24', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '3', [1, 2, -2, -1, -3]], ['1', '5/4', '-3', '1/8', '-53/32']], ['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 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 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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 37', ['3', [['3', '0', '0', '0', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [-2, -1, 0, -1]], ['-9', '-27/2', '-9/2', '-9/2']], ['control: random cascade 38', ['3', [['3', '0', '0', '0', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [1, 1, 3, 2, 3]], ['9/2', '27/8', '261/32', '315/128', '-315/512']]]]
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 3['-2', '3/2', '-2', '2', '-115/128']['-2', '3/2', '-11/8', '11/32', '-11/128']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 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 / eced8fc3b89d1eeb4c8bf905083c5e6300c7b56a0dc1d270790d051658cf7209

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)) if k == 0 else 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 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']], ['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 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 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['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']], ['repair check: 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 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 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']], ['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 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 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 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: 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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: 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 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']], ['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 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']]], [['regression: random cascade 24', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '3', [1, 2, -2, -1, -3]], ['1', '5/4', '-3', '1/8', '-53/32']], ['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 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 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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 37', ['3', [['3', '0', '0', '0', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [-2, -1, 0, -1]], ['-9', '-27/2', '-9/2', '-9/2']], ['control: random cascade 38', ['3', [['3', '0', '0', '0', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [1, 1, 3, 2, 3]], ['9/2', '27/8', '261/32', '315/128', '-315/512']]]]
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', '6', '21/4', '11/8']['3', '5', '19/4', '9/8']Failed
regression: random cascade 3['-2', '3/2', '-31/8', '103/32', '-55/128']['-2', '3/2', '-11/8', '11/32', '-11/128']Failed
repair check: two sections saturating['12', '12', '-3', '3']['4', '4', '-3', '3']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 / c8a3ccdd99eef769c584b7a6e4669aafc6d09835beb5c7adc56e108478f736d1

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 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']], ['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 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 7', ['1', [['1', '-1', '0', '1/4', '0'], ['1', '0', '0', '-1/2', '0']], '2', [1, 3, 1]], ['1', '2', '-1']], ['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']], ['repair check: 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 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 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']], ['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 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 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 14', ['1', [['3', '0', '0', '0', '0'], ['1', '0', '0', '-1/2', '0']], '5', [-2, 3]], ['-5', '5/2']], ['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 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']], ['control: random cascade 20', ['3', [['1/2', '1/2', '0', '0', '0']], '5', [-1, -3, -3]], ['-3/2', '-5', '-5']], ['control: 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 19', ['2', [['1', '0', '0', '-1/2', '0']], '5', [3, -3, 0, 0]], ['5', '-7/2', '-7/4', '-7/8']], ['regression: 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 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']], ['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 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']]], [['regression: random cascade 24', ['1', [['1', '0', '0', '-1/2', '0'], ['1', '-1', '0', '1/4', '0']], '3', [1, 2, -2, -1, -3]], ['1', '5/4', '-3', '1/8', '-53/32']], ['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 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 35', ['1', [['1', '0', '0', '-1/2', '0']], '3', [0, -2]], ['0', '-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 37', ['3', [['3', '0', '0', '0', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [-2, -1, 0, -1]], ['-9', '-27/2', '-9/2', '-9/2']], ['control: random cascade 38', ['3', [['3', '0', '0', '0', '0'], ['1', '-1', '0', '1/4', '0'], ['1/2', '1/2', '0', '0', '0']], '100', [1, 1, 3, 2, 3]], ['9/2', '27/8', '261/32', '315/128', '-315/512']]]]
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 3['-2', '3/2', '-11/8', '11/32', '-11/128']['-2', '3/2', '-11/8', '11/32', '-11/128']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 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 / f009edbd32cb37571c11024f04d903d9db86f32d52c7156189c40ad4458110f0

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

Case digest / 366e6035a1c99562c0e70c23e7d3fdd2f189b0a384e071a521b1dbf040240859