FA-15046 / Numerics / Open access
Negative radix encoding: nonnegative negative radix remainder · case 01
The exact negative radix encoding result violates the stated contract at nonnegative negative radix remainder.
ROOT CAUSE
The nonnegative negative radix remainder step uses n%(-b) instead of n%b.
THE FAILURE
The nonnegative negative radix remainder step uses n%(-b) instead of n%b.
Unsuccessful approach: The partial repair abs(n)%b still violates the nonnegative negative radix remainder invariant.
Case contract
Input [integer, magnitude base>=2]; return most-significant-first digits 0..base-1 representing integer in radix -base. Bounds: |integer|<=100 and base<=8.
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):
n,b=x
if n==0:return [0]
out=[]
for _ in range(60):
if n==0:break
r=n%(-b)
out.append(r)
n=(n-r)//(-b)
return out[::-1] if bool(out) else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([-100, 3], [1, 2, 1, 1, 1, 2]), ([100, 8], [2, 4, 4]), ([-100, 4], [2, 2, 1, 0]), ([-100, 5], [1, 1, 0, 0]), ([-100, 6], [1, 4, 5, 2]), ([-100, 7], [1, 5, 1, 5]), ([-100, 8], [1, 7, 5, 4])], [([-100, 3], [1, 2, 1, 1, 1, 2]), ([-100, 7], [1, 5, 1, 5]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-98, 5], [1, 1, 0, 2]), ([-98, 6], [1, 4, 5, 4]), ([-98, 7], [1, 5, 0, 0]), ([-98, 8], [1, 7, 5, 6])], [([-100, 4], [2, 2, 1, 0]), ([-99, 4], [2, 2, 1, 1]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-96, 8], [1, 7, 4, 0]), ([-95, 2], [1, 1, 1, 0, 0, 0, 0, 1]), ([-95, 3], [1, 2, 1, 2, 2, 1]), ([-95, 4], [2, 2, 0, 1])], [([-100, 5], [1, 1, 0, 0]), ([-99, 7], [1, 5, 1, 6]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-93, 4], [2, 2, 0, 3]), ([-93, 5], [1, 2, 4, 2]), ([-93, 6], [1, 4, 4, 3]), ([-93, 7], [1, 5, 0, 5])], [([-100, 6], [1, 4, 5, 2]), ([-98, 5], [1, 1, 0, 2]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-91, 7], [1, 6, 6, 0]), ([-91, 8], [1, 7, 4, 5]), ([-90, 2], [1, 1, 1, 1, 1, 0, 1, 0]), ([-90, 3], [1, 2, 1, 2, 0, 0])]]
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, -1, 0, -1, 0, 0, -1, 0, 0] | [1, 1, 1, 0, 1, 1, 0, 0] | Failed |
| explicit oracle 1 | [-1, 0, -2, 0, -1] | [1, 2, 1, 1, 1, 2] | Failed |
| explicit oracle 2 | [-1, -7, -5, -4] | [2, 4, 4] | Failed |
| explicit oracle 3 | [-1, -3, -3, -3, 0] | [2, 2, 1, 0] | Failed |
| explicit oracle 4 | [-4, 0, 0] | [1, 1, 0, 0] | Failed |
| explicit oracle 5 | [-3, -2, -4] | [1, 4, 5, 2] | Failed |
| explicit oracle 6 | [-2, 0, -2] | [1, 5, 1, 5] | Failed |
| explicit oracle 7 | [-2, -4, -4] | [1, 7, 5, 4] | Failed |
SHA-256 / 04498cca62fde6032ea83570d77a656111693ea59771531eac14ca9b78705655
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):
n,b=x
if n==0:return [0]
out=[]
for _ in range(60):
if n==0:break
r=abs(n)%b
out.append(r)
n=(n-r)//(-b)
return out[::-1] if bool(out) else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([-100, 3], [1, 2, 1, 1, 1, 2]), ([100, 8], [2, 4, 4]), ([-100, 4], [2, 2, 1, 0]), ([-100, 5], [1, 1, 0, 0]), ([-100, 6], [1, 4, 5, 2]), ([-100, 7], [1, 5, 1, 5]), ([-100, 8], [1, 7, 5, 4])], [([-100, 3], [1, 2, 1, 1, 1, 2]), ([-100, 7], [1, 5, 1, 5]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-98, 5], [1, 1, 0, 2]), ([-98, 6], [1, 4, 5, 4]), ([-98, 7], [1, 5, 0, 0]), ([-98, 8], [1, 7, 5, 6])], [([-100, 4], [2, 2, 1, 0]), ([-99, 4], [2, 2, 1, 1]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-96, 8], [1, 7, 4, 0]), ([-95, 2], [1, 1, 1, 0, 0, 0, 0, 1]), ([-95, 3], [1, 2, 1, 2, 2, 1]), ([-95, 4], [2, 2, 0, 1])], [([-100, 5], [1, 1, 0, 0]), ([-99, 7], [1, 5, 1, 6]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-93, 4], [2, 2, 0, 3]), ([-93, 5], [1, 2, 4, 2]), ([-93, 6], [1, 4, 4, 3]), ([-93, 7], [1, 5, 0, 5])], [([-100, 6], [1, 4, 5, 2]), ([-98, 5], [1, 1, 0, 2]), ([-100, 2], [1, 1, 1, 0, 1, 1, 0, 0]), ([100, 8], [2, 4, 4]), ([-91, 7], [1, 6, 6, 0]), ([-91, 8], [1, 7, 4, 5]), ([-90, 2], [1, 1, 1, 1, 1, 0, 1, 0]), ([-90, 3], [1, 2, 1, 2, 0, 0])]]
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, 1, 1, 0, 1, 1, 0, 0] | [1, 1, 1, 0, 1, 1, 0, 0] | Passed |
| explicit oracle 1 | [1, 1, 2, 0, 1] | [1, 2, 1, 1, 1, 2] | Failed |
| explicit oracle 2 | [2, 4, 4] | [2, 4, 4] | Passed |
| explicit oracle 3 | [2, 2, 1, 0] | [2, 2, 1, 0] | Passed |
| explicit oracle 4 | [1, 4, 0, 0] | [1, 1, 0, 0] | Failed |
| explicit oracle 5 | [2, 5, 4] | [1, 4, 5, 2] | Failed |
| explicit oracle 6 | [2, 0, 2] | [1, 5, 1, 5] | Failed |
| explicit oracle 7 | [1, 5, 4] | [1, 7, 5, 4] | Failed |
SHA-256 / 1745c4cc4947e77415921402cbee09b41486e553ea722ad064ad58646eeda1bc
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:22.734191+00:00.
Case digest / 9fe16e491e120405dd62488648c7f628f64cdf2dbe71bb795cf22fe483ca600b