FAILURE MAP
← Case archive

FA-14406 / Numerics / Open access

Bounded diophantine: second coordinate quotient · case 01

The exact bounded diophantine result violates the stated contract at second coordinate quotient.

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

ROOT CAUSE

The second coordinate quotient step uses t instead of t//b.

VERIFIED REPAIR

Use t//b at the second coordinate quotient step.

Unsuccessful approach: The partial repair abs(t)//b still violates the second coordinate quotient 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+1):
     t=c-a*u
     if t%b != 0: continue
     v=t
     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, 2, 2, 1], [[0, 1]]), ([1, 1, -2, 2], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 2, 2, 2], [[0, 1], [2, 0]]), ([1, 1, -2, 5], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 2, 2, 3], [[0, 1], [2, 0]]), ([1, 1, -1, 3], []), ([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, 2, 2, 4], [[0, 1], [2, 0]]), ([1, 1, 0, 1], [[0, 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, 2, 2, 5], [[0, 1], [2, 0]]), ([1, 1, 0, 4], [[0, 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, 1]]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 / e85eb4b6a8cfe2ded012210d2f617ec0223ba4673589d5623a4dee58228c2539

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(L+1):
     t=c-a*u
     if t%b != 0: continue
     v=abs(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, 2, 2, 1], [[0, 1]]), ([1, 1, -2, 2], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 2, 2, 2], [[0, 1], [2, 0]]), ([1, 1, -2, 5], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 2, 2, 3], [[0, 1], [2, 0]]), ([1, 1, -1, 3], []), ([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, 2, 2, 4], [[0, 1], [2, 0]]), ([1, 1, 0, 1], [[0, 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, 2, 2, 5], [[0, 1], [2, 0]]), ([1, 1, 0, 4], [[0, 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, 1]][[0, 1]]Passed
explicit oracle 1[[0, 2]][]Failed
explicit oracle 2[][]Passed
explicit oracle 3[][]Passed
explicit oracle 4[][]Passed
explicit oracle 5[[0, 2], [1, 3]][]Failed
explicit oracle 6[[0, 2], [1, 3], [2, 4]][]Failed
explicit oracle 7[[0, 2], [1, 3], [2, 4], [3, 5]][]Failed

SHA-256 / d2f90e1aad23de560598865ddc875e7ed5ebe65cc440415b44f4a90b2090b63d

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, 2, 2, 1], [[0, 1]]), ([1, 1, -2, 2], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, -2, 1], []), ([1, 1, -2, 3], []), ([1, 1, -2, 4], []), ([1, 1, -2, 5], [])], [([1, 2, 2, 2], [[0, 1], [2, 0]]), ([1, 1, -2, 5], []), ([1, 1, -2, 0], []), ([4, 4, 14, 5], []), ([1, 1, 0, 5], [[0, 0]]), ([1, 1, 1, 0], []), ([1, 1, 1, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 2, 2, 3], [[0, 1], [2, 0]]), ([1, 1, -1, 3], []), ([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, 2, 2, 4], [[0, 1], [2, 0]]), ([1, 1, 0, 1], [[0, 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, 2, 2, 5], [[0, 1], [2, 0]]), ([1, 1, 0, 4], [[0, 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, 1]][[0, 1]]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 / 20ac2f935cb7d1a68336db9481a6d82144953b0edaeafcf4d164217b59adf8b5

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

Case digest / d960c93dfa21e3d37bfe1732108ad5dd51c8b9072ebe485c9b799329677685d3