FAILURE MAP
← Case archive

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

Tensor views: diagonal stride sums both source strides · case 01

diagonal stride sums both source strides.

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

ROOT CAUSE

Moving one step along the diagonal advances along both source axes.

THE FAILURE

Moving one step along the diagonal advances along both source axes.

Unsuccessful approach: Summing strides but resetting offset only works for views based at storage origin.

Case contract

A square matrix diagonal view has length min(rows,cols) and stride row_stride+column_stride; preserve offset.

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):
    return min(shape),strides[0],offset
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('row major',solve([N+1,N+1],[N+1,1],6),(N+1,N+2,6))
check('pitched',solve([3,4],[7,2],N),(3,9,N))
check('rectangular',solve([2,5],[10,1],0),(2,11,0))
check('zero stride',solve([N,N],[0,0],4),(N,0,4))
check('negative column',solve([3,3],[3,-1],8),(3,2,8))
check('nonzero origin',solve([1,1],[4,2],N),(1,6,N))
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
row major[2, 2, 6][2, 3, 6]Failed
pitched[3, 7, 1][3, 9, 1]Failed
rectangular[2, 10, 0][2, 11, 0]Failed
zero stride[1, 0, 4][1, 0, 4]Passed
negative column[3, 3, 8][3, 2, 8]Failed
nonzero origin[1, 4, 1][1, 6, 1]Failed

SHA-256 / b3e6bdbc141d62be955ff88a3baa16b03d7fcb60c60b25d789ff9a5745b3ffdb

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(shape, strides, offset):
    return min(shape),strides[0]+strides[1],0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('row major',solve([N+1,N+1],[N+1,1],6),(N+1,N+2,6))
check('pitched',solve([3,4],[7,2],N),(3,9,N))
check('rectangular',solve([2,5],[10,1],0),(2,11,0))
check('zero stride',solve([N,N],[0,0],4),(N,0,4))
check('negative column',solve([3,3],[3,-1],8),(3,2,8))
check('nonzero origin',solve([1,1],[4,2],N),(1,6,N))
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
row major[2, 3, 0][2, 3, 6]Failed
pitched[3, 9, 0][3, 9, 1]Failed
rectangular[2, 11, 0][2, 11, 0]Passed
zero stride[1, 0, 0][1, 0, 4]Failed
negative column[3, 2, 0][3, 2, 8]Failed
nonzero origin[1, 6, 0][1, 6, 1]Failed

SHA-256 / 93cd23e5652d7868377e3bce7b05f2d4abf0acc85e43c9067b7f135439e36967

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

Case digest / 57f90eb8f44ac6a311d8a1bfee95af16a81b6119a3287fdc8374377dc26b034e