FA-5406 / Integer arithmetic / Open access
Isolate lowest set bit · case 01
Clearing the low bit is confused with extracting it.
ROOT CAUSE
Clearing the low bit is confused with extracting it.
THE FAILURE
Clearing the low bit is confused with extracting it.
Unsuccessful approach: Extracting the most significant bit selects the wrong end.
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. n is nonnegative; retain exactly its least significant one, or return zero for zero. Exact operational definition: n & -n
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):
return n & (n-1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (12,)', solve(*(12,)), 4)
check('fixture 2: (8,)', solve(*(8,)), 8)
check('fixture 3: (0,)', solve(*(0,)), 0)
check('fixture 4: (7,)', solve(*(7,)), 1)
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: (12,) | 8 | 4 | Failed |
| fixture 2: (8,) | 0 | 8 | Failed |
| fixture 3: (0,) | 0 | 0 | Passed |
| fixture 4: (7,) | 6 | 1 | Failed |
SHA-256 / 707e5c46ae606a4ee8e37e2d865739ee1aa649f412ecfe9faec6efc13076d688
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):
return 1 << (n.bit_length()-1) if n else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (12,)', solve(*(12,)), 4)
check('fixture 2: (8,)', solve(*(8,)), 8)
check('fixture 3: (0,)', solve(*(0,)), 0)
check('fixture 4: (7,)', solve(*(7,)), 1)
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: (12,) | 8 | 4 | Failed |
| fixture 2: (8,) | 8 | 8 | Passed |
| fixture 3: (0,) | 0 | 0 | Passed |
| fixture 4: (7,) | 4 | 1 | Failed |
SHA-256 / 26b3c273d152eccd66e27846f676c4ccd645cdd9ce58675915e59368696fa241
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.217938+00:00.
Case digest / eacd402a44566600af89b60c2c14b40d15443655de1aa79b336586049093c976