FAILURE MAP
← Case archive

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

Tensor views: slice origin advances storage offset · case 01

slice origin advances storage offset.

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

ROOT CAUSE

The slice changes logical extent without advancing to its first storage element.

THE FAILURE

The slice changes logical extent without advancing to its first storage element.

Unsuccessful approach: Adding start directly works only when the axis stride equals one.

Case contract

A unit-step slice along axis a adds start*stride[a] to offset and changes that dimension to stop-start.

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, axis, start, stop):
    return list(shape),offset
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('outer slice',solve([N+3,4],[4,1],10,0,2,N+2),([N,4],18))
check('inner slice',solve([3,N+2],[N+2,1],5,1,1,N+1),([3,N],6))
check('zero start',solve([4,3],[3,1],N,0,0,2),([2,3],N))
check('whole axis',solve([3,2],[2,1],7,1,0,2),([3,2],7))
check('negative stride',solve([4],[ -2],8,0,1,3),([2],6))
check('empty slice',solve([5],[3],4,0,2,2),([0],10))
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
outer slice[[4, 4], 10][[1, 4], 18]Failed
inner slice[[3, 3], 5][[3, 1], 6]Failed
zero start[[4, 3], 1][[2, 3], 1]Failed
whole axis[[3, 2], 7][[3, 2], 7]Passed
negative stride[[4], 8][[2], 6]Failed
empty slice[[5], 4][[0], 10]Failed

SHA-256 / cc78c16cc12b9f0eb1e6e8331b51ee09b9c51807962711262d86eb2b89dd8e78

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(shape, strides, offset, axis, start, stop):
    out=list(shape); out[axis]=stop-start
    return out,offset+start
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('outer slice',solve([N+3,4],[4,1],10,0,2,N+2),([N,4],18))
check('inner slice',solve([3,N+2],[N+2,1],5,1,1,N+1),([3,N],6))
check('zero start',solve([4,3],[3,1],N,0,0,2),([2,3],N))
check('whole axis',solve([3,2],[2,1],7,1,0,2),([3,2],7))
check('negative stride',solve([4],[ -2],8,0,1,3),([2],6))
check('empty slice',solve([5],[3],4,0,2,2),([0],10))
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
outer slice[[1, 4], 12][[1, 4], 18]Failed
inner slice[[3, 1], 6][[3, 1], 6]Passed
zero start[[2, 3], 1][[2, 3], 1]Passed
whole axis[[3, 2], 7][[3, 2], 7]Passed
negative stride[[2], 9][[2], 6]Failed
empty slice[[0], 6][[0], 10]Failed

SHA-256 / 1b58ed8b9994ae1f3beef2ff8d2232afc0c4c972569fe1b6ec89362325943c8e

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

Case digest / 189ed1cb40b8df75310bdfa805953a4c60e61c99915643394b48dfcfa8ad00d6