FAILURE MAP
← Case archive

FA-14411 / Numerics / Open access

Bounded diophantine: box membership · case 01

The exact bounded diophantine result violates the stated contract at box membership.

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

ROOT CAUSE

The box membership step uses v<=L instead of 0<=v<=L.

VERIFIED REPAIR

Use 0<=v<=L at the box membership step.

Unsuccessful approach: The partial repair 0<v<L still violates the box membership 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//b
     if 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, -2, 0], []), ([1, 1, 0, 0], [[0, 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, -2, 1], []), ([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, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 1, -2, 2], []), ([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, 3], []), ([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, -2, 4], []), ([1, 1, 2, 2], [[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, -2]][]Failed
explicit oracle 1[[0, 0]][[0, 0]]Passed
explicit oracle 2[][]Passed
explicit oracle 3[[0, -2], [1, -3]][]Failed
explicit oracle 4[[0, -2], [1, -3], [2, -4]][]Failed
explicit oracle 5[[0, -2], [1, -3], [2, -4], [3, -5]][]Failed
explicit oracle 6[[0, -2], [1, -3], [2, -4], [3, -5], [4, -6]][]Failed
explicit oracle 7[[0, -2], [1, -3], [2, -4], [3, -5], [4, -6], [5, -7]][]Failed

SHA-256 / 0aea49aeabb7fe6ccb38e9914b65f00ede239a3d2031b47d803355baa84e477d

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=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, -2, 0], []), ([1, 1, 0, 0], [[0, 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, -2, 1], []), ([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, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 1, -2, 2], []), ([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, 3], []), ([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, -2, 4], []), ([1, 1, 2, 2], [[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[][]Passed
explicit oracle 1[][[0, 0]]Failed
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 / 7b454ccafd2dc9520814a6c9efd61603c6e414dcb67c919a0ff61bf9efe9faae

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, -2, 0], []), ([1, 1, 0, 0], [[0, 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, -2, 1], []), ([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, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 1, -2, 2], []), ([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, 3], []), ([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, -2, 4], []), ([1, 1, 2, 2], [[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[][]Passed
explicit oracle 1[[0, 0]][[0, 0]]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 / 1770f1cf7749f922e10cdd708e4c2a77e9033a6b78a506eed4336eeca39da186

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

Case digest / 01bfeb746c045447524da782fcd6784075b05e75277f18dc15a557d2feeb4a88