FAILURE MAP
← Case archive

FA-13831 / Numerical aggregation / Open access

Huber residual total: The quadratic branch threshold is compared to squared residual magnitude. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The quadratic branch threshold is compared to squared residual magnitude.

THE FAILURE

The quadratic branch threshold is compared to squared residual magnitude.

Unsuccessful approach: Squaring the threshold instead moves the quadratic/linear transition.

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 errors:
        a=abs(e)
        total+=Fraction(e*e,2) if a*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 11010Passed
regression 21313Passed
regression 300Passed
regression 444Passed
regression 57/27/2Passed
regression 61225/2Failed
regression 700Passed
regression 813/27Failed
variable Huber tail88Passed

SHA-256 / 6c35c9929e91a0e5a5475b522f7cce82102399d0cfef33b3f8dc747b924ff4f3

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 errors:
        a=abs(e)
        total+=Fraction(e*e,2) if a<=d*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 11210Failed
regression 21713Failed
regression 300Passed
regression 444Passed
regression 57/27/2Passed
regression 629/225/2Failed
regression 700Passed
regression 877Passed
variable Huber tail98Failed

SHA-256 / 389509241390e8441d1f26f85f9872febbcbb7cfc056c1f4a62c06a4eb96a2fa

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 / a5eba82c5595e366045dc8a0648b4a5520eb38c1c637ee07da63f5475245e5b0