FAILURE MAP
← Case archive

FA-12481 / Molecular graph representation / Open access

Disconnected fragment charges are collapsed into a neutral flag · case 01

Disconnected fragment charges are collapsed into a neutral flag.

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

ROOT CAUSE

Opposite signs cancel before fragment-level metadata is produced.

THE FAILURE

Opposite signs cancel before fragment-level metadata is produced.

Unsuccessful approach: Taking absolute charge destroys anion signs.

Case contract

Input is an ordered list of molecular fragments, each a list of signed atom formal charges. Return per-fragment signed sums preserving order and empty fragments as zero.

Why this case matters

Controlled molecular graph interchange model; tests isolate atom or bond representation errors without claiming chemical validity or production toolkit equivalence.

1 / The failure

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

N = 1
observations = []
def solve(fragments):
    return [sum(sum(f) for f in fragments)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('salt fragments', solve([[N],[-N]]), [N,-N])
check('single anion', solve([[-N]]), [-N])
check('neutral fragment', solve([[1,-1]]), [0])
check('empty collection', solve([]), [])
check('empty fragment', solve([[],[-1]]), [0,-1])
check('multiple charged atoms', solve([[N,1],[-1,-N],[0]]), [N+1,-N-1,0])
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
salt fragments[0][1, -1]Failed
single anion[-1][-1]Passed
neutral fragment[0][0]Passed
empty collection[0][]Failed
empty fragment[-1][0, -1]Failed
multiple charged atoms[0][2, -2, 0]Failed

SHA-256 / de89a8c1761e51621d038be26b4db6efde9911c9d560497a58d7f2b835bdabb6

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(fragments):
    return [abs(sum(f)) for f in fragments]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('salt fragments', solve([[N],[-N]]), [N,-N])
check('single anion', solve([[-N]]), [-N])
check('neutral fragment', solve([[1,-1]]), [0])
check('empty collection', solve([]), [])
check('empty fragment', solve([[],[-1]]), [0,-1])
check('multiple charged atoms', solve([[N,1],[-1,-N],[0]]), [N+1,-N-1,0])
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
salt fragments[1, 1][1, -1]Failed
single anion[1][-1]Failed
neutral fragment[0][0]Passed
empty collection[][]Passed
empty fragment[0, 1][0, -1]Failed
multiple charged atoms[2, 2, 0][2, -2, 0]Failed

SHA-256 / 302cf1e3ad3292addb9fc4db6a4558d4b2fd0f7634788cbc7d3ba6b20ec481aa

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

Toy representation only; no valence inference, chemical sanitization, synthesis, or real molecular identity determination. 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-29T14:38:57.323115+00:00.

Case digest / 0d41ae20bbdd186e2404780af143311c327853eb20545e13933d21d6f5ddf515