FAILURE MAP
← Case archive

FA-14101 / Numerical aggregation / Open access

Multiset overlap similarity: The ratio of minimum to maximum mass is inverted. · case 01

The reduction disagrees with its explicit aggregation oracle.

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

ROOT CAUSE

The ratio of minimum to maximum mass is inverted.

VERIFIED REPAIR

Preserve the multiset overlap similarity contract at the identified reduction decision.

Unsuccessful approach: Subtracting overlap gives dissimilarity rather than the requested similarity.

Case contract

Return multiset Jaccard similarity: sum of per-label minimum frequencies divided by sum of per-label maximum frequencies, as exact Fraction string. Both empty returns "1". Integer labels are nominal.

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):
    ca,cb=Counter(a),Counter(b)
    keys=set(ca)|set(cb)
    intersection=sum(min(ca[k],cb[k]) for k in keys)
    union=sum(max(ca[k],cb[k]) for k in keys)
    return str(Fraction(union,max(1,intersection))) if union else "1"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 1, 2], [1, 2, 2])), '2/5')
check('regression 2', solve(*([], [])), '1')
check('regression 3', solve(*([1, 2], [])), '0')
check('regression 4', solve(*([2, 2], [2, 2])), '1')
check('regression 5', solve(*([-1, 0, 0], [0, 1])), '1/4')
check('regression 6', solve(*([3, 3, 4], [3, 3, 3, 4, 4])), '3/5')
check('regression 7', solve(*([0], [1])), '0')
check("variable overlap mass",solve([0]*N,[0]*(N+1)),str(Fraction(N,N+1)))
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/22/5Failed
regression 211Passed
regression 320Failed
regression 411Passed
regression 541/4Failed
regression 65/33/5Failed
regression 720Failed
variable overlap mass21/2Failed

SHA-256 / bc01af4a05b59a9a4726a1a20f67d2834a73a752316b8f9b079b597d33fbc2e8

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):
    ca,cb=Counter(a),Counter(b)
    keys=set(ca)|set(cb)
    intersection=sum(min(ca[k],cb[k]) for k in keys)
    union=sum(max(ca[k],cb[k]) for k in keys)
    return str(Fraction(union-intersection,union)) if union else "1"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 1, 2], [1, 2, 2])), '2/5')
check('regression 2', solve(*([], [])), '1')
check('regression 3', solve(*([1, 2], [])), '0')
check('regression 4', solve(*([2, 2], [2, 2])), '1')
check('regression 5', solve(*([-1, 0, 0], [0, 1])), '1/4')
check('regression 6', solve(*([3, 3, 4], [3, 3, 3, 4, 4])), '3/5')
check('regression 7', solve(*([0], [1])), '0')
check("variable overlap mass",solve([0]*N,[0]*(N+1)),str(Fraction(N,N+1)))
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 13/52/5Failed
regression 211Passed
regression 310Failed
regression 401Failed
regression 53/41/4Failed
regression 62/53/5Failed
regression 710Failed
variable overlap mass1/21/2Passed

SHA-256 / 7528655912a2eb774707cdae8fd6a6f0ffbd8ccbcbaa3180c2840c01bd0914ff

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):
    ca,cb=Counter(a),Counter(b)
    keys=set(ca)|set(cb)
    intersection=sum(min(ca[k],cb[k]) for k in keys)
    union=sum(max(ca[k],cb[k]) for k in keys)
    return str(Fraction(intersection,union)) if union else "1"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 1, 2], [1, 2, 2])), '2/5')
check('regression 2', solve(*([], [])), '1')
check('regression 3', solve(*([1, 2], [])), '0')
check('regression 4', solve(*([2, 2], [2, 2])), '1')
check('regression 5', solve(*([-1, 0, 0], [0, 1])), '1/4')
check('regression 6', solve(*([3, 3, 4], [3, 3, 3, 4, 4])), '3/5')
check('regression 7', solve(*([0], [1])), '0')
check("variable overlap mass",solve([0]*N,[0]*(N+1)),str(Fraction(N,N+1)))
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 12/52/5Passed
regression 211Passed
regression 300Passed
regression 411Passed
regression 51/41/4Passed
regression 63/53/5Passed
regression 700Passed
variable overlap mass1/21/2Passed

SHA-256 / 3b051b777280386b7ee69a79a8c64dcf88848d0b2840a6fbc9eeaf9db68094be

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

Case digest / 74deea08cd9034d0b0730303dc1ffc5bd8bd541c39cab1bc8266f1475a012327