FAILURE MAP
← Case archive

FA-13841 / Numerical aggregation / Open access

Huber residual total: Residuals are summed before applying the nonlinear loss. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Residuals are summed before applying the nonlinear loss.

THE FAILURE

Residuals are summed before applying the nonlinear loss.

Unsuccessful approach: Summing magnitudes first creates cross terms within the quadratic region.

Case contract

For integer residuals and nonnegative integer threshold delta, sum the convex Huber loss: e**2/2 inside threshold and delta*(abs(e)-delta/2) outside. Return exact Fraction string; this is a bounded loss reduction, not an optimizer.

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(errors, delta):
    if not errors: return "0"
    d=Fraction(delta)
    total=Fraction(0)
    for e in [sum(errors)]:
        a=abs(e)
        total+=Fraction(e*e,2) if a<=d else d*(a-d/2)
    return str(total)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([2, 2, 4], 2)), '10')
check('regression 2', solve(*([0, 1, -1, 4, -4], 2)), '13')
check('regression 3', solve(*([], 2)), '0')
check('regression 4', solve(*([2, -2], 2)), '4')
check('regression 5', solve(*([1, -1, 3], 1)), '7/2')
check('regression 6', solve(*([-5, 0, 2], 3)), '25/2')
check('regression 7', solve(*([7, -2, 1], 0)), '0')
check('regression 8', solve(*([1, 2, 3], 4)), '7')
check("variable Huber tail",solve([N+2,-N-2],2),str(4*N+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 fixtureActualExpectedOutcome
regression 11410Failed
regression 2013Failed
regression 300Passed
regression 404Failed
regression 55/27/2Failed
regression 69/225/2Failed
regression 700Passed
regression 8167Failed
variable Huber tail08Failed

SHA-256 / 360d0319b20792dcc2c5540af9b9922ee98d96e16149763a6e15c0895a546681

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(errors, delta):
    if not errors: return "0"
    d=Fraction(delta)
    total=Fraction(0)
    for e in [sum(abs(v) for v in errors)]:
        a=abs(e)
        total+=Fraction(e*e,2) if a<=d else d*(a-d/2)
    return str(total)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([2, 2, 4], 2)), '10')
check('regression 2', solve(*([0, 1, -1, 4, -4], 2)), '13')
check('regression 3', solve(*([], 2)), '0')
check('regression 4', solve(*([2, -2], 2)), '4')
check('regression 5', solve(*([1, -1, 3], 1)), '7/2')
check('regression 6', solve(*([-5, 0, 2], 3)), '25/2')
check('regression 7', solve(*([7, -2, 1], 0)), '0')
check('regression 8', solve(*([1, 2, 3], 4)), '7')
check("variable Huber tail",solve([N+2,-N-2],2),str(4*N+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 fixtureActualExpectedOutcome
regression 11410Failed
regression 21813Failed
regression 300Passed
regression 464Failed
regression 59/27/2Failed
regression 633/225/2Failed
regression 700Passed
regression 8167Failed
variable Huber tail108Failed

SHA-256 / 0db15317d4367089d6df1441e867777a0ba649a6c19de896cb949b9835f13dcc

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 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

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

Case digest / 8b4efe42211e89fdfd49926fa2adc47786722abe6d937f09b9ddcd3899211cd2