FAILURE MAP
← Case archive

FA-14766 / Numerics / Open access

Rational generating recurrence: requested coefficient length · case 01

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

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

ROOT CAUSE

The requested coefficient length step uses range(k+1) instead of range(k).

VERIFIED REPAIR

Use range(k) at the requested coefficient length step.

Unsuccessful approach: The partial repair range(1,k) still violates the requested coefficient length 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+1):
     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], 1], [1]), ([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, -1, -2], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1])], [([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, -1], [1, 1, 0], 1], [-1]), ([[-1, -1], [1, 1, 1], 1], [-1]), ([[-1, -1], [1, 1, 2], 1], [-1]), ([[-1, -1], [1, 2, -2], 1], [-1])], [([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 0], [1, -1, 2], 1], [-1]), ([[-1, 0], [1, 0, -2], 1], [-1]), ([[-1, 0], [1, 0, -1], 1], [-1]), ([[-1, 0], [1, 0, 0], 1], [-1])], [([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -1, 2], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, -2, -1], 1], [-1]), ([[-1, 1], [1, -2, 0], 1], [-1]), ([[-1, 1], [1, -2, 1], 1], [-1]), ([[-1, 1], [1, -2, 2], 1], [-1])], [([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, 0, 0], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, 1, 1], 1], [-1]), ([[-1, 1], [1, 1, 2], 1], [-1]), ([[-1, 1], [1, 2, -2], 1], [-1]), ([[-1, 1], [1, 2, -1], 1], [-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 fixtureActualExpectedOutcome
explicit oracle 0[-1, -3][-1]Failed
explicit oracle 1[1, -1][1]Failed
explicit oracle 2[-1, -3][-1]Failed
explicit oracle 3[-1, -3][-1]Failed
explicit oracle 4[-1, -3][-1]Failed
explicit oracle 5[-1, -3][-1]Failed
explicit oracle 6[-1, -2][-1]Failed
explicit oracle 7[-1, -2][-1]Failed

SHA-256 / 394d1289ed78d2e0867c10ff12348a9dac91600b7260f6f658601a1302d6ea6a

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(1,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], 1], [1]), ([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, -1, -2], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1])], [([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, -1], [1, 1, 0], 1], [-1]), ([[-1, -1], [1, 1, 1], 1], [-1]), ([[-1, -1], [1, 1, 2], 1], [-1]), ([[-1, -1], [1, 2, -2], 1], [-1])], [([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 0], [1, -1, 2], 1], [-1]), ([[-1, 0], [1, 0, -2], 1], [-1]), ([[-1, 0], [1, 0, -1], 1], [-1]), ([[-1, 0], [1, 0, 0], 1], [-1])], [([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -1, 2], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, -2, -1], 1], [-1]), ([[-1, 1], [1, -2, 0], 1], [-1]), ([[-1, 1], [1, -2, 1], 1], [-1]), ([[-1, 1], [1, -2, 2], 1], [-1])], [([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, 0, 0], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, 1, 1], 1], [-1]), ([[-1, 1], [1, 1, 2], 1], [-1]), ([[-1, 1], [1, 2, -2], 1], [-1]), ([[-1, 1], [1, 2, -1], 1], [-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 fixtureActualExpectedOutcome
explicit oracle 0[][-1]Failed
explicit oracle 1[][1]Failed
explicit oracle 2[][-1]Failed
explicit oracle 3[][-1]Failed
explicit oracle 4[][-1]Failed
explicit oracle 5[][-1]Failed
explicit oracle 6[][-1]Failed
explicit oracle 7[][-1]Failed

SHA-256 / a118337cec96ac0f5479c876be45bc2bea680aa4ba6f5c14bff928facbfa5c25

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], 1], [1]), ([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, -1, -2], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1])], [([[-1, -1], [1, -2, -1], 1], [-1]), ([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, -1], [1, 1, 0], 1], [-1]), ([[-1, -1], [1, 1, 1], 1], [-1]), ([[-1, -1], [1, 1, 2], 1], [-1]), ([[-1, -1], [1, 2, -2], 1], [-1])], [([[-1, -1], [1, -2, 0], 1], [-1]), ([[-1, -1], [1, -1, -1], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 0], [1, -1, 2], 1], [-1]), ([[-1, 0], [1, 0, -2], 1], [-1]), ([[-1, 0], [1, 0, -1], 1], [-1]), ([[-1, 0], [1, 0, 0], 1], [-1])], [([[-1, -1], [1, -2, 1], 1], [-1]), ([[-1, -1], [1, -1, 2], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, -2, -1], 1], [-1]), ([[-1, 1], [1, -2, 0], 1], [-1]), ([[-1, 1], [1, -2, 1], 1], [-1]), ([[-1, 1], [1, -2, 2], 1], [-1])], [([[-1, -1], [1, -2, 2], 1], [-1]), ([[-1, -1], [1, 0, 0], 1], [-1]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 1], [1]), ([[-1, 1], [1, 1, 1], 1], [-1]), ([[-1, 1], [1, 1, 2], 1], [-1]), ([[-1, 1], [1, 2, -2], 1], [-1]), ([[-1, 1], [1, 2, -1], 1], [-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 fixtureActualExpectedOutcome
explicit oracle 0[-1][-1]Passed
explicit oracle 1[1][1]Passed
explicit oracle 2[-1][-1]Passed
explicit oracle 3[-1][-1]Passed
explicit oracle 4[-1][-1]Passed
explicit oracle 5[-1][-1]Passed
explicit oracle 6[-1][-1]Passed
explicit oracle 7[-1][-1]Passed

SHA-256 / dca6ddad5336cd235b9e63dfe4bbbb7be71dafde4c6fdb7cb18cd97bd51fd798

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

Case digest / 9b7292cda95fbf7290020b1c4b3042d8533c0cf360fc266cbbb80fba51fcf8c0