FAILURE MAP
← Case archive

FA-13396 / Numerical aggregation / Open access

Empirical cdf supremum: The scan omits positions appearing in only one sample. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The scan omits positions appearing in only one sample.

VERIFIED REPAIR

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

Unsuccessful approach: Scanning only the first support can miss a maximum after a second-only jump.

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=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 101Failed
regression 201/2Failed
regression 302/3Failed
regression 400Passed
regression 5NoneNonePassed
regression 600Passed
regression 75/125/12Passed
regression 83/53/10Failed
regression 901/2Failed
variable support1/21/2Passed

SHA-256 / 93ee9594917e5f640308e5d798247a04e73303f90e35248792ef21bfe5d8f211

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)):
        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 211/2Failed
regression 312/3Failed
regression 400Passed
regression 5NoneNonePassed
regression 600Passed
regression 72/35/12Failed
regression 83/53/10Failed
regression 911/2Failed
variable support1/21/2Passed

SHA-256 / c0782a52453310188c11a7aff04dde0877fcac8177afc64c8e4a1bbb431e50cd

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

Case digest / ebd125605593ca01e0416c2bc7facdc9dff5c349363920fdcb78f12f1fe3c44d