{"abstract":"Decoders recover the data bits reversed.","category":"Error-correcting codes","checks":8,"contract":"Hamming(7,4) encoder: data d1..d4 go to positions 3, 5, 6, 7; the parity bit at position p (1, 2, 4) is the XOR of all other positions whose index has bit p set. Return the 7-bit codeword (position 1 first).","contract_signature":"d","evaluation_group":"w2-error_correcting_codes-hamming74-encode","failed_approach":"Swapping only d2 and d3 still misplaces half the data.","family":"w2-error_correcting_codes-hamming74-encode-data-placement","id":"FA-71866","implementations":{"attempt":{"sha256":"8b8f08a1f15402fa326ecfc0c3864fdcdf7f1d002da8415f287e841010f4bb64","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    d1, d2, d3, d4 = d\n    c = [0, 0, d1, 0, d3, d2, d4]\n    for p in (1, 2, 4):\n        v = 0\n        for pos in range(1, 8):\n            if pos & p and pos != p:\n                v ^= c[pos - 1]\n        c[p - 1] = v\n    return c\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[0, 0, 0, 1]]', [[0, 0, 0, 1]], [1, 1, 0, 1, 0, 0, 1]], ['regression [[0, 0, 1, 0]]', [[0, 0, 1, 0]], [0, 1, 0, 1, 0, 1, 0]], ['partial-repair [[0, 0, 1, 1]]', [[0, 0, 1, 1]], [1, 0, 0, 0, 0, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]]], [['regression [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]], ['regression [[0, 1, 0, 1]]', [[0, 1, 0, 1]], [0, 1, 0, 0, 1, 0, 1]], ['partial-repair [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[1, 0, 1, 1]]', [[1, 0, 1, 1]], [0, 1, 1, 0, 0, 1, 1]]], [['regression [[1, 0, 0, 0]]', [[1, 0, 0, 0]], [1, 1, 1, 0, 0, 0, 0]], ['regression [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['partial-repair [[1, 1, 0, 0]]', [[1, 1, 0, 0]], [0, 1, 1, 1, 1, 0, 0]], ['partial-repair [[1, 1, 0, 1]]', [[1, 1, 0, 1]], [1, 0, 1, 0, 1, 0, 1]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]]], [['regression [[1, 1, 0, 0]]', [[1, 1, 0, 0]], [0, 1, 1, 1, 1, 0, 0]], ['regression [[1, 1, 0, 1]]', [[1, 1, 0, 1]], [1, 0, 1, 0, 1, 0, 1]], ['partial-repair [[0, 0, 1, 1]]', [[0, 0, 1, 1]], [1, 0, 0, 0, 0, 1, 1]], ['partial-repair [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]]], [['regression [[0, 0, 0, 1]]', [[0, 0, 0, 1]], [1, 1, 0, 1, 0, 0, 1]], ['regression [[0, 0, 1, 0]]', [[0, 0, 1, 0]], [0, 1, 0, 1, 0, 1, 0]], ['partial-repair [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['partial-repair [[1, 0, 1, 1]]', [[1, 0, 1, 1]], [0, 1, 1, 0, 0, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]]]]\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":"0a23c7200eab4c824d9112af3306717383d06fcf6b42d64adcd4cf8e8cd75cce","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    d1, d2, d3, d4 = d\n    c = [0, 0, d4, 0, d3, d2, d1]\n    for p in (1, 2, 4):\n        v = 0\n        for pos in range(1, 8):\n            if pos & p and pos != p:\n                v ^= c[pos - 1]\n        c[p - 1] = v\n    return c\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[0, 0, 0, 1]]', [[0, 0, 0, 1]], [1, 1, 0, 1, 0, 0, 1]], ['regression [[0, 0, 1, 0]]', [[0, 0, 1, 0]], [0, 1, 0, 1, 0, 1, 0]], ['partial-repair [[0, 0, 1, 1]]', [[0, 0, 1, 1]], [1, 0, 0, 0, 0, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]]], [['regression [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]], ['regression [[0, 1, 0, 1]]', [[0, 1, 0, 1]], [0, 1, 0, 0, 1, 0, 1]], ['partial-repair [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[1, 0, 1, 1]]', [[1, 0, 1, 1]], [0, 1, 1, 0, 0, 1, 1]]], [['regression [[1, 0, 0, 0]]', [[1, 0, 0, 0]], [1, 1, 1, 0, 0, 0, 0]], ['regression [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['partial-repair [[1, 1, 0, 0]]', [[1, 1, 0, 0]], [0, 1, 1, 1, 1, 0, 0]], ['partial-repair [[1, 1, 0, 1]]', [[1, 1, 0, 1]], [1, 0, 1, 0, 1, 0, 1]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]]], [['regression [[1, 1, 0, 0]]', [[1, 1, 0, 0]], [0, 1, 1, 1, 1, 0, 0]], ['regression [[1, 1, 0, 1]]', [[1, 1, 0, 1]], [1, 0, 1, 0, 1, 0, 1]], ['partial-repair [[0, 0, 1, 1]]', [[0, 0, 1, 1]], [1, 0, 0, 0, 0, 1, 1]], ['partial-repair [[0, 1, 0, 0]]', [[0, 1, 0, 0]], [1, 0, 0, 1, 1, 0, 0]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]]], [['regression [[0, 0, 0, 1]]', [[0, 0, 0, 1]], [1, 1, 0, 1, 0, 0, 1]], ['regression [[0, 0, 1, 0]]', [[0, 0, 1, 0]], [0, 1, 0, 1, 0, 1, 0]], ['partial-repair [[1, 0, 1, 0]]', [[1, 0, 1, 0]], [1, 0, 1, 1, 0, 1, 0]], ['partial-repair [[1, 0, 1, 1]]', [[1, 0, 1, 1]], [0, 1, 1, 0, 0, 1, 1]], ['control [[0, 0, 0, 0]]', [[0, 0, 0, 0]], [0, 0, 0, 0, 0, 0, 0]], ['control [[0, 1, 1, 0]]', [[0, 1, 1, 0]], [1, 1, 0, 0, 1, 1, 0]], ['control [[1, 0, 0, 1]]', [[1, 0, 0, 1]], [0, 0, 1, 1, 0, 0, 1]], ['control [[1, 1, 1, 1]]', [[1, 1, 1, 1]], [1, 1, 1, 1, 1, 1, 1]]]]\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-hamming74-encode-data-placement","generated_at":"2026-09-29T14:48:33.463074+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Low-cost telemetry links protect nibbles with Hamming(7,4).","root_cause":"The data bits are placed as d4, d3, d2, d1 across positions 3, 5, 6, 7.","sha256":"205b69ff619f7d1322e785e7217db99eebfcc5c2d1972a03cd2fe73fef6075bd","title":"Hamming encoder writes the nibble in reverse order · 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.212,"exit_code":1,"observations":[{"actual":[1,1,0,1,0,0,1],"check":"regression [[0, 0, 0, 1]]","expected":[1,1,0,1,0,0,1],"passed":true},{"actual":[1,0,0,1,1,0,0],"check":"regression [[0, 0, 1, 0]]","expected":[0,1,0,1,0,1,0],"passed":false},{"actual":[0,1,0,0,1,0,1],"check":"partial-repair [[0, 0, 1, 1]]","expected":[1,0,0,0,0,1,1],"passed":false},{"actual":[0,0,0,0,0,0,0],"check":"control [[0, 0, 0, 0]]","expected":[0,0,0,0,0,0,0],"passed":true},{"actual":[1,1,0,0,1,1,0],"check":"control [[0, 1, 1, 0]]","expected":[1,1,0,0,1,1,0],"passed":true},{"actual":[0,0,1,1,0,0,1],"check":"control [[1, 0, 0, 1]]","expected":[0,0,1,1,0,0,1],"passed":true},{"actual":[1,1,1,1,1,1,1],"check":"control [[1, 1, 1, 1]]","expected":[1,1,1,1,1,1,1],"passed":true},{"actual":[0,1,0,1,0,1,0],"check":"control [[0, 1, 0, 0]]","expected":[1,0,0,1,1,0,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[0, 0, 0, 1]]\", \"actual\": [1, 1, 0, 1, 0, 0, 1], \"expected\": [1, 1, 0, 1, 0, 0, 1], \"passed\": true}, {\"check\": \"regression [[0, 0, 1, 0]]\", \"actual\": [1, 0, 0, 1, 1, 0, 0], \"expected\": [0, 1, 0, 1, 0, 1, 0], \"passed\": false}, {\"check\": \"partial-repair [[0, 0, 1, 1]]\", \"actual\": [0, 1, 0, 0, 1, 0, 1], \"expected\": [1, 0, 0, 0, 0, 1, 1], \"passed\": false}, {\"check\": \"control [[0, 0, 0, 0]]\", \"actual\": [0, 0, 0, 0, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0, 0], \"passed\": true}, {\"check\": \"control [[0, 1, 1, 0]]\", \"actual\": [1, 1, 0, 0, 1, 1, 0], \"expected\": [1, 1, 0, 0, 1, 1, 0], \"passed\": true}, {\"check\": \"control [[1, 0, 0, 1]]\", \"actual\": [0, 0, 1, 1, 0, 0, 1], \"expected\": [0, 0, 1, 1, 0, 0, 1], \"passed\": true}, {\"check\": \"control [[1, 1, 1, 1]]\", \"actual\": [1, 1, 1, 1, 1, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 1], \"passed\": true}, {\"check\": \"control [[0, 1, 0, 0]]\", \"actual\": [0, 1, 0, 1, 0, 1, 0], \"expected\": [1, 0, 0, 1, 1, 0, 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.749,"exit_code":1,"observations":[{"actual":[1,1,1,0,0,0,0],"check":"regression [[0, 0, 0, 1]]","expected":[1,1,0,1,0,0,1],"passed":false},{"actual":[1,0,0,1,1,0,0],"check":"regression [[0, 0, 1, 0]]","expected":[0,1,0,1,0,1,0],"passed":false},{"actual":[0,1,1,1,1,0,0],"check":"partial-repair [[0, 0, 1, 1]]","expected":[1,0,0,0,0,1,1],"passed":false},{"actual":[0,0,0,0,0,0,0],"check":"control [[0, 0, 0, 0]]","expected":[0,0,0,0,0,0,0],"passed":true},{"actual":[1,1,0,0,1,1,0],"check":"control [[0, 1, 1, 0]]","expected":[1,1,0,0,1,1,0],"passed":true},{"actual":[0,0,1,1,0,0,1],"check":"control [[1, 0, 0, 1]]","expected":[0,0,1,1,0,0,1],"passed":true},{"actual":[1,1,1,1,1,1,1],"check":"control [[1, 1, 1, 1]]","expected":[1,1,1,1,1,1,1],"passed":true},{"actual":[0,1,0,1,0,1,0],"check":"control [[0, 1, 0, 0]]","expected":[1,0,0,1,1,0,0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[0, 0, 0, 1]]\", \"actual\": [1, 1, 1, 0, 0, 0, 0], \"expected\": [1, 1, 0, 1, 0, 0, 1], \"passed\": false}, {\"check\": \"regression [[0, 0, 1, 0]]\", \"actual\": [1, 0, 0, 1, 1, 0, 0], \"expected\": [0, 1, 0, 1, 0, 1, 0], \"passed\": false}, {\"check\": \"partial-repair [[0, 0, 1, 1]]\", \"actual\": [0, 1, 1, 1, 1, 0, 0], \"expected\": [1, 0, 0, 0, 0, 1, 1], \"passed\": false}, {\"check\": \"control [[0, 0, 0, 0]]\", \"actual\": [0, 0, 0, 0, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0, 0], \"passed\": true}, {\"check\": \"control [[0, 1, 1, 0]]\", \"actual\": [1, 1, 0, 0, 1, 1, 0], \"expected\": [1, 1, 0, 0, 1, 1, 0], \"passed\": true}, {\"check\": \"control [[1, 0, 0, 1]]\", \"actual\": [0, 0, 1, 1, 0, 0, 1], \"expected\": [0, 0, 1, 1, 0, 0, 1], \"passed\": true}, {\"check\": \"control [[1, 1, 1, 1]]\", \"actual\": [1, 1, 1, 1, 1, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 1], \"passed\": true}, {\"check\": \"control [[0, 1, 0, 0]]\", \"actual\": [0, 1, 0, 1, 0, 1, 0], \"expected\": [1, 0, 0, 1, 1, 0, 0], \"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."}}