FAILURE MAP
← Case archive

FA-14446 / Numerics / Open access

Continued fraction convergents: denominator seeds · case 01

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

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

ROOT CAUSE

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

VERIFIED REPAIR

Use 1,0 at the denominator seeds step.

Unsuccessful approach: The partial repair 1,1 still violates the denominator 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=0,1
    q0,q1=0,1
    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, 2]][[2, 1]]Failed
explicit oracle 1[[1, 1]][[1, 1]]Passed
explicit oracle 2[[-2, -2], [-5, -5], [-22, -22]][[-2, 1], [-5, 3], [-22, 13]]Failed
explicit oracle 3[[3, 3]][[3, 1]]Failed
explicit oracle 4[[4, 4]][[4, 1]]Failed
explicit oracle 5[[1, 1], [2, 2]][[1, 1], [2, 1]]Failed
explicit oracle 6[[1, 1], [3, 3]][[1, 1], [3, 2]]Failed
explicit oracle 7[[1, 1], [4, 4]][[1, 1], [4, 3]]Failed

SHA-256 / f88eaa56491a2fc6cf9291bb874b04a3fa00b0fba456afcfbbc19a43e57f0b94

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=0,1
    q0,q1=1,1
    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, 3]][[2, 1]]Failed
explicit oracle 1[[1, 2]][[1, 1]]Failed
explicit oracle 2[[-2, -1], [-5, -2], [-22, -9]][[-2, 1], [-5, 3], [-22, 13]]Failed
explicit oracle 3[[3, 4]][[3, 1]]Failed
explicit oracle 4[[4, 5]][[4, 1]]Failed
explicit oracle 5[[1, 2], [2, 3]][[1, 1], [2, 1]]Failed
explicit oracle 6[[1, 2], [3, 5]][[1, 1], [3, 2]]Failed
explicit oracle 7[[1, 2], [4, 7]][[1, 1], [4, 3]]Failed

SHA-256 / 664f7564e287ef49d3950ef952f6118b4b05b138c5448427ae499014a72e484e

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

Case digest / 415b9d1a8fd4a0c8e266b7db4277538c8ff274cd9cfa8e6a0e13de745371f737