FAILURE MAP
← Case archive

FA-71976 / Error-correcting codes / Open access

GF(256) antilog table is not extended · case 01

The inverse of 1 is reported as 0.

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

ROOT CAUSE

EXP entries 255..509 are left at zero, so EXP[255] is 0 instead of 1.

VERIFIED REPAIR

Mirror EXP[0..254] into EXP[255..509].

Unsuccessful approach: Mirroring with an offset of 254 shifts the extended entries by one.

Case contract

Table-driven GF(2^8) (polynomial 0x11D, generator 2) operations: "div" a/b (None for b = 0, 0 for a = 0 otherwise), "inv" 1/a (None for 0) and "pow" a^b for integer b >= 0 (0^0 = 1, 0^b = 0). EXP is extended to 510 entries so sums of logarithms need no reduction. Unknown ops return None.

Why this case matters

Reed-Solomon decoders spend most time in log/antilog table lookups for division and inversion.

1 / The failure

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

N = 1
observations = []
def solve(op, a, b):
    EXP = [0] * 510
    LOG = [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    if op == 'div':
        if b == 0:
            return None
        if a == 0:
            return 0
        return EXP[(LOG[a] - LOG[b]) % 255]
    if op == 'inv':
        if a == 0:
            return None
        return EXP[255 - LOG[a]]
    if op == 'pow':
        if a == 0:
            return 0 if b > 0 else 1
        return EXP[(LOG[a] * b) % 255]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 1, 2]', ['div', 1, 2], 142], ['control ["div", 70, 40]', ['div', 70, 40], 108], ['control ["div", 57, 11]', ['div', 57, 11], 179], ['control ["div", 226, 96]', ['div', 226, 96], 190], ['control ["div", 238, 211]', ['div', 238, 211], 155], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76], ['control ["div", 73, 232]', ['div', 73, 232], 21], ['control ["div", 152, 74]', ['div', 152, 74], 235], ['control ["div", 255, 217]', ['div', 255, 217], 240], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133], ['control ["inv", 143, 0]', ['inv', 143, 0], 245], ['control ["inv", 212, 0]', ['inv', 212, 0], 249], ['control ["inv", 188, 0]', ['inv', 188, 0], 149], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214], ['control ["pow", 155, 166]', ['pow', 155, 166], 194], ['control ["pow", 28, 117]', ['pow', 28, 117], 100], ['control ["pow", 149, 57]', ['pow', 149, 57], 39], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40], ['control ["pow", 55, 427]', ['pow', 55, 427], 28], ['control ["div", 0, 0]', ['div', 0, 0], None], ['control ["div", 0, 7]', ['div', 0, 7], 0], ['control ["div", 7, 0]', ['div', 7, 0], None], ['control ["div", 1, 1]', ['div', 1, 1], 1]]]
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 ["inv", 1, 0]01Failed
control ["div", 1, 2]142142Passed
control ["div", 70, 40]108108Passed
control ["div", 57, 11]179179Passed
control ["div", 226, 96]190190Passed
control ["div", 238, 211]155155Passed
control ["div", 48, 99]118118Passed
control ["div", 65, 255]7676Passed

SHA-256 / b7c468e38f44cc5a9f98780c7d69a6bb12749c2a346c46f4799b3d496f7d2387

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(op, a, b):
    EXP = [0] * 510
    LOG = [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    for i in range(255, 510):
        EXP[i] = EXP[i - 254]
    if op == 'div':
        if b == 0:
            return None
        if a == 0:
            return 0
        return EXP[(LOG[a] - LOG[b]) % 255]
    if op == 'inv':
        if a == 0:
            return None
        return EXP[255 - LOG[a]]
    if op == 'pow':
        if a == 0:
            return 0 if b > 0 else 1
        return EXP[(LOG[a] * b) % 255]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 1, 2]', ['div', 1, 2], 142], ['control ["div", 70, 40]', ['div', 70, 40], 108], ['control ["div", 57, 11]', ['div', 57, 11], 179], ['control ["div", 226, 96]', ['div', 226, 96], 190], ['control ["div", 238, 211]', ['div', 238, 211], 155], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76], ['control ["div", 73, 232]', ['div', 73, 232], 21], ['control ["div", 152, 74]', ['div', 152, 74], 235], ['control ["div", 255, 217]', ['div', 255, 217], 240], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133], ['control ["inv", 143, 0]', ['inv', 143, 0], 245], ['control ["inv", 212, 0]', ['inv', 212, 0], 249], ['control ["inv", 188, 0]', ['inv', 188, 0], 149], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214], ['control ["pow", 155, 166]', ['pow', 155, 166], 194], ['control ["pow", 28, 117]', ['pow', 28, 117], 100], ['control ["pow", 149, 57]', ['pow', 149, 57], 39], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40], ['control ["pow", 55, 427]', ['pow', 55, 427], 28], ['control ["div", 0, 0]', ['div', 0, 0], None], ['control ["div", 0, 7]', ['div', 0, 7], 0], ['control ["div", 7, 0]', ['div', 7, 0], None], ['control ["div", 1, 1]', ['div', 1, 1], 1]]]
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 ["inv", 1, 0]21Failed
control ["div", 1, 2]142142Passed
control ["div", 70, 40]108108Passed
control ["div", 57, 11]179179Passed
control ["div", 226, 96]190190Passed
control ["div", 238, 211]155155Passed
control ["div", 48, 99]118118Passed
control ["div", 65, 255]7676Passed

SHA-256 / f9a3846e1123b0a34de61e61cd2133771850b31843438053e8fe2e60cbedf874

3 / The verified repair

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

N = 1
observations = []
def solve(op, a, b):
    EXP = [0] * 510
    LOG = [0] * 256
    x = 1
    for i in range(255):
        EXP[i] = x
        LOG[x] = i
        x <<= 1
        if x & 0x100:
            x ^= 0x11D
    for i in range(255, 510):
        EXP[i] = EXP[i - 255]
    if op == 'div':
        if b == 0:
            return None
        if a == 0:
            return 0
        return EXP[(LOG[a] - LOG[b]) % 255]
    if op == 'inv':
        if a == 0:
            return None
        return EXP[255 - LOG[a]]
    if op == 'pow':
        if a == 0:
            return 0 if b > 0 else 1
        return EXP[(LOG[a] * b) % 255]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 1, 2]', ['div', 1, 2], 142], ['control ["div", 70, 40]', ['div', 70, 40], 108], ['control ["div", 57, 11]', ['div', 57, 11], 179], ['control ["div", 226, 96]', ['div', 226, 96], 190], ['control ["div", 238, 211]', ['div', 238, 211], 155], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 48, 99]', ['div', 48, 99], 118], ['control ["div", 65, 255]', ['div', 65, 255], 76], ['control ["div", 73, 232]', ['div', 73, 232], 21], ['control ["div", 152, 74]', ['div', 152, 74], 235], ['control ["div", 255, 217]', ['div', 255, 217], 240], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["div", 82, 3]', ['div', 82, 3], 197], ['control ["inv", 204, 0]', ['inv', 204, 0], 133], ['control ["inv", 143, 0]', ['inv', 143, 0], 245], ['control ["inv", 212, 0]', ['inv', 212, 0], 249], ['control ["inv", 188, 0]', ['inv', 188, 0], 149], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["inv", 186, 0]', ['inv', 186, 0], 7], ['control ["inv", 215, 0]', ['inv', 215, 0], 214], ['control ["pow", 155, 166]', ['pow', 155, 166], 194], ['control ["pow", 28, 117]', ['pow', 28, 117], 100], ['control ["pow", 149, 57]', ['pow', 149, 57], 39], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40]], [['regression ["inv", 1, 0]', ['inv', 1, 0], 1], ['control ["pow", 63, 61]', ['pow', 63, 61], 49], ['control ["pow", 9, 596]', ['pow', 9, 596], 40], ['control ["pow", 55, 427]', ['pow', 55, 427], 28], ['control ["div", 0, 0]', ['div', 0, 0], None], ['control ["div", 0, 7]', ['div', 0, 7], 0], ['control ["div", 7, 0]', ['div', 7, 0], None], ['control ["div", 1, 1]', ['div', 1, 1], 1]]]
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 ["inv", 1, 0]11Passed
control ["div", 1, 2]142142Passed
control ["div", 70, 40]108108Passed
control ["div", 57, 11]179179Passed
control ["div", 226, 96]190190Passed
control ["div", 238, 211]155155Passed
control ["div", 48, 99]118118Passed
control ["div", 65, 255]7676Passed

SHA-256 / a5c4919be6951a2ffacae227bcb67e99746f06ca81ca7159b5487c470b802bb6

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

Case digest / 6ed6c33623ee6a66da49c2c14ee6bb102eb9c5c78baaee87b8e86ee7a8ffe1d6