FA-5471 / Integer arithmetic / Open access
Inclusive multiples count · case 01
Interval length loses alignment to the divisor.
ROOT CAUSE
Interval length loses alignment to the divisor.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return hi//step - (lo-1)//step
Unsuccessful approach: Subtracting the lower quotient excludes an aligned lower endpoint.
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. lo<=hi; count all integer multiples of positive step in the closed interval. Exact operational definition: hi//step - (lo-1)//step
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(lo, hi, step):
return (hi-lo)//step
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 9, 3)', solve(*(3, 9, 3)), 3)
check('fixture 2: (-5, 5, 3)', solve(*(-5, 5, 3)), 3)
check('fixture 3: (1, 2, 3)', solve(*(1, 2, 3)), 0)
check('fixture 4: (0, 0, 4)', solve(*(0, 0, 4)), 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: (3, 9, 3) | 2 | 3 | Failed |
| fixture 2: (-5, 5, 3) | 3 | 3 | Passed |
| fixture 3: (1, 2, 3) | 0 | 0 | Passed |
| fixture 4: (0, 0, 4) | 0 | 1 | Failed |
SHA-256 / 4f477f429eb6a6eb6d6bf844c306ec599bbb05e26f21d4d34b897883b98972fc
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(lo, hi, step):
return hi//step - lo//step
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 9, 3)', solve(*(3, 9, 3)), 3)
check('fixture 2: (-5, 5, 3)', solve(*(-5, 5, 3)), 3)
check('fixture 3: (1, 2, 3)', solve(*(1, 2, 3)), 0)
check('fixture 4: (0, 0, 4)', solve(*(0, 0, 4)), 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: (3, 9, 3) | 2 | 3 | Failed |
| fixture 2: (-5, 5, 3) | 3 | 3 | Passed |
| fixture 3: (1, 2, 3) | 0 | 0 | Passed |
| fixture 4: (0, 0, 4) | 0 | 1 | Failed |
SHA-256 / 6a20e3a7fd48a333c331edf20b6a66e8551b5106d85a9894be18ef7def6e5a2b
3 / The verified repair
Exit 0"""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(lo, hi, step):
return hi//step - (lo-1)//step
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 9, 3)', solve(*(3, 9, 3)), 3)
check('fixture 2: (-5, 5, 3)', solve(*(-5, 5, 3)), 3)
check('fixture 3: (1, 2, 3)', solve(*(1, 2, 3)), 0)
check('fixture 4: (0, 0, 4)', solve(*(0, 0, 4)), 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: (3, 9, 3) | 3 | 3 | Passed |
| fixture 2: (-5, 5, 3) | 3 | 3 | Passed |
| fixture 3: (1, 2, 3) | 0 | 0 | Passed |
| fixture 4: (0, 0, 4) | 1 | 1 | Passed |
SHA-256 / 945349368f8bfe214393702fd15282d9b72367fe4f7be376c1446a34060abecd
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.975089+00:00.
Case digest / ea9a467b139d9cc64611d092c8070cc0416face254807d4629be307b36688bc7