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

N = 1
observations = []
def solve(d):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': len(r),
    'cardinality': [i for i,x in enumerate(r) if x[2] != 2**x[0]],
    'children': [i for i,x in enumerate(r) if x[3] != list(range(x[0]-1,-1,-1))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': sum(x[0]+1 for x in r),
    'cardinality': [i for i,x in enumerate(r) if x[2] != 2**x[0]],
    'children': [i for i,x in enumerate(r) if x[3] != list(range(x[0]-1,-1,-1))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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 binomial forest certificate reports an incorrect population.

For a binomial-forest certificate, roots is a list of [rank,key,node_count,child_ranks]. Report canonical rank order, duplicate ranks, root minimum, size, tree-cardinality failures, and descending child-rank failures. No implicit tree nodes are present.

split: open-access


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

N = 1
observations = []
def solve(d):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': sum(x[2] for x in r),
    'cardinality': [i for i,x in enumerate(r) if x[2] != x[0]+1],
    'children': [i for i,x in enumerate(r) if x[3] != list(range(x[0]-1,-1,-1))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': sum(x[2] for x in r),
    'cardinality': [i for i,x in enumerate(r) if x[2] < 2**x[0]],
    'children': [i for i,x in enumerate(r) if x[3] != list(range(x[0]-1,-1,-1))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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 binomial forest certificate reports an incorrect cardinality.

For a binomial-forest certificate, roots is a list of [rank,key,node_count,child_ranks]. Report canonical rank order, duplicate ranks, root minimum, size, tree-cardinality failures, and descending child-rank failures. No implicit tree nodes are present.

split: open-access


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

N = 1
observations = []
def solve(d):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': sum(x[2] for x in r),
    'cardinality': [i for i,x in enumerate(r) if x[2] != 2**x[0]],
    'children': [i for i,x in enumerate(r) if sorted(x[3]) != list(range(x[0]))]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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):
    r = d['roots']
    return {'canonical': sorted([x[0] for x in r]),
    'collisions': sorted({x[0] for x in r if sum(y[0]==x[0] for y in r)>1}),
    'minimum': min([x[1] for x in r],default=None),
    'population': sum(x[2] for x in r),
    'cardinality': [i for i,x in enumerate(r) if x[2] != 2**x[0]],
    'children': [i for i,x in enumerate(r) if len(x[3]) != x[0]]}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 8, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 9, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 10, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 11, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})], [({'roots': []}, {'canonical': [], 'collisions': [], 'minimum': None, 'population': 0, 'cardinality': [], 'children': []}), ({'roots': [[0, 8, 1, []]]}, {'canonical': [0], 'collisions': [], 'minimum': 8, 'population': 1, 'cardinality': [], 'children': []}), ({'roots': [[2, 9, 4, [1, 0]], [0, 3, 1, []], [2, 2, 4, [1, 0]]]}, {'canonical': [0, 2, 2], 'collisions': [2], 'minimum': 2, 'population': 9, 'cardinality': [], 'children': []}), ({'roots': [[3, 1, 8, [2, 1, 0]], [1, 5, 2, [0]]]}, {'canonical': [1, 3], 'collisions': [], 'minimum': 1, 'population': 10, 'cardinality': [], 'children': []}), ({'roots': [[2, 4, 5, [0, 1]], [1, 4, 1, [0]]]}, {'canonical': [1, 2], 'collisions': [], 'minimum': 4, 'population': 6, 'cardinality': [0, 1], 'children': [0]}), ({'roots': [[1, 7, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]}), ({'roots': [[1, 12, 2, []], [3, 0, 7, [2, 0, 1]], [1, 2, 2, [0]]]}, {'canonical': [1, 1, 3], 'collisions': [1], 'minimum': 0, 'population': 11, 'cardinality': [1], 'children': [0, 1]})]][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 binomial forest certificate reports an incorrect children.

For a binomial-forest certificate, roots is a list of [rank,key,node_count,child_ranks]. Report canonical rank order, duplicate ranks, root minimum, size, tree-cardinality failures, and descending child-rank failures. No implicit tree nodes are present.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]!=i],
    'degrees': [i for i,x in enumerate(a) if x[4]!=len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i and a[x[3]][2]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]!=i],
    'degrees': [i for i,x in enumerate(a) if x[4]!=len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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 fibonacci rings certificate reports an incorrect reciprocity.

A finite Fibonacci-ring certificate stores nodes [key,parent,left,right,degree,mark,children]. All references are in range or parent=-1. Report broken circular-link reciprocity, parent-child backlinks, degree mismatch, marked roots, roots, and designated minimum validity.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i or a[x[3]][2]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]!=x[1]],
    'degrees': [i for i,x in enumerate(a) if x[4]!=len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i or a[x[3]][2]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]<0],
    'degrees': [i for i,x in enumerate(a) if x[4]!=len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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 fibonacci rings certificate reports an incorrect backlinks.

A finite Fibonacci-ring certificate stores nodes [key,parent,left,right,degree,mark,children]. All references are in range or parent=-1. Report broken circular-link reciprocity, parent-child backlinks, degree mismatch, marked roots, roots, and designated minimum validity.

split: open-access


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

N = 1
observations = []
def solve(d):
    a=d['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i or a[x[3]][2]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]!=i],
    'degrees': [i for i,x in enumerate(a) if x[4]<len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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['nodes']; m=d['minimum']; n=len(a)
    return {'reciprocity': [i for i,x in enumerate(a) if a[x[2]][3]!=i or a[x[3]][2]!=i],
    'backlinks': [[i,j] for i,x in enumerate(a) for j in x[6] if a[j][1]!=i],
    'degrees': [i for i,x in enumerate(a) if x[4]>len(x[6])],
    'root_marks': [i for i,x in enumerate(a) if x[1]==-1 and x[5]],
    'root_ids': [i for i,x in enumerate(a) if x[1]==-1],
    'minimum_valid': m is None if not a else (m is not None and a[m][1]==-1 and all(a[m][0]<=x[0] for x in a if x[1]==-1))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[10, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[11, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[12, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[13, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})], [({'nodes': [], 'minimum': None}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [], 'minimum_valid': True}), ({'nodes': [[5, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[4, -1, 0, 0, 2, False, [1, 2]], [6, 0, 2, 2, 0, False, []], [8, 0, 1, 1, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [], 'root_ids': [0], 'minimum_valid': True}), ({'nodes': [[8, -1, 1, 1, 0, True, []], [2, -1, 0, 0, 0, False, []]], 'minimum': 0}, {'reciprocity': [], 'backlinks': [], 'degrees': [], 'root_marks': [0], 'root_ids': [0, 1], 'minimum_valid': False}), ({'nodes': [[7, -1, 0, 0, 1, True, [1, 2]], [1, 0, 1, 2, 0, False, []], [4, -1, 1, 2, 2, True, []]], 'minimum': 1}, {'reciprocity': [1, 2], 'backlinks': [[0, 2]], 'degrees': [0, 2], 'root_marks': [0, 2], 'root_ids': [0, 2], 'minimum_valid': False}), ({'nodes': [[9, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True}), ({'nodes': [[14, -1, 2, 1, 3, False, [1]], [4, 2, 1, 2, 1, True, []], [3, -1, 0, 0, 1, True, [0]]], 'minimum': 2}, {'reciprocity': [0, 1, 2], 'backlinks': [[0, 1], [2, 0]], 'degrees': [0, 1], 'root_marks': [2], 'root_ids': [0, 2], 'minimum_valid': True})]][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 fibonacci rings certificate reports an incorrect degrees.

A finite Fibonacci-ring certificate stores nodes [key,parent,left,right,degree,mark,children]. All references are in range or parent=-1. Report broken circular-link reciprocity, parent-child backlinks, degree mismatch, marked roots, roots, and designated minimum validity.

split: open-access