FAILURE MAP
← Case archive

FA-14811 / Numerics / Open access

Integer polynomial pseudodivision: denominator clearing factor · case 01

The exact integer polynomial pseudodivision result violates the stated contract at denominator clearing factor.

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

ROOT CAUSE

The denominator clearing factor step uses b instead of b**steps.

VERIFIED REPAIR

Use b**steps at the denominator clearing factor step.

Unsuccessful approach: The partial repair abs(b)**steps still violates the denominator clearing factor invariant.

Case contract

Input [A,B] integer ascending canonical nonzero polynomials degA>=degB; returns [scale, quotient, remainder] with scale*A=B*quotient+remainder, scale=lc(B)^(degA-degB+1).

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=A[:];q=[0]*(len(A)-len(B)+1);b=B[-1];steps=len(A)-len(B)+1
    for _ in range(steps):
     if len(r)<len(B):
      q=[b*v for v in q];r=[b*v for v in r];continue
     k=len(r)-len(B)
     c=r[-1]
     q=[b*v for v in q]
     q[k]=q[k]+c
     r=[b*v for v in r]
     for j in range(len(B)):r[j+k]=r[j+k]-c*B[j]
     while r and r[-1]==0:r.pop()
    while q and q[-1]==0:q.pop()
    return [b,q,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[-2, -2], [-2, -2]], [-2, [-2], []]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2, -2], [-2, 1]], [1, [-6, -2], [-14]]), ([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]])], [([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2], [-1, -1]], [-1, [-2], []]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [2, -1]], [1, [6, 2], [-14]]), ([[-2, -2, -2], [2, 1]], [1, [2, -2], [-6]]), ([[-2, -2, -2], [2, 2]], [4, [0, -4], [-8]]), ([[-2, -2, -1], [-2, -2]], [4, [2, 2], [-4]])], [([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2], [1, -2]], [-2, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -1], [1, 1]], [1, [-1, -1], [-1]]), ([[-2, -2, -1], [1, 2]], [4, [-3, -2], [-5]]), ([[-2, -2, -1], [2, -2]], [4, [6, 2], [-20]]), ([[-2, -2, -1], [2, -1]], [1, [4, 1], [-10]])], [([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2], [2, -1]], [-1, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 1], [0, 2]], [4, [-4, 2], [-8]]), ([[-2, -2, 1], [1, -2]], [4, [3, -2], [-11]]), ([[-2, -2, 1], [1, -1]], [1, [1, -1], [-3]]), ([[-2, -2, 1], [1, 1]], [1, [-3, 1], [1]])], [([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]]), ([[-2, -1], [-1, -2]], [-2, [-1], [3]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 2], [0, -2]], [4, [4, -4], [-8]]), ([[-2, -2, 2], [0, -1]], [1, [2, -2], [-2]]), ([[-2, -2, 2], [0, 1]], [1, [-2, 2], [-2]]), ([[-2, -2, 2], [0, 2]], [4, [-4, 4], [-8]])]]
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, [0, 4], [-8]][4, [0, 4], [-8]]Failed
explicit oracle 1[-2, [-2], []][-2, [-2], []]Passed
explicit oracle 2[2, [2], []][2, [2], []]Passed
explicit oracle 3[-1, [-2, 2], [-6]][1, [-2, 2], [-6]]Failed
explicit oracle 4[1, [-6, -2], [-14]][1, [-6, -2], [-14]]Passed
explicit oracle 5[2, [-8, -4], [-24]][4, [-8, -4], [-24]]Failed
explicit oracle 6[-2, [2, 4], [-6]][4, [2, 4], [-6]]Failed
explicit oracle 7[-1, [0, 2], [-2]][1, [0, 2], [-2]]Failed

SHA-256 / d0d10a2440c7d11bd331e53ebc1a41a6965418e393fd4bf323a037ff5ae6404f

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=A[:];q=[0]*(len(A)-len(B)+1);b=B[-1];steps=len(A)-len(B)+1
    for _ in range(steps):
     if len(r)<len(B):
      q=[b*v for v in q];r=[b*v for v in r];continue
     k=len(r)-len(B)
     c=r[-1]
     q=[b*v for v in q]
     q[k]=q[k]+c
     r=[b*v for v in r]
     for j in range(len(B)):r[j+k]=r[j+k]-c*B[j]
     while r and r[-1]==0:r.pop()
    while q and q[-1]==0:q.pop()
    return [abs(b)**steps,q,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[-2, -2], [-2, -2]], [-2, [-2], []]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2, -2], [-2, 1]], [1, [-6, -2], [-14]]), ([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]])], [([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2], [-1, -1]], [-1, [-2], []]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [2, -1]], [1, [6, 2], [-14]]), ([[-2, -2, -2], [2, 1]], [1, [2, -2], [-6]]), ([[-2, -2, -2], [2, 2]], [4, [0, -4], [-8]]), ([[-2, -2, -1], [-2, -2]], [4, [2, 2], [-4]])], [([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2], [1, -2]], [-2, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -1], [1, 1]], [1, [-1, -1], [-1]]), ([[-2, -2, -1], [1, 2]], [4, [-3, -2], [-5]]), ([[-2, -2, -1], [2, -2]], [4, [6, 2], [-20]]), ([[-2, -2, -1], [2, -1]], [1, [4, 1], [-10]])], [([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2], [2, -1]], [-1, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 1], [0, 2]], [4, [-4, 2], [-8]]), ([[-2, -2, 1], [1, -2]], [4, [3, -2], [-11]]), ([[-2, -2, 1], [1, -1]], [1, [1, -1], [-3]]), ([[-2, -2, 1], [1, 1]], [1, [-3, 1], [1]])], [([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]]), ([[-2, -1], [-1, -2]], [-2, [-1], [3]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 2], [0, -2]], [4, [4, -4], [-8]]), ([[-2, -2, 2], [0, -1]], [1, [2, -2], [-2]]), ([[-2, -2, 2], [0, 1]], [1, [-2, 2], [-2]]), ([[-2, -2, 2], [0, 2]], [4, [-4, 4], [-8]])]]
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[4, [0, 4], [-8]][4, [0, 4], [-8]]Passed
explicit oracle 1[2, [-2], []][-2, [-2], []]Failed
explicit oracle 2[2, [2], []][2, [2], []]Passed
explicit oracle 3[1, [-2, 2], [-6]][1, [-2, 2], [-6]]Passed
explicit oracle 4[1, [-6, -2], [-14]][1, [-6, -2], [-14]]Passed
explicit oracle 5[4, [-8, -4], [-24]][4, [-8, -4], [-24]]Passed
explicit oracle 6[4, [2, 4], [-6]][4, [2, 4], [-6]]Passed
explicit oracle 7[1, [0, 2], [-2]][1, [0, 2], [-2]]Passed

SHA-256 / 5225ead39576c1babc358ae9b5e31a409e3f7cb664d864c82e22830a9f94f698

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=A[:];q=[0]*(len(A)-len(B)+1);b=B[-1];steps=len(A)-len(B)+1
    for _ in range(steps):
     if len(r)<len(B):
      q=[b*v for v in q];r=[b*v for v in r];continue
     k=len(r)-len(B)
     c=r[-1]
     q=[b*v for v in q]
     q[k]=q[k]+c
     r=[b*v for v in r]
     for j in range(len(B)):r[j+k]=r[j+k]-c*B[j]
     while r and r[-1]==0:r.pop()
    while q and q[-1]==0:q.pop()
    return [b**steps,q,r]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[-2, -2], [-2, -2]], [-2, [-2], []]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2, -2], [-2, 1]], [1, [-6, -2], [-14]]), ([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]])], [([[-2, -2, -2], [-2, -1]], [1, [-2, 2], [-6]]), ([[-2, -2], [-1, -1]], [-1, [-2], []]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -2], [2, -1]], [1, [6, 2], [-14]]), ([[-2, -2, -2], [2, 1]], [1, [2, -2], [-6]]), ([[-2, -2, -2], [2, 2]], [4, [0, -4], [-8]]), ([[-2, -2, -1], [-2, -2]], [4, [2, 2], [-4]])], [([[-2, -2, -2], [-2, 2]], [4, [-8, -4], [-24]]), ([[-2, -2], [1, -2]], [-2, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, -1], [1, 1]], [1, [-1, -1], [-1]]), ([[-2, -2, -1], [1, 2]], [4, [-3, -2], [-5]]), ([[-2, -2, -1], [2, -2]], [4, [6, 2], [-20]]), ([[-2, -2, -1], [2, -1]], [1, [4, 1], [-10]])], [([[-2, -2, -2], [-1, -2]], [4, [2, 4], [-6]]), ([[-2, -2], [2, -1]], [-1, [-2], [6]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 1], [0, 2]], [4, [-4, 2], [-8]]), ([[-2, -2, 1], [1, -2]], [4, [3, -2], [-11]]), ([[-2, -2, 1], [1, -1]], [1, [1, -1], [-3]]), ([[-2, -2, 1], [1, 1]], [1, [-3, 1], [1]])], [([[-2, -2, -2], [-1, -1]], [1, [0, 2], [-2]]), ([[-2, -1], [-1, -2]], [-2, [-1], [3]]), ([[-2, -2, -2], [-2, -2]], [4, [0, 4], [-8]]), ([[2, 2], [2, 2]], [2, [2], []]), ([[-2, -2, 2], [0, -2]], [4, [4, -4], [-8]]), ([[-2, -2, 2], [0, -1]], [1, [2, -2], [-2]]), ([[-2, -2, 2], [0, 1]], [1, [-2, 2], [-2]]), ([[-2, -2, 2], [0, 2]], [4, [-4, 4], [-8]])]]
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[4, [0, 4], [-8]][4, [0, 4], [-8]]Passed
explicit oracle 1[-2, [-2], []][-2, [-2], []]Passed
explicit oracle 2[2, [2], []][2, [2], []]Passed
explicit oracle 3[1, [-2, 2], [-6]][1, [-2, 2], [-6]]Passed
explicit oracle 4[1, [-6, -2], [-14]][1, [-6, -2], [-14]]Passed
explicit oracle 5[4, [-8, -4], [-24]][4, [-8, -4], [-24]]Passed
explicit oracle 6[4, [2, 4], [-6]][4, [2, 4], [-6]]Passed
explicit oracle 7[1, [0, 2], [-2]][1, [0, 2], [-2]]Passed

SHA-256 / 6d343e5b34761fc0eda1c1992b8ef0078c75ff41a426132643de10b53b065ef5

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

Case digest / df363e313d67de181bd9d22f429d393ab9cab6ab9c6117de434728aa9311ef83