FAILURE MAP
← Case archive

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

Tensor views: broadcast aligns dimensions from the right · case 01

broadcast aligns dimensions from the right.

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

ROOT CAUSE

Broadcast dimensions pair from the trailing axes; leading axes are implicitly size one.

THE FAILURE

Broadcast dimensions pair from the trailing axes; leading axes are implicitly size one.

Unsuccessful approach: Padding the trailing side pairs unrelated axes when input ranks differ.

Case contract

Return broadcasted shape for two shapes, treating missing leading dimensions as one; incompatible sizes excluded.

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(left, right):
    return [max(a,b) for a,b in zip(left,right)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leading rank',solve([4,1,3],[4]),[4,1,4])
check('two ranks',solve([2,N],[1,N]),[2,N])
check('both scalar',solve([],[]),[])
check('one scalar',solve([], [N,2]),[N,2])
check('single trailing',solve([1],[N]),[N])
check('unit expansion',solve([2,1],[1,4]),[2,4])
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
leading rank[4][4, 1, 4]Failed
two ranks[2, 1][2, 1]Passed
both scalar[][]Passed
one scalar[][1, 2]Failed
single trailing[1][1]Passed
unit expansion[2, 4][2, 4]Passed

SHA-256 / 320db64d684dd5289059b0c4f61b697932d53cb02b57c56b9f69e8d47203203c

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(left, right):
    rank=max(len(left),len(right))
    a=list(left)+[1]*(rank-len(left)); b=list(right)+[1]*(rank-len(right))
    return [max(x,y) for x,y in zip(a,b)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leading rank',solve([4,1,3],[4]),[4,1,4])
check('two ranks',solve([2,N],[1,N]),[2,N])
check('both scalar',solve([],[]),[])
check('one scalar',solve([], [N,2]),[N,2])
check('single trailing',solve([1],[N]),[N])
check('unit expansion',solve([2,1],[1,4]),[2,4])
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
leading rank[4, 1, 3][4, 1, 4]Failed
two ranks[2, 1][2, 1]Passed
both scalar[][]Passed
one scalar[1, 2][1, 2]Passed
single trailing[1][1]Passed
unit expansion[2, 4][2, 4]Passed

SHA-256 / 9b272b2fece96377d16651f004f94900221707577e3c043186f203f1f71ff839

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

Case digest / 38705aa8978e19c21a10eb50f70b01f3efe8ce7c7a0967c6ef1313721569e243