{"abstract":"Operands with the top bit set are not reduced.","category":"Error-correcting codes","checks":8,"contract":"Multiply two elements of GF(2^8) defined by the primitive polynomial x^8+x^4+x^3+x^2+1 (0x11D) using shift-and-add. Operands outside 0..255 return None.","contract_signature":"a, b","evaluation_group":"w2-error_correcting_codes-gf256-multiply","failed_approach":"Sampling bit 6 before the shift reduces one step early.","family":"w2-error_correcting_codes-gf256-multiply-carry-sampling","id":"FA-71966","implementations":{"attempt":{"sha256":"285673dd2c6c72c69543c19f1a6f885359fcba930f684eaf5423a0392fd41091","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b):\n    if not (0 <= a < 256 and 0 <= b < 256):\n        return None\n    p = 0\n    for _ in range(8):\n        if b & 1:\n            p ^= a\n        b >>= 1\n        carry = a & 0x40\n        a = (a << 1) & 0xFF\n        if carry:\n            a ^= 0x1D\n    return p\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [158, 185]', [158, 185], 141], ['regression [66, 7]', [66, 7], 211], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [198, 115]', [198, 115], 153], ['control [136, 144]', [136, 144], 15], ['control [184, 92]', [184, 92], 29]], [['regression [198, 115]', [198, 115], 153], ['regression [136, 144]', [136, 144], 15], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [95, 65]', [95, 65], 1], ['control [44, 122]', [44, 122], 249], ['control [232, 214]', [232, 214], 217]], [['regression [243, 34]', [243, 34], 240], ['regression [9, 184]', [9, 184], 17], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [231, 130]', [231, 130], 45], ['control [28, 61]', [28, 61], 246], ['control [253, 149]', [253, 149], 58]], [['regression [44, 122]', [44, 122], 249], ['regression [232, 214]', [232, 214], 217], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [117, 177]', [117, 177], 104], ['control [70, 227]', [70, 227], 18], ['control [114, 166]', [114, 166], 104]], [['regression [51, 91]', [51, 91], 155], ['regression [231, 130]', [231, 130], 45], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [1, 200]', [1, 200], 200], ['control [2, 128]', [2, 128], 29], ['control [128, 2]', [128, 2], 29]]]\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":"57ecb8ed83a58ea02b25ea965f56cec3d7c5ced08db2cdf124652fcd003fa7a3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b):\n    if not (0 <= a < 256 and 0 <= b < 256):\n        return None\n    p = 0\n    for _ in range(8):\n        if b & 1:\n            p ^= a\n        b >>= 1\n        a = (a << 1) & 0xFF\n        carry = a & 0x80\n        if carry:\n            a ^= 0x1D\n    return p\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [158, 185]', [158, 185], 141], ['regression [66, 7]', [66, 7], 211], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [198, 115]', [198, 115], 153], ['control [136, 144]', [136, 144], 15], ['control [184, 92]', [184, 92], 29]], [['regression [198, 115]', [198, 115], 153], ['regression [136, 144]', [136, 144], 15], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [95, 65]', [95, 65], 1], ['control [44, 122]', [44, 122], 249], ['control [232, 214]', [232, 214], 217]], [['regression [243, 34]', [243, 34], 240], ['regression [9, 184]', [9, 184], 17], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [231, 130]', [231, 130], 45], ['control [28, 61]', [28, 61], 246], ['control [253, 149]', [253, 149], 58]], [['regression [44, 122]', [44, 122], 249], ['regression [232, 214]', [232, 214], 217], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [256, 1]', [256, 1], None], ['control [117, 177]', [117, 177], 104], ['control [70, 227]', [70, 227], 18], ['control [114, 166]', [114, 166], 104]], [['regression [51, 91]', [51, 91], 155], ['regression [231, 130]', [231, 130], 45], ['control [256, 1]', [256, 1], None], ['control [0, 5]', [0, 5], 0], ['control [3, 7]', [3, 7], 9], ['control [1, 200]', [1, 200], 200], ['control [2, 128]', [2, 128], 29], ['control [128, 2]', [128, 2], 29]]]\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-gf256-multiply-carry-sampling","generated_at":"2026-09-29T14:48:34.267656+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Reed-Solomon codecs for storage and QR codes are built on GF(2^8) arithmetic with polynomial 0x11D.","root_cause":"The carry bit is sampled after the shift and mask, when it has already been discarded.","sha256":"bac7e8177c25c7314cc7affb5c9c7a7dc39dd9a26ba88e5ce1ad5df85dc688da","title":"GF(256) multiply tests the carry after shifting · 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.237,"exit_code":1,"observations":[{"actual":107,"check":"regression [158, 185]","expected":141,"passed":false},{"actual":233,"check":"regression [66, 7]","expected":211,"passed":false},{"actual":0,"check":"control [0, 5]","expected":0,"passed":true},{"actual":9,"check":"control [3, 7]","expected":9,"passed":true},{"actual":null,"check":"control [256, 1]","expected":null,"passed":true},{"actual":188,"check":"control [198, 115]","expected":153,"passed":false},{"actual":104,"check":"control [136, 144]","expected":15,"passed":false},{"actual":191,"check":"control [184, 92]","expected":29,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [158, 185]\", \"actual\": 107, \"expected\": 141, \"passed\": false}, {\"check\": \"regression [66, 7]\", \"actual\": 233, \"expected\": 211, \"passed\": false}, {\"check\": \"control [0, 5]\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control [3, 7]\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"control [256, 1]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [198, 115]\", \"actual\": 188, \"expected\": 153, \"passed\": false}, {\"check\": \"control [136, 144]\", \"actual\": 104, \"expected\": 15, \"passed\": false}, {\"check\": \"control [184, 92]\", \"actual\": 191, \"expected\": 29, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.17,"exit_code":1,"observations":[{"actual":107,"check":"regression [158, 185]","expected":141,"passed":false},{"actual":233,"check":"regression [66, 7]","expected":211,"passed":false},{"actual":0,"check":"control [0, 5]","expected":0,"passed":true},{"actual":9,"check":"control [3, 7]","expected":9,"passed":true},{"actual":null,"check":"control [256, 1]","expected":null,"passed":true},{"actual":188,"check":"control [198, 115]","expected":153,"passed":false},{"actual":104,"check":"control [136, 144]","expected":15,"passed":false},{"actual":191,"check":"control [184, 92]","expected":29,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [158, 185]\", \"actual\": 107, \"expected\": 141, \"passed\": false}, {\"check\": \"regression [66, 7]\", \"actual\": 233, \"expected\": 211, \"passed\": false}, {\"check\": \"control [0, 5]\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"control [3, 7]\", \"actual\": 9, \"expected\": 9, \"passed\": true}, {\"check\": \"control [256, 1]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [198, 115]\", \"actual\": 188, \"expected\": 153, \"passed\": false}, {\"check\": \"control [136, 144]\", \"actual\": 104, \"expected\": 15, \"passed\": false}, {\"check\": \"control [184, 92]\", \"actual\": 191, \"expected\": 29, \"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."}}