FAILURE MAP
← Case archive

FA-13046 / Numerical aggregation / Open access

Histogram interval mass: Bin contributions are averaged rather than accumulated. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Bin contributions are averaged rather than accumulated.

VERIFIED REPAIR

Preserve the histogram interval mass contract at the identified reduction decision.

Unsuccessful approach: Selecting the largest contribution also loses mass from other bins.

Case contract

Bins [left,right,mass] have positive widths and nonnegative integer masses. Treat each bin as uniform density. Return exact mass in query [a,b] as a Fraction string; reversed/empty queries have zero mass.

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(bins, a, b):
    return str(sum((Fraction(m*max(0,min(r,b)-max(l,a)),r-l) for l,r,m in bins),Fraction(0))/max(1,len(bins))) if a<b else "0"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[0, 4, 8], [4, 10, 3]], 2, 7)), '11/2')
check('regression 2', solve(*([[0, 4, 8]], 1, 2)), '2')
check('regression 3', solve(*([[0, 4, 8]], -3, 8)), '8')
check('regression 4', solve(*([[0, 4, 8]], 4, 9)), '0')
check('regression 5', solve(*([[0, 4, 8]], 7, 9)), '0')
check('regression 6', solve(*([], 0, 1)), '0')
check('regression 7', solve(*([[0, 4, 8]], 3, 1)), '0')
check('regression 8', solve(*([[2, 7, 10], [10, 12, 8]], 0, 11)), '14')
check("variable density mass",solve([[0,N+2,2*(N+2)]],1,N+1),str(2*N))
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 111/411/2Failed
regression 222Passed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 8714Failed
variable density mass22Passed

SHA-256 / 4d9b650ef41220fcccb01c77fc1d8702f8bd3f88da82b24a13e3a424fbde1dc4

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(bins, a, b):
    return str(max([Fraction(0)]+[Fraction(m*max(0,min(r,b)-max(l,a)),r-l) for l,r,m in bins])) if a<b else "0"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[0, 4, 8], [4, 10, 3]], 2, 7)), '11/2')
check('regression 2', solve(*([[0, 4, 8]], 1, 2)), '2')
check('regression 3', solve(*([[0, 4, 8]], -3, 8)), '8')
check('regression 4', solve(*([[0, 4, 8]], 4, 9)), '0')
check('regression 5', solve(*([[0, 4, 8]], 7, 9)), '0')
check('regression 6', solve(*([], 0, 1)), '0')
check('regression 7', solve(*([[0, 4, 8]], 3, 1)), '0')
check('regression 8', solve(*([[2, 7, 10], [10, 12, 8]], 0, 11)), '14')
check("variable density mass",solve([[0,N+2,2*(N+2)]],1,N+1),str(2*N))
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 1411/2Failed
regression 222Passed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 81014Failed
variable density mass22Passed

SHA-256 / 62069cd7df7dd5f435dfed2ef958b2777e1234cd962cd5fd71f9678294e6f5e1

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(bins, a, b):
    return str(sum((Fraction(m*max(0,min(r,b)-max(l,a)),r-l) for l,r,m in bins),Fraction(0))) if a<b else "0"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([[0, 4, 8], [4, 10, 3]], 2, 7)), '11/2')
check('regression 2', solve(*([[0, 4, 8]], 1, 2)), '2')
check('regression 3', solve(*([[0, 4, 8]], -3, 8)), '8')
check('regression 4', solve(*([[0, 4, 8]], 4, 9)), '0')
check('regression 5', solve(*([[0, 4, 8]], 7, 9)), '0')
check('regression 6', solve(*([], 0, 1)), '0')
check('regression 7', solve(*([[0, 4, 8]], 3, 1)), '0')
check('regression 8', solve(*([[2, 7, 10], [10, 12, 8]], 0, 11)), '14')
check("variable density mass",solve([[0,N+2,2*(N+2)]],1,N+1),str(2*N))
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 111/211/2Passed
regression 222Passed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 81414Passed
variable density mass22Passed

SHA-256 / 107370a03c9fab1f517251c09773874ca40a3249c1e245496d2d4461c1e39f40

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

Case digest / e809e10a088b7ae2f9a9f109749e3d8461783364acea412d4cb43e21fb435724