FA-100441 / Sparse tensor canonicalization / Open access
Sparse tensor: duplicate coordinates are overwritten instead of summed · case 01
duplicate coordinates are overwritten instead of summed.
ROOT CAUSE
Direct assignment discards earlier contributions at a coordinate.
THE FAILURE
Direct assignment discards earlier contributions at a coordinate.
Unsuccessful approach: Keeping the first value fixes overwrite order dependence but still omits subsequent contributions.
Case contract
Entries are [row,column,value]. Return lexically sorted coordinate/value rows, summing all values at equal coordinates.
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):
out={}
for r,c,v in entries: out[(r,c)]=v
return [[r,c,v] for (r,c),v in sorted(out.items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate add',solve([[0,1,N],[0,1,2]]),[[0,1,N+2]])
check('several cells',solve([[1,0,3],[0,1,N],[1,0,4]]),[[0,1,N],[1,0,7]])
check('empty',solve([]),[])
check('single',solve([[N,0,5]]),[[N,0,5]])
check('negative values',solve([[0,0,-N],[0,0,1]]),[[0,0,1-N]])
check('cancel',solve([[0,0,N],[0,0,-N]]),[[0,0,0]])
check('unique entries',solve([[1,2,4],[0,3,8]]),[[0,3,8],[1,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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| duplicate add | [[0, 1, 2]] | [[0, 1, 3]] | Failed |
| several cells | [[0, 1, 1], [1, 0, 4]] | [[0, 1, 1], [1, 0, 7]] | Failed |
| empty | [] | [] | Passed |
| single | [[1, 0, 5]] | [[1, 0, 5]] | Passed |
| negative values | [[0, 0, 1]] | [[0, 0, 0]] | Failed |
| cancel | [[0, 0, -1]] | [[0, 0, 0]] | Failed |
| unique entries | [[0, 3, 8], [1, 2, 4]] | [[0, 3, 8], [1, 2, 4]] | Passed |
SHA-256 / fc90576f96d576fcf695ec2dd1458565c35807cd25b0472399347a46069f686e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(entries):
out={}
for r,c,v in entries: out[(r,c)]=out.get((r,c),v)
return [[r,c,v] for (r,c),v in sorted(out.items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('duplicate add',solve([[0,1,N],[0,1,2]]),[[0,1,N+2]])
check('several cells',solve([[1,0,3],[0,1,N],[1,0,4]]),[[0,1,N],[1,0,7]])
check('empty',solve([]),[])
check('single',solve([[N,0,5]]),[[N,0,5]])
check('negative values',solve([[0,0,-N],[0,0,1]]),[[0,0,1-N]])
check('cancel',solve([[0,0,N],[0,0,-N]]),[[0,0,0]])
check('unique entries',solve([[1,2,4],[0,3,8]]),[[0,3,8],[1,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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| duplicate add | [[0, 1, 1]] | [[0, 1, 3]] | Failed |
| several cells | [[0, 1, 1], [1, 0, 3]] | [[0, 1, 1], [1, 0, 7]] | Failed |
| empty | [] | [] | Passed |
| single | [[1, 0, 5]] | [[1, 0, 5]] | Passed |
| negative values | [[0, 0, -1]] | [[0, 0, 0]] | Failed |
| cancel | [[0, 0, 1]] | [[0, 0, 0]] | Failed |
| unique entries | [[0, 3, 8], [1, 2, 4]] | [[0, 3, 8], [1, 2, 4]] | Passed |
SHA-256 / dcb301e022d0fddf7cee4a1a717033d1fa6429d2da7f9cee5a8dc9e3395b2d08
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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.784922+00:00.
Case digest / cff760ae59bc69ead0a06f269986d8b39d0d9d0b61ad8eeaf0ec150546489f23