FAILURE MAP
← Case archive

FA-14441 / Numerics / Open access

Continued fraction convergents: numerator seeds · case 01

The exact continued fraction convergents result violates the stated contract at numerator seeds.

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

ROOT CAUSE

The numerator seeds step uses 1,0 instead of 0,1.

VERIFIED REPAIR

Use 0,1 at the numerator seeds step.

Unsuccessful approach: The partial repair 1,1 still violates the numerator seeds invariant.

Case contract

Input nonempty coefficients with positive terms after first; return every convergent as [numerator,positive denominator].

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=x
    p0,p1=1,0
    q0,q1=1,0
    out=[]
    for c in a:
     p=c*p1+p0
     q=c*q1+q0
     out.append([p,q])
     p0,p1,q0,q1=p1,p,q1,q
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2], [[2, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([3], [[3, 1]]), ([4], [[4, 1]]), ([1, 1], [[1, 1], [2, 1]]), ([1, 2], [[1, 1], [3, 2]]), ([1, 3], [[1, 1], [4, 3]])], [([3], [[3, 1]]), ([4], [[4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 2], [[4, 1], [9, 2]]), ([4, 3], [[4, 1], [13, 3]]), ([4, 4], [[4, 1], [17, 4]]), ([1, 1, 1], [[1, 1], [2, 1], [3, 2]])], [([4], [[4, 1]]), ([1, 3], [[1, 1], [4, 3]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([1, 4, 3], [[1, 1], [5, 4], [16, 13]]), ([1, 4, 4], [[1, 1], [5, 4], [21, 17]]), ([2, 1, 1], [[2, 1], [3, 1], [5, 2]]), ([2, 1, 2], [[2, 1], [3, 1], [8, 3]])], [([1, 1], [[1, 1], [2, 1]]), ([2, 2], [[2, 1], [5, 2]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([2, 4, 4], [[2, 1], [9, 4], [38, 17]]), ([3, 1, 1], [[3, 1], [4, 1], [7, 2]]), ([3, 1, 2], [[3, 1], [4, 1], [11, 3]]), ([3, 1, 3], [[3, 1], [4, 1], [15, 4]])], [([1, 2], [[1, 1], [3, 2]]), ([3, 1], [[3, 1], [4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 1, 1], [[4, 1], [5, 1], [9, 2]]), ([4, 1, 2], [[4, 1], [5, 1], [14, 3]]), ([4, 1, 3], [[4, 1], [5, 1], [19, 4]]), ([4, 1, 4], [[4, 1], [5, 1], [24, 5]])]]
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]][[2, 1]]Failed
explicit oracle 1[[1, 1]][[1, 1]]Passed
explicit oracle 2[[1, 1], [3, 3], [13, 13]][[-2, 1], [-5, 3], [-22, 13]]Failed
explicit oracle 3[[1, 1]][[3, 1]]Failed
explicit oracle 4[[1, 1]][[4, 1]]Failed
explicit oracle 5[[1, 1], [1, 1]][[1, 1], [2, 1]]Failed
explicit oracle 6[[1, 1], [2, 2]][[1, 1], [3, 2]]Failed
explicit oracle 7[[1, 1], [3, 3]][[1, 1], [4, 3]]Failed

SHA-256 / c8555194bb063a41dec1aed4ac4c3c09125fbb0939a0d2a215ccf49a81379362

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=x
    p0,p1=1,1
    q0,q1=1,0
    out=[]
    for c in a:
     p=c*p1+p0
     q=c*q1+q0
     out.append([p,q])
     p0,p1,q0,q1=p1,p,q1,q
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2], [[2, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([3], [[3, 1]]), ([4], [[4, 1]]), ([1, 1], [[1, 1], [2, 1]]), ([1, 2], [[1, 1], [3, 2]]), ([1, 3], [[1, 1], [4, 3]])], [([3], [[3, 1]]), ([4], [[4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 2], [[4, 1], [9, 2]]), ([4, 3], [[4, 1], [13, 3]]), ([4, 4], [[4, 1], [17, 4]]), ([1, 1, 1], [[1, 1], [2, 1], [3, 2]])], [([4], [[4, 1]]), ([1, 3], [[1, 1], [4, 3]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([1, 4, 3], [[1, 1], [5, 4], [16, 13]]), ([1, 4, 4], [[1, 1], [5, 4], [21, 17]]), ([2, 1, 1], [[2, 1], [3, 1], [5, 2]]), ([2, 1, 2], [[2, 1], [3, 1], [8, 3]])], [([1, 1], [[1, 1], [2, 1]]), ([2, 2], [[2, 1], [5, 2]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([2, 4, 4], [[2, 1], [9, 4], [38, 17]]), ([3, 1, 1], [[3, 1], [4, 1], [7, 2]]), ([3, 1, 2], [[3, 1], [4, 1], [11, 3]]), ([3, 1, 3], [[3, 1], [4, 1], [15, 4]])], [([1, 2], [[1, 1], [3, 2]]), ([3, 1], [[3, 1], [4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 1, 1], [[4, 1], [5, 1], [9, 2]]), ([4, 1, 2], [[4, 1], [5, 1], [14, 3]]), ([4, 1, 3], [[4, 1], [5, 1], [19, 4]]), ([4, 1, 4], [[4, 1], [5, 1], [24, 5]])]]
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[[3, 1]][[2, 1]]Failed
explicit oracle 1[[2, 1]][[1, 1]]Failed
explicit oracle 2[[-1, 1], [-2, 3], [-9, 13]][[-2, 1], [-5, 3], [-22, 13]]Failed
explicit oracle 3[[4, 1]][[3, 1]]Failed
explicit oracle 4[[5, 1]][[4, 1]]Failed
explicit oracle 5[[2, 1], [3, 1]][[1, 1], [2, 1]]Failed
explicit oracle 6[[2, 1], [5, 2]][[1, 1], [3, 2]]Failed
explicit oracle 7[[2, 1], [7, 3]][[1, 1], [4, 3]]Failed

SHA-256 / c8b2b1369278efda21ad76ba2668a0b3ceb27e4e0dd1c9f11aafbd6cbd527738

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=x
    p0,p1=0,1
    q0,q1=1,0
    out=[]
    for c in a:
     p=c*p1+p0
     q=c*q1+q0
     out.append([p,q])
     p0,p1,q0,q1=p1,p,q1,q
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2], [[2, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([3], [[3, 1]]), ([4], [[4, 1]]), ([1, 1], [[1, 1], [2, 1]]), ([1, 2], [[1, 1], [3, 2]]), ([1, 3], [[1, 1], [4, 3]])], [([3], [[3, 1]]), ([4], [[4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 2], [[4, 1], [9, 2]]), ([4, 3], [[4, 1], [13, 3]]), ([4, 4], [[4, 1], [17, 4]]), ([1, 1, 1], [[1, 1], [2, 1], [3, 2]])], [([4], [[4, 1]]), ([1, 3], [[1, 1], [4, 3]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([1, 4, 3], [[1, 1], [5, 4], [16, 13]]), ([1, 4, 4], [[1, 1], [5, 4], [21, 17]]), ([2, 1, 1], [[2, 1], [3, 1], [5, 2]]), ([2, 1, 2], [[2, 1], [3, 1], [8, 3]])], [([1, 1], [[1, 1], [2, 1]]), ([2, 2], [[2, 1], [5, 2]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([2, 4, 4], [[2, 1], [9, 4], [38, 17]]), ([3, 1, 1], [[3, 1], [4, 1], [7, 2]]), ([3, 1, 2], [[3, 1], [4, 1], [11, 3]]), ([3, 1, 3], [[3, 1], [4, 1], [15, 4]])], [([1, 2], [[1, 1], [3, 2]]), ([3, 1], [[3, 1], [4, 1]]), ([1], [[1, 1]]), ([-2, 3, 4], [[-2, 1], [-5, 3], [-22, 13]]), ([4, 1, 1], [[4, 1], [5, 1], [9, 2]]), ([4, 1, 2], [[4, 1], [5, 1], [14, 3]]), ([4, 1, 3], [[4, 1], [5, 1], [19, 4]]), ([4, 1, 4], [[4, 1], [5, 1], [24, 5]])]]
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, 1]][[2, 1]]Passed
explicit oracle 1[[1, 1]][[1, 1]]Passed
explicit oracle 2[[-2, 1], [-5, 3], [-22, 13]][[-2, 1], [-5, 3], [-22, 13]]Passed
explicit oracle 3[[3, 1]][[3, 1]]Passed
explicit oracle 4[[4, 1]][[4, 1]]Passed
explicit oracle 5[[1, 1], [2, 1]][[1, 1], [2, 1]]Passed
explicit oracle 6[[1, 1], [3, 2]][[1, 1], [3, 2]]Passed
explicit oracle 7[[1, 1], [4, 3]][[1, 1], [4, 3]]Passed

SHA-256 / c22aeafdbceb08f93cbf8c24e2ea5925b98e6631d91b5b05fbebd30bd5ca9882

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

Case digest / 64dabdd90b1e73b3ebf8fc86f81eb840fc81428e4a1b3fd1c008c27702c512b2