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

N = 1
observations = []
def solve(d):
    a=d['intervals']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': a[:-1],
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': a[:-1]+[tail] if a else [],
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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 pop end certificate reports an incorrect remaining.

A bounded interval-tail removal receives intervals, and side low or high. Remove the requested endpoint from the final interval (singleton removed wholly), returning extracted tail replacement, remaining interval list, new logical size, singleton status, surviving endpoint, and array-node count. This isolates tail extraction before global bubbling.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['intervals']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,a))-2 if a else 0,
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': 2*len(out),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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 pop end certificate reports an incorrect size.

A bounded interval-tail removal receives intervals, and side low or high. Remove the requested endpoint from the final interval (singleton removed wholly), returning extracted tail replacement, remaining interval list, new logical size, singleton status, surviving endpoint, and array-node count. This isolates tail extraction before global bubbling.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['intervals']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out),
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==2,
    'survivor': rest[0] if rest else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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 pop end certificate reports an incorrect singleton.

A bounded interval-tail removal receives intervals, and side low or high. Remove the requested endpoint from the final interval (singleton removed wholly), returning extracted tail replacement, remaining interval list, new logical size, singleton status, surviving endpoint, and array-node count. This isolates tail extraction before global bubbling.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['intervals']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': v,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': tail[0] if len(tail)==2 else None,
    'nodes': len(out)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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 pop end certificate reports an incorrect survivor.

A bounded interval-tail removal receives intervals, and side low or high. Remove the requested endpoint from the final interval (singleton removed wholly), returning extracted tail replacement, remaining interval list, new logical size, singleton status, surviving endpoint, and array-node count. This isolates tail extraction before global bubbling.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['intervals']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': max(0,len(a)-1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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']; side=d['side']; tail=a[-1] if a else []; k=0 if side=='low' else -1; v=tail[k] if tail else None; rest=tail[1:] if side=='low' else tail[:-1]; out=a[:-1]+([rest] if rest else []) if a else []
    return {'replacement': v,
    'remaining': out,
    'size': sum(map(len,out)),
    'singleton': bool(out) and len(out[-1])==1,
    'survivor': rest[0] if rest else None,
    'nodes': len(a)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 7]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [7]], 'size': 5, 'singleton': True, 'survivor': 7, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 8]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [8]], 'size': 5, 'singleton': True, 'survivor': 8, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 9]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [9]], 'size': 5, 'singleton': True, 'survivor': 9, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 10]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [10]], 'size': 5, 'singleton': True, 'survivor': 10, 'nodes': 3})], [({'intervals': [], 'side': 'low'}, {'replacement': None, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[4]], 'side': 'high'}, {'replacement': 4, 'remaining': [], 'size': 0, 'singleton': False, 'survivor': None, 'nodes': 0}), ({'intervals': [[1, 9]], 'side': 'low'}, {'replacement': 1, 'remaining': [[9]], 'size': 1, 'singleton': True, 'survivor': 9, 'nodes': 1}), ({'intervals': [[1, 9], [3, 7]], 'side': 'high'}, {'replacement': 7, 'remaining': [[1, 9], [3]], 'size': 3, 'singleton': True, 'survivor': 3, 'nodes': 2}), ({'intervals': [[1, 9], [3]], 'side': 'low'}, {'replacement': 3, 'remaining': [[1, 9]], 'size': 2, 'singleton': False, 'survivor': None, 'nodes': 1}), ({'intervals': [[1, 9], [2, 8], [4, 6]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [6]], 'size': 5, 'singleton': True, 'survivor': 6, 'nodes': 3}), ({'intervals': [[1, 9], [2, 8], [4, 11]], 'side': 'low'}, {'replacement': 4, 'remaining': [[1, 9], [2, 8], [11]], 'size': 5, 'singleton': True, 'survivor': 11, 'nodes': 3})]][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 pop end certificate reports an incorrect nodes.

A bounded interval-tail removal receives intervals, and side low or high. Remove the requested endpoint from the final interval (singleton removed wholly), returning extracted tail replacement, remaining interval list, new logical size, singleton status, surviving endpoint, and array-node count. This isolates tail extraction before global bubbling.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['slots']; i=d['index']; last=len(a)-1; out=[list(x) for x in a[:-1]]
    if i<last: out[i]=list(a[-1])
    direction='none' if i==last else ('up' if i>0 and out[i][1]<out[(i-1)//2][1] else 'down')
    return {'slots': [x for k,x in enumerate(a) if k!=i],
    'removed': a[i][0],
    'direction': direction,
    'replacement_location': None if i==last else [a[-1][0],i],
    'retained': sorted(x[0] for x in out),
    'size': len(a)-1}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'slots': [['a', 1]], 'index': 0}, {'slots': [], 'removed': 'a', 'direction': 'none', 'replacement_location': None, 'retained': [], 'size': 0}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 4}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['g', 4], ['f', 3]], 'removed': 'e', 'direction': 'up', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 3]], 'index': 0}, {'slots': [['c', 3], ['b', 2]], 'removed': 'a', 'direction': 'down', 'replacement_location': ['c', 0], 'retained': ['b', 'c'], 'size': 2}), ({'slots': [['a', 1], ['b', 2], ['c', 3], ['d', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 3]], 'removed': 'd', 'direction': 'none', 'replacement_location': None, 'retained': ['a', 'b', 'c'], 'size': 3}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['g', 4], ['e', 8], ['f', 3]], 'removed': 'd', 'direction': 'up', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6})], [({'slots': [['a', 1]], 'index': 0}, {'slots': [], 'removed': 'a', 'direction': 'none', 'replacement_location': None, 'retained': [], 'size': 0}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 4}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['g', 4], ['f', 3]], 'removed': 'e', 'direction': 'up', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 3]], 'index': 0}, {'slots': [['c', 3], ['b', 2]], 'removed': 'a', 'direction': 'down', 'replacement_location': ['c', 0], 'retained': ['b', 'c'], 'size': 2}), ({'slots': [['a', 1], ['b', 2], ['c', 3], ['d', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 3]], 'removed': 'd', 'direction': 'none', 'replacement_location': None, 'retained': ['a', 'b', 'c'], 'size': 3}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['g', 4], ['e', 8], ['f', 3]], 'removed': 'd', 'direction': 'up', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 2}, {'slots': [['a', 1], ['b', 2], ['g', 3], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'c', 'direction': 'down', 'replacement_location': ['g', 2], 'retained': ['a', 'b', 'd', 'e', 'f', 'g'], 'size': 6})], [({'slots': [['a', 1]], 'index': 0}, {'slots': [], 'removed': 'a', 'direction': 'none', 'replacement_location': None, 'retained': [], 'size': 0}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 4}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['g', 4], ['f', 3]], 'removed': 'e', 'direction': 'up', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 3]], 'index': 0}, {'slots': [['c', 3], ['b', 2]], 'removed': 'a', 'direction': 'down', 'replacement_location': ['c', 0], 'retained': ['b', 'c'], 'size': 2}), ({'slots': [['a', 1], ['b', 2], ['c', 3], ['d', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 3]], 'removed': 'd', 'direction': 'none', 'replacement_location': None, 'retained': ['a', 'b', 'c'], 'size': 3}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['g', 4], ['e', 8], ['f', 3]], 'removed': 'd', 'direction': 'up', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 2], ['g', 3], ['e', 5], ['f', 2]], 'removed': 'd', 'direction': 'down', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6})], [({'slots': [['a', 1]], 'index': 0}, {'slots': [], 'removed': 'a', 'direction': 'none', 'replacement_location': None, 'retained': [], 'size': 0}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 4}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['g', 4], ['f', 3]], 'removed': 'e', 'direction': 'up', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 3]], 'index': 0}, {'slots': [['c', 3], ['b', 2]], 'removed': 'a', 'direction': 'down', 'replacement_location': ['c', 0], 'retained': ['b', 'c'], 'size': 2}), ({'slots': [['a', 1], ['b', 2], ['c', 3], ['d', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 3]], 'removed': 'd', 'direction': 'none', 'replacement_location': None, 'retained': ['a', 'b', 'c'], 'size': 3}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['g', 4], ['e', 8], ['f', 3]], 'removed': 'd', 'direction': 'up', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 4}, {'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['g', 3], ['f', 2]], 'removed': 'e', 'direction': 'down', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6})], [({'slots': [['a', 1]], 'index': 0}, {'slots': [], 'removed': 'a', 'direction': 'none', 'replacement_location': None, 'retained': [], 'size': 0}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 4}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['g', 4], ['f', 3]], 'removed': 'e', 'direction': 'up', 'replacement_location': ['g', 4], 'retained': ['a', 'b', 'c', 'd', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 3]], 'index': 0}, {'slots': [['c', 3], ['b', 2]], 'removed': 'a', 'direction': 'down', 'replacement_location': ['c', 0], 'retained': ['b', 'c'], 'size': 2}), ({'slots': [['a', 1], ['b', 2], ['c', 3], ['d', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 2], ['c', 3]], 'removed': 'd', 'direction': 'none', 'replacement_location': None, 'retained': ['a', 'b', 'c'], 'size': 3}), ({'slots': [['a', 1], ['b', 5], ['c', 2], ['d', 7], ['e', 8], ['f', 3], ['g', 4]], 'index': 3}, {'slots': [['a', 1], ['b', 5], ['c', 2], ['g', 4], ['e', 8], ['f', 3]], 'removed': 'd', 'direction': 'up', 'replacement_location': ['g', 3], 'retained': ['a', 'b', 'c', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 1}, {'slots': [['a', 1], ['g', 3], ['c', 2], ['d', 4], ['e', 5], ['f', 2]], 'removed': 'b', 'direction': 'down', 'replacement_location': ['g', 1], 'retained': ['a', 'c', 'd', 'e', 'f', 'g'], 'size': 6}), ({'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['f', 2], ['g', 3]], 'index': 5}, {'slots': [['a', 1], ['b', 2], ['c', 2], ['d', 4], ['e', 5], ['g', 3]], 'removed': 'f', 'direction': 'down', 'replacement_location': ['g', 5], 'retained': ['a', 'b', 'c', 'd', 'e', 'g'], 'size': 6})]][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 indexed erase routing certificate reports an incorrect slots.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


prompt:
The bounded indexed erase routing certificate reports an incorrect removed.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


prompt:
The bounded indexed erase routing certificate reports an incorrect direction.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


prompt:
The bounded indexed erase routing certificate reports an incorrect replacement location.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


prompt:
The bounded indexed erase routing certificate reports an incorrect retained.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


prompt:
The bounded indexed erase routing certificate reports an incorrect size.

An indexed heap erasure certificate gives slots [id,key], selected slot i, and a valid min-heap prefix before deletion. Fill the hole with the last record unless erasing the tail. Decide upward repair if replacement is smaller than its parent, otherwise downward; return shortened slots, removed id, direction, replacement handle location, retained identities, and logical size.

split: open-access


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

N = 1
observations = []
def solve(d):
    b=d['buckets']; mask=d['mask']; p=d['pop']; actual=sum(1<<i for i,x in enumerate(b) if x); remaining=max(0,len(b[p])-1) if b else 0
    return {'actual_mask': sum(i for i,x in enumerate(b) if x),
    'minimum': (actual & -actual).bit_length()-1 if actual else None,
    'maximum': actual.bit_length()-1 if actual else None,
    'ghosts': [i for i,x in enumerate(b) if mask&(1<<i) and not x],
    'missing': [i for i,x in enumerate(b) if x and not mask&(1<<i)],
    'after_pop': mask if remaining or not b else mask & ~(1<<p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 1, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0], 'missing': [1, 3, 4], 'after_pop': 1})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 2, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [3, 4], 'after_pop': 2})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 3, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0], 'missing': [3, 4], 'after_pop': 3})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 4, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [2], 'missing': [1, 3, 4], 'after_pop': 4})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 5, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0, 2], 'missing': [1, 3, 4], 'after_pop': 5})]][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):
    b=d['buckets']; mask=d['mask']; p=d['pop']; actual=sum(1<<i for i,x in enumerate(b) if x); remaining=max(0,len(b[p])-1) if b else 0
    return {'actual_mask': sum(1<<len(x) for x in b if x),
    'minimum': (actual & -actual).bit_length()-1 if actual else None,
    'maximum': actual.bit_length()-1 if actual else None,
    'ghosts': [i for i,x in enumerate(b) if mask&(1<<i) and not x],
    'missing': [i for i,x in enumerate(b) if x and not mask&(1<<i)],
    'after_pop': mask if remaining or not b else mask & ~(1<<p)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 1, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0], 'missing': [1, 3, 4], 'after_pop': 1})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 2, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [3, 4], 'after_pop': 2})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 3, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0], 'missing': [3, 4], 'after_pop': 3})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 4, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [2], 'missing': [1, 3, 4], 'after_pop': 4})], [({'buckets': [], 'mask': 0, 'pop': 0}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [['a']], 'mask': 1, 'pop': 0}, {'actual_mask': 1, 'minimum': 0, 'maximum': 0, 'ghosts': [], 'missing': [], 'after_pop': 0}), ({'buckets': [[], ['a', 'b'], [], ['c']], 'mask': 10, 'pop': 1}, {'actual_mask': 10, 'minimum': 1, 'maximum': 3, 'ghosts': [], 'missing': [], 'after_pop': 10}), ({'buckets': [['a'], [], ['c']], 'mask': 3, 'pop': 0}, {'actual_mask': 5, 'minimum': 0, 'maximum': 2, 'ghosts': [1], 'missing': [2], 'after_pop': 2}), ({'buckets': [[], [], []], 'mask': 7, 'pop': 1}, {'actual_mask': 0, 'minimum': None, 'maximum': None, 'ghosts': [0, 1, 2], 'missing': [], 'after_pop': 5}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 8, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [], 'missing': [1, 4], 'after_pop': 8}), ({'buckets': [[], ['x'], [], ['y', 'z'], ['q']], 'mask': 5, 'pop': 3}, {'actual_mask': 26, 'minimum': 1, 'maximum': 4, 'ghosts': [0, 2], 'missing': [1, 3, 4], 'after_pop': 5})]][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 priority bitset certificate reports an incorrect actual mask.

A bounded bucket priority queue certificate supplies occupancy mask and bucket lists for priorities 0..width-1. Report actual occupancy mask, least occupied priority, greatest occupied priority, mask-only ghost priorities, missing-mask priorities, and popped-bucket bit clearing after removing one first element from requested priority. Empty buckets are valid.

split: open-access