FA-12466 / Molecular graph representation / Open access
Materialized hydrogens are counted twice · case 01
Materialized hydrogens are counted twice.
ROOT CAUSE
The cached total hydrogen annotation is added to explicit neighbors.
VERIFIED REPAIR
Implement the explicit toy representation contract: Annotation total is either None or total attached hydrogen count including materialized H neighbors. Return total if present, otherwise explicit neighbor H count; counts are nonnegative and present totals are at least explicit count.
Unsuccessful approach: Ignoring cached total loses nonmaterialized hydrogens.
Case contract
Annotation total is either None or total attached hydrogen count including materialized H neighbors. Return total if present, otherwise explicit neighbor H count; counts are nonnegative and present totals are at least explicit count.
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(neighbors, total):
return neighbors.count("H") + (total or 0)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed explicit implicit', solve(['H','C'], N+1), N+1)
check('all explicit', solve(['H','H'], 2), 2)
check('none materialized', solve(['C'], N), N)
check('no annotation', solve(['H','C'], None), 1)
check('zero total', solve([], 0), 0)
check('empty unknown', solve([], None), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| mixed explicit implicit | 3 | 2 | Failed |
| all explicit | 4 | 2 | Failed |
| none materialized | 1 | 1 | Passed |
| no annotation | 1 | 1 | Passed |
| zero total | 0 | 0 | Passed |
| empty unknown | 0 | 0 | Passed |
SHA-256 / e19eaef02d35d0c3ce8b802492dd807aee4e875f0ae0a41be2e568c80c6d3bec
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(neighbors, total):
return neighbors.count("H")
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed explicit implicit', solve(['H','C'], N+1), N+1)
check('all explicit', solve(['H','H'], 2), 2)
check('none materialized', solve(['C'], N), N)
check('no annotation', solve(['H','C'], None), 1)
check('zero total', solve([], 0), 0)
check('empty unknown', solve([], None), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| mixed explicit implicit | 1 | 2 | Failed |
| all explicit | 2 | 2 | Passed |
| none materialized | 0 | 1 | Failed |
| no annotation | 1 | 1 | Passed |
| zero total | 0 | 0 | Passed |
| empty unknown | 0 | 0 | Passed |
SHA-256 / 30f66e63226830e8390a3a3336752de2bcc999d974bc0ca104d1c0e897082bdf
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(neighbors, total):
return neighbors.count("H") if total is None else total
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('mixed explicit implicit', solve(['H','C'], N+1), N+1)
check('all explicit', solve(['H','H'], 2), 2)
check('none materialized', solve(['C'], N), N)
check('no annotation', solve(['H','C'], None), 1)
check('zero total', solve([], 0), 0)
check('empty unknown', solve([], None), 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| mixed explicit implicit | 2 | 2 | Passed |
| all explicit | 2 | 2 | Passed |
| none materialized | 1 | 1 | Passed |
| no annotation | 1 | 1 | Passed |
| zero total | 0 | 0 | Passed |
| empty unknown | 0 | 0 | Passed |
SHA-256 / 54965e0e36afaa5e068ddfe2b087d4d0e6dbda425dc5aa1aadc7ea1bb29d1e5e
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.220108+00:00.
Case digest / 526226625076ad5050840bb3d2c87b72293d97f5ca131bb6f28b1b79f81cfe33