FA-6361 / Discrete calculus / Open access
Prefix sums inclusive · case 01
The current sample is excluded from each prefix.
ROOT CAUSE
The current sample is excluded from each prefix.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return list(itertools.accumulate(values))
Unsuccessful approach: Suffix totals reverse the accumulation direction.
Case contract
Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. Prefix sums inclusive. Exact operational definition: list(itertools.accumulate(values))
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Discrete calculus 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(values):
return [sum(values[:i]) for i in range(len(values))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [1, 3, 6])
check('fixture 2: ([2, -2, 4],)', solve(*([2, -2, 4],)), [2, 0, 4])
check('fixture 3: ([5],)', solve(*([5],)), [5])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],) | [0, 1, 3] | [1, 3, 6] | Failed |
| fixture 2: ([2, -2, 4],) | [0, 2, 0] | [2, 0, 4] | Failed |
| fixture 3: ([5],) | [0] | [5] | Failed |
| fixture 4: ([],) | [] | [] | Passed |
SHA-256 / 0ab418788b75b7efe3c48acd8af13a2f9754dcd3f78c809f080fca3afe485acb
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(values):
return [sum(values[i:]) for i in range(len(values))]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [1, 3, 6])
check('fixture 2: ([2, -2, 4],)', solve(*([2, -2, 4],)), [2, 0, 4])
check('fixture 3: ([5],)', solve(*([5],)), [5])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],) | [6, 5, 3] | [1, 3, 6] | Failed |
| fixture 2: ([2, -2, 4],) | [4, 2, 4] | [2, 0, 4] | Failed |
| fixture 3: ([5],) | [5] | [5] | Passed |
| fixture 4: ([],) | [] | [] | Passed |
SHA-256 / 5decbf10f844b4950671a551b29cb698a9eb2622fbae4a44308a609b87f9709a
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(values):
return list(itertools.accumulate(values))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), [1, 3, 6])
check('fixture 2: ([2, -2, 4],)', solve(*([2, -2, 4],)), [2, 0, 4])
check('fixture 3: ([5],)', solve(*([5],)), [5])
check('fixture 4: ([],)', solve(*([],)), [])
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: ([1, 2, 3],) | [1, 3, 6] | [1, 3, 6] | Passed |
| fixture 2: ([2, -2, 4],) | [2, 0, 4] | [2, 0, 4] | Passed |
| fixture 3: ([5],) | [5] | [5] | Passed |
| fixture 4: ([],) | [] | [] | Passed |
SHA-256 / 6a5304898063427b4fd857ac66e221bb626d73111326f42ac9f151266afa61a7
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:38:00.651574+00:00.
Case digest / 53ede76122d65ae8d3fd5cb6cd775eae5d2cc95e97b38f51cd24fd7d67f395e5