FAILURE MAP
← Case archive

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

Tensor views: row-major stride recurrence · case 01

row-major stride recurrence.

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

ROOT CAUSE

The recurrence multiplies by the current axis size, so it shifts every outer stride.

THE FAILURE

The recurrence multiplies by the current axis size, so it shifts every outer stride.

Unsuccessful approach: Using the previous axis size still shifts the recurrence and breaks outer layouts.

Case contract

For shape dimensions, return contiguous row-major element strides; empty shape has empty 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):
    return [1]*len(shape)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matrix',solve([N,3]),[3,1])
check('three axes',solve([2,N,4]),[N*4,4,1])
check('singleton axis',solve([1,N]),[N,1])
check('unit vector',solve([N]),[1])
check('empty rank',solve([]),[])
check('two singleton',solve([1,1]),[1,1])
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
matrix[1, 1][3, 1]Failed
three axes[1, 1, 1][4, 4, 1]Failed
singleton axis[1, 1][1, 1]Passed
unit vector[1][1]Passed
empty rank[][]Passed
two singleton[1, 1][1, 1]Passed

SHA-256 / b991b4aa119ee294646d9d63efd79dc811008193547cedf4498f200d55730568

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(shape):
    out=[1]*len(shape)
    for i in range(len(shape)-2,-1,-1): out[i]=out[i+1]*shape[i]
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matrix',solve([N,3]),[3,1])
check('three axes',solve([2,N,4]),[N*4,4,1])
check('singleton axis',solve([1,N]),[N,1])
check('unit vector',solve([N]),[1])
check('empty rank',solve([]),[])
check('two singleton',solve([1,1]),[1,1])
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
matrix[1, 1][3, 1]Failed
three axes[2, 1, 1][4, 4, 1]Failed
singleton axis[1, 1][1, 1]Passed
unit vector[1][1]Passed
empty rank[][]Passed
two singleton[1, 1][1, 1]Passed

SHA-256 / 43df736060ee94b2eb8105d563fc73df72286aced295164c2603562be11c1a51

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

Case digest / 2c9856e7e84334a6fccb61240ab798357dfd06e11762ef942e704a32a3f54747