FAILURE MAP
← Case archive

FA-13406 / Numerical aggregation / Open access

Empirical cdf supremum: The final cumulative discrepancy overwrites earlier maxima. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The final cumulative discrepancy overwrites earlier maxima.

VERIFIED REPAIR

Preserve the empirical cdf supremum contract at the identified reduction decision.

Unsuccessful approach: Summing discrepancies computes an unweighted support statistic instead of a supremum.

Case contract

Return the maximum absolute difference between the right-continuous empirical cumulative distributions of two nonempty integer samples 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)
    pa=pb=Fraction(0)
    best=Fraction(0)
    for x in sorted(set(ca)|set(cb)):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        best=abs(pa-pb)
    return str(best)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3], [0])), '1')
check('regression 2', solve(*([-5, 3], [-2, 1])), '1/2')
check('regression 3', solve(*([1, 1, 4], [2, 3])), '2/3')
check('regression 4', solve(*([0, 0, 0], [0])), '0')
check('regression 5', solve(*([], [1])), None)
check('regression 6', solve(*([1, 2], [1, 2])), '0')
check('regression 7', solve(*([-5, 0, 8], [-2, 8, 8, 8])), '5/12')
check('regression 8', solve(*([0, 4], [0, 1, 2, 3, 4])), '3/10')
check('regression 9', solve(*([2, 2], [1, 1, 3, 3])), '1/2')
check("variable support",solve([0,N],[N,N]),"1/2")
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 101Failed
regression 201/2Failed
regression 302/3Failed
regression 400Passed
regression 5NoneNonePassed
regression 600Passed
regression 705/12Failed
regression 803/10Failed
regression 901/2Failed
variable support01/2Failed

SHA-256 / 61ef88d3cb6a9a64ce0252bd1fcb3fb33f4b9f6076101b5c0cb2bcd2b57a030a

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)
    pa=pb=Fraction(0)
    best=Fraction(0)
    for x in sorted(set(ca)|set(cb)):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        best+=abs(pa-pb)
    return str(best)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3], [0])), '1')
check('regression 2', solve(*([-5, 3], [-2, 1])), '1/2')
check('regression 3', solve(*([1, 1, 4], [2, 3])), '2/3')
check('regression 4', solve(*([0, 0, 0], [0])), '0')
check('regression 5', solve(*([], [1])), None)
check('regression 6', solve(*([1, 2], [1, 2])), '0')
check('regression 7', solve(*([-5, 0, 8], [-2, 8, 8, 8])), '5/12')
check('regression 8', solve(*([0, 4], [0, 1, 2, 3, 4])), '3/10')
check('regression 9', solve(*([2, 2], [1, 1, 3, 3])), '1/2')
check("variable support",solve([0,N],[N,N]),"1/2")
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 111Passed
regression 211/2Failed
regression 37/62/3Failed
regression 400Passed
regression 5NoneNonePassed
regression 600Passed
regression 75/65/12Failed
regression 84/53/10Failed
regression 911/2Failed
variable support1/21/2Passed

SHA-256 / 93d56bea53c0d0e465c07503d83b5a8e63b0a9f79735e11ba4f52d77b8b8cb50

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)
    pa=pb=Fraction(0)
    best=Fraction(0)
    for x in sorted(set(ca)|set(cb)):
        pa+=Fraction(ca[x],len(a))
        pb+=Fraction(cb[x],len(b))
        best=max(best,abs(pa-pb))
    return str(best)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([3], [0])), '1')
check('regression 2', solve(*([-5, 3], [-2, 1])), '1/2')
check('regression 3', solve(*([1, 1, 4], [2, 3])), '2/3')
check('regression 4', solve(*([0, 0, 0], [0])), '0')
check('regression 5', solve(*([], [1])), None)
check('regression 6', solve(*([1, 2], [1, 2])), '0')
check('regression 7', solve(*([-5, 0, 8], [-2, 8, 8, 8])), '5/12')
check('regression 8', solve(*([0, 4], [0, 1, 2, 3, 4])), '3/10')
check('regression 9', solve(*([2, 2], [1, 1, 3, 3])), '1/2')
check("variable support",solve([0,N],[N,N]),"1/2")
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 111Passed
regression 21/21/2Passed
regression 32/32/3Passed
regression 400Passed
regression 5NoneNonePassed
regression 600Passed
regression 75/125/12Passed
regression 83/103/10Passed
regression 91/21/2Passed
variable support1/21/2Passed

SHA-256 / ddf4ebc36608e574c462ed740eefb855c4c46abcb901c6a609803ce88ef84dbe

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

Case digest / 119cf305c39449a0c9a438a9cf7faf31471584b6bea3152aede08a35f6372f8a