FA-14731 / Numerics / Open access
Forward difference newton basis: adjacent pair span · case 01
The exact forward difference newton basis result violates the stated contract at adjacent pair span.
ROOT CAUSE
The adjacent pair span step uses range(0,len(row)-1,2) instead of range(len(row)-1).
VERIFIED REPAIR
Use range(len(row)-1) at the adjacent pair span step.
Unsuccessful approach: The partial repair range(1,len(row)-1) still violates the adjacent pair span invariant.
Case contract
Input nonempty integer sequence f(0)..f(n); return binomial-basis coefficients Delta^k f(0).
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):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i+1]-row[i] for i in range(0,len(row)-1,2)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1, -1], [-1, 0, 0]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 0], [-1, 1]), ([-1, 1], [-1, 2])], [([-1, -1, 0], [-1, 0, 1]), ([0, -1], [0, -1]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([-1, -1, 1], [-1, 0, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([-1, 0, -1], [-1, 1, -2]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([-1, 0, 0], [-1, 1, -1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [-1, 0] | [-1, 0, 0] | Failed |
| explicit oracle 1 | [-1, 0] | [-1, 0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 0, 0] | [1, 0, 0, 0, 0] | Failed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1, 1] | [-1, 1] | Passed |
| explicit oracle 7 | [-1, 2] | [-1, 2] | Passed |
SHA-256 / 110f5e9fa52e4fb5192bd10cf4d8507b267342bb41c131eabace374a755812ef
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):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i+1]-row[i] for i in range(1,len(row)-1)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1, -1], [-1, 0, 0]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 0], [-1, 1]), ([-1, 1], [-1, 2])], [([-1, -1, 0], [-1, 0, 1]), ([0, -1], [0, -1]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([-1, -1, 1], [-1, 0, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([-1, 0, -1], [-1, 1, -2]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([-1, 0, 0], [-1, 1, -1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [-1, 0] | [-1, 0, 0] | Failed |
| explicit oracle 1 | [-1] | [-1, 0] | Failed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 0, 0] | [1, 0, 0, 0, 0] | Failed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1] | [-1, 1] | Failed |
| explicit oracle 7 | [-1] | [-1, 2] | Failed |
SHA-256 / ad8129e3d73414370149e7ea7bb17178c90340e06180fc6651e0d14acab3568f
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):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i+1]-row[i] for i in range(len(row)-1)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1, -1], [-1, 0, 0]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 0], [-1, 1]), ([-1, 1], [-1, 2])], [([-1, -1, 0], [-1, 0, 1]), ([0, -1], [0, -1]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([-1, -1, 1], [-1, 0, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([-1, 0, -1], [-1, 1, -2]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([-1, 0, 0], [-1, 1, -1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [-1, 0, 0] | [-1, 0, 0] | Passed |
| explicit oracle 1 | [-1, 0] | [-1, 0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 0, 0, 0, 0] | [1, 0, 0, 0, 0] | Passed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1, 1] | [-1, 1] | Passed |
| explicit oracle 7 | [-1, 2] | [-1, 2] | Passed |
SHA-256 / ad0e77ffd62c606ed54fcfa9c3a00f70f77fcf70164af889ca2482db1eb8f000
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:19.827141+00:00.
Case digest / 8f3560597083a352c01a54306cdf056fefb706a6c3fdea791f47fb7e8b4a9f53