FAILURE MAP
← Case archive

FA-15716 / Numerics / Open access

Finite field discrete transform: frequency bin range · case 01

The exact finite field discrete transform result violates the stated contract at frequency bin range.

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

ROOT CAUSE

The frequency bin range step uses range(1,n+1) instead of range(n).

VERIFIED REPAIR

Use range(n) at the frequency bin range step.

Unsuccessful approach: The partial repair range(n-1) still violates the frequency bin range invariant.

Case contract

Input [values,p,w], len(values)=n and w has exact multiplicative order n modulo prime p; forward transform sum values[j]*w^(j*k) modulo p.

Why this case matters

Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    values,p,w=x;n=len(values);out=[]
    for k in range(1,n+1):
     total=0
     for j in range(n):
      factor=pow(w,j*k,p)
      total=(total+values[j]*factor)%p
     out.append(total)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 1], 5, 4], [3, 1]), ([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 2], 5, 4], [2, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 4], 5, 4], [4, 1])], [([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[0, 2], 5, 4], [2, 3]), ([[1, 1], 5, 4], [2, 0]), ([[4, 3], 5, 4], [2, 1]), ([[2, 0], 5, 4], [2, 2])], [([[2, 1], 5, 4], [3, 1]), ([[0, 4], 5, 4], [4, 1]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 0], 5, 4], [4, 4]), ([[1, 4], 5, 4], [0, 2]), ([[1, 2], 5, 4], [3, 4]), ([[0, 3], 5, 4], [3, 2])], [([[0, 2], 5, 4], [2, 3]), ([[1, 4], 5, 4], [0, 2]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 3], 5, 4], [2, 1]), ([[4, 1], 5, 4], [0, 3]), ([[1, 0], 5, 4], [1, 1]), ([[3, 3], 5, 4], [1, 0])], [([[1, 3], 5, 4], [4, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 5, 0], 7, 2], [0, 5, 1]), ([[0, 0, 4], 7, 2], [4, 2, 1]), ([[5, 5, 2], 7, 2], [5, 2, 1]), ([[1, 6, 1], 7, 2], [1, 3, 6])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 0[2, 3][3, 2]Failed
explicit oracle 1[14, 9, 14, 4, 14, 0, 10, 15][15, 14, 9, 14, 4, 14, 0, 10]Failed
explicit oracle 2[1, 3][3, 1]Failed
explicit oracle 3[1, 3][3, 1]Failed
explicit oracle 4[3, 3][3, 3]Passed
explicit oracle 5[3, 2][2, 3]Failed
explicit oracle 6[3, 4][4, 3]Failed
explicit oracle 7[1, 4][4, 1]Failed

SHA-256 / 0b616ce05f373c5f87d13b09e21c7e9bbe1e8b474a0e567fdca31dca1677401d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    values,p,w=x;n=len(values);out=[]
    for k in range(n-1):
     total=0
     for j in range(n):
      factor=pow(w,j*k,p)
      total=(total+values[j]*factor)%p
     out.append(total)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 1], 5, 4], [3, 1]), ([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 2], 5, 4], [2, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 4], 5, 4], [4, 1])], [([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[0, 2], 5, 4], [2, 3]), ([[1, 1], 5, 4], [2, 0]), ([[4, 3], 5, 4], [2, 1]), ([[2, 0], 5, 4], [2, 2])], [([[2, 1], 5, 4], [3, 1]), ([[0, 4], 5, 4], [4, 1]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 0], 5, 4], [4, 4]), ([[1, 4], 5, 4], [0, 2]), ([[1, 2], 5, 4], [3, 4]), ([[0, 3], 5, 4], [3, 2])], [([[0, 2], 5, 4], [2, 3]), ([[1, 4], 5, 4], [0, 2]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 3], 5, 4], [2, 1]), ([[4, 1], 5, 4], [0, 3]), ([[1, 0], 5, 4], [1, 1]), ([[3, 3], 5, 4], [1, 0])], [([[1, 3], 5, 4], [4, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 5, 0], 7, 2], [0, 5, 1]), ([[0, 0, 4], 7, 2], [4, 2, 1]), ([[5, 5, 2], 7, 2], [5, 2, 1]), ([[1, 6, 1], 7, 2], [1, 3, 6])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 0[3][3, 2]Failed
explicit oracle 1[15, 14, 9, 14, 4, 14, 0][15, 14, 9, 14, 4, 14, 0, 10]Failed
explicit oracle 2[3][3, 1]Failed
explicit oracle 3[3][3, 1]Failed
explicit oracle 4[3][3, 3]Failed
explicit oracle 5[2][2, 3]Failed
explicit oracle 6[4][4, 3]Failed
explicit oracle 7[4][4, 1]Failed

SHA-256 / 3dd81ad06976b7d8b1e2668cb3e8b0942c6ae5820a4e5a39d80617280ff6e534

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    values,p,w=x;n=len(values);out=[]
    for k in range(n):
     total=0
     for j in range(n):
      factor=pow(w,j*k,p)
      total=(total+values[j]*factor)%p
     out.append(total)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 1], 5, 4], [3, 1]), ([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 2], 5, 4], [2, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 4], 5, 4], [4, 1])], [([[2, 1], 5, 4], [3, 1]), ([[3, 0], 5, 4], [3, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[0, 2], 5, 4], [2, 3]), ([[1, 1], 5, 4], [2, 0]), ([[4, 3], 5, 4], [2, 1]), ([[2, 0], 5, 4], [2, 2])], [([[2, 1], 5, 4], [3, 1]), ([[0, 4], 5, 4], [4, 1]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 0], 5, 4], [4, 4]), ([[1, 4], 5, 4], [0, 2]), ([[1, 2], 5, 4], [3, 4]), ([[0, 3], 5, 4], [3, 2])], [([[0, 2], 5, 4], [2, 3]), ([[1, 4], 5, 4], [0, 2]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[4, 3], 5, 4], [2, 1]), ([[4, 1], 5, 4], [0, 3]), ([[1, 0], 5, 4], [1, 1]), ([[3, 3], 5, 4], [1, 0])], [([[1, 3], 5, 4], [4, 3]), ([[1, 3], 5, 4], [4, 3]), ([[0, 3], 5, 4], [3, 2]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[2, 5, 0], 7, 2], [0, 5, 1]), ([[0, 0, 4], 7, 2], [4, 2, 1]), ([[5, 5, 2], 7, 2], [5, 2, 1]), ([[1, 6, 1], 7, 2], [1, 3, 6])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 0[3, 2][3, 2]Passed
explicit oracle 1[15, 14, 9, 14, 4, 14, 0, 10][15, 14, 9, 14, 4, 14, 0, 10]Passed
explicit oracle 2[3, 1][3, 1]Passed
explicit oracle 3[3, 1][3, 1]Passed
explicit oracle 4[3, 3][3, 3]Passed
explicit oracle 5[2, 3][2, 3]Passed
explicit oracle 6[4, 3][4, 3]Passed
explicit oracle 7[4, 1][4, 1]Passed

SHA-256 / 197eb271af90eb5975e9169217f0c662547c6c1152d11c090230a9e677c1527d

Verification & scope

A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:39:29.475714+00:00.

Case digest / a1e1b88e60c2ecb6fa0c5088df07d2fef1c3df5881fb89e83b5e7ff98023675f