FAILURE MAP
← Case archive

FA-15596 / Numerics / Open access

Gf2 field multiplication: field addition operation · case 01

The exact gf2 field multiplication result violates the stated contract at field addition operation.

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

ROOT CAUSE

The field addition operation step uses out+a instead of out^a.

VERIFIED REPAIR

Use out^a at the field addition operation step.

Unsuccessful approach: The partial repair out|a still violates the field addition operation invariant.

Case contract

Input [a,b,irreducible polynomial bitmask], nonnegative field elements; return carryless product reduced by that monic polynomial.

Why this case matters

Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a,b,poly=x;n=poly.bit_length()-1;out=0
    for _ in range(n):
     if b&1:out=out+a
     b=b>>1
     a<<=1
     if a&(1<<n):a=a^poly
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 3, 7], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 7], 0), ([0, 2, 7], 0), ([0, 3, 7], 0), ([1, 0, 7], 0), ([1, 1, 7], 1)], [([3, 3, 7], 2), ([2, 7, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([2, 5, 11], 1), ([3, 6, 11], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 6, 11], 7)], [([2, 7, 11], 5), ([4, 6, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 7, 11], 1)], [([3, 3, 11], 5), ([5, 7, 11], 6), ([0, 0, 7], 0), ([15, 15, 31], 8), ([6, 4, 11], 5), ([6, 5, 11], 3), ([6, 6, 11], 2), ([6, 7, 11], 4)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 051Failed
explicit oracle 100Passed
explicit oracle 2228Failed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 600Passed
explicit oracle 711Passed

SHA-256 / 5a01b8479d2719edc5e1145f691cc98f16c4d05b3456a00d012e6bb5967bec89

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a,b,poly=x;n=poly.bit_length()-1;out=0
    for _ in range(n):
     if b&1:out=out|a
     b=b>>1
     a<<=1
     if a&(1<<n):a=a^poly
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 3, 7], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 7], 0), ([0, 2, 7], 0), ([0, 3, 7], 0), ([1, 0, 7], 0), ([1, 1, 7], 1)], [([3, 3, 7], 2), ([2, 7, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([2, 5, 11], 1), ([3, 6, 11], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 6, 11], 7)], [([2, 7, 11], 5), ([4, 6, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 7, 11], 1)], [([3, 3, 11], 5), ([5, 7, 11], 6), ([0, 0, 7], 0), ([15, 15, 31], 8), ([6, 4, 11], 5), ([6, 5, 11], 3), ([6, 6, 11], 2), ([6, 7, 11], 4)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 031Failed
explicit oracle 100Passed
explicit oracle 2158Failed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 600Passed
explicit oracle 711Passed

SHA-256 / 234867347f45c9b0eab45cc4f30ed47ab767e5031f599b4a73e2d550b95d65fa

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
    a,b,poly=x;n=poly.bit_length()-1;out=0
    for _ in range(n):
     if b&1:out=out^a
     b=b>>1
     a<<=1
     if a&(1<<n):a=a^poly
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 3, 7], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 7], 0), ([0, 2, 7], 0), ([0, 3, 7], 0), ([1, 0, 7], 0), ([1, 1, 7], 1)], [([3, 3, 7], 2), ([2, 7, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([2, 5, 11], 1), ([3, 6, 11], 1), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 6, 11], 7)], [([2, 7, 11], 5), ([4, 6, 11], 5), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 7, 11], 1)], [([3, 3, 11], 5), ([5, 7, 11], 6), ([0, 0, 7], 0), ([15, 15, 31], 8), ([6, 4, 11], 5), ([6, 5, 11], 3), ([6, 6, 11], 2), ([6, 7, 11], 4)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("explicit oracle %d" % i, 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
explicit oracle 011Passed
explicit oracle 100Passed
explicit oracle 288Passed
explicit oracle 300Passed
explicit oracle 400Passed
explicit oracle 500Passed
explicit oracle 600Passed
explicit oracle 711Passed

SHA-256 / b8c47d8a4d392ff521e7064f41021618a127d7c1d797a938f1b85733aa6b6085

Verification & scope

A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:39:28.367423+00:00.

Case digest / a280d7ae5cdceb2f32637b89194c9b93f4805f31061319d2fcde9bb7e9cb75fe