FA-15431 / Numerics / Open access
Exact tridiagonal solve: forward rhs elimination · case 01
The exact exact tridiagonal solve result violates the stated contract at forward rhs elimination.
ROOT CAUSE
The forward rhs elimination step uses r[i]/den instead of (r[i]-low[i-1]*r[i-1])/den.
VERIFIED REPAIR
Use (r[i]-low[i-1]*r[i-1])/den at the forward rhs elimination step.
Unsuccessful approach: The partial repair (r[i]+low[i-1]*r[i-1])/den still violates the forward rhs elimination invariant.
Case contract
Input [lower,diag,upper,rhs] integer tridiagonal system with nonzero Thomas pivots; return rational solution [p,q] per coordinate.
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):
low,d,up,b=x;n=len(d)
c=list(map(Fraction,up));r=list(map(Fraction,b));den=Fraction(d[0])
if not den:return None
if c:c[0]=c[0]/den
r[0]=r[0]/den
for i in range(1,n):
den=d[i]-low[i-1]*c[i-1]
if not den:return None
if i<n-1:c[i]/=den
r[i]=r[i]/den
for i in range(n-2,-1,-1):r[i]=r[i]-c[i]*r[i+1]
return [[v.numerator,v.denominator] for v in r]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [2], [-1, 4]], [[-7, 17], [25, 34]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]])], [([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 3]], [[3, 16], [7, 16]]), ([[-2], [6, 6], [2], [1, 1]], [[1, 10], [1, 5]]), ([[0], [6, 6], [1], [0, -1]], [[1, 36], [-1, 6]]), ([[-1], [6, 6], [1], [5, 1]], [[29, 37], [11, 37]])], [([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [0], [0, 4]], [[0, 1], [2, 3]]), ([[-2], [6, 6], [0], [3, -4]], [[1, 2], [-1, 2]]), ([[0], [6, 6], [0], [1, -2]], [[1, 6], [-1, 3]]), ([[-2], [6, 6], [1], [5, 2]], [[14, 19], [11, 19]])], [([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [1], [-1, -3]], [[-3, 35], [-17, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[0, -1], [6, 6, 6], [2, 1], [5, -2, 4]], [[217, 222], [-16, 37], [22, 37]]), ([[-1, -1], [6, 6, 6], [0, -1], [0, -3, -1]], [[0, 1], [-19, 35], [-9, 35]]), ([[-2, 0], [6, 6, 6], [0, -1], [-3, -5, 3]], [[-1, 2], [-11, 12], [1, 2]]), ([[1, 0], [6, 6, 6], [-1, 0], [-3, -3, 5]], [[-21, 37], [-15, 37], [5, 6]])], [([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [-1], [-1, 3]], [[-3, 37], [19, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[-1, 2], [6, 6, 6], [-2, 1], [5, 3, -4]], [[107, 96], [27, 32], [-91, 96]]), ([[-2, 2], [6, 6, 6], [-2, 2], [2, -2, 0]], [[5, 21], [-2, 7], [2, 21]]), ([[-2, 1], [6, 6, 6], [0, 2], [4, 4, 2]], [[2, 3], [14, 17], [10, 51]]), ([[1, -1], [6, 6, 6], [-2, 0], [-5, -4, 0]], [[-1, 1], [-1, 2], [-1, 12]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [[-9, 38], [-15, 19]] | [[-4, 19], [-33, 38]] | Failed |
| explicit oracle 1 | [[1, 2], [-1, 3], [3843083, 4080582], [-442598, 680097], [-27935, 55143], [-396, 557]] | [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]] | Failed |
| explicit oracle 2 | [[5, 24], [3, 8]] | [[1, 4], [1, 4]] | Failed |
| explicit oracle 3 | [[-43, 57], [9, 19]] | [[-27, 38], [14, 19]] | Failed |
| explicit oracle 4 | [[-215, 222], [-30, 37]] | [[-35, 37], [-25, 37]] | Failed |
| explicit oracle 5 | [[-1, 3], [2, 3]] | [[-1, 3], [13, 18]] | Failed |
| explicit oracle 6 | [[-41, 102], [12, 17]] | [[-7, 17], [25, 34]] | Failed |
| explicit oracle 7 | [[17, 21], [6, 7]] | [[29, 35], [34, 35]] | Failed |
SHA-256 / 7bcc0667e51e231960ab3b369f1b0927ef7395032d31eb1b492cebce01523e18
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):
low,d,up,b=x;n=len(d)
c=list(map(Fraction,up));r=list(map(Fraction,b));den=Fraction(d[0])
if not den:return None
if c:c[0]=c[0]/den
r[0]=r[0]/den
for i in range(1,n):
den=d[i]-low[i-1]*c[i-1]
if not den:return None
if i<n-1:c[i]/=den
r[i]=(r[i]+low[i-1]*r[i-1])/den
for i in range(n-2,-1,-1):r[i]=r[i]-c[i]*r[i+1]
return [[v.numerator,v.denominator] for v in r]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [2], [-1, 4]], [[-7, 17], [25, 34]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]])], [([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 3]], [[3, 16], [7, 16]]), ([[-2], [6, 6], [2], [1, 1]], [[1, 10], [1, 5]]), ([[0], [6, 6], [1], [0, -1]], [[1, 36], [-1, 6]]), ([[-1], [6, 6], [1], [5, 1]], [[29, 37], [11, 37]])], [([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [0], [0, 4]], [[0, 1], [2, 3]]), ([[-2], [6, 6], [0], [3, -4]], [[1, 2], [-1, 2]]), ([[0], [6, 6], [0], [1, -2]], [[1, 6], [-1, 3]]), ([[-2], [6, 6], [1], [5, 2]], [[14, 19], [11, 19]])], [([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [1], [-1, -3]], [[-3, 35], [-17, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[0, -1], [6, 6, 6], [2, 1], [5, -2, 4]], [[217, 222], [-16, 37], [22, 37]]), ([[-1, -1], [6, 6, 6], [0, -1], [0, -3, -1]], [[0, 1], [-19, 35], [-9, 35]]), ([[-2, 0], [6, 6, 6], [0, -1], [-3, -5, 3]], [[-1, 2], [-11, 12], [1, 2]]), ([[1, 0], [6, 6, 6], [-1, 0], [-3, -3, 5]], [[-21, 37], [-15, 37], [5, 6]])], [([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [-1], [-1, 3]], [[-3, 37], [19, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[-1, 2], [6, 6, 6], [-2, 1], [5, 3, -4]], [[107, 96], [27, 32], [-91, 96]]), ([[-2, 2], [6, 6, 6], [-2, 2], [2, -2, 0]], [[5, 21], [-2, 7], [2, 21]]), ([[-2, 1], [6, 6, 6], [0, 2], [4, 4, 2]], [[2, 3], [14, 17], [10, 51]]), ([[1, -1], [6, 6, 6], [-2, 0], [-5, -4, 0]], [[-1, 1], [-1, 2], [-1, 12]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [[-5, 19], [-27, 38]] | [[-4, 19], [-33, 38]] | Failed |
| explicit oracle 1 | [[1, 2], [-1, 2], [2289035, 2040291], [-497488, 680097], [-14086, 55143], [-370, 557]] | [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]] | Failed |
| explicit oracle 2 | [[1, 6], [1, 2]] | [[1, 4], [1, 4]] | Failed |
| explicit oracle 3 | [[-91, 114], [4, 19]] | [[-27, 38], [14, 19]] | Failed |
| explicit oracle 4 | [[-110, 111], [-35, 37]] | [[-35, 37], [-25, 37]] | Failed |
| explicit oracle 5 | [[-1, 3], [11, 18]] | [[-1, 3], [13, 18]] | Failed |
| explicit oracle 6 | [[-20, 51], [23, 34]] | [[-7, 17], [25, 34]] | Failed |
| explicit oracle 7 | [[83, 105], [26, 35]] | [[29, 35], [34, 35]] | Failed |
SHA-256 / bade308152784be9d0259ad9b310f1ef802bbde6f87f54c7d915d252b7765992
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):
low,d,up,b=x;n=len(d)
c=list(map(Fraction,up));r=list(map(Fraction,b));den=Fraction(d[0])
if not den:return None
if c:c[0]=c[0]/den
r[0]=r[0]/den
for i in range(1,n):
den=d[i]-low[i-1]*c[i-1]
if not den:return None
if i<n-1:c[i]/=den
r[i]=(r[i]-low[i-1]*r[i-1])/den
for i in range(n-2,-1,-1):r[i]=r[i]-c[i]*r[i+1]
return [[v.numerator,v.denominator] for v in r]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [2], [-1, 4]], [[-7, 17], [25, 34]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]])], [([[2], [6, 6], [2], [2, 2]], [[1, 4], [1, 4]]), ([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [2], [2, 3]], [[3, 16], [7, 16]]), ([[-2], [6, 6], [2], [1, 1]], [[1, 10], [1, 5]]), ([[0], [6, 6], [1], [0, -1]], [[1, 36], [-1, 6]]), ([[-1], [6, 6], [1], [5, 1]], [[29, 37], [11, 37]])], [([[2], [6, 6], [-1], [-5, 3]], [[-27, 38], [14, 19]]), ([[-1], [6, 6], [-1], [4, 5]], [[29, 35], [34, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[2], [6, 6], [0], [0, 4]], [[0, 1], [2, 3]]), ([[-2], [6, 6], [0], [3, -4]], [[1, 2], [-1, 2]]), ([[0], [6, 6], [0], [1, -2]], [[1, 6], [-1, 3]]), ([[-2], [6, 6], [1], [5, 2]], [[14, 19], [11, 19]])], [([[1], [6, 6], [-1], [-5, -5]], [[-35, 37], [-25, 37]]), ([[1], [6, 6], [1], [-1, -3]], [[-3, 35], [-17, 35]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[0, -1], [6, 6, 6], [2, 1], [5, -2, 4]], [[217, 222], [-16, 37], [22, 37]]), ([[-1, -1], [6, 6, 6], [0, -1], [0, -3, -1]], [[0, 1], [-19, 35], [-9, 35]]), ([[-2, 0], [6, 6, 6], [0, -1], [-3, -5, 3]], [[-1, 2], [-11, 12], [1, 2]]), ([[1, 0], [6, 6, 6], [-1, 0], [-3, -3, 5]], [[-21, 37], [-15, 37], [5, 6]])], [([[1], [6, 6], [0], [-2, 4]], [[-1, 3], [13, 18]]), ([[1], [6, 6], [-1], [-1, 3]], [[-3, 37], [19, 37]]), ([[-1], [6, 6], [2], [-3, -5]], [[-4, 19], [-33, 38]]), ([[-2, -2, -1, -2, -2], [6, 6, 6, 6, 6, 6], [0, 0, 1, -2, -1], [3, -2, 5, -3, -2, -4]], [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]]), ([[-1, 2], [6, 6, 6], [-2, 1], [5, 3, -4]], [[107, 96], [27, 32], [-91, 96]]), ([[-2, 2], [6, 6, 6], [-2, 2], [2, -2, 0]], [[5, 21], [-2, 7], [2, 21]]), ([[-2, 1], [6, 6, 6], [0, 2], [4, 4, 2]], [[2, 3], [14, 17], [10, 51]]), ([[1, -1], [6, 6, 6], [-2, 0], [-5, -4, 0]], [[-1, 1], [-1, 2], [-1, 12]])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | [[-4, 19], [-33, 38]] | [[-4, 19], [-33, 38]] | Passed |
| explicit oracle 1 | [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]] | [[1, 2], [-1, 6], [487, 557], [-968, 1671], [-376, 557], [-1490, 1671]] | Passed |
| explicit oracle 2 | [[1, 4], [1, 4]] | [[1, 4], [1, 4]] | Passed |
| explicit oracle 3 | [[-27, 38], [14, 19]] | [[-27, 38], [14, 19]] | Passed |
| explicit oracle 4 | [[-35, 37], [-25, 37]] | [[-35, 37], [-25, 37]] | Passed |
| explicit oracle 5 | [[-1, 3], [13, 18]] | [[-1, 3], [13, 18]] | Passed |
| explicit oracle 6 | [[-7, 17], [25, 34]] | [[-7, 17], [25, 34]] | Passed |
| explicit oracle 7 | [[29, 35], [34, 35]] | [[29, 35], [34, 35]] | Passed |
SHA-256 / c0e233b20f155e723989a0bc804d3f1e5aeee69a63a83c46757a6b3b809c67f3
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:26.711348+00:00.
Case digest / e50ef87db9c0bd7bb2fa5c87a0b6d1e5b2ad2240a37d97c54c743564cf015c11