FA-72036 / Error-correcting codes / Open access
RAID-5 reads data chunks in disk order · case 01
Logical chunks come back rotated for stripes whose parity is not on the last disk.
ROOT CAUSE
Chunks are read left-asymmetrically (disk order skipping parity) instead of starting after the parity disk.
VERIFIED REPAIR
Read chunk j from disk (parity + 1 + j) mod n.
Unsuccessful approach: Walking backwards from the parity disk reverses the chunk order.
Case 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].
Why this case matters
Array controllers rebuild degraded stripes and must map disks to logical chunks correctly.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(blocks, stripe, n):
if n < 3 or len(blocks) != n or blocks.count(None) > 1:
return None
pd = n - 1 - stripe % n
if None in blocks:
m = blocks.index(None)
x = 0
for k, v in enumerate(blocks):
if k != m:
x ^= v
blocks = blocks[:m] + [x] + blocks[m + 1:]
else:
x = 0
for v in blocks:
x ^= v
if x != 0:
return 'parity-mismatch'
order = [j if j < pd else j + 1 for j in range(n - 1)]
return [[blocks[d] for d in order], blocks[pd]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[80, 29, 77], 1, 3]', [[80, 29, 77], 1, 3], [[77, 80], 29]], ['regression [[80, null, 77], 1, 3]', [[80, None, 77], 1, 3], [[77, 80], 29]], ['partial-repair [[132, 23, 147], 0, 3]', [[132, 23, 147], 0, 3], [[132, 23], 147]], ['partial-repair [[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']], [['regression [[197, null, 1, 70], 1, 4]', [[197, None, 1, 70], 1, 4], [[70, 197, 130], 1]], ['regression [[202, 146, 183, 239], 2, 4]', [[202, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['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 [[45, 55, 172, 192, 118], 2, 5]', [[45, 55, 172, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['regression [[45, 55, null, 192, 118], 2, 5]', [[45, 55, None, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['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 [[95, 206, 36, null, 230], 6, 5]', [[95, 206, 36, None, 230], 6, 5], [[230, 95, 206, 36], 83]], ['regression [[48, 163, 83, 128, 142, 206], 4, 6]', [[48, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['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 [[158, 132, 216, 194], 5, 4]', [[158, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['regression [[null, 132, 216, 194], 5, 4]', [[None, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['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']]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[80, 29, 77], 1, 3] | [[80, 77], 29] | [[77, 80], 29] | Failed |
| regression [[80, null, 77], 1, 3] | [[80, 77], 29] | [[77, 80], 29] | Failed |
| partial-repair [[132, 23, 147], 0, 3] | [[132, 23], 147] | [[132, 23], 147] | Passed |
| partial-repair [[132, null, 147], 0, 3] | [[132, 23], 147] | [[132, 23], 147] | Passed |
| control [[133, 23, 147], 0, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[81, 29, 77], 1, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[167, 226, 235, 175], 0, 4] | parity-mismatch | parity-mismatch | Passed |
| control [[196, 130, 1, 70], 1, 4] | parity-mismatch | parity-mismatch | Passed |
SHA-256 / c3740ce73b6919f506b5ed0ee8bdf1787a3a78841b688a376bcbaed1043a504c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(blocks, stripe, n):
if n < 3 or len(blocks) != n or blocks.count(None) > 1:
return None
pd = n - 1 - stripe % n
if None in blocks:
m = blocks.index(None)
x = 0
for k, v in enumerate(blocks):
if k != m:
x ^= v
blocks = blocks[:m] + [x] + blocks[m + 1:]
else:
x = 0
for v in blocks:
x ^= v
if x != 0:
return 'parity-mismatch'
order = [(pd - 1 - j) % n for j in range(n - 1)]
return [[blocks[d] for d in order], blocks[pd]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[80, 29, 77], 1, 3]', [[80, 29, 77], 1, 3], [[77, 80], 29]], ['regression [[80, null, 77], 1, 3]', [[80, None, 77], 1, 3], [[77, 80], 29]], ['partial-repair [[132, 23, 147], 0, 3]', [[132, 23, 147], 0, 3], [[132, 23], 147]], ['partial-repair [[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']], [['regression [[197, null, 1, 70], 1, 4]', [[197, None, 1, 70], 1, 4], [[70, 197, 130], 1]], ['regression [[202, 146, 183, 239], 2, 4]', [[202, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['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 [[45, 55, 172, 192, 118], 2, 5]', [[45, 55, 172, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['regression [[45, 55, null, 192, 118], 2, 5]', [[45, 55, None, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['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 [[95, 206, 36, null, 230], 6, 5]', [[95, 206, 36, None, 230], 6, 5], [[230, 95, 206, 36], 83]], ['regression [[48, 163, 83, 128, 142, 206], 4, 6]', [[48, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['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 [[158, 132, 216, 194], 5, 4]', [[158, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['regression [[null, 132, 216, 194], 5, 4]', [[None, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['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']]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[80, 29, 77], 1, 3] | [[80, 77], 29] | [[77, 80], 29] | Failed |
| regression [[80, null, 77], 1, 3] | [[80, 77], 29] | [[77, 80], 29] | Failed |
| partial-repair [[132, 23, 147], 0, 3] | [[23, 132], 147] | [[132, 23], 147] | Failed |
| partial-repair [[132, null, 147], 0, 3] | [[23, 132], 147] | [[132, 23], 147] | Failed |
| control [[133, 23, 147], 0, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[81, 29, 77], 1, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[167, 226, 235, 175], 0, 4] | parity-mismatch | parity-mismatch | Passed |
| control [[196, 130, 1, 70], 1, 4] | parity-mismatch | parity-mismatch | Passed |
SHA-256 / c7402900531c875d222dcfc5220fe2a6ec9c6cf75c37516ce9cf7863379d91df
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(blocks, stripe, n):
if n < 3 or len(blocks) != n or blocks.count(None) > 1:
return None
pd = n - 1 - stripe % n
if None in blocks:
m = blocks.index(None)
x = 0
for k, v in enumerate(blocks):
if k != m:
x ^= v
blocks = blocks[:m] + [x] + blocks[m + 1:]
else:
x = 0
for v in blocks:
x ^= v
if x != 0:
return 'parity-mismatch'
order = [(pd + 1 + j) % n for j in range(n - 1)]
return [[blocks[d] for d in order], blocks[pd]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[80, 29, 77], 1, 3]', [[80, 29, 77], 1, 3], [[77, 80], 29]], ['regression [[80, null, 77], 1, 3]', [[80, None, 77], 1, 3], [[77, 80], 29]], ['partial-repair [[132, 23, 147], 0, 3]', [[132, 23, 147], 0, 3], [[132, 23], 147]], ['partial-repair [[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']], [['regression [[197, null, 1, 70], 1, 4]', [[197, None, 1, 70], 1, 4], [[70, 197, 130], 1]], ['regression [[202, 146, 183, 239], 2, 4]', [[202, 146, 183, 239], 2, 4], [[183, 239, 202], 146]], ['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 [[45, 55, 172, 192, 118], 2, 5]', [[45, 55, 172, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['regression [[45, 55, null, 192, 118], 2, 5]', [[45, 55, None, 192, 118], 2, 5], [[192, 118, 45, 55], 172]], ['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 [[95, 206, 36, null, 230], 6, 5]', [[95, 206, 36, None, 230], 6, 5], [[230, 95, 206, 36], 83]], ['regression [[48, 163, 83, 128, 142, 206], 4, 6]', [[48, 163, 83, 128, 142, 206], 4, 6], [[83, 128, 142, 206, 48], 163]], ['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 [[158, 132, 216, 194], 5, 4]', [[158, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['regression [[null, 132, 216, 194], 5, 4]', [[None, 132, 216, 194], 5, 4], [[194, 158, 132], 216]], ['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']]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression [[80, 29, 77], 1, 3] | [[77, 80], 29] | [[77, 80], 29] | Passed |
| regression [[80, null, 77], 1, 3] | [[77, 80], 29] | [[77, 80], 29] | Passed |
| partial-repair [[132, 23, 147], 0, 3] | [[132, 23], 147] | [[132, 23], 147] | Passed |
| partial-repair [[132, null, 147], 0, 3] | [[132, 23], 147] | [[132, 23], 147] | Passed |
| control [[133, 23, 147], 0, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[81, 29, 77], 1, 3] | parity-mismatch | parity-mismatch | Passed |
| control [[167, 226, 235, 175], 0, 4] | parity-mismatch | parity-mismatch | Passed |
| control [[196, 130, 1, 70], 1, 4] | parity-mismatch | parity-mismatch | Passed |
SHA-256 / 1324e069c65d9e69a7637d833f9cabe41a84e8307e9ab0966f6a532aecbc6e19
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:48:34.885546+00:00.
Case digest / aa29453dcaf4f2d873f11aaf3b839d50b03a7aad18f21118a3dbdb7a7dcb7d32