FA-15636 / Numerics / Open access
Binary polynomial division: quotient remainder result positions · case 01
The exact binary polynomial division result violates the stated contract at quotient remainder result positions.
ROOT CAUSE
The quotient remainder result positions step uses [a,q] instead of [q,a].
THE FAILURE
The quotient remainder result positions step uses [a,q] instead of [q,a].
Unsuccessful approach: The partial repair [q,a&1] still violates the quotient remainder result positions invariant.
Case contract
Input [a,b] integer bitmasks for F2 polynomials with b>0; return [quotient,remainder] of carryless division. Bounds: a,b<2^32.
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=x;q=0
for _ in range(40):
if a.bit_length()<b.bit_length():break
shift=a.bit_length()-b.bit_length()
if shift<0:return None
q=q^(1<<shift)
a=a^(b<<shift)
return [a,q]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([1, 1], [1, 0]), ([2, 4], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([0, 2], [0, 0]), ([0, 3], [0, 0]), ([0, 4], [0, 0]), ([0, 5], [0, 0])], [([1, 2], [0, 1]), ([2, 7], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([0, 18], [0, 0]), ([0, 19], [0, 0]), ([0, 20], [0, 0]), ([0, 21], [0, 0])], [([1, 3], [0, 1]), ([2, 10], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([1, 4], [0, 1]), ([1, 5], [0, 1]), ([1, 6], [0, 1]), ([1, 7], [0, 1])], [([1, 4], [0, 1]), ([2, 13], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([1, 21], [0, 1]), ([1, 22], [0, 1]), ([1, 23], [0, 1]), ([1, 24], [0, 1])], [([1, 5], [0, 1]), ([2, 16], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([2, 7], [0, 2]), ([2, 8], [0, 2]), ([2, 9], [0, 2]), ([2, 10], [0, 2])]]
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, 1] | [1, 0] | Failed |
| explicit oracle 1 | [2, 0] | [0, 2] | Failed |
| explicit oracle 2 | [0, 0] | [0, 0] | Passed |
| explicit oracle 3 | [3, 4] | [4, 3] | Failed |
| explicit oracle 4 | [0, 0] | [0, 0] | Passed |
| explicit oracle 5 | [0, 0] | [0, 0] | Passed |
| explicit oracle 6 | [0, 0] | [0, 0] | Passed |
| explicit oracle 7 | [0, 0] | [0, 0] | Passed |
SHA-256 / 5de021d5c13f4035d449bdde592e39dd3394192db17f26e7c37e16c7d70469f4
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=x;q=0
for _ in range(40):
if a.bit_length()<b.bit_length():break
shift=a.bit_length()-b.bit_length()
if shift<0:return None
q=q^(1<<shift)
a=a^(b<<shift)
return [q,a&1]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([1, 1], [1, 0]), ([2, 4], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([0, 2], [0, 0]), ([0, 3], [0, 0]), ([0, 4], [0, 0]), ([0, 5], [0, 0])], [([1, 2], [0, 1]), ([2, 7], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([0, 18], [0, 0]), ([0, 19], [0, 0]), ([0, 20], [0, 0]), ([0, 21], [0, 0])], [([1, 3], [0, 1]), ([2, 10], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([1, 4], [0, 1]), ([1, 5], [0, 1]), ([1, 6], [0, 1]), ([1, 7], [0, 1])], [([1, 4], [0, 1]), ([2, 13], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([1, 21], [0, 1]), ([1, 22], [0, 1]), ([1, 23], [0, 1]), ([1, 24], [0, 1])], [([1, 5], [0, 1]), ([2, 16], [0, 2]), ([0, 1], [0, 0]), ([127, 31], [4, 3]), ([2, 7], [0, 2]), ([2, 8], [0, 2]), ([2, 9], [0, 2]), ([2, 10], [0, 2])]]
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 | [1, 0] | [1, 0] | Passed |
| explicit oracle 1 | [0, 0] | [0, 2] | Failed |
| explicit oracle 2 | [0, 0] | [0, 0] | Passed |
| explicit oracle 3 | [4, 1] | [4, 3] | Failed |
| explicit oracle 4 | [0, 0] | [0, 0] | Passed |
| explicit oracle 5 | [0, 0] | [0, 0] | Passed |
| explicit oracle 6 | [0, 0] | [0, 0] | Passed |
| explicit oracle 7 | [0, 0] | [0, 0] | Passed |
SHA-256 / 6286184836fcf355210383b6eb9947749789e6f0e7b7a0fcfb4c04cf8e9b9675
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.776606+00:00.
Case digest / 9b665794a0c7ad8f23e9afc375839093b38f0955fbefe70ae022b7f55d0a69e0