{"abstract":"Pairs with both bits wrong are penalised like a single error, so wrong paths win.","category":"Error-correcting codes","checks":8,"contract":"Hard-decision Viterbi decoder for the terminated K=3 (7,5) code (outputs g=7 then g=5 per step, two zero tail bits). Branch metric is the Hamming distance between the received pair and the branch output. Survivors keep the first strictly better candidate (states in ascending order, input 0 before 1). Decoding ends in state 0 and the two tail bits are removed. Return [decoded bits, final path metric]; odd or too-short input returns None.","contract_signature":"r","evaluation_group":"w2-error_correcting_codes-viterbi-hard","failed_approach":"Weighting the first bit double is not a Hamming distance either.","family":"w2-error_correcting_codes-viterbi-hard-branch-metric","id":"FA-71951","implementations":{"attempt":{"sha256":"58cddef372a9ac9a3dbc5310ec18ac3dcf3bf908c0560cffc3ad20bfddfa3554","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    if len(r) % 2 or len(r) < 4:\n        return None\n    INF = 10 ** 9\n    metric = [0, INF, INF, INF]\n    paths = [[], [], [], []]\n    for t in range(len(r) // 2):\n        y0, y1 = r[2 * t], r[2 * t + 1]\n        new_m = [INF] * 4\n        new_p = [None] * 4\n        for st in range(4):\n            if metric[st] >= INF:\n                continue\n            for b in (0, 1):\n                reg = (b << 2) | st\n                o0 = bin(reg & 7).count('1') % 2\n                o1 = bin(reg & 5).count('1') % 2\n                ns = reg >> 1\n                m = metric[st] + 2 * (o0 != y0) + (o1 != y1)\n                if m < new_m[ns]:\n                    new_m[ns] = m\n                    new_p[ns] = paths[st] + [b]\n        metric, paths = new_m, new_p\n    return [paths[0][:-2], metric[0]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]], [[1, 1, 0], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]', [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]], [[0, 1, 0, 0], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]], [[1, 1, 0], 0]], ['control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]', [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]], [[1, 1, 0], 1]], ['control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]', [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]], [[1, 1, 0], 2]], ['control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]', [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]], [[0, 1, 0, 0], 0]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]], [[0, 1, 0, 1, 1], 1]], ['control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1]]', [[0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1]], [[0, 1, 0, 0], 2]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0]], [[1, 0, 1, 0, 0], 0]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0]], [[1, 0, 1, 0, 0], 1]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1]], [[1, 0, 1, 0, 0], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 0]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 1]], ['partial-repair [[0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0]], [[1, 1, 0, 0, 0, 0], 1]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 0, 0], 2]], ['control [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]]', [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1, 1], 0]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1, 1], 1]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 1], 2]], ['partial-repair [[1, 1, 1, 0]]', [[1, 1, 1, 0]], [[], 3]], ['control [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0]]', [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0]], [[1, 0, 0, 0, 1, 1, 1], 2]], ['control [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]]', [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 1, 1], 0]], ['control [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]]', [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 1, 1], 1]], ['control [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0]], [[0, 0, 0, 0, 0, 0, 1, 1], 2]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]', [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]], [[0, 1, 0, 0], 2]], ['partial-repair [[1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0]], [[1, 0, 1, 0, 0], 2]], ['control [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1]], [[0, 1, 0, 1, 1], 0]], ['control [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0]], [[0, 1, 0, 1, 1], 2]], ['control [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 0]], ['control [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 0, 1], 2]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a4960082dc6c87f7dc4c219912b51048046409895fc6a70f9e7cad99084b6e97","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(r):\n    if len(r) % 2 or len(r) < 4:\n        return None\n    INF = 10 ** 9\n    metric = [0, INF, INF, INF]\n    paths = [[], [], [], []]\n    for t in range(len(r) // 2):\n        y0, y1 = r[2 * t], r[2 * t + 1]\n        new_m = [INF] * 4\n        new_p = [None] * 4\n        for st in range(4):\n            if metric[st] >= INF:\n                continue\n            for b in (0, 1):\n                reg = (b << 2) | st\n                o0 = bin(reg & 7).count('1') % 2\n                o1 = bin(reg & 5).count('1') % 2\n                ns = reg >> 1\n                m = metric[st] + ((o0 != y0) or (o1 != y1))\n                if m < new_m[ns]:\n                    new_m[ns] = m\n                    new_p[ns] = paths[st] + [b]\n        metric, paths = new_m, new_p\n    return [paths[0][:-2], metric[0]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]', [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]], [[1, 1, 0], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]', [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]], [[0, 1, 0, 0], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]], [[1, 1, 0], 0]], ['control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]', [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]], [[1, 1, 0], 1]], ['control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]', [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]], [[1, 1, 0], 2]], ['control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]', [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]], [[0, 1, 0, 0], 0]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1]], [[0, 1, 0, 1, 1], 1]], ['control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1]]', [[0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1]], [[0, 1, 0, 0], 2]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0]], [[1, 0, 1, 0, 0], 0]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0]], [[1, 0, 1, 0, 0], 1]], ['control [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1]]', [[1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1]], [[1, 0, 1, 0, 0], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 0]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 1]], ['partial-repair [[0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 2]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0]], [[1, 1, 0, 0, 0, 0], 1]], ['control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1]]', [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1]], [[1, 1, 0, 0, 0, 0], 2]], ['control [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]]', [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1, 1], 0]], ['control [[1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]]', [[1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1]], [[1, 0, 0, 0, 1, 1, 1], 1]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]]', [[0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1]], [[0, 1, 0, 1], 2]], ['partial-repair [[1, 1, 1, 0]]', [[1, 1, 1, 0]], [[], 3]], ['control [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0]]', [[1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0]], [[1, 0, 0, 0, 1, 1, 1], 2]], ['control [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]]', [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 1, 1], 0]], ['control [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]]', [[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1]], [[0, 0, 0, 0, 0, 0, 1, 1], 1]], ['control [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0]]', [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0]], [[0, 0, 0, 0, 0, 0, 1, 1], 2]]], [['regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]', [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]], [[1, 1, 0, 0, 0, 0], 2]], ['regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2]], ['partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]', [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]], [[0, 1, 0, 0], 2]], ['partial-repair [[1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0]]', [[1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0]], [[1, 0, 1, 0, 0], 2]], ['control [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1]]', [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1]], [[0, 1, 0, 1, 1], 0]], ['control [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0]]', [[0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0]], [[0, 1, 0, 1, 1], 2]], ['control [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]', [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]], [[0, 0, 0, 1, 0, 1], 0]], ['control [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0]]', [[0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0]], [[0, 0, 0, 1, 0, 1], 2]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model of the named code under the stated contract; not a production codec. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-error_correcting_codes-viterbi-hard-branch-metric","generated_at":"2026-09-29T14:48:34.187353+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Receivers recover convolutionally coded frames by maximum-likelihood trellis search.","root_cause":"The branch metric adds (o0 != y0) or (o1 != y1) instead of the sum of both mismatches.","sha256":"4cf14c9ec15a6e968924477c9c128f2f40435fd8bbc5b62d297d26dc488fc7e1","title":"Viterbi scores a pair mismatch as one error · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":38.199,"exit_code":1,"observations":[{"actual":[[1,1,0,0,0,0],3],"check":"regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]","expected":[[1,1,0,0,0,0],2],"passed":false},{"actual":[[1,0,1,0,0,0,1,0,1],3],"check":"regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]","expected":[[1,0,1,0,0,0,1,0,1],2],"passed":false},{"actual":[[1,1,0],3],"check":"partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]","expected":[[1,1,0],2],"passed":false},{"actual":[[0,1,0,0],3],"check":"partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]","expected":[[0,1,0,0],2],"passed":false},{"actual":[[1,1,0],0],"check":"control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]","expected":[[1,1,0],0],"passed":true},{"actual":[[1,1,0],1],"check":"control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]","expected":[[1,1,0],1],"passed":true},{"actual":[[1,1,0],2],"check":"control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]","expected":[[1,1,0],2],"passed":true},{"actual":[[0,1,0,0],0],"check":"control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]","expected":[[0,1,0,0],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]\", \"actual\": [[1, 1, 0, 0, 0, 0], 3], \"expected\": [[1, 1, 0, 0, 0, 0], 2], \"passed\": false}, {\"check\": \"regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]\", \"actual\": [[1, 0, 1, 0, 0, 0, 1, 0, 1], 3], \"expected\": [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2], \"passed\": false}, {\"check\": \"partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]\", \"actual\": [[1, 1, 0], 3], \"expected\": [[1, 1, 0], 2], \"passed\": false}, {\"check\": \"partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]\", \"actual\": [[0, 1, 0, 0], 3], \"expected\": [[0, 1, 0, 0], 2], \"passed\": false}, {\"check\": \"control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]\", \"actual\": [[1, 1, 0], 0], \"expected\": [[1, 1, 0], 0], \"passed\": true}, {\"check\": \"control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]\", \"actual\": [[1, 1, 0], 1], \"expected\": [[1, 1, 0], 1], \"passed\": true}, {\"check\": \"control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]\", \"actual\": [[1, 1, 0], 2], \"expected\": [[1, 1, 0], 2], \"passed\": true}, {\"check\": \"control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]\", \"actual\": [[0, 1, 0, 0], 0], \"expected\": [[0, 1, 0, 0], 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.577,"exit_code":1,"observations":[{"actual":[[1,1,0,0,0,0],1],"check":"regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]","expected":[[1,1,0,0,0,0],2],"passed":false},{"actual":[[1,0,0,0,0,0,1,0,1],2],"check":"regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]","expected":[[1,0,1,0,0,0,1,0,1],2],"passed":false},{"actual":[[1,1,0],2],"check":"partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]","expected":[[1,1,0],2],"passed":true},{"actual":[[0,1,0,0],2],"check":"partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]","expected":[[0,1,0,0],2],"passed":true},{"actual":[[1,1,0],0],"check":"control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]","expected":[[1,1,0],0],"passed":true},{"actual":[[1,1,0],1],"check":"control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]","expected":[[1,1,0],1],"passed":true},{"actual":[[1,1,0],2],"check":"control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]","expected":[[1,1,0],2],"passed":true},{"actual":[[0,1,0,0],0],"check":"control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]","expected":[[0,1,0,0],0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0]]\", \"actual\": [[1, 1, 0, 0, 0, 0], 1], \"expected\": [[1, 1, 0, 0, 0, 0], 2], \"passed\": false}, {\"check\": \"regression [[1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1]]\", \"actual\": [[1, 0, 0, 0, 0, 0, 1, 0, 1], 2], \"expected\": [[1, 0, 1, 0, 0, 0, 1, 0, 1], 2], \"passed\": false}, {\"check\": \"partial-repair [[0, 1, 0, 1, 0, 1, 1, 1, 0, 1]]\", \"actual\": [[1, 1, 0], 2], \"expected\": [[1, 1, 0], 2], \"passed\": true}, {\"check\": \"partial-repair [[0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0]]\", \"actual\": [[0, 1, 0, 0], 2], \"expected\": [[0, 1, 0, 0], 2], \"passed\": true}, {\"check\": \"control [[1, 1, 0, 1, 0, 1, 1, 1, 0, 0]]\", \"actual\": [[1, 1, 0], 0], \"expected\": [[1, 1, 0], 0], \"passed\": true}, {\"check\": \"control [[1, 1, 0, 0, 0, 1, 1, 1, 0, 0]]\", \"actual\": [[1, 1, 0], 1], \"expected\": [[1, 1, 0], 1], \"passed\": true}, {\"check\": \"control [[1, 1, 0, 1, 0, 1, 1, 0, 0, 1]]\", \"actual\": [[1, 1, 0], 2], \"expected\": [[1, 1, 0], 2], \"passed\": true}, {\"check\": \"control [[0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0]]\", \"actual\": [[0, 1, 0, 0], 0], \"expected\": [[0, 1, 0, 0], 0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}