FAILURE MAP
← Case archive

FA-12866 / Numerical aggregation / Open access

Absolute deviation about anchor: Absolute value is applied after cancellation of signed deviations. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Absolute value is applied after cancellation of signed deviations.

VERIFIED REPAIR

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

Unsuccessful approach: Taking absolute observations before subtracting the anchor breaks negative anchors.

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 abs(sum(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 108Failed
regression 200Passed
regression 300Passed
regression 488Passed
regression 537Failed
variable anchor17Failed

SHA-256 / c0d908562c866bfe197936d6f8783362164e6ab8ee682f957b23c7bf2426f10c

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(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 428Failed
regression 577Passed
variable anchor57Failed

SHA-256 / 15629fef653b444cc2cc5aac4358cc429890f923635a0d87ed9ba71127da4748

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

Case digest / d1760af3c8f2222790a106df861460d085b242b8fb0f66b9cc5fe53af7e4f47b