{"abstract":"Clean frames are reported corrupted or \"corrected\" into different payloads.","category":"Error-correcting codes","checks":8,"contract":"Frames of 2..15 bytes end with a CRC-8 (polynomial 0x07, initial value 0, MSB first, no final XOR) over the preceding bytes. A matching CRC is \"clean\"; otherwise try every single-bit flip across the whole frame, including the CRC byte, and accept the first that makes the CRC match (\"corrected\"). Otherwise \"uncorrectable\". Return [status, payload bytes or None].","contract_signature":"frame","evaluation_group":"w2-error_correcting_codes-crc8-bit-correction","failed_approach":"Starting at 0 but XORing 0xFF at the end is a different CRC variant.","family":"w2-error_correcting_codes-crc8-bit-correction-crc-init","id":"FA-72226","implementations":{"attempt":{"sha256":"9523b83a57e9a5c7dc5ac453ae11cc189242334b7f2739ccaf0c2d2c9daecf64","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(frame):\n    def crc8(data):\n        c = 0\n        for byte in data:\n            c ^= byte\n            for _ in range(8):\n                c = ((c << 1) ^ 0x07) & 0xFF if c & 0x80 else (c << 1) & 0xFF\n        return c ^ 0xFF\n    if not 2 <= len(frame) <= 15:\n        return None\n    if crc8(frame[:-1]) == frame[-1]:\n        return ['clean', list(frame[:-1])]\n    for pos in range(8 * len(frame)):\n        trial = list(frame)\n        trial[pos // 8] ^= 0x80 >> (pos % 8)\n        if crc8(trial[:-1]) == trial[-1]:\n            return ['corrected', trial[:-1]]\n    return ['uncorrectable', None]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]', [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]], ['clean', [49, 50, 51, 52, 53, 54, 55, 56, 57]]], ['regression [[61, 179]]', [[61, 179]], ['clean', [61]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[61, 51]]', [[61, 51]], ['corrected', [61]]], ['control [[61, 177]]', [[61, 177]], ['corrected', [61]]], ['control [[167, 181, 113]]', [[167, 181, 113]], ['clean', [167, 181]]], ['control [[183, 181, 113]]', [[183, 181, 113]], ['corrected', [167, 181]]]], [['regression [[61, 177]]', [[61, 177]], ['corrected', [61]]], ['regression [[167, 181, 113]]', [[167, 181, 113]], ['clean', [167, 181]]], ['control [[1]]', [[1]], None], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[72, 197, 62, 193]]', [[72, 197, 62, 193]], ['clean', [72, 197, 62]]], ['control [[72, 197, 62, 201]]', [[72, 197, 62, 201]], ['corrected', [72, 197, 62]]], ['control [[175, 80, 114, 95, 27]]', [[175, 80, 114, 95, 27]], ['clean', [175, 80, 114, 95]]], ['control [[175, 80, 115, 95, 27]]', [[175, 80, 115, 95, 27]], ['corrected', [175, 80, 114, 95]]]], [['regression [[167, 181, 81]]', [[167, 181, 81]], ['corrected', [167, 181]]], ['regression [[72, 197, 62, 193]]', [[72, 197, 62, 193]], ['clean', [72, 197, 62]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[2, 155, 243, 103, 139, 4, 159]]', [[2, 155, 243, 103, 139, 4, 159]], ['clean', [2, 155, 243, 103, 139, 4]]], ['control [[2, 155, 243, 111, 139, 4, 159]]', [[2, 155, 243, 111, 139, 4, 159]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[2, 155, 243, 103, 139, 4, 158]]', [[2, 155, 243, 103, 139, 4, 158]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[210, 131, 94, 129, 185, 125, 64, 227, 14]]', [[210, 131, 94, 129, 185, 125, 64, 227, 14]], ['clean', [210, 131, 94, 129, 185, 125, 64, 227]]]], [['regression [[175, 80, 114, 95, 27]]', [[175, 80, 114, 95, 27]], ['clean', [175, 80, 114, 95]]], ['regression [[175, 80, 115, 95, 27]]', [[175, 80, 115, 95, 27]], ['corrected', [175, 80, 114, 95]]], ['control [[1]]', [[1]], None], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[210, 131, 94, 129, 185, 125, 64, 227, 15]]', [[210, 131, 94, 129, 185, 125, 64, 227, 15]], ['corrected', [210, 131, 94, 129, 185, 125, 64, 227]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 147]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 147]], ['clean', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 155]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 155]], ['corrected', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 151]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 151]], ['corrected', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]]], [['regression [[2, 155, 243, 103, 139, 4, 159]]', [[2, 155, 243, 103, 139, 4, 159]], ['clean', [2, 155, 243, 103, 139, 4]]], ['regression [[2, 155, 243, 111, 139, 4, 159]]', [[2, 155, 243, 111, 139, 4, 159]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[195, 130, 127, 222]]', [[195, 130, 127, 222]], ['corrected', [195, 130, 127]]], ['control [[195, 130, 127, 215]]', [[195, 130, 127, 215]], ['corrected', [195, 130, 127]]], ['control [[127, 209, 201, 183, 47, 43]]', [[127, 209, 201, 183, 47, 43]], ['clean', [127, 209, 201, 183, 47]]], ['control [[127, 209, 205, 183, 47, 43]]', [[127, 209, 205, 183, 47, 43]], ['corrected', [127, 209, 201, 183, 47]]]]]\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":"e625f3050a66158c15531c650450dbbb1c0b4ce3cfcb21815d341f5a1831ca76","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(frame):\n    def crc8(data):\n        c = 0xFF\n        for byte in data:\n            c ^= byte\n            for _ in range(8):\n                c = ((c << 1) ^ 0x07) & 0xFF if c & 0x80 else (c << 1) & 0xFF\n        return c\n    if not 2 <= len(frame) <= 15:\n        return None\n    if crc8(frame[:-1]) == frame[-1]:\n        return ['clean', list(frame[:-1])]\n    for pos in range(8 * len(frame)):\n        trial = list(frame)\n        trial[pos // 8] ^= 0x80 >> (pos % 8)\n        if crc8(trial[:-1]) == trial[-1]:\n            return ['corrected', trial[:-1]]\n    return ['uncorrectable', None]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]', [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]], ['clean', [49, 50, 51, 52, 53, 54, 55, 56, 57]]], ['regression [[61, 179]]', [[61, 179]], ['clean', [61]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[61, 51]]', [[61, 51]], ['corrected', [61]]], ['control [[61, 177]]', [[61, 177]], ['corrected', [61]]], ['control [[167, 181, 113]]', [[167, 181, 113]], ['clean', [167, 181]]], ['control [[183, 181, 113]]', [[183, 181, 113]], ['corrected', [167, 181]]]], [['regression [[61, 177]]', [[61, 177]], ['corrected', [61]]], ['regression [[167, 181, 113]]', [[167, 181, 113]], ['clean', [167, 181]]], ['control [[1]]', [[1]], None], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[72, 197, 62, 193]]', [[72, 197, 62, 193]], ['clean', [72, 197, 62]]], ['control [[72, 197, 62, 201]]', [[72, 197, 62, 201]], ['corrected', [72, 197, 62]]], ['control [[175, 80, 114, 95, 27]]', [[175, 80, 114, 95, 27]], ['clean', [175, 80, 114, 95]]], ['control [[175, 80, 115, 95, 27]]', [[175, 80, 115, 95, 27]], ['corrected', [175, 80, 114, 95]]]], [['regression [[167, 181, 81]]', [[167, 181, 81]], ['corrected', [167, 181]]], ['regression [[72, 197, 62, 193]]', [[72, 197, 62, 193]], ['clean', [72, 197, 62]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[2, 155, 243, 103, 139, 4, 159]]', [[2, 155, 243, 103, 139, 4, 159]], ['clean', [2, 155, 243, 103, 139, 4]]], ['control [[2, 155, 243, 111, 139, 4, 159]]', [[2, 155, 243, 111, 139, 4, 159]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[2, 155, 243, 103, 139, 4, 158]]', [[2, 155, 243, 103, 139, 4, 158]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[210, 131, 94, 129, 185, 125, 64, 227, 14]]', [[210, 131, 94, 129, 185, 125, 64, 227, 14]], ['clean', [210, 131, 94, 129, 185, 125, 64, 227]]]], [['regression [[175, 80, 114, 95, 27]]', [[175, 80, 114, 95, 27]], ['clean', [175, 80, 114, 95]]], ['regression [[175, 80, 115, 95, 27]]', [[175, 80, 115, 95, 27]], ['corrected', [175, 80, 114, 95]]], ['control [[1]]', [[1]], None], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[210, 131, 94, 129, 185, 125, 64, 227, 15]]', [[210, 131, 94, 129, 185, 125, 64, 227, 15]], ['corrected', [210, 131, 94, 129, 185, 125, 64, 227]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 147]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 147]], ['clean', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 155]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 155]], ['corrected', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]], ['control [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 151]]', [[210, 125, 246, 195, 53, 171, 122, 103, 140, 202, 151]], ['corrected', [210, 125, 246, 195, 53, 171, 122, 103, 140, 202]]]], [['regression [[2, 155, 243, 103, 139, 4, 159]]', [[2, 155, 243, 103, 139, 4, 159]], ['clean', [2, 155, 243, 103, 139, 4]]], ['regression [[2, 155, 243, 111, 139, 4, 159]]', [[2, 155, 243, 111, 139, 4, 159]], ['corrected', [2, 155, 243, 103, 139, 4]]], ['control [[49, 50, 51]]', [[49, 50, 51]], ['uncorrectable', None]], ['control [[1]]', [[1]], None], ['control [[195, 130, 127, 222]]', [[195, 130, 127, 222]], ['corrected', [195, 130, 127]]], ['control [[195, 130, 127, 215]]', [[195, 130, 127, 215]], ['corrected', [195, 130, 127]]], ['control [[127, 209, 201, 183, 47, 43]]', [[127, 209, 201, 183, 47, 43]], ['clean', [127, 209, 201, 183, 47]]], ['control [[127, 209, 205, 183, 47, 43]]', [[127, 209, 205, 183, 47, 43]], ['corrected', [127, 209, 201, 183, 47]]]]]\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-crc8-bit-correction-crc-init","generated_at":"2026-09-29T14:48:36.635299+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Sensor buses use short CRC-protected frames and correct single-bit upsets instead of retransmitting.","root_cause":"The CRC register starts at 0xFF although the stated CRC-8 starts at 0.","sha256":"b2e458d408314e34078ef490944c24b29f369b0dc37a43fcd9a243e786d4db08","title":"CRC correction presets the register to all ones · 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":39.065,"exit_code":1,"observations":[{"actual":["uncorrectable",null],"check":"regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]","expected":["clean",[49,50,51,52,53,54,55,56,57]],"passed":false},{"actual":["uncorrectable",null],"check":"regression [[61, 179]]","expected":["clean",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[49, 50, 51]]","expected":["uncorrectable",null],"passed":true},{"actual":null,"check":"control [[1]]","expected":null,"passed":true},{"actual":["uncorrectable",null],"check":"control [[61, 51]]","expected":["corrected",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[61, 177]]","expected":["corrected",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[167, 181, 113]]","expected":["clean",[167,181]],"passed":false},{"actual":["corrected",[191,181]],"check":"control [[183, 181, 113]]","expected":["corrected",[167,181]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [49, 50, 51, 52, 53, 54, 55, 56, 57]], \"passed\": false}, {\"check\": \"regression [[61, 179]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [61]], \"passed\": false}, {\"check\": \"control [[49, 50, 51]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"uncorrectable\", null], \"passed\": true}, {\"check\": \"control [[1]]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [[61, 51]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"corrected\", [61]], \"passed\": false}, {\"check\": \"control [[61, 177]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"corrected\", [61]], \"passed\": false}, {\"check\": \"control [[167, 181, 113]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [167, 181]], \"passed\": false}, {\"check\": \"control [[183, 181, 113]]\", \"actual\": [\"corrected\", [191, 181]], \"expected\": [\"corrected\", [167, 181]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.955,"exit_code":1,"observations":[{"actual":["uncorrectable",null],"check":"regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]","expected":["clean",[49,50,51,52,53,54,55,56,57]],"passed":false},{"actual":["uncorrectable",null],"check":"regression [[61, 179]]","expected":["clean",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[49, 50, 51]]","expected":["uncorrectable",null],"passed":true},{"actual":null,"check":"control [[1]]","expected":null,"passed":true},{"actual":["uncorrectable",null],"check":"control [[61, 51]]","expected":["corrected",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[61, 177]]","expected":["corrected",[61]],"passed":false},{"actual":["uncorrectable",null],"check":"control [[167, 181, 113]]","expected":["clean",[167,181]],"passed":false},{"actual":["corrected",[183,181]],"check":"control [[183, 181, 113]]","expected":["corrected",[167,181]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[49, 50, 51, 52, 53, 54, 55, 56, 57, 244]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [49, 50, 51, 52, 53, 54, 55, 56, 57]], \"passed\": false}, {\"check\": \"regression [[61, 179]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [61]], \"passed\": false}, {\"check\": \"control [[49, 50, 51]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"uncorrectable\", null], \"passed\": true}, {\"check\": \"control [[1]]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [[61, 51]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"corrected\", [61]], \"passed\": false}, {\"check\": \"control [[61, 177]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"corrected\", [61]], \"passed\": false}, {\"check\": \"control [[167, 181, 113]]\", \"actual\": [\"uncorrectable\", null], \"expected\": [\"clean\", [167, 181]], \"passed\": false}, {\"check\": \"control [[183, 181, 113]]\", \"actual\": [\"corrected\", [183, 181]], \"expected\": [\"corrected\", [167, 181]], \"passed\": false}], \"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."}}