FAILURE MAP
← Case archive

FA-13431 / Numerical aggregation / Open access

Empirical transport distance: Signed CDF differences cancel before absolute value. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Signed CDF differences cancel before absolute value.

THE FAILURE

Signed CDF differences cancel before absolute value.

Unsuccessful approach: Leaving the signed result computes mean displacement rather than transport cost.

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+=(pa-pb)*(points[i+1]-x)
    return str(abs(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 11/217/6Failed
regression 255Passed
regression 300Passed
regression 4NoneNonePassed
regression 520/320/3Passed
regression 62/34/3Failed
regression 704Failed
variable transport span11Passed

SHA-256 / d8c90b320be13499d6e950ae79d88f301f16e8b3e9c04d25178f6f4558f69a23

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+=(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 1-1/217/6Failed
regression 255Passed
regression 300Passed
regression 4NoneNonePassed
regression 520/320/3Passed
regression 62/34/3Failed
regression 704Failed
variable transport span11Passed

SHA-256 / f239be0f7b93673c4baefedba9691d667b64d0cff503d0b5aef0b9e62d8ed75f

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 71954716431ad78f099649ba5d44f04f25c5ec121c24c139d9f15dbafb2dc50c