FAILURE MAP
← Case archive

FA-15406 / Numerics / Open access

Rational nullspace basis: pivot coordinate placement · case 01

The exact rational nullspace basis result violates the stated contract at pivot coordinate placement.

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

ROOT CAUSE

The pivot coordinate placement step uses i instead of p.

VERIFIED REPAIR

Use p at the pivot coordinate placement step.

Unsuccessful approach: The partial repair c still violates the pivot coordinate placement invariant.

Case contract

Input nonempty rectangular integer matrix; return canonical nullspace basis, one vector per free column increasing, with that free coordinate one and other free coordinates zero.

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;pivots=[]
    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];a[r]=[v/d for v in a[r]]
     for i in range(rows):
      if i!=r:
       v=a[i][c];a[i]=[a[i][j]-v*a[r][j] for j in range(cols)]
     pivots.append(c);r+=1
    free=[c for c in range(cols) if c not in pivots]
    out=[]
    for c in free:
     v=[Fraction(0)]*cols
     v[c]=Fraction(1)
     for i,p in enumerate(pivots):v[i]=-a[i][c]
     out.append([[z.numerator,z.denominator] for z in v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 1]], [[[1, 1], [0, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[1, 1]], [[[-1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-2, 0]], [[[0, 1], [1, 1]]]), ([[2, 1]], [[[-1, 2], [1, 1]]])], [([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, -1]], [[[1, 1], [0, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[2, 2]], [[[-1, 1], [1, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[-1, 1], [-1, 0]], []), ([[0, 0], [-1, 2]], [[[2, 1], [1, 1]]]), ([[-2, 1], [1, -2]], []), ([[-1, 0], [0, 0]], [[[0, 1], [1, 1]]])], [([[0, -1]], [[[1, 1], [0, 1]]]), ([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, -2], [2, 0]], []), ([[-1, -2], [0, 1]], []), ([[-2, 0], [-2, 0]], [[[0, 1], [1, 1]]]), ([[0, 0], [0, -1]], [[[1, 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 fixtureActualExpectedOutcome
explicit oracle 0[[[0, 1], [0, 1]]][[[1, 1], [0, 1]]]Failed
explicit oracle 1[[[1, 2], [1, 1]]][[[1, 2], [1, 1]]]Passed
explicit oracle 2[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 3[[[3, 1], [1, 2], [15, 2], [1, 1]]][[[3, 1], [1, 2], [15, 2], [1, 1]]]Passed
explicit oracle 4[[[-1, 1], [1, 1]]][[[-1, 1], [1, 1]]]Passed
explicit oracle 5[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 6[[[0, 1], [1, 1]]][[[0, 1], [1, 1]]]Passed
explicit oracle 7[[[-1, 2], [1, 1]]][[[-1, 2], [1, 1]]]Passed

SHA-256 / c5e7dc7fabfaf913bc91c04c59bbb23da3f692f699798517755dc70c9ae66024

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;pivots=[]
    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];a[r]=[v/d for v in a[r]]
     for i in range(rows):
      if i!=r:
       v=a[i][c];a[i]=[a[i][j]-v*a[r][j] for j in range(cols)]
     pivots.append(c);r+=1
    free=[c for c in range(cols) if c not in pivots]
    out=[]
    for c in free:
     v=[Fraction(0)]*cols
     v[c]=Fraction(1)
     for i,p in enumerate(pivots):v[c]=-a[i][c]
     out.append([[z.numerator,z.denominator] for z in v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 1]], [[[1, 1], [0, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[1, 1]], [[[-1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-2, 0]], [[[0, 1], [1, 1]]]), ([[2, 1]], [[[-1, 2], [1, 1]]])], [([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, -1]], [[[1, 1], [0, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[2, 2]], [[[-1, 1], [1, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[-1, 1], [-1, 0]], []), ([[0, 0], [-1, 2]], [[[2, 1], [1, 1]]]), ([[-2, 1], [1, -2]], []), ([[-1, 0], [0, 0]], [[[0, 1], [1, 1]]])], [([[0, -1]], [[[1, 1], [0, 1]]]), ([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, -2], [2, 0]], []), ([[-1, -2], [0, 1]], []), ([[-2, 0], [-2, 0]], [[[0, 1], [1, 1]]]), ([[0, 0], [0, -1]], [[[1, 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 fixtureActualExpectedOutcome
explicit oracle 0[[[0, 1], [0, 1]]][[[1, 1], [0, 1]]]Failed
explicit oracle 1[[[0, 1], [1, 2]]][[[1, 2], [1, 1]]]Failed
explicit oracle 2[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 3[[[0, 1], [0, 1], [0, 1], [15, 2]]][[[3, 1], [1, 2], [15, 2], [1, 1]]]Failed
explicit oracle 4[[[0, 1], [-1, 1]]][[[-1, 1], [1, 1]]]Failed
explicit oracle 5[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 6[[[0, 1], [0, 1]]][[[0, 1], [1, 1]]]Failed
explicit oracle 7[[[0, 1], [-1, 2]]][[[-1, 2], [1, 1]]]Failed

SHA-256 / b308068c1e8e5e4e4a8372f1381795af1d50ded71ed0d1b0034dfa0b556f4562

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=[list(map(Fraction,r)) for r in x];rows=len(a);cols=len(a[0]);r=0;pivots=[]
    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];a[r]=[v/d for v in a[r]]
     for i in range(rows):
      if i!=r:
       v=a[i][c];a[i]=[a[i][j]-v*a[r][j] for j in range(cols)]
     pivots.append(c);r+=1
    free=[c for c in range(cols) if c not in pivots]
    out=[]
    for c in free:
     v=[Fraction(0)]*cols
     v[c]=Fraction(1)
     for i,p in enumerate(pivots):v[p]=-a[i][c]
     out.append([[z.numerator,z.denominator] for z in v])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 1]], [[[1, 1], [0, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[1, 1]], [[[-1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[-2, 0]], [[[0, 1], [1, 1]]]), ([[2, 1]], [[[-1, 2], [1, 1]]])], [([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, -1]], [[[1, 1], [0, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[-2, -1]], [[[-1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[2, 2]], [[[-1, 1], [1, 1]]]), ([[2, -1]], [[[1, 2], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]])], [([[0, 1]], [[[1, 1], [0, 1]]]), ([[1, -1]], [[[1, 1], [1, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[-1, 1], [-1, 0]], []), ([[0, 0], [-1, 2]], [[[2, 1], [1, 1]]]), ([[-2, 1], [1, -2]], []), ([[-1, 0], [0, 0]], [[[0, 1], [1, 1]]])], [([[0, -1]], [[[1, 1], [0, 1]]]), ([[0, 2]], [[[1, 1], [0, 1]]]), ([[0, 0]], [[[1, 1], [0, 1]], [[0, 1], [1, 1]]]), ([[0, 2, 0, -1], [2, -1, -1, 2], [1, -2, 0, -2]], [[[3, 1], [1, 2], [15, 2], [1, 1]]]), ([[0, -2], [2, 0]], []), ([[-1, -2], [0, 1]], []), ([[-2, 0], [-2, 0]], [[[0, 1], [1, 1]]]), ([[0, 0], [0, -1]], [[[1, 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 fixtureActualExpectedOutcome
explicit oracle 0[[[1, 1], [0, 1]]][[[1, 1], [0, 1]]]Passed
explicit oracle 1[[[1, 2], [1, 1]]][[[1, 2], [1, 1]]]Passed
explicit oracle 2[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 3[[[3, 1], [1, 2], [15, 2], [1, 1]]][[[3, 1], [1, 2], [15, 2], [1, 1]]]Passed
explicit oracle 4[[[-1, 1], [1, 1]]][[[-1, 1], [1, 1]]]Passed
explicit oracle 5[[[1, 1], [0, 1]], [[0, 1], [1, 1]]][[[1, 1], [0, 1]], [[0, 1], [1, 1]]]Passed
explicit oracle 6[[[0, 1], [1, 1]]][[[0, 1], [1, 1]]]Passed
explicit oracle 7[[[-1, 2], [1, 1]]][[[-1, 2], [1, 1]]]Passed

SHA-256 / cb2f25f4978b235cef9bfe3dc2dff71ddb4074321f1bc961e430e5becb56a9f1

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

Case digest / 7efb0bb740563ce70c6bfdd90520bb68fe66fb0e744b8202aeae9ae0bb606319