FA-14626 / Numerics / Open access
Polynomial composition: product allocation · case 01
The exact polynomial composition result violates the stated contract at product allocation.
ROOT CAUSE
The product allocation step uses max(1,len(r)+len(B)-2) instead of (len(r)+len(B)-1).
VERIFIED REPAIR
Use (len(r)+len(B)-1) at the product allocation step.
Unsuccessful approach: The partial repair max(len(r),len(B)) still violates the product allocation invariant.
Case contract
Input [A,B] nonempty ascending integer polynomials; return canonical ascending coefficients A(B(t)), zero represented [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):
A,B=x
r=[0]
for a in reversed(A):
t=[0]*max(1,len(r)+len(B)-2)
for i,u in enumerate(r):
for j,v in enumerate(B):
if i+j>=len(t):return None
t[i+j]+=u*v
t[0]+=a
r=t
while len(r)>1 and r[-1]==0:r.pop()
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, -1], [0, 1]], [-1, -1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1])], [([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, 0], [1, 1]], [-2, -1]), ([[-1, -1, 1], [-1, -1]], [1, 3, 1]), ([[-1, -1, 1], [-1, 0]], [1]), ([[-1, -1, 1], [-1, 1]], [1, -3, 1])], [([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, -1], [1, 0]], [-2]), ([[-1, 0, -1], [1, 1]], [-2, -2, -1]), ([[-1, 0, 0], [-1, -1]], [-1]), ([[-1, 0, 0], [-1, 0]], [-1])], [([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, 0], [-1, -1]], [0, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, 1], [1, -1]], [0, -2, 1]), ([[-1, 0, 1], [1, 0]], [0]), ([[-1, 0, 1], [1, 1]], [0, 2, 1]), ([[-1, 1, -1], [-1, -1]], [-3, -3, -1])], [([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, 0], [0, -1]], [-1, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 1, 0], [0, 1]], [-1, 1]), ([[-1, 1, 0], [1, -1]], [0, -1]), ([[-1, 1, 0], [1, 0]], [0]), ([[-1, 1, 0], [1, 1]], [0, 1])]]
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 | None | [-1, -1, -1] | Failed |
| explicit oracle 1 | None | [0] | Failed |
| explicit oracle 2 | None | [-1] | Failed |
| explicit oracle 3 | None | [-1, 1, -1] | Failed |
| explicit oracle 4 | None | [-1, 1, -1] | Failed |
| explicit oracle 5 | None | [-1] | Failed |
| explicit oracle 6 | None | [-1, -1, -1] | Failed |
| explicit oracle 7 | None | [-3, 3, -1] | Failed |
SHA-256 / f0c66d4e137d8281cd6b310fae709c8c5f2306691d48309c4d00527bffc32b21
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):
A,B=x
r=[0]
for a in reversed(A):
t=[0]*max(len(r),len(B))
for i,u in enumerate(r):
for j,v in enumerate(B):
if i+j>=len(t):return None
t[i+j]+=u*v
t[0]+=a
r=t
while len(r)>1 and r[-1]==0:r.pop()
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, -1], [0, 1]], [-1, -1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1])], [([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, 0], [1, 1]], [-2, -1]), ([[-1, -1, 1], [-1, -1]], [1, 3, 1]), ([[-1, -1, 1], [-1, 0]], [1]), ([[-1, -1, 1], [-1, 1]], [1, -3, 1])], [([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, -1], [1, 0]], [-2]), ([[-1, 0, -1], [1, 1]], [-2, -2, -1]), ([[-1, 0, 0], [-1, -1]], [-1]), ([[-1, 0, 0], [-1, 0]], [-1])], [([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, 0], [-1, -1]], [0, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, 1], [1, -1]], [0, -2, 1]), ([[-1, 0, 1], [1, 0]], [0]), ([[-1, 0, 1], [1, 1]], [0, 2, 1]), ([[-1, 1, -1], [-1, -1]], [-3, -3, -1])], [([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, 0], [0, -1]], [-1, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 1, 0], [0, 1]], [-1, 1]), ([[-1, 1, 0], [1, -1]], [0, -1]), ([[-1, 1, 0], [1, 0]], [0]), ([[-1, 1, 0], [1, 1]], [0, 1])]]
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 | None | [-1, -1, -1] | Failed |
| explicit oracle 1 | None | [0] | Failed |
| explicit oracle 2 | None | [-1] | Failed |
| explicit oracle 3 | None | [-1, 1, -1] | Failed |
| explicit oracle 4 | None | [-1, 1, -1] | Failed |
| explicit oracle 5 | None | [-1] | Failed |
| explicit oracle 6 | None | [-1, -1, -1] | Failed |
| explicit oracle 7 | None | [-3, 3, -1] | Failed |
SHA-256 / 9bf42b88aa8babadbd18b271edf036c52836944190be03bb29328d3c5cb70a4c
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):
A,B=x
r=[0]
for a in reversed(A):
t=[0]*(len(r)+len(B)-1)
for i,u in enumerate(r):
for j,v in enumerate(B):
if i+j>=len(t):return None
t[i+j]+=u*v
t[0]+=a
r=t
while len(r)>1 and r[-1]==0:r.pop()
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, -1], [0, 1]], [-1, -1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1])], [([[-1, -1, -1], [-1, 0]], [-1]), ([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, -1, 0], [1, 1]], [-2, -1]), ([[-1, -1, 1], [-1, -1]], [1, 3, 1]), ([[-1, -1, 1], [-1, 0]], [1]), ([[-1, -1, 1], [-1, 1]], [1, -3, 1])], [([[-1, -1, -1], [-1, 1]], [-1, 1, -1]), ([[-1, -1, -1], [1, -1]], [-3, 3, -1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, -1], [1, 0]], [-2]), ([[-1, 0, -1], [1, 1]], [-2, -2, -1]), ([[-1, 0, 0], [-1, -1]], [-1]), ([[-1, 0, 0], [-1, 0]], [-1])], [([[-1, -1, -1], [0, -1]], [-1, 1, -1]), ([[-1, -1, 0], [-1, -1]], [0, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 0, 1], [1, -1]], [0, -2, 1]), ([[-1, 0, 1], [1, 0]], [0]), ([[-1, 0, 1], [1, 1]], [0, 2, 1]), ([[-1, 1, -1], [-1, -1]], [-3, -3, -1])], [([[-1, -1, -1], [0, 0]], [-1]), ([[-1, -1, 0], [0, -1]], [-1, 1]), ([[-1, -1, -1], [-1, -1]], [-1, -1, -1]), ([[0, 0], [1, 1]], [0]), ([[-1, 1, 0], [0, 1]], [-1, 1]), ([[-1, 1, 0], [1, -1]], [0, -1]), ([[-1, 1, 0], [1, 0]], [0]), ([[-1, 1, 0], [1, 1]], [0, 1])]]
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, -1, -1] | [-1, -1, -1] | Passed |
| explicit oracle 1 | [0] | [0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [-1, 1, -1] | [-1, 1, -1] | Passed |
| explicit oracle 4 | [-1, 1, -1] | [-1, 1, -1] | Passed |
| explicit oracle 5 | [-1] | [-1] | Passed |
| explicit oracle 6 | [-1, -1, -1] | [-1, -1, -1] | Passed |
| explicit oracle 7 | [-3, 3, -1] | [-3, 3, -1] | Passed |
SHA-256 / 4f629b4165161e47d9e9f5a48c4419d49e9e9fe7ff4ab985fe2b4454829cf015
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:18.659814+00:00.
Case digest / e864bb7203733b70858f871b55fd4b5c3131f56e71aa366c2d39f6b9008e28c4