FAILURE MAP
← Case archive

FA-14391 / Numerics / Open access

Bounded diophantine: first coordinate endpoint · case 01

The exact bounded diophantine result violates the stated contract at first coordinate endpoint.

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

ROOT CAUSE

The first coordinate endpoint step uses range(L) instead of range(L+1).

VERIFIED REPAIR

Use range(L+1) at the first coordinate endpoint step.

Unsuccessful approach: The partial repair range(1,L+1) still violates the first coordinate endpoint invariant.

Case contract

Input [a,b,c,L], positive a,b and nonnegative L; lexicographically ordered nonnegative solutions a*u+b*v=c with u,v<=L.

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,c,L=x
    out=[]
    for u in range(L):
     t=c-a*u
     if t%b != 0: continue
     v=t//b
     if 0<=v<=L: out.append([u,v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([1, 1, 0, 0], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 2], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 0, 3], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 2], [[0, 1], [1, 0]]), ([1, 1, 1, 3], [[0, 1], [1, 0]])], [([1, 1, 2, 1], [[1, 1]]), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 3, 4], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 3, 5], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 4, 0], []), ([1, 1, 4, 1], [])], [([1, 1, 2, 2], [[0, 2], [1, 1], [2, 0]]), ([1, 1, 1, 4], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 6, 3], [[3, 3]]), ([1, 1, 6, 4], [[2, 4], [3, 3], [4, 2]]), ([1, 1, 6, 5], [[1, 5], [2, 4], [3, 3], [4, 2], [5, 1]]), ([1, 1, 7, 0], [])], [([1, 1, 3, 2], [[1, 2], [2, 1]]), ([1, 1, 2, 3], [[0, 2], [1, 1], [2, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 9, 2], []), ([1, 1, 9, 3], []), ([1, 1, 9, 4], []), ([1, 1, 9, 5], [[4, 5], [5, 4]])]]
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[][[0, 0]]Failed
explicit oracle 1[][]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[][]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][]Passed
explicit oracle 7[][]Passed

SHA-256 / 014400422b73bbbc44925d8477b35ab6a2c3ccb5f50f65ec543da3fa94de2ab7

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,c,L=x
    out=[]
    for u in range(1,L+1):
     t=c-a*u
     if t%b != 0: continue
     v=t//b
     if 0<=v<=L: out.append([u,v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([1, 1, 0, 0], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 2], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 0, 3], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 2], [[0, 1], [1, 0]]), ([1, 1, 1, 3], [[0, 1], [1, 0]])], [([1, 1, 2, 1], [[1, 1]]), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 3, 4], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 3, 5], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 4, 0], []), ([1, 1, 4, 1], [])], [([1, 1, 2, 2], [[0, 2], [1, 1], [2, 0]]), ([1, 1, 1, 4], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 6, 3], [[3, 3]]), ([1, 1, 6, 4], [[2, 4], [3, 3], [4, 2]]), ([1, 1, 6, 5], [[1, 5], [2, 4], [3, 3], [4, 2], [5, 1]]), ([1, 1, 7, 0], [])], [([1, 1, 3, 2], [[1, 2], [2, 1]]), ([1, 1, 2, 3], [[0, 2], [1, 1], [2, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 9, 2], []), ([1, 1, 9, 3], []), ([1, 1, 9, 4], []), ([1, 1, 9, 5], [[4, 5], [5, 4]])]]
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[][[0, 0]]Failed
explicit oracle 1[][]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[][]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][]Passed
explicit oracle 7[][]Passed

SHA-256 / 9911af003d40f0599677dcbeaf9a1dcdd1e72e2684116d8b4322eca2d13dd1a1

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,c,L=x
    out=[]
    for u in range(L+1):
     t=c-a*u
     if t%b != 0: continue
     v=t//b
     if 0<=v<=L: out.append([u,v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([1, 1, 0, 0], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 2], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 0, 3], [[0, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 2], [[0, 1], [1, 0]]), ([1, 1, 1, 3], [[0, 1], [1, 0]])], [([1, 1, 2, 1], [[1, 1]]), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 3, 4], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 3, 5], [[0, 3], [1, 2], [2, 1], [3, 0]]), ([1, 1, 4, 0], []), ([1, 1, 4, 1], [])], [([1, 1, 2, 2], [[0, 2], [1, 1], [2, 0]]), ([1, 1, 1, 4], [[0, 1], [1, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 6, 3], [[3, 3]]), ([1, 1, 6, 4], [[2, 4], [3, 3], [4, 2]]), ([1, 1, 6, 5], [[1, 5], [2, 4], [3, 3], [4, 2], [5, 1]]), ([1, 1, 7, 0], [])], [([1, 1, 3, 2], [[1, 2], [2, 1]]), ([1, 1, 2, 3], [[0, 2], [1, 1], [2, 0]]), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 9, 2], []), ([1, 1, 9, 3], []), ([1, 1, 9, 4], []), ([1, 1, 9, 5], [[4, 5], [5, 4]])]]
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[[0, 0]][[0, 0]]Passed
explicit oracle 1[][]Passed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[][]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][]Passed
explicit oracle 7[][]Passed

SHA-256 / 95e5757204eff3797631c87a61bc363fedd7adfaa23b7ef24c61da0ed8b7983b

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

Case digest / 5bbcc3dea65c1e969b6c4688460756b44404a35f13f82d8fce87f9bc1cc820de