FA-100471 / Sparse tensor canonicalization / Open access
Sparse tensor: duplicate CSR columns are retained as separate coordinates · case 01
duplicate CSR columns are retained as separate coordinates.
ROOT CAUSE
CSR rows can contain duplicate column coordinates whose values contribute to one logical cell.
THE FAILURE
CSR rows can contain duplicate column coordinates whose values contribute to one logical cell.
Unsuccessful approach: Overwrite order still discards all but one duplicate contribution.
Case contract
Within each row, sum equal columns, omit zero totals, and return canonical CSR [row_ptr,columns,values].
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(ptr,columns,values):
return [ptr,columns,values]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicates',solve([0,3],[1,1,0],[N,2,4]),[[0,2],[0,1],[4,N+2]])
check('rows isolated',solve([0,2,4],[0,0,0,0],[1,2,3,4]),[[0,1,2],[0,0],[3,7]])
check('empty',solve([0],[],[]),[[0],[],[]])
check('single',solve([0,1],[N],[6]),[[0,1],[N],[6]])
check('cancellation',solve([0,2],[0,0],[N,-N]),[[0,0],[],[]])
check('unsorted unique',solve([0,2],[2,0],[5,3]),[[0,2],[0,2],[3,5]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| duplicates | [[0, 3], [1, 1, 0], [1, 2, 4]] | [[0, 2], [0, 1], [4, 3]] | Failed |
| rows isolated | [[0, 2, 4], [0, 0, 0, 0], [1, 2, 3, 4]] | [[0, 1, 2], [0, 0], [3, 7]] | Failed |
| empty | [[0], [], []] | [[0], [], []] | Passed |
| single | [[0, 1], [1], [6]] | [[0, 1], [1], [6]] | Passed |
| cancellation | [[0, 2], [0, 0], [1, -1]] | [[0, 0], [], []] | Failed |
| unsorted unique | [[0, 2], [2, 0], [5, 3]] | [[0, 2], [0, 2], [3, 5]] | Failed |
SHA-256 / 0bfa57a57faf4c09ead5b54ba57a437fa0b1a10d9e0d00295380400d1f36c63a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(ptr,columns,values):
outp=[0]; outc=[]; outv=[]
for r in range(len(ptr)-1):
pairs=sorted(zip(columns[ptr[r]:ptr[r+1]],values[ptr[r]:ptr[r+1]]))
for c,v in pairs:
if not outc or outp[-1]==len(outc) or outc[-1]!=c: outc.append(c); outv.append(v)
else: outv[-1]=v
outp.append(len(outc))
return [outp,outc,outv]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicates',solve([0,3],[1,1,0],[N,2,4]),[[0,2],[0,1],[4,N+2]])
check('rows isolated',solve([0,2,4],[0,0,0,0],[1,2,3,4]),[[0,1,2],[0,0],[3,7]])
check('empty',solve([0],[],[]),[[0],[],[]])
check('single',solve([0,1],[N],[6]),[[0,1],[N],[6]])
check('cancellation',solve([0,2],[0,0],[N,-N]),[[0,0],[],[]])
check('unsorted unique',solve([0,2],[2,0],[5,3]),[[0,2],[0,2],[3,5]])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| duplicates | [[0, 2], [0, 1], [4, 2]] | [[0, 2], [0, 1], [4, 3]] | Failed |
| rows isolated | [[0, 1, 2], [0, 0], [2, 4]] | [[0, 1, 2], [0, 0], [3, 7]] | Failed |
| empty | [[0], [], []] | [[0], [], []] | Passed |
| single | [[0, 1], [1], [6]] | [[0, 1], [1], [6]] | Passed |
| cancellation | [[0, 1], [0], [1]] | [[0, 0], [], []] | Failed |
| unsorted unique | [[0, 2], [0, 2], [3, 5]] | [[0, 2], [0, 2], [3, 5]] | Passed |
SHA-256 / f538104b4501b921bac99fffa2bb7151b38d57c8e22f9cf4af8e3834b7c86d67
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:35.815395+00:00.
Case digest / b2945245e97809e6c83a209b6407485edbbd0331c1c04b9fdce23c053e31a53e