FA-15806 / Numerics / Open access
Singular hensel root tree: root residue digit placement · case 01
The exact singular hensel root tree result violates the stated contract at root residue digit placement.
ROOT CAUSE
The root residue digit placement step uses r+digit instead of r+digit*mod.
VERIFIED REPAIR
Use r+digit*mod at the root residue digit placement step.
Unsuccessful approach: The partial repair r*p+digit still violates the root residue digit placement invariant.
Case contract
Input [polynomial coefficients,p,k], p prime and k>=1; enumerate all roots modulo p^k, including singular roots.
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):
coeff,p,k=x
roots=[r for r in range(p) if sum(c*r**i for i,c in enumerate(coeff))%p==0];mod=p
for _ in range(1,k):
nextmod=mod*p
out=[]
for r in roots:
for digit in range(p):
s=r+digit
if sum(c*s**i for i,c in enumerate(coeff))%nextmod==0:out.append(s)
roots=sorted(set(out));mod=nextmod
return [roots,mod]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 0, 1], 2, 2], [[0, 2], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 3, 3], [[0, 9, 18], 27])], [([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[-1, 0, 1], 2, 3], [[1, 3, 5, 7], 8]), ([[-1, 0, 1], 2, 4], [[1, 7, 9, 15], 16]), ([[-1, 0, 1], 3, 1], [[1, 2], 3])], [([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 5, 2], [[0, 5, 10, 15, 20], 25]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 2, 1], 2, 3], [[0, 2, 4, 6], 8]), ([[0, 2, 1], 2, 4], [[0, 6, 8, 14], 16]), ([[0, 2, 1], 3, 1], [[0, 1], 3]), ([[0, 2, 1], 3, 2], [[0, 7], 9])], [([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 7, 2], [[0, 7, 14, 21, 28, 35, 42], 49]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-4, 0, 1], 2, 4], [[2, 6, 10, 14], 16]), ([[-4, 0, 1], 3, 1], [[1, 2], 3]), ([[-4, 0, 1], 3, 2], [[2, 7], 9]), ([[-4, 0, 1], 3, 3], [[2, 25], 27])], [([[0, 0, 1], 3, 3], [[0, 9, 18], 27]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 0, 1], 3, 3], [[0, 3, 6, 9, 12, 15, 18, 21, 24], 27]), ([[0, 0, 0, 1], 3, 4], [[0, 9, 18, 27, 36, 45, 54, 63, 72], 81])]]
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], 4] | [[0, 2], 4] | Failed |
| explicit oracle 1 | [[0], 2] | [[0], 2] | Passed |
| explicit oracle 2 | [[1], 2401] | [[1, 2399], 2401] | Failed |
| explicit oracle 3 | [[0], 8] | [[0, 4], 8] | Failed |
| explicit oracle 4 | [[0], 16] | [[0, 4, 8, 12], 16] | Failed |
| explicit oracle 5 | [[0], 3] | [[0], 3] | Passed |
| explicit oracle 6 | [[0], 9] | [[0, 3, 6], 9] | Failed |
| explicit oracle 7 | [[0], 27] | [[0, 9, 18], 27] | Failed |
SHA-256 / e47af78945d6d1f6da8aa8764e6c4e3cfdcebc322202a657ef1559efe2b424c5
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):
coeff,p,k=x
roots=[r for r in range(p) if sum(c*r**i for i,c in enumerate(coeff))%p==0];mod=p
for _ in range(1,k):
nextmod=mod*p
out=[]
for r in roots:
for digit in range(p):
s=r*p+digit
if sum(c*s**i for i,c in enumerate(coeff))%nextmod==0:out.append(s)
roots=sorted(set(out));mod=nextmod
return [roots,mod]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 0, 1], 2, 2], [[0, 2], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 3, 3], [[0, 9, 18], 27])], [([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[-1, 0, 1], 2, 3], [[1, 3, 5, 7], 8]), ([[-1, 0, 1], 2, 4], [[1, 7, 9, 15], 16]), ([[-1, 0, 1], 3, 1], [[1, 2], 3])], [([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 5, 2], [[0, 5, 10, 15, 20], 25]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 2, 1], 2, 3], [[0, 2, 4, 6], 8]), ([[0, 2, 1], 2, 4], [[0, 6, 8, 14], 16]), ([[0, 2, 1], 3, 1], [[0, 1], 3]), ([[0, 2, 1], 3, 2], [[0, 7], 9])], [([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 7, 2], [[0, 7, 14, 21, 28, 35, 42], 49]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-4, 0, 1], 2, 4], [[2, 6, 10, 14], 16]), ([[-4, 0, 1], 3, 1], [[1, 2], 3]), ([[-4, 0, 1], 3, 2], [[2, 7], 9]), ([[-4, 0, 1], 3, 3], [[2, 25], 27])], [([[0, 0, 1], 3, 3], [[0, 9, 18], 27]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 0, 1], 3, 3], [[0, 3, 6, 9, 12, 15, 18, 21, 24], 27]), ([[0, 0, 0, 1], 3, 4], [[0, 9, 18, 27, 36, 45, 54, 63, 72], 81])]]
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], 4] | [[0, 2], 4] | Failed |
| explicit oracle 1 | [[0], 2] | [[0], 2] | Passed |
| explicit oracle 2 | [[], 2401] | [[1, 2399], 2401] | Failed |
| explicit oracle 3 | [[0], 8] | [[0, 4], 8] | Failed |
| explicit oracle 4 | [[0], 16] | [[0, 4, 8, 12], 16] | Failed |
| explicit oracle 5 | [[0], 3] | [[0], 3] | Passed |
| explicit oracle 6 | [[0], 9] | [[0, 3, 6], 9] | Failed |
| explicit oracle 7 | [[0], 27] | [[0, 9, 18], 27] | Failed |
SHA-256 / ef8dd417b08e67bdc6bc843a66e1c776c2fb508ffc107e36450f114eacd2f7b2
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):
coeff,p,k=x
roots=[r for r in range(p) if sum(c*r**i for i,c in enumerate(coeff))%p==0];mod=p
for _ in range(1,k):
nextmod=mod*p
out=[]
for r in roots:
for digit in range(p):
s=r+digit*mod
if sum(c*s**i for i,c in enumerate(coeff))%nextmod==0:out.append(s)
roots=sorted(set(out));mod=nextmod
return [roots,mod]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 0, 1], 2, 2], [[0, 2], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 3, 3], [[0, 9, 18], 27])], [([[0, 0, 1], 2, 3], [[0, 4], 8]), ([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[-1, 0, 1], 2, 3], [[1, 3, 5, 7], 8]), ([[-1, 0, 1], 2, 4], [[1, 7, 9, 15], 16]), ([[-1, 0, 1], 3, 1], [[1, 2], 3])], [([[0, 0, 1], 2, 4], [[0, 4, 8, 12], 16]), ([[0, 0, 1], 5, 2], [[0, 5, 10, 15, 20], 25]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 2, 1], 2, 3], [[0, 2, 4, 6], 8]), ([[0, 2, 1], 2, 4], [[0, 6, 8, 14], 16]), ([[0, 2, 1], 3, 1], [[0, 1], 3]), ([[0, 2, 1], 3, 2], [[0, 7], 9])], [([[0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 1], 7, 2], [[0, 7, 14, 21, 28, 35, 42], 49]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[-4, 0, 1], 2, 4], [[2, 6, 10, 14], 16]), ([[-4, 0, 1], 3, 1], [[1, 2], 3]), ([[-4, 0, 1], 3, 2], [[2, 7], 9]), ([[-4, 0, 1], 3, 3], [[2, 25], 27])], [([[0, 0, 1], 3, 3], [[0, 9, 18], 27]), ([[-1, 0, 1], 2, 2], [[1, 3], 4]), ([[0, 0, 1], 2, 1], [[0], 2]), ([[-2, 1, 1], 7, 4], [[1, 2399], 2401]), ([[0, 0, 0, 1], 3, 1], [[0], 3]), ([[0, 0, 0, 1], 3, 2], [[0, 3, 6], 9]), ([[0, 0, 0, 1], 3, 3], [[0, 3, 6, 9, 12, 15, 18, 21, 24], 27]), ([[0, 0, 0, 1], 3, 4], [[0, 9, 18, 27, 36, 45, 54, 63, 72], 81])]]
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, 2], 4] | [[0, 2], 4] | Passed |
| explicit oracle 1 | [[0], 2] | [[0], 2] | Passed |
| explicit oracle 2 | [[1, 2399], 2401] | [[1, 2399], 2401] | Passed |
| explicit oracle 3 | [[0, 4], 8] | [[0, 4], 8] | Passed |
| explicit oracle 4 | [[0, 4, 8, 12], 16] | [[0, 4, 8, 12], 16] | Passed |
| explicit oracle 5 | [[0], 3] | [[0], 3] | Passed |
| explicit oracle 6 | [[0, 3, 6], 9] | [[0, 3, 6], 9] | Passed |
| explicit oracle 7 | [[0, 9, 18], 27] | [[0, 9, 18], 27] | Passed |
SHA-256 / 4ca5f0bcb1063eb1391b9ea0f6c8c7f331ad0b5229073ba2a6c94c200f222ba5
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:30.426570+00:00.
Case digest / 5628e711e1435e7270ce039a23301826fc82c4ef2491ed2f52736d7e41dbac24