FA-14096 / Numerical aggregation / Open access
Multiset overlap similarity: Frequency mass is multiplied by nominal label magnitude. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
Frequency mass is multiplied by nominal label magnitude.
VERIFIED REPAIR
Preserve the multiset overlap similarity contract at the identified reduction decision.
Unsuccessful approach: Taking label magnitude still makes similarity depend on arbitrary label numbering.
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(k*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 3/5 | 2/5 | Failed |
| regression 2 | 1 | 1 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 2 | 1 | Failed |
| regression 5 | 0 | 1/4 | Failed |
| regression 6 | 2 | 3/5 | Failed |
| regression 7 | 0 | 0 | Passed |
| variable overlap mass | 0 | 1/2 | Failed |
SHA-256 / 8e6abe4aa04b6d30395d98682ef2761dae3aa70855e23f51015df2e7e0caf50b
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(abs(k)*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 3/5 | 2/5 | Failed |
| regression 2 | 1 | 1 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 2 | 1 | Failed |
| regression 5 | 0 | 1/4 | Failed |
| regression 6 | 2 | 3/5 | Failed |
| regression 7 | 0 | 0 | Passed |
| variable overlap mass | 0 | 1/2 | Failed |
SHA-256 / 8b62a3180005326a1675be43062217df4964a173512cef57308a7de998269663
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 1 | 2/5 | 2/5 | Passed |
| regression 2 | 1 | 1 | Passed |
| regression 3 | 0 | 0 | Passed |
| regression 4 | 1 | 1 | Passed |
| regression 5 | 1/4 | 1/4 | Passed |
| regression 6 | 3/5 | 3/5 | Passed |
| regression 7 | 0 | 0 | Passed |
| variable overlap mass | 1/2 | 1/2 | Passed |
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.614019+00:00.
Case digest / 0a5e5dff2567b3a82424fa78f72721a7f82ae2d2c716da3dc030fcb8d9ec0807