FAILURE MAP
← Case archive

FA-12906 / Numerical aggregation / Open access

Clipped contribution sum: The lower clipping branch is omitted. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The lower clipping branch is omitted.

VERIFIED REPAIR

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

Unsuccessful approach: Applying the lower bound to the final total misses per-item clipping.

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(min(hi,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 1-27Failed
regression 200Passed
regression 366Passed
regression 4-6-5Failed
regression 548Failed
variable cap34Failed

SHA-256 / bd6ab4652229474489565ad989718918720f9aa3ca4a20fab0e456d2d735d353

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 max(lo,sum(min(hi,x) 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(*([-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 107Failed
regression 200Passed
regression 366Passed
regression 4-3-5Failed
regression 548Failed
variable cap34Failed

SHA-256 / 61f3ca1d0d8484efb468399a5818a7b9dd42e91ee7dec236c0bf1b97ffe73d83

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

Case digest / bfb308a894c3361afaaa569eca5d1a68b21a68c840ac2c12f9383e82be85832b