FAILURE MAP
← Case archive

FA-12846 / Numerical aggregation / Open access

Signed channel totals: The negative subtotal loses its sign. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The negative subtotal loses its sign.

VERIFIED REPAIR

Preserve the signed channel totals contract at the identified reduction decision.

Unsuccessful approach: Negating every value also negates the positive subtotal.

Case contract

Return [positive total, negative total, zero count] for an integer sequence; preserve signs and multiplicity.

Why this case matters

Exact bounded examples isolate a reduction defect without floating-point or external-service effects.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    return [sum(x for x in xs if x>0),sum(abs(x) for x in xs if x<0),xs.count(0)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3, -2, 0, 3, -4, 0],)), [6, -6, 2])
check('regression 2', solve(*([],)), [0, 0, 0])
check('regression 3', solve(*([0, 0, 0],)), [0, 0, 3])
check('regression 4', solve(*([-8, -2],)), [0, -10, 0])
check('regression 5', solve(*([2, 2, 7],)), [11, 0, 0])
check("variable signed channels", solve([N,-N,0,N]), [2*N,-N,1])
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
regression 1[6, 6, 2][6, -6, 2]Failed
regression 2[0, 0, 0][0, 0, 0]Passed
regression 3[0, 0, 3][0, 0, 3]Passed
regression 4[0, 10, 0][0, -10, 0]Failed
regression 5[11, 0, 0][11, 0, 0]Passed
variable signed channels[2, 1, 1][2, -1, 1]Failed

SHA-256 / 1a05b2f27a3ea4b9056898649c1cb88f1d87dc8550a754d5b46fdd826478e852

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    return [-sum(x for x in xs if x>0),sum(x for x in xs if x<0),xs.count(0)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3, -2, 0, 3, -4, 0],)), [6, -6, 2])
check('regression 2', solve(*([],)), [0, 0, 0])
check('regression 3', solve(*([0, 0, 0],)), [0, 0, 3])
check('regression 4', solve(*([-8, -2],)), [0, -10, 0])
check('regression 5', solve(*([2, 2, 7],)), [11, 0, 0])
check("variable signed channels", solve([N,-N,0,N]), [2*N,-N,1])
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
regression 1[-6, -6, 2][6, -6, 2]Failed
regression 2[0, 0, 0][0, 0, 0]Passed
regression 3[0, 0, 3][0, 0, 3]Passed
regression 4[0, -10, 0][0, -10, 0]Passed
regression 5[-11, 0, 0][11, 0, 0]Failed
variable signed channels[-2, -1, 1][2, -1, 1]Failed

SHA-256 / c2ba639f7ad528a47fabc40c08a635d1f8c0ee8ed08d64ac9c7639c5d51ffaac

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(xs):
    return [sum(x for x in xs if x>0), sum(x for x in xs if x<0), xs.count(0)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3, -2, 0, 3, -4, 0],)), [6, -6, 2])
check('regression 2', solve(*([],)), [0, 0, 0])
check('regression 3', solve(*([0, 0, 0],)), [0, 0, 3])
check('regression 4', solve(*([-8, -2],)), [0, -10, 0])
check('regression 5', solve(*([2, 2, 7],)), [11, 0, 0])
check("variable signed channels", solve([N,-N,0,N]), [2*N,-N,1])
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
regression 1[6, -6, 2][6, -6, 2]Passed
regression 2[0, 0, 0][0, 0, 0]Passed
regression 3[0, 0, 3][0, 0, 3]Passed
regression 4[0, -10, 0][0, -10, 0]Passed
regression 5[11, 0, 0][11, 0, 0]Passed
variable signed channels[2, -1, 1][2, -1, 1]Passed

SHA-256 / 78a7955d2be7a67187873c2aed8d1ea9bd0e81f6fbe78c695ab3204ec5a175d8

Verification & scope

Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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:39:00.797323+00:00.

Case digest / 810207848a597723621c18bb5203adb5c5268506464e270807489e1f20daeb7b