broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>=x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if len(x)==1],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect reversed.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]>lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<highs[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect low order.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]<highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if len(a[i])==2 and highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect high order.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': min(highs) if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[-1] if a else None,
    'maximum': highs[0] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect minimum.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': max(lows) if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[-1] if a else None,
    'members': sum(len(x) for x in a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect maximum.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': 2*n}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    a=d['intervals']; n=len(a); lows=[x[0] for x in a]; highs=[x[-1] for x in a]
    return {'reversed': [i for i,x in enumerate(a) if x[0]>x[-1]],
    'low_order': [i for i in range(1,n) if lows[i]<lows[(i-1)//2]],
    'high_order': [i for i in range(1,n) if highs[i]>highs[(i-1)//2]],
    'minimum': lows[0] if a else None,
    'maximum': highs[0] if a else None,
    'members': n}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 10], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 10, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 11], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 11, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 12], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 12, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 13], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 13, 'members': 8})], [({'intervals': []}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': None, 'maximum': None, 'members': 0}), ({'intervals': [[4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 4, 'maximum': 4, 'members': 1}), ({'intervals': [[1, 9], [2, 7], [3]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 5}), ({'intervals': [[1, 8], [2, 7], [9]]}, {'reversed': [], 'low_order': [], 'high_order': [2], 'minimum': 1, 'maximum': 8, 'members': 5}), ({'intervals': [[5, 3], [1, 6], [4, 8]]}, {'reversed': [0], 'low_order': [1, 2], 'high_order': [1, 2], 'minimum': 5, 'maximum': 3, 'members': 6}), ({'intervals': [[1, 9], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 9, 'members': 8}), ({'intervals': [[1, 14], [2, 8], [3, 7], [4, 4]]}, {'reversed': [], 'low_order': [], 'high_order': [], 'minimum': 1, 'maximum': 14, 'members': 8})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval endpoints certificate reports an incorrect members.

An interval heap stores ordered pairs [lo,hi] except the last node may be singleton [x]. Report reversed intervals, low-end heap violations, high-end heap violations treating singleton as both endpoints, global minimum, global maximum, and member count.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    x=d['x']; s=d['singleton']; lo,hi=d['parent']
    return {'completed': [s,x],
    'lower': x<lo,
    'upper': x>hi,
    'contained': lo<=x<=hi,
    'displaced': lo if x<lo else hi if x>hi else None,
    'new_size': d["size"]+1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 7, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 8, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 9, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 10, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 10], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 11, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 11], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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

N = 1
observations = []
def solve(d):
    x=d['x']; s=d['singleton']; lo,hi=d['parent']
    return {'completed': [min(s,x),min(s,x)],
    'lower': x<lo,
    'upper': x>hi,
    'contained': lo<=x<=hi,
    'displaced': lo if x<lo else hi if x>hi else None,
    'new_size': d["size"]+1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 7, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 8, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 9, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 10, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 10], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})], [({'x': 1, 'singleton': 6, 'parent': [2, 8], 'size': 3}, {'completed': [1, 6], 'lower': True, 'upper': False, 'contained': False, 'displaced': 2, 'new_size': 4}), ({'x': 9, 'singleton': 4, 'parent': [2, 8], 'size': 5}, {'completed': [4, 9], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 6}), ({'x': 5, 'singleton': 7, 'parent': [2, 8], 'size': 7}, {'completed': [5, 7], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 8}), ({'x': 2, 'singleton': 3, 'parent': [2, 8], 'size': 9}, {'completed': [2, 3], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 10}), ({'x': 8, 'singleton': 1, 'parent': [2, 8], 'size': 11}, {'completed': [1, 8], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 12}), ({'x': 6, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 6], 'lower': False, 'upper': False, 'contained': True, 'displaced': None, 'new_size': 2}), ({'x': 11, 'singleton': 6, 'parent': [2, 8], 'size': 1}, {'completed': [6, 11], 'lower': False, 'upper': True, 'contained': False, 'displaced': 8, 'new_size': 2})]][N-1]
check('regression certificate 1', solve(cases[0][0]), cases[0][1])
check('regression certificate 2', solve(cases[1][0]), cases[1][1])
check('regression certificate 3', solve(cases[2][0]), cases[2][1])
check('regression certificate 4', solve(cases[3][0]), cases[3][1])
check('regression certificate 5', solve(cases[4][0]), cases[4][1])
check('regression certificate 6', solve(cases[5][0]), cases[5][1])
check('variant-dependent certificate', solve(cases[6][0]), cases[6][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 bounded interval insert certificate reports an incorrect completed.

Insert key x into an interval-heap last-node decision. For a singleton last interval s, complete it as sorted(s,x). For a new singleton with parent [lo,hi], x below lo routes to the lower heap, above hi to the upper heap, otherwise stays. Return pair completion, lower route, upper route, contained route, parent endpoint displaced on crossing, and logical-size increment.

split: open-access