FAILURE MAP
← Case archive

FA-98821 / Tensor stride and reshape semantics / Open access

Tensor views: logical index bounds are checked per axis · case 01

logical index bounds are checked per axis.

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

ROOT CAUSE

The address calculation accepts coordinates outside the logical shape.

THE FAILURE

The address calculation accepts coordinates outside the logical shape.

Unsuccessful approach: Rejecting negative coordinates still lets indices at or above an axis size through.

Case contract

Return None if any index is outside [0,size); otherwise compute offset + dot(index,strides).

Why this case matters

Dense tensor views rely on consistent logical coordinates and physical storage addresses.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(shape, strides, offset, index):
    return offset+sum(i*s for i,s in zip(index,strides))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('last valid',solve([2,N],[N,1],5,[1,N-1]),5+2*N-1)
check('too large',solve([2,3],[3,1],0,[2,0]),None)
check('negative',solve([3],[1],0,[-1]),None)
check('origin',solve([2,2],[2,1],N,[0,0]),N)
check('rank mismatch',solve([2,2],[2,1],0,[1]),None)
check('scalar',solve([],[],7,[]),7)
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
last valid66Passed
too large6NoneFailed
negative-1NoneFailed
origin11Passed
rank mismatch2NoneFailed
scalar77Passed

SHA-256 / 5c76f1c962d3829cb67e13632391d40de669bdd438922a5d5778c965f197db1b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(shape, strides, offset, index):
    if any(i<0 for i in index): return None
    return offset+sum(i*s for i,s in zip(index,strides))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('last valid',solve([2,N],[N,1],5,[1,N-1]),5+2*N-1)
check('too large',solve([2,3],[3,1],0,[2,0]),None)
check('negative',solve([3],[1],0,[-1]),None)
check('origin',solve([2,2],[2,1],N,[0,0]),N)
check('rank mismatch',solve([2,2],[2,1],0,[1]),None)
check('scalar',solve([],[],7,[]),7)
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
last valid66Passed
too large6NoneFailed
negativeNoneNonePassed
origin11Passed
rank mismatch2NoneFailed
scalar77Passed

SHA-256 / 609313bedb567942f5cba8315400131d9c1deaa8a504ce5e96985b12b1f93802

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 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

Self-contained integer metadata models only; no production framework compatibility or performance claim. 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-30T16:48:17.165200+00:00.

Case digest / d48550621fde747dd89be05c32b5b6c565289666e5e26bad528dac2f580239ae