FA-6376 / Discrete calculus / Open access
Trapezoidal integral nonuniform grid · case 01
Interval widths are assumed to be one.
ROOT CAUSE
Interval widths are assumed to be one.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(sum((Fraction((b-a)*(v+u),2) for a,b,u,v in zip(x,x[1:],y,y[1:])),Fraction()))
Unsuccessful approach: Left endpoint values replace linear interpolation across each interval.
Case contract
Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. x has distinct ordered coordinates and matches y; descending x yields negative integral. Exact operational definition: str(sum((Fraction((b-a)*(v+u),2) for a,b,u,v in zip(x,x[1:],y,y[1:])),Fraction()))
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(x, y):
return str(sum((Fraction(u+v,2) for u,v in zip(y,y[1:])),Fraction()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 3], [0, 2, 2])', solve(*([0, 1, 3], [0, 2, 2])), '5')
check('fixture 2: ([0, 2], [1, 3])', solve(*([0, 2], [1, 3])), '4')
check('fixture 3: ([2, 0], [3, 1])', solve(*([2, 0], [3, 1])), '-4')
check('fixture 4: ([1], [4])', solve(*([1], [4])), '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, 1, 3], [0, 2, 2]) | 3 | 5 | Failed |
| fixture 2: ([0, 2], [1, 3]) | 2 | 4 | Failed |
| fixture 3: ([2, 0], [3, 1]) | 2 | -4 | Failed |
| fixture 4: ([1], [4]) | 0 | 0 | Passed |
SHA-256 / 0457a57a58a028800e5f26e99301c330de7311aaf0b1c50eceddc20d36b98e03
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(x, y):
return str(sum((Fraction((b-a)*u) for a,b,u in zip(x,x[1:],y)),Fraction()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 3], [0, 2, 2])', solve(*([0, 1, 3], [0, 2, 2])), '5')
check('fixture 2: ([0, 2], [1, 3])', solve(*([0, 2], [1, 3])), '4')
check('fixture 3: ([2, 0], [3, 1])', solve(*([2, 0], [3, 1])), '-4')
check('fixture 4: ([1], [4])', solve(*([1], [4])), '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, 1, 3], [0, 2, 2]) | 4 | 5 | Failed |
| fixture 2: ([0, 2], [1, 3]) | 2 | 4 | Failed |
| fixture 3: ([2, 0], [3, 1]) | -6 | -4 | Failed |
| fixture 4: ([1], [4]) | 0 | 0 | Passed |
SHA-256 / b1d2605c9fbf02602a9f0e46754b4526a186d4f49cbb177b54c68f07e0c41c0d
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(x, y):
return str(sum((Fraction((b-a)*(v+u),2) for a,b,u,v in zip(x,x[1:],y,y[1:])),Fraction()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 3], [0, 2, 2])', solve(*([0, 1, 3], [0, 2, 2])), '5')
check('fixture 2: ([0, 2], [1, 3])', solve(*([0, 2], [1, 3])), '4')
check('fixture 3: ([2, 0], [3, 1])', solve(*([2, 0], [3, 1])), '-4')
check('fixture 4: ([1], [4])', solve(*([1], [4])), '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, 1, 3], [0, 2, 2]) | 5 | 5 | Passed |
| fixture 2: ([0, 2], [1, 3]) | 4 | 4 | Passed |
| fixture 3: ([2, 0], [3, 1]) | -4 | -4 | Passed |
| fixture 4: ([1], [4]) | 0 | 0 | Passed |
SHA-256 / 6bbbfd298d5b515c531a7c6c29fd60cc81030e1e9b85e5dd1c63f825e263cc9e
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.993738+00:00.
Case digest / 3732ae6db1e15927cb410a2cbd48e14577ec0ad564281b4684bc726951f9987c