FAILURE MAP
← Case archive

FA-12876 / Numerical aggregation / Open access

Absolute deviation about anchor: Contributions below the anchor are discarded. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Contributions below the anchor are discarded.

VERIFIED REPAIR

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

Unsuccessful approach: Clamping observations at zero is not absolute deviation.

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 sum(max(0,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 148Failed
regression 200Passed
regression 300Passed
regression 408Failed
regression 557Failed
variable anchor47Failed

SHA-256 / 4db8193a426190298dd2d2288fc6fbe68ef2b051e6fec57c241cd788fcaf6795

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(max(0,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 448Failed
regression 577Passed
variable anchor57Failed

SHA-256 / ca656081135c4c3e6ca62fe746365de55fa506583a5311a8ae9aa045ad90bacc

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

Case digest / be9689ca49eda9a6db75a69b6cf7bf3be9d475823ace3e47c88601ebb3cd9cd8