FAILURE MAP
← Case archive

FA-12881 / Numerical aggregation / Open access

Absolute deviation about anchor: The supplied anchor is replaced by the sample mean. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The supplied anchor is replaced by the sample mean.

VERIFIED REPAIR

Preserve the absolute deviation about anchor contract at the identified reduction decision.

Unsuccessful approach: Replacing the mean by the first observation still ignores the supplied anchor.

Case contract

Return sum(abs(x-anchor)); empty input returns zero. Anchor is supplied, not estimated.

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, anchor):
    return str(sum(abs(Fraction(x)-Fraction(sum(xs),len(xs))) for x in xs)) if xs else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 5, 9], 5)), 8)
check('regression 2', solve(*([], 4)), 0)
check('regression 3', solve(*([4, 4], 4)), 0)
check('regression 4', solve(*([-3, -1], 2)), 8)
check('regression 5', solve(*([0, 0, 6], 1)), 7)
check("variable anchor", solve([N-3,N+2,N+2],N),7)
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 188Failed
regression 200Passed
regression 300Failed
regression 428Failed
regression 587Failed
variable anchor20/37Failed

SHA-256 / e22ec899a2f42bdae3d8d580ae637a287c8faf2b127ee7848bf851291c649f99

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, anchor):
    return sum(abs(x-xs[0]) for x in xs) if xs else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 5, 9], 5)), 8)
check('regression 2', solve(*([], 4)), 0)
check('regression 3', solve(*([4, 4], 4)), 0)
check('regression 4', solve(*([-3, -1], 2)), 8)
check('regression 5', solve(*([0, 0, 6], 1)), 7)
check("variable anchor", solve([N-3,N+2,N+2],N),7)
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 1128Failed
regression 200Passed
regression 300Passed
regression 428Failed
regression 567Failed
variable anchor107Failed

SHA-256 / 32aa33d28b54d8e4f3a338dbae1741bd4b038ddc018e3827553f2b39817b2f01

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, anchor):
    return sum(abs(x-anchor) for x in xs)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 5, 9], 5)), 8)
check('regression 2', solve(*([], 4)), 0)
check('regression 3', solve(*([4, 4], 4)), 0)
check('regression 4', solve(*([-3, -1], 2)), 8)
check('regression 5', solve(*([0, 0, 6], 1)), 7)
check("variable anchor", solve([N-3,N+2,N+2],N),7)
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 188Passed
regression 200Passed
regression 300Passed
regression 488Passed
regression 577Passed
variable anchor77Passed

SHA-256 / fdf32ae20efa0796e6f0e4a7625899e2afdf6315c10f56c9ba996a64f78c8aa0

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

Case digest / a7dbab7fd8fe5fcc47b259f9c40d20f7bce8a0307405d14c5fe725b3781515e8