FAILURE MAP
← Case archive

FA-100506 / Sparse tensor canonicalization / Open access

Sparse tensor: column projection returns all entries instead of one column · case 01

column projection returns all entries instead of one column.

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

ROOT CAUSE

Projection should select one exact column and retain each matching row/value.

THE FAILURE

Projection should select one exact column and retain each matching row/value.

Unsuccessful approach: A prefix of columns still contains values from other columns.

Case contract

Project a COO matrix onto one column and return sorted [row,value] pairs.

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,column):
    return [[r,v] for r,c,v in entries]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one column',solve([[0,0,2],[1,N,3],[2,N+1,4]],N),[[1,3]])
check('empty',solve([],N),[])
check('absent',solve([[0,0,5]],N+1),[])
check('multiple rows',solve([[2,N,8],[0,N,3],[1,0,2]],N),[[0,3],[2,8]])
check('column zero',solve([[N,0,6],[0,1,7]],0),[[N,6]])
check('singleton',solve([[0,N,4]],N),[[0,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
one column[[0, 2], [1, 3], [2, 4]][[1, 3]]Failed
empty[][]Passed
absent[[0, 5]][]Failed
multiple rows[[2, 8], [0, 3], [1, 2]][[0, 3], [2, 8]]Failed
column zero[[1, 6], [0, 7]][[1, 6]]Failed
singleton[[0, 4]][[0, 4]]Passed

SHA-256 / 4dd919ed67d7fa63b4bba9b5bd0a7326d75ff7c015e2b87262053793c19ee909

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries,column):
    return [[r,v] for r,c,v in entries if c<=column]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('one column',solve([[0,0,2],[1,N,3],[2,N+1,4]],N),[[1,3]])
check('empty',solve([],N),[])
check('absent',solve([[0,0,5]],N+1),[])
check('multiple rows',solve([[2,N,8],[0,N,3],[1,0,2]],N),[[0,3],[2,8]])
check('column zero',solve([[N,0,6],[0,1,7]],0),[[N,6]])
check('singleton',solve([[0,N,4]],N),[[0,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
one column[[0, 2], [1, 3]][[1, 3]]Failed
empty[][]Passed
absent[[0, 5]][]Failed
multiple rows[[2, 8], [0, 3], [1, 2]][[0, 3], [2, 8]]Failed
column zero[[1, 6]][[1, 6]]Passed
singleton[[0, 4]][[0, 4]]Passed

SHA-256 / 3c9ccb52d211ec19b2b009d097661877ba362e8d8c0d292f78eba7f786802f3a

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

Case digest / a9326c8525597856b4484b2b073d2c7b2e372ceda103ff6f86808921ccd91fc2