FAILURE MAP
← Case archive

FA-6046 / Linear algebra / Open access

Matrix frobenius norm squared · case 01

Squaring a total introduces cancellation and cross terms.

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

ROOT CAUSE

Squaring a total introduces cancellation and cross terms.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return sum(x*x for row in m for x in row)

Unsuccessful approach: Absolute values use an entrywise one-norm instead of squared two-norm.

Case contract

Integer matrix/vector entries, rectangular rows, compatible multiplication dimensions, and square matrices for determinant, trace, inverse, symmetry and characteristic-polynomial operations. Rational matrix outputs are reduced Fraction strings. Matrix frobenius norm squared. Exact operational definition: sum(x*x for row in m for x in row)

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Linear algebra results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return sum(x for row in m for x in row)**2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), 30)
check('fixture 2: ([[1, -1]],)', solve(*([[1, -1]],)), 2)
check('fixture 3: ([[0]],)', solve(*([[0]],)), 0)
check('fixture 4: ([],)', solve(*([],)), 0)
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
fixture 1: ([[1, 2], [3, 4]],)10030Failed
fixture 2: ([[1, -1]],)02Failed
fixture 3: ([[0]],)00Passed
fixture 4: ([],)00Passed

SHA-256 / a64894b27e566b47494ff9cff8e14ef529ac02b5bc6d8b2a5eef68f31ef3e3e8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return sum(abs(x) for row in m for x in row)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), 30)
check('fixture 2: ([[1, -1]],)', solve(*([[1, -1]],)), 2)
check('fixture 3: ([[0]],)', solve(*([[0]],)), 0)
check('fixture 4: ([],)', solve(*([],)), 0)
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
fixture 1: ([[1, 2], [3, 4]],)1030Failed
fixture 2: ([[1, -1]],)22Passed
fixture 3: ([[0]],)00Passed
fixture 4: ([],)00Passed

SHA-256 / 71708cc5dca93dd67395ace607df68222a06cb09783a012aae59693f8701a25c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(m):
    return sum(x*x for row in m for x in row)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([[1, 2], [3, 4]],)', solve(*([[1, 2], [3, 4]],)), 30)
check('fixture 2: ([[1, -1]],)', solve(*([[1, -1]],)), 2)
check('fixture 3: ([[0]],)', solve(*([[0]],)), 0)
check('fixture 4: ([],)', solve(*([],)), 0)
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
fixture 1: ([[1, 2], [3, 4]],)3030Passed
fixture 2: ([[1, -1]],)22Passed
fixture 3: ([[0]],)00Passed
fixture 4: ([],)00Passed

SHA-256 / 210be307855e51f50659105aab7d202bb129c754e39d74836299871b1a603978

Verification & scope

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

Case digest / 9e4b20f2585b8d097bd3276270c64be9636434fad8172a6d095489c952d5df48