FAILURE MAP
← Case archive

FA-14786 / Numerics / Open access

Rational generating recurrence: coefficient retention · case 01

The exact rational generating recurrence result violates the stated contract at coefficient retention.

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

ROOT CAUSE

The coefficient retention step uses abs(v) instead of v.

VERIFIED REPAIR

Use v at the coefficient retention step.

Unsuccessful approach: The partial repair v if n==0 else r[-1] still violates the coefficient retention invariant.

Case contract

Input [P,Q,k] integer ascending arrays with Q[0]=1 and k>=0; return first k coefficients of formal series P/Q.

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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v-Q[j]*r[n-j]
     r.append(abs(v))
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 1], [-1]), ([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 1, -1, -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][-1]Failed
explicit oracle 1[1, 1][-1, -3]Failed
explicit oracle 2[1, 1, 4, 10, 28, 76, 208, 568][1, -1, 0, 2, -4, 4, 0, -8]Failed
explicit oracle 3[1, 1, 4][-1, -3, -8]Failed
explicit oracle 4[1, 1, 4, 10][-1, -3, -8, -22]Failed
explicit oracle 5[1, 1, 4, 10, 28][-1, -3, -8, -22, -60]Failed
explicit oracle 6[1, 1, 4, 10, 28, 76][-1, -3, -8, -22, -60, -164]Failed
explicit oracle 7[1, 1, 4, 10, 28, 76, 208][-1, -3, -8, -22, -60, -164, -448]Failed

SHA-256 / f193dc7cf476d17f9a3b92ee7ecaf86866f1fb0f2c4fc9c869226c9224f6099b

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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v-Q[j]*r[n-j]
     r.append(v if n==0 else r[-1])
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 1], [-1]), ([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 1, -1, -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][-1]Passed
explicit oracle 1[-1, -1][-1, -3]Failed
explicit oracle 2[1, 1, 1, 1, 1, 1, 1, 1][1, -1, 0, 2, -4, 4, 0, -8]Failed
explicit oracle 3[-1, -1, -1][-1, -3, -8]Failed
explicit oracle 4[-1, -1, -1, -1][-1, -3, -8, -22]Failed
explicit oracle 5[-1, -1, -1, -1, -1][-1, -3, -8, -22, -60]Failed
explicit oracle 6[-1, -1, -1, -1, -1, -1][-1, -3, -8, -22, -60, -164]Failed
explicit oracle 7[-1, -1, -1, -1, -1, -1, -1][-1, -3, -8, -22, -60, -164, -448]Failed

SHA-256 / c78a4cd7bb6b3915e214d0b2b9649f576c251b8c7b3482d88eda292b719df527

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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v-Q[j]*r[n-j]
     r.append(v)
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 1], [-1]), ([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 1, -1, -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][-1]Passed
explicit oracle 1[-1, -3][-1, -3]Passed
explicit oracle 2[1, -1, 0, 2, -4, 4, 0, -8][1, -1, 0, 2, -4, 4, 0, -8]Passed
explicit oracle 3[-1, -3, -8][-1, -3, -8]Passed
explicit oracle 4[-1, -3, -8, -22][-1, -3, -8, -22]Passed
explicit oracle 5[-1, -3, -8, -22, -60][-1, -3, -8, -22, -60]Passed
explicit oracle 6[-1, -3, -8, -22, -60, -164][-1, -3, -8, -22, -60, -164]Passed
explicit oracle 7[-1, -3, -8, -22, -60, -164, -448][-1, -3, -8, -22, -60, -164, -448]Passed

SHA-256 / d799b38cf8afe311f92bb8a8d42db2ffc5bef731f220dc7ca41884dc33bae56e

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

Case digest / b44e1724be8afaaa0989d9979c001fb83603945cc56075146c0421b26a0cf254