FAILURE MAP
← Case archive

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

Tensor views: stepped slice multiplies stride · case 01

stepped slice multiplies stride.

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

ROOT CAUSE

Stepped slices retain fewer elements than the raw interval length suggests.

THE FAILURE

Stepped slices retain fewer elements than the raw interval length suggests.

Unsuccessful approach: Floor division drops a final selected element when the interval is not step-divisible.

Case contract

Positive-step slice length is ceil(max(0,stop-start)/step), offset advances by start stride, new stride multiplies by step.

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, step):
    out=list(shape); out[axis]=max(0,stop-start)
    s=list(strides); s[axis]*=step
    return out,s,offset+start*strides[axis]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('odd length',solve([N+5],[2],4,0,1,N+4,2),([((N+3)+1)//2],[4],6))
check('unit step',solve([5],[3],1,0,1,4,1),([3],[3],4))
check('empty slice',solve([5],[2],7,0,3,3,2),([0],[4],13))
check('single element',solve([4],[5],0,0,2,3,3),([1],[15],10))
check('overshoot stop',solve([N],[1],2,0,0,N,2),([(N+1)//2],[2],2))
check('start at end',solve([4],[3],5,0,4,4,2),([0],[6],17))
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
odd length[[4], [4], 6][[2], [4], 6]Failed
unit step[[3], [3], 4][[3], [3], 4]Passed
empty slice[[0], [4], 13][[0], [4], 13]Passed
single element[[1], [15], 10][[1], [15], 10]Passed
overshoot stop[[1], [2], 2][[1], [2], 2]Passed
start at end[[0], [6], 17][[0], [6], 17]Passed

SHA-256 / 508e1346b906058f9e35eed1d007d5d2a6ce23016b9467427499102f54f14676

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, step):
    out=list(shape); out[axis]=max(0,(stop-start)//step)
    s=list(strides); s[axis]*=step
    return out,s,offset+start*strides[axis]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('odd length',solve([N+5],[2],4,0,1,N+4,2),([((N+3)+1)//2],[4],6))
check('unit step',solve([5],[3],1,0,1,4,1),([3],[3],4))
check('empty slice',solve([5],[2],7,0,3,3,2),([0],[4],13))
check('single element',solve([4],[5],0,0,2,3,3),([1],[15],10))
check('overshoot stop',solve([N],[1],2,0,0,N,2),([(N+1)//2],[2],2))
check('start at end',solve([4],[3],5,0,4,4,2),([0],[6],17))
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
odd length[[2], [4], 6][[2], [4], 6]Passed
unit step[[3], [3], 4][[3], [3], 4]Passed
empty slice[[0], [4], 13][[0], [4], 13]Passed
single element[[0], [15], 10][[1], [15], 10]Failed
overshoot stop[[0], [2], 2][[1], [2], 2]Failed
start at end[[0], [6], 17][[0], [6], 17]Passed

SHA-256 / 93aea4d6b4a8b6f5312b66bff5eab4491751cd454ae7fe6d48d75913ab364fa1

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

Case digest / f92bb05e62989c3d6029af46574646dabb6f3639313115a0488842bbe4df0e92