FAILURE MAP
← Case archive

FA-13041 / Numerical aggregation / Open access

Histogram interval mass: Density is truncated before integration. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Density is truncated before integration.

VERIFIED REPAIR

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

Unsuccessful approach: Truncating each fractional contribution still loses exact mass.

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//(r-l))*max(0,min(r,b)-max(l,a)) 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 81414Passed
variable density mass22Passed

SHA-256 / 030d804d5c232eb4b6a305299646a9278efae567bd461b93a0db30da927539df

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*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 1511/2Failed
regression 222Passed
regression 388Passed
regression 400Passed
regression 500Passed
regression 600Passed
regression 700Passed
regression 81414Passed
variable density mass22Passed

SHA-256 / 5b2571491333c7246aec92aa23f85c877b9acb32058b95d0a7b4bbcbcc031e6d

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

Case digest / b6c9e09d281458a83e5389b499ecf449080388b504f058b8b0bf0d64a504f330