FAILURE MAP
← Case archive

FA-14396 / Numerics / Open access

Bounded diophantine: remaining right hand side · case 01

The exact bounded diophantine result violates the stated contract at remaining right hand side.

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

ROOT CAUSE

The remaining right hand side step uses c-u instead of c-a*u.

VERIFIED REPAIR

Use c-a*u at the remaining right hand side step.

Unsuccessful approach: The partial repair c+a*u still violates the remaining right hand side 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-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 = [[([2, 1, 1, 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], [])], [([2, 1, 1, 2], [[0, 1]]), ([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]])], [([2, 1, 1, 3], [[0, 1]]), ([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], [])], [([2, 1, 1, 4], [[0, 1]]), ([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], [])], [([2, 1, 1, 5], [[0, 1]]), ([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], [1, 0]][[0, 1]]Failed
explicit oracle 1[][]Passed
explicit oracle 2[][]Passed
explicit oracle 3[[2, 3]][]Failed
explicit oracle 4[][]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][]Passed
explicit oracle 7[][]Passed

SHA-256 / b1ebb186ee42392e91c318f9705c164e9d56fa788b1f5c66d049f945f186aff6

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

SHA-256 / 4c8ef737c48c465cbdb777086be6a7b20adfe0faa2dab7bd1ee747392d8839c0

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

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

Case digest / 87e42f0f803da2dce0c9e8c4c6a03039dc9286d519f0e8049d2b239f75006b79