FA-15466 / Numerics / Open access
Integer matrix binary power: multiplicative identity seed · case 01
The exact integer matrix binary power result violates the stated contract at multiplicative identity seed.
ROOT CAUSE
The multiplicative identity seed step uses [[0]*n for _ in range(n)] instead of [[int(i==j) for j in range(n)] for i in range(n)].
VERIFIED REPAIR
Use [[int(i==j) for j in range(n)] for i in range(n)] at the multiplicative identity seed step.
Unsuccessful approach: The partial repair [row[:] for row in a] still violates the multiplicative identity seed invariant.
Case contract
Input [square integer matrix,nonnegative exponent<=12]; return exact matrix power.
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,e=x;n=len(a)
def mul(a,b):return [[sum(a[i][k]*b[k][j] for k in range(n)) for j in range(n)] for i in range(n)]
r=[[0]*n for _ in range(n)]
for _ in range(12):
if e==0:break
if e%2==1:r=mul(r,a)
a=mul(a,a)
e=e//2
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 1], [[-1]]), ([[[-1]], 2], [[1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 4], [[1]]), ([[[-1]], 5], [[-1]]), ([[[-1]], 6], [[1]])], [([[[-1]], 1], [[-1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[2]], 8], [[256]]), ([[[2]], 0], [[1]]), ([[[2]], 1], [[2]]), ([[[2]], 2], [[4]])], [([[[-1]], 2], [[1]]), ([[[-1]], 6], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[1]], 7], [[1]]), ([[[1]], 8], [[1]]), ([[[3]], 0], [[1]]), ([[[3]], 1], [[3]])], [([[[-1]], 3], [[-1]]), ([[[2]], 0], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 6], [[1]]), ([[[-1]], 7], [[-1]]), ([[[-1]], 8], [[1]]), ([[[3]], 0], [[1]])], [([[[-1]], 4], [[1]]), ([[[2]], 3], [[8]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-3]], 5], [[-243]]), ([[[-3]], 6], [[729]]), ([[[-3]], 7], [[-2187]]), ([[[-3]], 8], [[6561]])]]
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 | [[0]] | [[1]] | Failed |
| explicit oracle 1 | [[0, 0], [0, 0]] | [[1168, 2688], [-896, -624]] | Failed |
| explicit oracle 2 | [[0]] | [[-1]] | Failed |
| explicit oracle 3 | [[0]] | [[1]] | Failed |
| explicit oracle 4 | [[0]] | [[-1]] | Failed |
| explicit oracle 5 | [[0]] | [[1]] | Failed |
| explicit oracle 6 | [[0]] | [[-1]] | Failed |
| explicit oracle 7 | [[0]] | [[1]] | Failed |
SHA-256 / c1626b18a42dc67a2d314882eb675dfc83b656304c5287a4a8e9c23643168498
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,e=x;n=len(a)
def mul(a,b):return [[sum(a[i][k]*b[k][j] for k in range(n)) for j in range(n)] for i in range(n)]
r=[row[:] for row in a]
for _ in range(12):
if e==0:break
if e%2==1:r=mul(r,a)
a=mul(a,a)
e=e//2
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 1], [[-1]]), ([[[-1]], 2], [[1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 4], [[1]]), ([[[-1]], 5], [[-1]]), ([[[-1]], 6], [[1]])], [([[[-1]], 1], [[-1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[2]], 8], [[256]]), ([[[2]], 0], [[1]]), ([[[2]], 1], [[2]]), ([[[2]], 2], [[4]])], [([[[-1]], 2], [[1]]), ([[[-1]], 6], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[1]], 7], [[1]]), ([[[1]], 8], [[1]]), ([[[3]], 0], [[1]]), ([[[3]], 1], [[3]])], [([[[-1]], 3], [[-1]]), ([[[2]], 0], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 6], [[1]]), ([[[-1]], 7], [[-1]]), ([[[-1]], 8], [[1]]), ([[[3]], 0], [[1]])], [([[[-1]], 4], [[1]]), ([[[2]], 3], [[8]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-3]], 5], [[-243]]), ([[[-3]], 6], [[729]]), ([[[-3]], 7], [[-2187]]), ([[[-3]], 8], [[6561]])]]
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]] | Failed |
| explicit oracle 1 | [[-3856, -4560], [1520, -816]] | [[1168, 2688], [-896, -624]] | Failed |
| explicit oracle 2 | [[1]] | [[-1]] | Failed |
| explicit oracle 3 | [[-1]] | [[1]] | Failed |
| explicit oracle 4 | [[1]] | [[-1]] | Failed |
| explicit oracle 5 | [[-1]] | [[1]] | Failed |
| explicit oracle 6 | [[1]] | [[-1]] | Failed |
| explicit oracle 7 | [[-1]] | [[1]] | Failed |
SHA-256 / de091ca921b510f8d66613bf561fd0d888786d9f31069a6e9e86855a4455321d
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,e=x;n=len(a)
def mul(a,b):return [[sum(a[i][k]*b[k][j] for k in range(n)) for j in range(n)] for i in range(n)]
r=[[int(i==j) for j in range(n)] for i in range(n)]
for _ in range(12):
if e==0:break
if e%2==1:r=mul(r,a)
a=mul(a,a)
e=e//2
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 1], [[-1]]), ([[[-1]], 2], [[1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 4], [[1]]), ([[[-1]], 5], [[-1]]), ([[[-1]], 6], [[1]])], [([[[-1]], 1], [[-1]]), ([[[-1]], 3], [[-1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[2]], 8], [[256]]), ([[[2]], 0], [[1]]), ([[[2]], 1], [[2]]), ([[[2]], 2], [[4]])], [([[[-1]], 2], [[1]]), ([[[-1]], 6], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[1]], 7], [[1]]), ([[[1]], 8], [[1]]), ([[[3]], 0], [[1]]), ([[[3]], 1], [[3]])], [([[[-1]], 3], [[-1]]), ([[[2]], 0], [[1]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-1]], 6], [[1]]), ([[[-1]], 7], [[-1]]), ([[[-1]], 8], [[1]]), ([[[3]], 0], [[1]])], [([[[-1]], 4], [[1]]), ([[[2]], 3], [[8]]), ([[[-1]], 0], [[1]]), ([[[-1, 3], [-1, -3]], 8], [[1168, 2688], [-896, -624]]), ([[[-3]], 5], [[-243]]), ([[[-3]], 6], [[729]]), ([[[-3]], 7], [[-2187]]), ([[[-3]], 8], [[6561]])]]
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]] | Passed |
| explicit oracle 1 | [[1168, 2688], [-896, -624]] | [[1168, 2688], [-896, -624]] | Passed |
| explicit oracle 2 | [[-1]] | [[-1]] | Passed |
| explicit oracle 3 | [[1]] | [[1]] | Passed |
| explicit oracle 4 | [[-1]] | [[-1]] | Passed |
| explicit oracle 5 | [[1]] | [[1]] | Passed |
| explicit oracle 6 | [[-1]] | [[-1]] | Passed |
| explicit oracle 7 | [[1]] | [[1]] | Passed |
SHA-256 / beab4e23ad47e54bab607908c54a591b300ce89fa9e6c206b37bb711620ef63a
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:27.036561+00:00.
Case digest / 63fc77639070155b58d6b26ba77dbac7d30e3537b9f3aeab82118b1521642f32