FAILURE MAP
← Case archive

FA-72001 / Error-correcting codes / Open access

RS error flag only inspects the first syndrome · case 01

Errors that happen to leave S_0 zero are reported clean.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The flag is synd[0] != 0 rather than any nonzero syndrome.

VERIFIED REPAIR

Flag an error when any syndrome is nonzero.

Unsuccessful approach: Checking the first and last syndrome still misses errors visible only in middle syndromes.

Case contract

Reed-Solomon syndromes over GF(2^8) (0x11D, alpha = 2, first consecutive root alpha^0). msg lists coefficients from the highest degree down. S_j = msg(alpha^j) for j = 0..nsym-1 by Horner evaluation. Return [syndromes, whether any syndrome is nonzero].

Why this case matters

Storage and broadcast decoders start every Reed-Solomon block with a syndrome check.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(msg, nsym):
    EXP, LOG = [0] * 512, [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = EXP[i + 255] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    def mul(a, b):
        return 0 if a == 0 or b == 0 else EXP[LOG[a] + LOG[b]]
    
    synd = []
    for j in range(nsym):
        root = EXP[j]
        v = 0
        for coef in msg:
            v = mul(v, root) ^ coef
        synd.append(v)
    return [synd, synd[0] != 0]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]], ['control [[23, 252, 61, 64, 130], 4]', [[23, 252, 61, 64, 130], 4], [[20, 40, 7, 141], True]], ['control [[176, 102, 222, 44, 125, 89], 2]', [[176, 102, 222, 44, 125, 89], 2], [[0, 0], False]], ['control [[176, 102, 222, 61, 125, 89], 2]', [[176, 102, 222, 61, 125, 89], 2], [[17, 68], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]], ['control [[123, 214, 103, 174, 192, 187, 31], 2]', [[123, 214, 103, 174, 192, 187, 31], 2], [[0, 0], False]], ['control [[123, 214, 103, 174, 192, 161, 31], 2]', [[123, 214, 103, 174, 192, 161, 31], 2], [[26, 52], True]], ['control [[123, 214, 103, 174, 192, 161, 31], 4]', [[123, 214, 103, 174, 192, 161, 31], 4], [[26, 52, 69, 105], True]], ['control [[131, 154, 183, 135, 93, 251, 102, 233], 2]', [[131, 154, 183, 135, 93, 251, 102, 233], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['partial-repair [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 2]', [[131, 154, 183, 135, 93, 136, 102, 233], 2], [[115, 209], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 4]', [[131, 154, 183, 135, 93, 136, 102, 233], 4], [[115, 209, 164, 73], True]], ['control [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2], [[0, 0], False]], ['control [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2], [[133, 184], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['control [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2], [[0, 0], False]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2], [[203, 88], True]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4], [[203, 88, 8, 229], True]], ['control [[0, 0, 0, 0], 2]', [[0, 0, 0, 0], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[0, 0, 7], 2]', [[0, 0, 7], 2], [[7, 7], True]], ['control [[1, 0, 0, 0], 3]', [[1, 0, 0, 0], 3], [[1, 8, 64], True]], ['control [[3, 5, 7, 11], 4]', [[3, 5, 7, 11], 4], [[10, 9, 135, 32], True]], ['control [[200, 1, 0], 2]', [[200, 1, 0], 2], [[201, 5], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]]]]
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 fixtureActualExpectedOutcome
regression [[1, 5, 4], 3][[0, 10, 0], False][[0, 10, 0], True]Failed
regression [[2, 10, 8], 3][[0, 20, 0], False][[0, 20, 0], True]Failed
control [[23, 252, 61, 84, 130], 2][[0, 0], False][[0, 0], False]Passed
control [[23, 252, 61, 64, 130], 2][[20, 40], True][[20, 40], True]Passed
control [[23, 252, 61, 64, 130], 4][[20, 40, 7, 141], True][[20, 40, 7, 141], True]Passed
control [[176, 102, 222, 44, 125, 89], 2][[0, 0], False][[0, 0], False]Passed
control [[176, 102, 222, 61, 125, 89], 2][[17, 68], True][[17, 68], True]Passed
control [[176, 102, 222, 61, 125, 89], 4][[17, 68, 169, 244], True][[17, 68, 169, 244], True]Passed

SHA-256 / 0f272cb6daedfccb7c90f075ab48a3449678b17456fd7b704ce61ff5d709c50e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(msg, nsym):
    EXP, LOG = [0] * 512, [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = EXP[i + 255] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    def mul(a, b):
        return 0 if a == 0 or b == 0 else EXP[LOG[a] + LOG[b]]
    
    synd = []
    for j in range(nsym):
        root = EXP[j]
        v = 0
        for coef in msg:
            v = mul(v, root) ^ coef
        synd.append(v)
    return [synd, bool(synd[0] or synd[-1])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]], ['control [[23, 252, 61, 64, 130], 4]', [[23, 252, 61, 64, 130], 4], [[20, 40, 7, 141], True]], ['control [[176, 102, 222, 44, 125, 89], 2]', [[176, 102, 222, 44, 125, 89], 2], [[0, 0], False]], ['control [[176, 102, 222, 61, 125, 89], 2]', [[176, 102, 222, 61, 125, 89], 2], [[17, 68], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]], ['control [[123, 214, 103, 174, 192, 187, 31], 2]', [[123, 214, 103, 174, 192, 187, 31], 2], [[0, 0], False]], ['control [[123, 214, 103, 174, 192, 161, 31], 2]', [[123, 214, 103, 174, 192, 161, 31], 2], [[26, 52], True]], ['control [[123, 214, 103, 174, 192, 161, 31], 4]', [[123, 214, 103, 174, 192, 161, 31], 4], [[26, 52, 69, 105], True]], ['control [[131, 154, 183, 135, 93, 251, 102, 233], 2]', [[131, 154, 183, 135, 93, 251, 102, 233], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['partial-repair [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 2]', [[131, 154, 183, 135, 93, 136, 102, 233], 2], [[115, 209], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 4]', [[131, 154, 183, 135, 93, 136, 102, 233], 4], [[115, 209, 164, 73], True]], ['control [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2], [[0, 0], False]], ['control [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2], [[133, 184], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['control [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2], [[0, 0], False]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2], [[203, 88], True]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4], [[203, 88, 8, 229], True]], ['control [[0, 0, 0, 0], 2]', [[0, 0, 0, 0], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[0, 0, 7], 2]', [[0, 0, 7], 2], [[7, 7], True]], ['control [[1, 0, 0, 0], 3]', [[1, 0, 0, 0], 3], [[1, 8, 64], True]], ['control [[3, 5, 7, 11], 4]', [[3, 5, 7, 11], 4], [[10, 9, 135, 32], True]], ['control [[200, 1, 0], 2]', [[200, 1, 0], 2], [[201, 5], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]]]]
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 fixtureActualExpectedOutcome
regression [[1, 5, 4], 3][[0, 10, 0], False][[0, 10, 0], True]Failed
regression [[2, 10, 8], 3][[0, 20, 0], False][[0, 20, 0], True]Failed
control [[23, 252, 61, 84, 130], 2][[0, 0], False][[0, 0], False]Passed
control [[23, 252, 61, 64, 130], 2][[20, 40], True][[20, 40], True]Passed
control [[23, 252, 61, 64, 130], 4][[20, 40, 7, 141], True][[20, 40, 7, 141], True]Passed
control [[176, 102, 222, 44, 125, 89], 2][[0, 0], False][[0, 0], False]Passed
control [[176, 102, 222, 61, 125, 89], 2][[17, 68], True][[17, 68], True]Passed
control [[176, 102, 222, 61, 125, 89], 4][[17, 68, 169, 244], True][[17, 68, 169, 244], True]Passed

SHA-256 / 100f738ca0301e08ef00ff22a6604187c14126085f859bdfcb999c0f79c2afc2

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(msg, nsym):
    EXP, LOG = [0] * 512, [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = EXP[i + 255] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    def mul(a, b):
        return 0 if a == 0 or b == 0 else EXP[LOG[a] + LOG[b]]
    
    synd = []
    for j in range(nsym):
        root = EXP[j]
        v = 0
        for coef in msg:
            v = mul(v, root) ^ coef
        synd.append(v)
    return [synd, any(synd)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]], ['control [[23, 252, 61, 64, 130], 4]', [[23, 252, 61, 64, 130], 4], [[20, 40, 7, 141], True]], ['control [[176, 102, 222, 44, 125, 89], 2]', [[176, 102, 222, 44, 125, 89], 2], [[0, 0], False]], ['control [[176, 102, 222, 61, 125, 89], 2]', [[176, 102, 222, 61, 125, 89], 2], [[17, 68], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['control [[176, 102, 222, 61, 125, 89], 4]', [[176, 102, 222, 61, 125, 89], 4], [[17, 68, 169, 244], True]], ['control [[123, 214, 103, 174, 192, 187, 31], 2]', [[123, 214, 103, 174, 192, 187, 31], 2], [[0, 0], False]], ['control [[123, 214, 103, 174, 192, 161, 31], 2]', [[123, 214, 103, 174, 192, 161, 31], 2], [[26, 52], True]], ['control [[123, 214, 103, 174, 192, 161, 31], 4]', [[123, 214, 103, 174, 192, 161, 31], 4], [[26, 52, 69, 105], True]], ['control [[131, 154, 183, 135, 93, 251, 102, 233], 2]', [[131, 154, 183, 135, 93, 251, 102, 233], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['partial-repair [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 2]', [[131, 154, 183, 135, 93, 136, 102, 233], 2], [[115, 209], True]], ['control [[131, 154, 183, 135, 93, 136, 102, 233], 4]', [[131, 154, 183, 135, 93, 136, 102, 233], 4], [[115, 209, 164, 73], True]], ['control [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 165, 35, 253, 93, 184], 2], [[0, 0], False]], ['control [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2]', [[70, 25, 237, 118, 90, 32, 35, 253, 93, 184], 2], [[133, 184], True]]], [['regression [[4, 20, 16], 3]', [[4, 20, 16], 3], [[0, 40, 0], True]], ['regression [[1, 2, 3], 3]', [[1, 2, 3], 3], [[0, 3, 27], True]], ['partial-repair [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['partial-repair [[3, 15, 12], 3]', [[3, 15, 12], 3], [[0, 30, 0], True]], ['control [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 97, 156, 109, 21, 94, 12], 2], [[0, 0], False]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 2], [[203, 88], True]], ['control [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4]', [[178, 65, 204, 132, 27, 119, 170, 156, 109, 21, 94, 12], 4], [[203, 88, 8, 229], True]], ['control [[0, 0, 0, 0], 2]', [[0, 0, 0, 0], 2], [[0, 0], False]]], [['regression [[1, 5, 4], 3]', [[1, 5, 4], 3], [[0, 10, 0], True]], ['regression [[2, 10, 8], 3]', [[2, 10, 8], 3], [[0, 20, 0], True]], ['control [[0, 0, 7], 2]', [[0, 0, 7], 2], [[7, 7], True]], ['control [[1, 0, 0, 0], 3]', [[1, 0, 0, 0], 3], [[1, 8, 64], True]], ['control [[3, 5, 7, 11], 4]', [[3, 5, 7, 11], 4], [[10, 9, 135, 32], True]], ['control [[200, 1, 0], 2]', [[200, 1, 0], 2], [[201, 5], True]], ['control [[23, 252, 61, 84, 130], 2]', [[23, 252, 61, 84, 130], 2], [[0, 0], False]], ['control [[23, 252, 61, 64, 130], 2]', [[23, 252, 61, 64, 130], 2], [[20, 40], True]]]]
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 fixtureActualExpectedOutcome
regression [[1, 5, 4], 3][[0, 10, 0], True][[0, 10, 0], True]Passed
regression [[2, 10, 8], 3][[0, 20, 0], True][[0, 20, 0], True]Passed
control [[23, 252, 61, 84, 130], 2][[0, 0], False][[0, 0], False]Passed
control [[23, 252, 61, 64, 130], 2][[20, 40], True][[20, 40], True]Passed
control [[23, 252, 61, 64, 130], 4][[20, 40, 7, 141], True][[20, 40, 7, 141], True]Passed
control [[176, 102, 222, 44, 125, 89], 2][[0, 0], False][[0, 0], False]Passed
control [[176, 102, 222, 61, 125, 89], 2][[17, 68], True][[17, 68], True]Passed
control [[176, 102, 222, 61, 125, 89], 4][[17, 68, 169, 244], True][[17, 68, 169, 244], True]Passed

SHA-256 / 73d46b6a60f27c882d5239e15377e7103954a02d7ea9f1e7ca3ff37e302da87c

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.679463+00:00.

Case digest / 41c4a62c03ecf7b6e4518e11611b699939a46bea99499688bdf2aeb72dc2682f