FAILURE MAP
← Case archive

FA-12896 / Numerical aggregation / Open access

Clipped contribution sum: Outliers are dropped instead of contributing their clipped endpoint. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Outliers are dropped instead of contributing their clipped endpoint.

VERIFIED REPAIR

Preserve the clipped contribution sum contract at the identified reduction decision.

Unsuccessful approach: Only high outliers are clipped; low outliers are still dropped.

Case contract

For lo<=hi, clip each integer contribution into [lo,hi], then sum. Empty is zero.

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, lo, hi):
    return sum(x for x in xs if lo<=x<=hi)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([-9, 2, 8], 0, 5)), 7)
check('regression 2', solve(*([], 1, 3)), 0)
check('regression 3', solve(*([1, 2, 3], 0, 5)), 6)
check('regression 4', solve(*([-4, -2], -3, -1)), -5)
check('regression 5', solve(*([0, 0, 9], 2, 4)), 8)
check("variable cap", solve([0,N,N*4],1,N+1),2*N+2)
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 127Failed
regression 200Passed
regression 366Passed
regression 4-2-5Failed
regression 508Failed
variable cap14Failed

SHA-256 / 73c634a9d9a7181f2f8a4331b3a2c060a44d2b1b3dcb82253c45200b6bbee356

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, lo, hi):
    return sum(min(hi,x) for x in xs if x>=lo)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([-9, 2, 8], 0, 5)), 7)
check('regression 2', solve(*([], 1, 3)), 0)
check('regression 3', solve(*([1, 2, 3], 0, 5)), 6)
check('regression 4', solve(*([-4, -2], -3, -1)), -5)
check('regression 5', solve(*([0, 0, 9], 2, 4)), 8)
check("variable cap", solve([0,N,N*4],1,N+1),2*N+2)
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 177Passed
regression 200Passed
regression 366Passed
regression 4-2-5Failed
regression 548Failed
variable cap34Failed

SHA-256 / 2aa7e74fb3cd4ac87c877adc4817ef9924c37a07f272bea3b94362ba58244ff8

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, lo, hi):
    return sum(min(hi,max(lo,x)) for x in xs)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([-9, 2, 8], 0, 5)), 7)
check('regression 2', solve(*([], 1, 3)), 0)
check('regression 3', solve(*([1, 2, 3], 0, 5)), 6)
check('regression 4', solve(*([-4, -2], -3, -1)), -5)
check('regression 5', solve(*([0, 0, 9], 2, 4)), 8)
check("variable cap", solve([0,N,N*4],1,N+1),2*N+2)
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 177Passed
regression 200Passed
regression 366Passed
regression 4-5-5Passed
regression 588Passed
variable cap44Passed

SHA-256 / 292d2346600b360db4ccacda4326c8fc92cbbdeeb13fc7443e3492b695c3e822

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

Case digest / 98182d5194fe70d9821add73eff2d90b97cbb9ff8f94a5e5c4db14542e526060