FAILURE MAP
← Case archive

FA-13451 / Numerical aggregation / Open access

Empirical transport distance: Support gaps are forced to at least one even after normalization. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

Support gaps are forced to at least one even after normalization.

VERIFIED REPAIR

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

Unsuccessful approach: Subtracting a unit treats continuous gap length as interior lattice-point count.

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-pb)*(points[i+1]-x+1)
    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 1417/6Failed
regression 265Failed
regression 300Passed
regression 4NoneNonePassed
regression 5820/3Failed
regression 65/34/3Failed
regression 754Failed
variable transport span21Failed

SHA-256 / 7f831ec05fb198223e8db985e425f8149ced9f71566a6e6395858416f23ef524

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-pb)*max(0,points[i+1]-x-1)
    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 15/317/6Failed
regression 245Failed
regression 300Passed
regression 4NoneNonePassed
regression 516/320/3Failed
regression 614/3Failed
regression 734Failed
variable transport span01Failed

SHA-256 / b470f3b1bd1496c5c8a2539407a8175f0bb1b24668f41c591ee7dad60dd81654

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

Case digest / d4277243dc71a7bbf6336b7a52ccb6071305713ecac9172f792de9632a294b74