FAILURE MAP
← Case archive

FA-100501 / Sparse tensor canonicalization / Open access

Sparse tensor: row selection matches columns instead of rows · case 01

row selection matches columns instead of rows.

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

ROOT CAUSE

Row filtering must inspect the row coordinate and canonicalize the selected columns.

THE FAILURE

Row filtering must inspect the row coordinate and canonicalize the selected columns.

Unsuccessful approach: A threshold includes unrelated earlier rows, even though the requested row match is exact.

Case contract

Return entries from exactly the requested row, preserving their column/value pairs in column order.

Why this case matters

A small offline sparse-array operation has explicit coordinate and storage semantics.

1 / The failure

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

N = 1
observations = []
def solve(entries,row):
    return [[r,c,v] for r,c,v in entries if c==row]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('requested row',solve([[0,2,3],[1,0,4],[2,1,5]],1),[[1,0,4]])
check('different column same label',solve([[0,1,3],[1,2,4]],1),[[1,2,4]])
check('empty',solve([],N),[])
check('no match',solve([[0,0,1]],N+1),[])
check('multiple sorted',solve([[N,2,1],[N,0,3],[N,1,5]],N),[[N,0,3],[N,1,5],[N,2,1]])
check('single row',solve([[0,N,8]],0),[[0,N,8]])
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
requested row[[2, 1, 5]][[1, 0, 4]]Failed
different column same label[[0, 1, 3]][[1, 2, 4]]Failed
empty[][]Passed
no match[][]Passed
multiple sorted[[1, 1, 5]][[1, 0, 3], [1, 1, 5], [1, 2, 1]]Failed
single row[][[0, 1, 8]]Failed

SHA-256 / 2134f0aeb54ea8af39be88dd8689359eb38f6ada2fbe7ba9c1083676c33656a2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries,row):
    return [[r,c,v] for r,c,v in entries if r<=row]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('requested row',solve([[0,2,3],[1,0,4],[2,1,5]],1),[[1,0,4]])
check('different column same label',solve([[0,1,3],[1,2,4]],1),[[1,2,4]])
check('empty',solve([],N),[])
check('no match',solve([[0,0,1]],N+1),[])
check('multiple sorted',solve([[N,2,1],[N,0,3],[N,1,5]],N),[[N,0,3],[N,1,5],[N,2,1]])
check('single row',solve([[0,N,8]],0),[[0,N,8]])
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
requested row[[0, 2, 3], [1, 0, 4]][[1, 0, 4]]Failed
different column same label[[0, 1, 3], [1, 2, 4]][[1, 2, 4]]Failed
empty[][]Passed
no match[[0, 0, 1]][]Failed
multiple sorted[[1, 2, 1], [1, 0, 3], [1, 1, 5]][[1, 0, 3], [1, 1, 5], [1, 2, 1]]Failed
single row[[0, 1, 8]][[0, 1, 8]]Passed

SHA-256 / c95a7567b7805af7c5e5626ab9d42755f174bfaa9ec222d7838e32fb0c8c9338

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

These are toy integer-valued COO or CSR contracts; they make no claim about a framework API, floating point policy, or large tensor performance. 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:36.272893+00:00.

Case digest / d03f93b62ce60d6765d08e143524ae860aed34bec32c9a917fb77bc7c87ad5be