broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(abs(bucket[i]),-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs)-width+1,width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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(xs, width):
    out=[]
    for start in range(0,max(0,len(xs)-1),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted([low,high]):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high,len(bucket)-1])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width+1]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[max(0,start-1):start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width+1):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),max(1,width-1)):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=max(range(len(bucket)),key=lambda i:(bucket[i],-i))
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=low
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

source:
"""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(xs, width):
    out=[]
    for start in range(0,len(xs),width):
        bucket=xs[start:start+width]
        low=min(range(len(bucket)),key=lambda i:(bucket[i],i))
        high=len(bucket)-1
        for i in sorted(set([low,high])):
            out.append([start+i,bucket[i]])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([8, 1, 6, 2, 9, 3, 4], 3)), [[0, 8], [1, 1], [3, 2], [4, 9], [6, 4]])
check('regression 2', solve(*([], 2)), [])
check('regression 3', solve(*([3, 3, 3, 1, 1], 3)), [[0, 3], [3, 1]])
check('regression 4', solve(*([-4, -1, -8, 0], 2)), [[0, -4], [1, -1], [2, -8], [3, 0]])
check('regression 5', solve(*([9, 1, 5], 1)), [[0, 9], [1, 1], [2, 5]])
check('regression 6', solve(*([4, 2, 8, 3], 9)), [[1, 2], [2, 8]])
check('regression 7', solve(*([5, 5, 1, 1, 9, 9], 6)), [[2, 1], [4, 9]])
check("variable bucket amplitude",solve([N,0,2*N],3),[[1,0],[2,2*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

For positive integer width, partition numeric observations into consecutive buckets including a final short bucket. Emit each bucket first-occurring minimum and first-occurring maximum once, in original observation order, as [global index,value]. Flat buckets emit one point.

split: open-access


broken_source:
"""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(int(ca[k]>0 and cb[k]>0) 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)

source:
"""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(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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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(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)

source:
"""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(abs(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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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)

source:
"""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)
    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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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(sum((Fraction(min(ca[k],cb[k]),max(ca[k],cb[k])) for k in keys),Fraction(0))/len(keys)) if keys 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)

source:
"""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(max([Fraction(min(ca[k],cb[k]),max(ca[k],cb[k])) for k in keys] or [Fraction(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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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 a and b 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)

source:
"""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 a and b else "0"
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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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=max([min(ca[k],cb[k]) for k in keys] or [0])
    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)

source:
"""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=min([min(ca[k],cb[k]) for k in keys] or [0])
    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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

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.

split: open-access


broken_source:
"""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)
    dot=sum(min(ca[k],cb[k]) for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(int(ca[k]>0 and cb[k]>0) for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=len(ca)
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=na
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in ca.values())+sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(abs(dot),na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na+nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,max(na,nb)**2)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(ca[k]**2 for k in keys if cb[k])
    nb=sum(cb[k]**2 for k in keys if ca[k])
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(ca[k]**2 for k in keys if cb[k])
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else "1"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(ca[k]*cb[k] for k in keys)
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else "0"
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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)
    dot=sum(x*y for x,y in zip(ca.values(),cb.values()))
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

source:
"""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)
    dot=sum(x*y for x,y in zip(sorted(ca.values()),sorted(cb.values())))
    na=sum(v*v for v in ca.values())
    nb=sum(v*v for v in cb.values())
    return str(Fraction(dot*dot,na*nb)) if na and nb else None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([1, 1, 2], [1, 2, 2])), '16/25')
check('regression 2', solve(*([1, 2], [1, 2])), '1')
check('regression 3', solve(*([], [])), None)
check('regression 4', solve(*([0], [1])), '0')
check('regression 5', solve(*([1, 1, 1, 2], [1, 2])), '4/5')
check('regression 6', solve(*([-1, 0, 0], [0, 0, 1, 1])), '2/5')
check('regression 7', solve(*([2, 2], [])), None)
check("variable cosine concentration",solve([0]*N+[1],[0]),str(Fraction(N*N,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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Treat samples as frequency vectors over nominal integer labels. Return squared cosine dot**2/(sum count_a**2 * sum count_b**2) as exact Fraction string. A zero norm on either side returns None.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x and y]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x or 0,y or 0) for x,y in rows]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x or 0,y or 0) for x,y in rows if x is not None or y is not None]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(rows),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [sum(x is not None for x,y in rows),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in rows if x is not None),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in rows if x is not None and y),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=list(zip([x for x,y in rows if x is not None],[y for x,y in rows if y is not None]))
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=list(zip(sorted(x for x,y in rows if x is not None),sorted(y for x,y in rows if y is not None)))
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x for x,y in pairs)*sum(y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x+y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum(x-y for x,y in pairs)**2]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=[(x,y) for x,y in rows if x is not None and y is not None]
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),abs(sum(x-y for x,y in pairs))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access


broken_source:
"""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(rows):
    pairs=list(set((x,y) for x,y in rows if x is not None and y is not None))
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

source:
"""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(rows):
    pairs=list(dict((x,y) for x,y in rows if x is not None and y is not None).items())
    return [len(pairs),sum(x for x,y in pairs),sum(y for x,y in pairs),sum(x*y for x,y in pairs),sum((x-y)**2 for x,y in pairs)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(1, 2), (None, 9), (3, None), (0, 4)],)), [2, 1, 6, 2, 17])
check('regression 2', solve(*([],)), [0, 0, 0, 0, 0])
check('regression 3', solve(*([(None, None)],)), [0, 0, 0, 0, 0])
check('regression 4', solve(*([(-2, 3), (4, -1), (0, 0)],)), [3, 2, 2, -10, 50])
check('regression 5', solve(*([(3, 3), (3, 3), (None, 4)],)), [2, 6, 6, 18, 0])
check('regression 6', solve(*([(0, 2), (2, 0)],)), [2, 2, 2, 0, 8])
check('regression 7', solve(*([(5, None), (None, 6)],)), [0, 0, 0, 0, 0])
check("variable complete pair",solve([(N,2*N),(None,N),(0,N)]),[2,N,3*N,2*N*N,2*N*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)

prompt:
The reduction disagrees with its explicit aggregation oracle.

Each row holds two integer values or None. Include a row only when both values are observed; zero is observed. Return [paired count, x sum, y sum, cross-product sum, squared-distance sum]. No imputation and no marginal-only contributions.

split: open-access