FA-13041 / Numerical aggregation / Open access
Histogram interval mass: Density is truncated before integration. · case 01
The reduction disagrees with its explicit aggregation oracle.
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 4 | 11/2 | Failed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | 8 | 8 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 0 | 0 | Passed |
| regression 6 | 0 | 0 | Passed |
| regression 7 | 0 | 0 | Passed |
| regression 8 | 14 | 14 | Passed |
| variable density mass | 2 | 2 | Passed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 5 | 11/2 | Failed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | 8 | 8 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 0 | 0 | Passed |
| regression 6 | 0 | 0 | Passed |
| regression 7 | 0 | 0 | Passed |
| regression 8 | 14 | 14 | Passed |
| variable density mass | 2 | 2 | Passed |
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 11/2 | 11/2 | Passed |
| regression 2 | 2 | 2 | Passed |
| regression 3 | 8 | 8 | Passed |
| regression 4 | 0 | 0 | Passed |
| regression 5 | 0 | 0 | Passed |
| regression 6 | 0 | 0 | Passed |
| regression 7 | 0 | 0 | Passed |
| regression 8 | 14 | 14 | Passed |
| variable density mass | 2 | 2 | Passed |
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