FA-15606 / Numerics / Open access
Gf2 field multiplication: irreducible polynomial reduction · case 01
The exact gf2 field multiplication result violates the stated contract at irreducible polynomial reduction.
ROOT CAUSE
The irreducible polynomial reduction step uses a-poly instead of a^poly.
VERIFIED REPAIR
Use a^poly at the irreducible polynomial reduction step.
Unsuccessful approach: The partial repair a&((1<<n)-1) still violates the irreducible polynomial reduction 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, 2, 7], 3), ([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)], [([2, 3, 7], 1), ([3, 3, 7], 2), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([3, 2, 7], 1), ([2, 6, 11], 7), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 5, 11], 1)], [([3, 3, 7], 2), ([3, 5, 11], 4), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 6, 11], 5)], [([2, 4, 11], 3), ([4, 2, 11], 3), ([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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | -3 | 3 | Failed |
| explicit oracle 1 | 0 | 0 | Passed |
| explicit oracle 2 | -80 | 8 | Failed |
| explicit oracle 3 | 0 | 0 | Passed |
| explicit oracle 4 | 0 | 0 | Passed |
| explicit oracle 5 | 0 | 0 | Passed |
| explicit oracle 6 | 0 | 0 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / c720a1d31782f41ff7ccfc4bfab55cd4db8ec749b97ebfdfd0e7a3134c5d86a9
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&((1<<n)-1)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([2, 2, 7], 3), ([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)], [([2, 3, 7], 1), ([3, 3, 7], 2), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([3, 2, 7], 1), ([2, 6, 11], 7), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 5, 11], 1)], [([3, 3, 7], 2), ([3, 5, 11], 4), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 6, 11], 5)], [([2, 4, 11], 3), ([4, 2, 11], 3), ([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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | 0 | 3 | Failed |
| explicit oracle 1 | 0 | 0 | Passed |
| explicit oracle 2 | 5 | 8 | Failed |
| explicit oracle 3 | 0 | 0 | Passed |
| explicit oracle 4 | 0 | 0 | Passed |
| explicit oracle 5 | 0 | 0 | Passed |
| explicit oracle 6 | 0 | 0 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / 0a1d429d3e9019b5fa40b9de3ad1a49e1cdf0d01bcfa60bae2cd95d7fa203375
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, 2, 7], 3), ([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)], [([2, 3, 7], 1), ([3, 3, 7], 2), ([0, 0, 7], 0), ([15, 15, 31], 8), ([0, 1, 11], 0), ([0, 2, 11], 0), ([0, 3, 11], 0), ([0, 4, 11], 0)], [([3, 2, 7], 1), ([2, 6, 11], 7), ([0, 0, 7], 0), ([15, 15, 31], 8), ([2, 2, 11], 4), ([2, 3, 11], 6), ([2, 4, 11], 3), ([2, 5, 11], 1)], [([3, 3, 7], 2), ([3, 5, 11], 4), ([0, 0, 7], 0), ([15, 15, 31], 8), ([4, 3, 11], 7), ([4, 4, 11], 6), ([4, 5, 11], 2), ([4, 6, 11], 5)], [([2, 4, 11], 3), ([4, 2, 11], 3), ([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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| explicit oracle 0 | 3 | 3 | Passed |
| explicit oracle 1 | 0 | 0 | Passed |
| explicit oracle 2 | 8 | 8 | Passed |
| explicit oracle 3 | 0 | 0 | Passed |
| explicit oracle 4 | 0 | 0 | Passed |
| explicit oracle 5 | 0 | 0 | Passed |
| explicit oracle 6 | 0 | 0 | Passed |
| explicit oracle 7 | 1 | 1 | Passed |
SHA-256 / 7c3278051d0cba3555edfdabda1e772a4fe87d78c7cd41ea53589bc8c46ed88c
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.416556+00:00.
Case digest / 2e03a69aaad0c9b096adbc2db6e834d1e415679748509d3e9cce53650c4cf4d7