{"abstract":"Rebuilt stripes return parity as data for most stripes.","category":"Error-correcting codes","checks":8,"contract":"RAID-5 left-symmetric layout on n >= 3 disks: in stripe s the parity lives on disk n-1-(s mod n) and data chunk j lives on disk (parity + 1 + j) mod n. blocks lists the stripe per disk (ints; at most one None for a failed disk). A missing block is rebuilt by XOR; with no missing block the XOR of all blocks must be 0 or the result is \"parity-mismatch\". Return [data chunks in logical order, parity block].","contract_signature":"blocks, stripe, n","evaluation_group":"w2-error_correcting_codes-raid5-left-symmetric","failed_approach":"Using (n - s) mod n is one disk off.","family":"w2-error_correcting_codes-raid5-left-symmetric-parity-rotation","id":"FA-72031","implementations":{"attempt":{"sha256":"969cdb596b887e0bc4b7ada6f148d74c00d8c67ba45846a1eae40ed235f256fe","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(blocks, stripe, n):\n    if n < 3 or len(blocks) != n or blocks.count(None) > 1:\n        return None\n    pd = (n - stripe) % n\n    if None in blocks:\n        m = blocks.index(None)\n        x = 0\n        for k, v in enumerate(blocks):\n            if k != m:\n                x ^= v\n        blocks = blocks[:m] + [x] + blocks[m + 1:]\n    else:\n        x = 0\n        for v in blocks:\n            x ^= v\n        if x != 0:\n            return 'parity-mismatch'\n    order = [(pd + 1 + j) % n for j in range(n - 1)]\n    return [[blocks[d] for d in order], blocks[pd]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[132, 23, 147], 0, 3]', [[132, 23, 147], 0, 3], [[132, 23], 147]], ['regression [[132, null, 147], 0, 3]', [[132, None, 147], 0, 3], [[132, 23], 147]], ['control [[133, 23, 147], 0, 3]', [[133, 23, 147], 0, 3], 'parity-mismatch'], ['control [[81, 29, 77], 1, 3]', [[81, 29, 77], 1, 3], 'parity-mismatch'], ['control [[167, 226, 235, 175], 0, 4]', [[167, 226, 235, 175], 0, 4], 'parity-mismatch'], ['control [[196, 130, 1, 70], 1, 4]', [[196, 130, 1, 70], 1, 4], 'parity-mismatch'], ['control [[203, 146, 183, 239], 2, 4]', [[203, 146, 183, 239], 2, 4], 'parity-mismatch'], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch']], [['regression [[166, null, 235, 175], 0, 4]', [[166, None, 235, 175], 0, 4], [[166, 226, 235], 175]], ['regression [[197, 130, 1, 70], 1, 4]', [[197, 130, 1, 70], 1, 4], [[70, 197, 130], 1]], ['partial-repair [[80, null, 77], 1, 3]', [[80, None, 77], 1, 3], [[77, 80], 29]], ['partial-repair [[166, 226, 235, 175], 0, 4]', [[166, 226, 235, 175], 0, 4], [[166, 226, 235], 175]], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch'], ['control [[44, 55, 172, 192, 118], 2, 5]', [[44, 55, 172, 192, 118], 2, 5], 'parity-mismatch'], ['control [[94, 206, 36, 83, 230], 6, 5]', [[94, 206, 36, 83, 230], 6, 5], 'parity-mismatch'], ['control [[49, 163, 83, 128, 142, 206], 4, 6]', [[49, 163, 83, 128, 142, 206], 4, 6], 'parity-mismatch']], [['regression [[202, 146, 183, 239], 2, 4]', [[202, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['regression [[null, 146, 183, 239], 2, 4]', [[None, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['partial-repair [[197, 130, 1, 70], 1, 4]', [[197, 130, 1, 70], 1, 4], [[70, 197, 130], 1]], ['partial-repair [[197, null, 1, 70], 1, 4]', [[197, None, 1, 70], 1, 4], [[70, 197, 130], 1]], ['control [[18, 127, 108], 2, 3]', [[18, 127, 108], 2, 3], 'parity-mismatch'], ['control [[134, 159, 201, 163, 114], 0, 5]', [[134, 159, 201, 163, 114], 0, 5], 'parity-mismatch'], ['control [[1, null, null], 0, 3]', [[1, None, None], 0, 3], None], ['control [[1, 2], 0, 2]', [[1, 2], 0, 2], None]], [['regression [[96, 103, null, 49], 3, 4]', [[96, 103, None, 49], 3, 4], [[103, 54, 49], 96]], ['regression [[95, 206, 36, 83, 230], 6, 5]', [[95, 206, 36, 83, 230], 6, 5], [[230, 95, 206, 36], 83]], ['partial-repair [[null, 146, 183, 239], 2, 4]', [[None, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['partial-repair [[96, 103, 54, 49], 3, 4]', [[96, 103, 54, 49], 3, 4], [[103, 54, 49], 96]], ['control [[133, 23, 147], 0, 3]', [[133, 23, 147], 0, 3], 'parity-mismatch'], ['control [[81, 29, 77], 1, 3]', [[81, 29, 77], 1, 3], 'parity-mismatch'], ['control [[167, 226, 235, 175], 0, 4]', [[167, 226, 235, 175], 0, 4], 'parity-mismatch'], ['control [[196, 130, 1, 70], 1, 4]', [[196, 130, 1, 70], 1, 4], 'parity-mismatch']], [['regression [[48, 163, 83, 128, 142, 206], 4, 6]', [[48, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['regression [[null, 163, 83, 128, 142, 206], 4, 6]', [[None, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['partial-repair [[45, 55, 172, 192, 118], 2, 5]', [[45, 55, 172, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['partial-repair [[45, 55, null, 192, 118], 2, 5]', [[45, 55, None, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch'], ['control [[44, 55, 172, 192, 118], 2, 5]', [[44, 55, 172, 192, 118], 2, 5], 'parity-mismatch'], ['control [[94, 206, 36, 83, 230], 6, 5]', [[94, 206, 36, 83, 230], 6, 5], 'parity-mismatch'], ['control [[49, 163, 83, 128, 142, 206], 4, 6]', [[49, 163, 83, 128, 142, 206], 4, 6], 'parity-mismatch']]]\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":"fadfa63a91285e1412488c8578150f34838f66c0be7e73275d40be8215a157b1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(blocks, stripe, n):\n    if n < 3 or len(blocks) != n or blocks.count(None) > 1:\n        return None\n    pd = stripe % n\n    if None in blocks:\n        m = blocks.index(None)\n        x = 0\n        for k, v in enumerate(blocks):\n            if k != m:\n                x ^= v\n        blocks = blocks[:m] + [x] + blocks[m + 1:]\n    else:\n        x = 0\n        for v in blocks:\n            x ^= v\n        if x != 0:\n            return 'parity-mismatch'\n    order = [(pd + 1 + j) % n for j in range(n - 1)]\n    return [[blocks[d] for d in order], blocks[pd]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [[132, 23, 147], 0, 3]', [[132, 23, 147], 0, 3], [[132, 23], 147]], ['regression [[132, null, 147], 0, 3]', [[132, None, 147], 0, 3], [[132, 23], 147]], ['control [[133, 23, 147], 0, 3]', [[133, 23, 147], 0, 3], 'parity-mismatch'], ['control [[81, 29, 77], 1, 3]', [[81, 29, 77], 1, 3], 'parity-mismatch'], ['control [[167, 226, 235, 175], 0, 4]', [[167, 226, 235, 175], 0, 4], 'parity-mismatch'], ['control [[196, 130, 1, 70], 1, 4]', [[196, 130, 1, 70], 1, 4], 'parity-mismatch'], ['control [[203, 146, 183, 239], 2, 4]', [[203, 146, 183, 239], 2, 4], 'parity-mismatch'], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch']], [['regression [[166, null, 235, 175], 0, 4]', [[166, None, 235, 175], 0, 4], [[166, 226, 235], 175]], ['regression [[197, 130, 1, 70], 1, 4]', [[197, 130, 1, 70], 1, 4], [[70, 197, 130], 1]], ['partial-repair [[80, null, 77], 1, 3]', [[80, None, 77], 1, 3], [[77, 80], 29]], ['partial-repair [[166, 226, 235, 175], 0, 4]', [[166, 226, 235, 175], 0, 4], [[166, 226, 235], 175]], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch'], ['control [[44, 55, 172, 192, 118], 2, 5]', [[44, 55, 172, 192, 118], 2, 5], 'parity-mismatch'], ['control [[94, 206, 36, 83, 230], 6, 5]', [[94, 206, 36, 83, 230], 6, 5], 'parity-mismatch'], ['control [[49, 163, 83, 128, 142, 206], 4, 6]', [[49, 163, 83, 128, 142, 206], 4, 6], 'parity-mismatch']], [['regression [[202, 146, 183, 239], 2, 4]', [[202, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['regression [[null, 146, 183, 239], 2, 4]', [[None, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['partial-repair [[197, 130, 1, 70], 1, 4]', [[197, 130, 1, 70], 1, 4], [[70, 197, 130], 1]], ['partial-repair [[197, null, 1, 70], 1, 4]', [[197, None, 1, 70], 1, 4], [[70, 197, 130], 1]], ['control [[18, 127, 108], 2, 3]', [[18, 127, 108], 2, 3], 'parity-mismatch'], ['control [[134, 159, 201, 163, 114], 0, 5]', [[134, 159, 201, 163, 114], 0, 5], 'parity-mismatch'], ['control [[1, null, null], 0, 3]', [[1, None, None], 0, 3], None], ['control [[1, 2], 0, 2]', [[1, 2], 0, 2], None]], [['regression [[96, 103, null, 49], 3, 4]', [[96, 103, None, 49], 3, 4], [[103, 54, 49], 96]], ['regression [[95, 206, 36, 83, 230], 6, 5]', [[95, 206, 36, 83, 230], 6, 5], [[230, 95, 206, 36], 83]], ['partial-repair [[null, 146, 183, 239], 2, 4]', [[None, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['partial-repair [[96, 103, 54, 49], 3, 4]', [[96, 103, 54, 49], 3, 4], [[103, 54, 49], 96]], ['control [[133, 23, 147], 0, 3]', [[133, 23, 147], 0, 3], 'parity-mismatch'], ['control [[81, 29, 77], 1, 3]', [[81, 29, 77], 1, 3], 'parity-mismatch'], ['control [[167, 226, 235, 175], 0, 4]', [[167, 226, 235, 175], 0, 4], 'parity-mismatch'], ['control [[196, 130, 1, 70], 1, 4]', [[196, 130, 1, 70], 1, 4], 'parity-mismatch']], [['regression [[48, 163, 83, 128, 142, 206], 4, 6]', [[48, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['regression [[null, 163, 83, 128, 142, 206], 4, 6]', [[None, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['partial-repair [[45, 55, 172, 192, 118], 2, 5]', [[45, 55, 172, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['partial-repair [[45, 55, null, 192, 118], 2, 5]', [[45, 55, None, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['control [[97, 103, 54, 49], 3, 4]', [[97, 103, 54, 49], 3, 4], 'parity-mismatch'], ['control [[44, 55, 172, 192, 118], 2, 5]', [[44, 55, 172, 192, 118], 2, 5], 'parity-mismatch'], ['control [[94, 206, 36, 83, 230], 6, 5]', [[94, 206, 36, 83, 230], 6, 5], 'parity-mismatch'], ['control [[49, 163, 83, 128, 142, 206], 4, 6]', [[49, 163, 83, 128, 142, 206], 4, 6], 'parity-mismatch']]]\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-raid5-left-symmetric-parity-rotation","generated_at":"2026-09-29T14:48:34.802864+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Array controllers rebuild degraded stripes and must map disks to logical chunks correctly.","root_cause":"The parity disk is computed as s mod n instead of n-1-(s mod n).","sha256":"ca51c050a87ebf0f67449f3d3569736dfc64c2262520f873a4eafa208cc7591e","title":"RAID-5 parity rotates in the right-asymmetric direction · 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":36.586,"exit_code":1,"observations":[{"actual":[[23,147],132],"check":"regression [[132, 23, 147], 0, 3]","expected":[[132,23],147],"passed":false},{"actual":[[23,147],132],"check":"regression [[132, null, 147], 0, 3]","expected":[[132,23],147],"passed":false},{"actual":"parity-mismatch","check":"control [[133, 23, 147], 0, 3]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[81, 29, 77], 1, 3]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[167, 226, 235, 175], 0, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[196, 130, 1, 70], 1, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[203, 146, 183, 239], 2, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[97, 103, 54, 49], 3, 4]","expected":"parity-mismatch","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[132, 23, 147], 0, 3]\", \"actual\": [[23, 147], 132], \"expected\": [[132, 23], 147], \"passed\": false}, {\"check\": \"regression [[132, null, 147], 0, 3]\", \"actual\": [[23, 147], 132], \"expected\": [[132, 23], 147], \"passed\": false}, {\"check\": \"control [[133, 23, 147], 0, 3]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[81, 29, 77], 1, 3]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[167, 226, 235, 175], 0, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[196, 130, 1, 70], 1, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[203, 146, 183, 239], 2, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[97, 103, 54, 49], 3, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.526,"exit_code":1,"observations":[{"actual":[[23,147],132],"check":"regression [[132, 23, 147], 0, 3]","expected":[[132,23],147],"passed":false},{"actual":[[23,147],132],"check":"regression [[132, null, 147], 0, 3]","expected":[[132,23],147],"passed":false},{"actual":"parity-mismatch","check":"control [[133, 23, 147], 0, 3]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[81, 29, 77], 1, 3]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[167, 226, 235, 175], 0, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[196, 130, 1, 70], 1, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[203, 146, 183, 239], 2, 4]","expected":"parity-mismatch","passed":true},{"actual":"parity-mismatch","check":"control [[97, 103, 54, 49], 3, 4]","expected":"parity-mismatch","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [[132, 23, 147], 0, 3]\", \"actual\": [[23, 147], 132], \"expected\": [[132, 23], 147], \"passed\": false}, {\"check\": \"regression [[132, null, 147], 0, 3]\", \"actual\": [[23, 147], 132], \"expected\": [[132, 23], 147], \"passed\": false}, {\"check\": \"control [[133, 23, 147], 0, 3]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[81, 29, 77], 1, 3]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[167, 226, 235, 175], 0, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[196, 130, 1, 70], 1, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[203, 146, 183, 239], 2, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"passed\": true}, {\"check\": \"control [[97, 103, 54, 49], 3, 4]\", \"actual\": \"parity-mismatch\", \"expected\": \"parity-mismatch\", \"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."}}