FAILURE MAP
← Case archive

FA-14736 / Numerics / Open access

Forward difference newton basis: basis coefficient order · case 01

The exact forward difference newton basis result violates the stated contract at basis coefficient order.

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

ROOT CAUSE

The basis coefficient order step uses out[::-1] instead of out.

THE FAILURE

The basis coefficient order step uses out[::-1] instead of out.

Unsuccessful approach: The partial repair sorted(out) still violates the basis coefficient order 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(len(row)-1)]
    return out[::-1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1], [-1, 0]), ([0, -1], [0, -1]), ([-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, 0], [-1, 1]), ([1, 1], [1, 0]), ([-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, 2]), ([-1, 0, 1], [-1, 1, 0]), ([-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])], [([0, -1], [0, -1]), ([-1, 1, 1], [-1, 2, -2]), ([-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])], [([0, 1], [0, 1]), ([0, -1, 1], [0, -1, 3]), ([-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 fixtureActualExpectedOutcome
explicit oracle 0[0, -1][-1, 0]Failed
explicit oracle 1[-1, 0][0, -1]Failed
explicit oracle 2[-1][-1]Passed
explicit oracle 3[0, 0, 0, 0, 1][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]Failed
explicit oracle 7[2, -1][-1, 2]Failed

SHA-256 / b7432e94e5a8d03f1f39f31f555e716d4034554b01a143fb216a31aece2fc285

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(len(row)-1)]
    return sorted(out)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, -1], [-1, 0]), ([0, -1], [0, -1]), ([-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, 0], [-1, 1]), ([1, 1], [1, 0]), ([-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, 2]), ([-1, 0, 1], [-1, 1, 0]), ([-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])], [([0, -1], [0, -1]), ([-1, 1, 1], [-1, 2, -2]), ([-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])], [([0, 1], [0, 1]), ([0, -1, 1], [0, -1, 3]), ([-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 fixtureActualExpectedOutcome
explicit oracle 0[-1, 0][-1, 0]Passed
explicit oracle 1[-1, 0][0, -1]Failed
explicit oracle 2[-1][-1]Passed
explicit oracle 3[0, 0, 0, 0, 1][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 / b71157256563f46ccd72fa4e4c43c2c70f78a8c97c57aa6dbf99d9a5825a1e28

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 2d3463bb266c64961db0a5fb5da07c83528b0787455f7ebaeb59b593eef45330