FA-91536 / Digital signal filters / Open access
Polyphase decimator feeds branch p with samples ahead in time · case 01
The output uses future samples x[mD + p], a non-causal and wrongly aligned result.
ROOT CAUSE
The branch input index is (m - j) D + p instead of (m - j) D - p.
VERIFIED REPAIR
Feed branch p with x[(m - j) D - p].
Unsuccessful approach: The attempted repair feeds branch p with x[(m - j) D - (D - 1 - p)], reversing the commutator.
Case contract
Input [h, D, samples] (integers). Output y[m] = sum_k h[k] x[mD - k] for m = 0 .. ceil(len/D) - 1 with x = 0 outside the signal, computed through the polyphase split E_p[j] = h[jD + p].
Why this case matters
Polyphase decimators avoid computing discarded outputs; commutator and phase-split slips alias the output.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[p::D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D + p
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['repair check: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['repair check: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]]], [['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]], ['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 12', [[-2, 3, 1, -3, 1, 2, 3], 3, [2, 5, 1, 5, -2, -2]], [-4, -8]], ['regression: random polyphase 13', [[1, 4], 2, [-4, 3, -1, 4]], [-4, 11]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: length divisible | [3, 7] | [1, 5] | Failed |
| regression: random polyphase 0 | [9, 10, -11, 2] | [6, 11, -4, -3] | Failed |
| repair check: impulse through D=2 | [1, 3, 0] | [1, 3, 0] | Passed |
| regression: random polyphase 1 | [-7, -3] | [-6, 4] | Failed |
| regression: random polyphase 2 | [-7, -5] | [-8, 5] | Failed |
| regression: random polyphase 4 | [3, 6, -10, 11] | [0, -6, 16, 6] | Failed |
| regression: random polyphase 5 | [-4, 16] | [-9, 20] | Failed |
SHA-256 / 612a01fddfffd476fd5853be270a13fcb60d5d41275dde11f914e309d7e4d8ac
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[p::D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D - (D - 1 - p)
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['repair check: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['repair check: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]]], [['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]], ['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 12', [[-2, 3, 1, -3, 1, 2, 3], 3, [2, 5, 1, 5, -2, -2]], [-4, -8]], ['regression: random polyphase 13', [[1, 4], 2, [-4, 3, -1, 4]], [-4, 11]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: length divisible | [1, 5] | [1, 5] | Passed |
| regression: random polyphase 0 | [-3, -10, -1, 9] | [6, 11, -4, -3] | Failed |
| repair check: impulse through D=2 | [2, 0, 0] | [1, 3, 0] | Failed |
| regression: random polyphase 1 | [-3, 5] | [-6, 4] | Failed |
| regression: random polyphase 2 | [4, -8] | [-8, 5] | Failed |
| regression: random polyphase 4 | [3, -2, 15, 0] | [0, -6, 16, 6] | Failed |
| regression: random polyphase 5 | [-3, 19] | [-9, 20] | Failed |
SHA-256 / b6019807a00a64f000f07e9b4bccd79d896355c051a1a6e6f7f7b982285c388b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[p::D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D - p
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['repair check: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['repair check: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]]], [['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]], ['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 12', [[-2, 3, 1, -3, 1, 2, 3], 3, [2, 5, 1, 5, -2, -2]], [-4, -8]], ['regression: random polyphase 13', [[1, 4], 2, [-4, 3, -1, 4]], [-4, 11]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['regression: random polyphase 9', [[1, -2, 2, 3, 1, 0], 3, [5, 2, 1, -3, 4, 0, 0, 1]], [5, 14, 0]]]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: length divisible | [1, 5] | [1, 5] | Passed |
| regression: random polyphase 0 | [6, 11, -4, -3] | [6, 11, -4, -3] | Passed |
| repair check: impulse through D=2 | [1, 3, 0] | [1, 3, 0] | Passed |
| regression: random polyphase 1 | [-6, 4] | [-6, 4] | Passed |
| regression: random polyphase 2 | [-8, 5] | [-8, 5] | Passed |
| regression: random polyphase 4 | [0, -6, 16, 6] | [0, -6, 16, 6] | Passed |
| regression: random polyphase 5 | [-9, 20] | [-9, 20] | Passed |
SHA-256 / b21c1a2498abd2a640aecbd7a31df5e91ad9dd5a506f309bb5df7dda18e3ffe5
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.920295+00:00.
Case digest / 9d8bc16891889758382399fb79052a973cee99e735e38c3b9bd081ed66e0d2e8