FAILURE MAP
← Case archive

FA-13426 / Numerical aggregation / Open access

Empirical transport distance: Area uses the CDF state before its left-boundary jumps. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Area uses the CDF state before its left-boundary jumps.

VERIFIED REPAIR

Preserve the empirical transport distance contract at the identified reduction decision.

Unsuccessful approach: Delaying only one sample jump misaligns the two CDFs.

Case contract

For nonempty integer samples with equal total probability after separate normalization, return integral of absolute CDF difference over the real line as a Fraction string. Empty either side returns None.

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(a, b):
    if not a or not b: return None
    ca,cb=Counter(a),Counter(b)
    points=sorted(set(ca)|set(cb))
    pa=pb=Fraction(0)
    area=Fraction(0)
    for i,x in enumerate(points[:-1]):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        area+=abs((pa-Fraction(ca[x],len(a)))-(pb-Fraction(cb[x],len(b))))*(points[i+1]-x)
    return str(area)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([0, 0, 9], [1, 4])), '17/6')
check('regression 2', solve(*([2], [7])), '5')
check('regression 3', solve(*([1, 2], [1, 2])), '0')
check('regression 4', solve(*([], [1])), None)
check('regression 5', solve(*([-8, -1, 4], [-3, 9, 9])), '20/3')
check('regression 6', solve(*([0, 2, 8], [0, 8])), '4/3')
check('regression 7', solve(*([0, 10], [4, 6])), '4')
check("variable transport span",solve([0],[N]),str(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 117/617/6Passed
regression 205Failed
regression 300Passed
regression 4NoneNonePassed
regression 57/320/3Failed
regression 614/3Failed
regression 714Failed
variable transport span01Failed

SHA-256 / 93dbac93875ff0d03d773a6ec5b8fb19a6e5e2420c74eb78d09ebe24519a7477

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(a, b):
    if not a or not b: return None
    ca,cb=Counter(a),Counter(b)
    points=sorted(set(ca)|set(cb))
    pa=pb=Fraction(0)
    area=Fraction(0)
    for i,x in enumerate(points[:-1]):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        area+=abs((pa-Fraction(ca[x],len(a)))-pb)*(points[i+1]-x)
    return str(area)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([0, 0, 9], [1, 4])), '17/6')
check('regression 2', solve(*([2], [7])), '5')
check('regression 3', solve(*([1, 2], [1, 2])), '0')
check('regression 4', solve(*([], [1])), None)
check('regression 5', solve(*([-8, -1, 4], [-3, 9, 9])), '20/3')
check('regression 6', solve(*([0, 2, 8], [0, 8])), '4/3')
check('regression 7', solve(*([0, 10], [4, 6])), '4')
check("variable transport span",solve([0],[N]),str(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 113/617/6Failed
regression 205Failed
regression 31/20Failed
regression 4NoneNonePassed
regression 55/320/3Failed
regression 624/3Failed
regression 724Failed
variable transport span01Failed

SHA-256 / 6eda354ee79d9a5010ace1504b08f4c2e8b6cf16f714368b7df04c5b621748ae

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(a, b):
    if not a or not b: return None
    ca,cb=Counter(a),Counter(b)
    points=sorted(set(ca)|set(cb))
    pa=pb=Fraction(0)
    area=Fraction(0)
    for i,x in enumerate(points[:-1]):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        area+=abs(pa-pb)*(points[i+1]-x)
    return str(area)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([0, 0, 9], [1, 4])), '17/6')
check('regression 2', solve(*([2], [7])), '5')
check('regression 3', solve(*([1, 2], [1, 2])), '0')
check('regression 4', solve(*([], [1])), None)
check('regression 5', solve(*([-8, -1, 4], [-3, 9, 9])), '20/3')
check('regression 6', solve(*([0, 2, 8], [0, 8])), '4/3')
check('regression 7', solve(*([0, 10], [4, 6])), '4')
check("variable transport span",solve([0],[N]),str(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 117/617/6Passed
regression 255Passed
regression 300Passed
regression 4NoneNonePassed
regression 520/320/3Passed
regression 64/34/3Passed
regression 744Passed
variable transport span11Passed

SHA-256 / aedf34f7a9c69f0b5617f3aefe986b52030289190148a5521303189b768a7b17

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

Case digest / f01d0769652431a10ee28a5e9f06624e89b1beb3038d469b49d2b909c0605cf6