FAILURE MAP
← Case archive

FA-100451 / Sparse tensor canonicalization / Open access

Sparse tensor: coalesced zero values remain stored · case 01

coalesced zero values remain stored.

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

ROOT CAUSE

A coordinate is retained even when duplicate contributions cancel exactly.

THE FAILURE

A coordinate is retained even when duplicate contributions cancel exactly.

Unsuccessful approach: Filtering inputs loses zero-valued no-op entries but cannot remove a nonzero coordinate that becomes zero only after coalescing.

Case contract

Sum duplicate coordinates and omit coordinates whose final integer value is zero.

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)]=out.get((r,c),0)+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('cancellation',solve([[0,0,N],[0,0,-N]]),[])
check('retain nonzero',solve([[0,1,N],[0,1,2]]),[[0,1,N+2]])
check('explicit zero',solve([[1,1,0]]),[])
check('empty',solve([]),[])
check('partial cancel',solve([[0,0,N+2],[0,0,-1]]),[[0,0,N+1]])
check('mixed',solve([[1,0,3],[0,2,0],[1,0,-3]]),[])
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
cancellation[[0, 0, 0]][]Failed
retain nonzero[[0, 1, 3]][[0, 1, 3]]Passed
explicit zero[[1, 1, 0]][]Failed
empty[][]Passed
partial cancel[[0, 0, 2]][[0, 0, 2]]Passed
mixed[[0, 2, 0], [1, 0, 0]][]Failed

SHA-256 / 37a3f1b0574ce9e1c86b76e2d830b7ed21f2567bb96a64f7f054db92c7f68045

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:
     if v: out[(r,c)]=out.get((r,c),0)+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('cancellation',solve([[0,0,N],[0,0,-N]]),[])
check('retain nonzero',solve([[0,1,N],[0,1,2]]),[[0,1,N+2]])
check('explicit zero',solve([[1,1,0]]),[])
check('empty',solve([]),[])
check('partial cancel',solve([[0,0,N+2],[0,0,-1]]),[[0,0,N+1]])
check('mixed',solve([[1,0,3],[0,2,0],[1,0,-3]]),[])
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
cancellation[[0, 0, 0]][]Failed
retain nonzero[[0, 1, 3]][[0, 1, 3]]Passed
explicit zero[][]Passed
empty[][]Passed
partial cancel[[0, 0, 2]][[0, 0, 2]]Passed
mixed[[1, 0, 0]][]Failed

SHA-256 / 855f85533c8a8ad3a6e7bd18e397fd32f56fe016644a0a1745a33371fd1880e0

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

Case digest / 87a9c383c6e05db333b5b1b80622336bf00a57af79c3dc9444d0c2f103c50cb8