FAILURE MAP
← Case archive

FA-6031 / Linear algebra / Open access

Matrix vector product · case 01

Products between nonmatching coordinates contaminate each row.

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

ROOT CAUSE

Products between nonmatching coordinates contaminate each row.

VERIFIED REPAIR

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

Unsuccessful approach: Row totals and vector totals are added instead of paired multiplication.

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 vector product. Exact operational definition: [sum(x*y for x,y in zip(row,v)) for row in m]

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

SHA-256 / d7a249c5b062d899abccd43a18b2570ec34969c3f493ad9437f46eb7d9acfeaf

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

SHA-256 / 8227d79b1584f55b798dffbbe68a096d2e512a447ae7c65280ea4b670ff0f808

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

SHA-256 / ba18927a94abbed5ab512ab947e12c5fec0805a6048121caf9d9a06d94dcac9a

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

Case digest / 08505b48e5a9f8698cab03d31d6f4f2af089e2c487c2b28e6bfec87a220f0337