FA-5396 / Integer arithmetic / Open access
Fixed width bit complement · case 01
Infinite sign-extension bits leak into a finite-word complement.
ROOT CAUSE
Infinite sign-extension bits leak into a finite-word complement.
THE FAILURE
Infinite sign-extension bits leak into a finite-word complement.
Unsuccessful approach: Taking a magnitude is not a finite-word mask.
Case contract
Integer arguments; denominators, steps, moduli, and bit widths are positive. Unsigned word inputs fit the specified width except where masking is explicitly the operation. Sequence sizes are nonnegative. Fixed width bit complement. Exact operational definition: n ^ ((1<<bits)-1)
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Integer mathematics results depend on the stated convention.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(n, bits):
return ~n
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0, 4)', solve(*(0, 4)), 15)
check('fixture 2: (15, 4)', solve(*(15, 4)), 0)
check('fixture 3: (5, 4)', solve(*(5, 4)), 10)
check('fixture 4: (1, 1)', solve(*(1, 1)), 0)
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 |
|---|---|---|---|
| fixture 1: (0, 4) | -1 | 15 | Failed |
| fixture 2: (15, 4) | -16 | 0 | Failed |
| fixture 3: (5, 4) | -6 | 10 | Failed |
| fixture 4: (1, 1) | -2 | 0 | Failed |
SHA-256 / 6049788a34b43d7d86b20d8d70ceddd0060e3a8f1d7ec470fe4ae223a2e55ba9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(n, bits):
return abs(~n)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0, 4)', solve(*(0, 4)), 15)
check('fixture 2: (15, 4)', solve(*(15, 4)), 0)
check('fixture 3: (5, 4)', solve(*(5, 4)), 10)
check('fixture 4: (1, 1)', solve(*(1, 1)), 0)
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 |
|---|---|---|---|
| fixture 1: (0, 4) | 1 | 15 | Failed |
| fixture 2: (15, 4) | 16 | 0 | Failed |
| fixture 3: (5, 4) | 6 | 10 | Failed |
| fixture 4: (1, 1) | 2 | 0 | Failed |
SHA-256 / 5d91168db5ace3505648d1aec3c4ee2b4b5ff349d74829166e3c7f18960b4a53
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 4 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
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:37:49.082572+00:00.
Case digest / b0488800c63bd8666caff041680baf90d72de2a8bcc1dcb006e152dcf99c8d79