FAILURE MAP
← Case archive

FA-15721 / Numerics / Open access

Finite field discrete transform: sample index coverage · case 01

The exact finite field discrete transform result violates the stated contract at sample index coverage.

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

ROOT CAUSE

The sample index coverage step uses range(n-1) instead of range(n).

VERIFIED REPAIR

Use range(n) at the sample index coverage step.

Unsuccessful approach: The partial repair range(1,n) still violates the sample index coverage 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(n):
     total=0
     for j in range(n-1):
      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]), ([[2, 1], 5, 4], [3, 1]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[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]), ([[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]), ([[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]), ([[3, 1], 5, 4], [4, 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, 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]), ([[4, 0], 5, 4], [4, 4]), ([[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, 1], 5, 4], [2, 0]), ([[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[0, 0][3, 2]Failed
explicit oracle 1[2, 2][3, 1]Failed
explicit oracle 2[3, 8, 6, 4, 16, 3, 3, 3][15, 14, 9, 14, 4, 14, 0, 10]Failed
explicit oracle 3[2, 2][3, 1]Failed
explicit oracle 4[3, 3][3, 3]Passed
explicit oracle 5[0, 0][2, 3]Failed
explicit oracle 6[1, 1][4, 3]Failed
explicit oracle 7[0, 0][4, 1]Failed

SHA-256 / b12eca5eb5bb7008eaaf0586f028706e0cc4413a38bcaccee0d6ab3e10973f21

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):
     total=0
     for j in range(1,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]), ([[2, 1], 5, 4], [3, 1]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[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]), ([[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]), ([[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]), ([[3, 1], 5, 4], [4, 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, 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]), ([[4, 0], 5, 4], [4, 4]), ([[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, 1], 5, 4], [2, 0]), ([[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[1, 4][3, 1]Failed
explicit oracle 2[5, 4, 16, 4, 11, 4, 7, 0][15, 14, 9, 14, 4, 14, 0, 10]Failed
explicit oracle 3[1, 4][3, 1]Failed
explicit oracle 4[0, 0][3, 3]Failed
explicit oracle 5[2, 3][2, 3]Passed
explicit oracle 6[3, 2][4, 3]Failed
explicit oracle 7[4, 1][4, 1]Passed

SHA-256 / 9ef6be66ce1bd5d333c22d981d9bb738c719e467e6dfd607fb595ec5373d00b6

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]), ([[2, 1], 5, 4], [3, 1]), ([[10, 15, 12, 4, 14, 0, 16, 12], 17, 2], [15, 14, 9, 14, 4, 14, 0, 10]), ([[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]), ([[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]), ([[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]), ([[3, 1], 5, 4], [4, 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, 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]), ([[4, 0], 5, 4], [4, 4]), ([[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, 1], 5, 4], [2, 0]), ([[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[3, 1][3, 1]Passed
explicit oracle 2[15, 14, 9, 14, 4, 14, 0, 10][15, 14, 9, 14, 4, 14, 0, 10]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 / 416d53bc1a0e034ac824f70cf2436dff628b12710e9908321e27a51403ba0e3f

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

Case digest / 0272f8ce542603d319deed2e8f9be2dd3dbc60236059a5e12889b7c60a552fbc