FAILURE MAP
← Case archive

FA-13016 / Numerical aggregation / Open access

Histogram interval mass: An intersecting bin contributes all of its mass. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

An intersecting bin contributes all of its mass.

VERIFIED REPAIR

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

Unsuccessful approach: Requiring full containment instead drops partially overlapping 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(m for l,r,m in bins if l<b and r>a)) 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 11111/2Failed
regression 282Failed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 81814Failed
variable density mass62Failed

SHA-256 / 40a467e08a6dee1a78f3cf032588f7c48645507ea9bba43f1f7f7ff83322af47

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(sum(m for l,r,m in bins if a<=l and r<=b)) 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 1011/2Failed
regression 202Failed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 81014Failed
variable density mass02Failed

SHA-256 / ced5f95e4b6cb1f8745c0334bb4ca963ded659de281c13dd1c9997a62c099f2f

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

Case digest / 9e4153ef3a6738396e1d26a68d7bec0476de405d493a3c14a133329453271b85