FAILURE MAP
← Case archive

FA-14401 / Numerics / Open access

Bounded diophantine: divisibility filter · case 01

The exact bounded diophantine result violates the stated contract at divisibility filter.

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

ROOT CAUSE

The divisibility filter step uses t == 0 instead of t%b != 0.

VERIFIED REPAIR

Use t%b != 0 at the divisibility filter step.

Unsuccessful approach: The partial repair t%b == 0 still violates the divisibility filter 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 == 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, 0, 1], [[0, 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, 1], [[0, 1], [1, 0]]), ([1, 1, 1, 2], [[0, 1], [1, 0]])], [([1, 1, 0, 2], [[0, 0]]), ([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, 0, 3], [[0, 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, 0, 4], [[0, 0]]), ([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, 0]]Failed
explicit oracle 1[][]Passed
explicit oracle 2[[0, 3], [1, 2], [2, 1], [3, 0]][]Failed
explicit oracle 3[][]Passed
explicit oracle 4[][]Passed
explicit oracle 5[][]Passed
explicit oracle 6[][]Passed
explicit oracle 7[][]Passed

SHA-256 / 56134983f5c434c8d7afff328df6c9cc45ca22af2c5c3bf45116c3943cf20273

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

SHA-256 / 17ba7f8886bfd1522c1f1d71076ea35b6f80efd28d0572baf1f8fad799cd8523

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

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

Case digest / 5d8e66e1f4fcfc264cb2271f17af1785099628e8768874b0464997c621ab9392