FA-15386 / Numerics / Open access
Rational row reduction: pivot row cursor · case 01
The exact rational row reduction result violates the stated contract at pivot row cursor.
ROOT CAUSE
The pivot row cursor step uses r instead of r+1.
THE FAILURE
The pivot row cursor step uses r instead of r+1.
Unsuccessful approach: The partial repair min(rows,r+2) still violates the pivot row cursor invariant.
Case contract
Input nonempty rectangular integer matrix; return RREF with each rational entry [p,q].
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=[list(map(Fraction,r)) for r in x];rows=len(a);cols=len(a[0]);r=0
for c in range(cols):
if r==rows:break
pivot=next((i for i in range(r,rows) if a[i][c]!=0),None)
if pivot is None:continue
a[r],a[pivot]=a[pivot],a[r]
d=a[r][c]
if not d:return None
a[r]=[v/d for v in a[r]]
for i in range(rows):
if i==r:continue
v=a[i][c]
a[i]=[a[i][j]-v*a[r][j] for j in range(cols)]
r=r
return [[[v.numerator,v.denominator] for v in row] for row in a]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[2, -1]], [[[1, 1], [-1, 2]]]), ([[1, 0], [2, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[1, 1]], [[[1, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[-2, 0]], [[[1, 1], [0, 1]]]), ([[0, 1]], [[[0, 1], [1, 1]]])], [([[2, 1]], [[[1, 1], [1, 2]]]), ([[2, -2], [1, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, 1]], [[[0, 1], [1, 1]]]), ([[-2, -1]], [[[1, 1], [1, 2]]]), ([[-2, -1]], [[[1, 1], [1, 2]]]), ([[0, -1]], [[[0, 1], [1, 1]]])], [([[-2, -1]], [[[1, 1], [1, 2]]]), ([[-1, -2], [-1, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[2, 2]], [[[1, 1], [1, 1]]]), ([[2, -1]], [[[1, 1], [-1, 2]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[1, -1]], [[[1, 1], [-1, 1]]])], [([[2, -2]], [[[1, 1], [-1, 1]]]), ([[-1, 1], [-1, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, 0], [-1, 2]], [[[1, 1], [-2, 1]], [[0, 1], [0, 1]]]), ([[-2, 1], [1, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-1, 0], [0, 0]], [[[1, 1], [0, 1]], [[0, 1], [0, 1]]]), ([[2, 1], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]])], [([[1, -1]], [[[1, 1], [-1, 1]]]), ([[2, 2], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, -2], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-1, -2], [0, 1]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-2, 0], [-2, 0]], [[[1, 1], [0, 1]], [[0, 1], [0, 1]]]), ([[0, 0], [0, -1]], [[[0, 1], [1, 1]], [[0, 1], [0, 1]]])]]
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 | [[[-2, 1], [1, 1]]] | [[[1, 1], [-1, 2]]] | Failed |
| explicit oracle 1 | [[[0, 1], [1, 1]], [[1, 1], [0, 1]]] | [[[1, 1], [0, 1]], [[0, 1], [1, 1]]] | Failed |
| explicit oracle 2 | [[[0, 1], [0, 1]]] | [[[0, 1], [0, 1]]] | Passed |
| explicit oracle 3 | [[[1, 1], [-1, 2], [-1, 2], [1, 1]], [[1, 1], [3, 2], [-1, 2], [0, 1]], [[3, 1], [-3, 1], [-1, 1], [0, 1]]] | [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]] | Failed |
| explicit oracle 4 | [[[1, 1], [1, 1]]] | [[[1, 1], [1, 1]]] | Passed |
| explicit oracle 5 | [[[0, 1], [0, 1]]] | [[[0, 1], [0, 1]]] | Passed |
| explicit oracle 6 | [[[1, 1], [0, 1]]] | [[[1, 1], [0, 1]]] | Passed |
| explicit oracle 7 | [[[0, 1], [1, 1]]] | [[[0, 1], [1, 1]]] | Passed |
SHA-256 / f3ca608115840a0464efce2bbea8095b636faa718752dad7f0c912cd413d634b
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=[list(map(Fraction,r)) for r in x];rows=len(a);cols=len(a[0]);r=0
for c in range(cols):
if r==rows:break
pivot=next((i for i in range(r,rows) if a[i][c]!=0),None)
if pivot is None:continue
a[r],a[pivot]=a[pivot],a[r]
d=a[r][c]
if not d:return None
a[r]=[v/d for v in a[r]]
for i in range(rows):
if i==r:continue
v=a[i][c]
a[i]=[a[i][j]-v*a[r][j] for j in range(cols)]
r=min(rows,r+2)
return [[[v.numerator,v.denominator] for v in row] for row in a]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[2, -1]], [[[1, 1], [-1, 2]]]), ([[1, 0], [2, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[1, 1]], [[[1, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[-2, 0]], [[[1, 1], [0, 1]]]), ([[0, 1]], [[[0, 1], [1, 1]]])], [([[2, 1]], [[[1, 1], [1, 2]]]), ([[2, -2], [1, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, 1]], [[[0, 1], [1, 1]]]), ([[-2, -1]], [[[1, 1], [1, 2]]]), ([[-2, -1]], [[[1, 1], [1, 2]]]), ([[0, -1]], [[[0, 1], [1, 1]]])], [([[-2, -1]], [[[1, 1], [1, 2]]]), ([[-1, -2], [-1, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[2, 2]], [[[1, 1], [1, 1]]]), ([[2, -1]], [[[1, 1], [-1, 2]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[1, -1]], [[[1, 1], [-1, 1]]])], [([[2, -2]], [[[1, 1], [-1, 1]]]), ([[-1, 1], [-1, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, 0], [-1, 2]], [[[1, 1], [-2, 1]], [[0, 1], [0, 1]]]), ([[-2, 1], [1, -2]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-1, 0], [0, 0]], [[[1, 1], [0, 1]], [[0, 1], [0, 1]]]), ([[2, 1], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]])], [([[1, -1]], [[[1, 1], [-1, 1]]]), ([[2, 2], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 0]], [[[0, 1], [0, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]]), ([[0, -2], [2, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-1, -2], [0, 1]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-2, 0], [-2, 0]], [[[1, 1], [0, 1]], [[0, 1], [0, 1]]]), ([[0, 0], [0, -1]], [[[0, 1], [1, 1]], [[0, 1], [0, 1]]])]]
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 | [[[1, 1], [-1, 2]]] | [[[1, 1], [-1, 2]]] | Passed |
| explicit oracle 1 | [[[1, 1], [0, 1]], [[0, 1], [-2, 1]]] | [[[1, 1], [0, 1]], [[0, 1], [1, 1]]] | Failed |
| explicit oracle 2 | [[[0, 1], [0, 1]]] | [[[0, 1], [0, 1]]] | Passed |
| explicit oracle 3 | [[[1, 1], [0, 1], [-2, 3], [2, 1]], [[0, 1], [0, 1], [2, 3], [-5, 1]], [[0, 1], [1, 1], [-1, 3], [2, 1]]] | [[[1, 1], [0, 1], [0, 1], [-3, 1]], [[0, 1], [1, 1], [0, 1], [-1, 2]], [[0, 1], [0, 1], [1, 1], [-15, 2]]] | Failed |
| explicit oracle 4 | [[[1, 1], [1, 1]]] | [[[1, 1], [1, 1]]] | Passed |
| explicit oracle 5 | [[[0, 1], [0, 1]]] | [[[0, 1], [0, 1]]] | Passed |
| explicit oracle 6 | [[[1, 1], [0, 1]]] | [[[1, 1], [0, 1]]] | Passed |
| explicit oracle 7 | [[[0, 1], [1, 1]]] | [[[0, 1], [1, 1]]] | Passed |
SHA-256 / 57797b2098ccc014738e577c55dcfb8384f7f303da4528ce419f338b538181cb
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.287657+00:00.
Case digest / 31e3697e23f8a683377ebb751cdff88d9a708f1d873e6d3adb55ff1e96261091