FA-13636 / Numerical aggregation / Open access
Time weighted step level: The first future level is backfilled before it begins. · case 01
The reduction disagrees with its explicit aggregation oracle.
ROOT CAUSE
The first future level is backfilled before it begins.
VERIFIED REPAIR
Preserve the time weighted step level contract at the identified reduction decision.
Unsuccessful approach: Summing future levels also invents pre-observation exposure.
Case contract
Events set a right-continuous integer-timestamp level; later-listed events win timestamp ties. Initial level before any event is zero. Return exact average over [start,end), including level carried from earlier history, or None if interval has no duration.
Why this case matters
Exact bounded examples isolate a reduction defect without floating-point or external-service effects.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(events, start, end):
if end<=start: return None
changes={}
for t,value in events:
changes[t]=value
points=sorted(set([start,end]+[t for t in changes if start<t<end]))
area=0
for left,right in zip(points,points[1:]):
earlier=[t for t in changes if t<=left]
value=changes[max(earlier)] if earlier else (changes[min(changes)] if changes else 0)
area+=value*(right-left)
return str(Fraction(area,end-start))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')
check('regression 2', solve(*([], 0, 4)), '0')
check('regression 3', solve(*([(3, 5)], 0, 5)), '2')
check('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')
check('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')
check('regression 6', solve(*([(0, 2)], 3, 3)), None)
check('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')
check("variable duration weighting",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))
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 |
|---|---|---|---|
| regression 1 | 5 | 5 | Passed |
| regression 2 | 0 | 0 | Passed |
| regression 3 | 5 | 2 | Failed |
| regression 4 | 7 | 7 | Passed |
| regression 5 | 9/7 | 9/7 | Passed |
| regression 6 | None | None | Passed |
| regression 7 | 17/5 | 17/5 | Passed |
| variable duration weighting | 4 | 4 | Passed |
SHA-256 / 52aa7b8d7c457d3c68e8c5c5233946694c1f502563fbc1d41b05042f308b00f2
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(events, start, end):
if end<=start: return None
changes={}
for t,value in events:
changes[t]=value
points=sorted(set([start,end]+[t for t in changes if start<t<end]))
area=0
for left,right in zip(points,points[1:]):
earlier=[t for t in changes if t<=left]
value=changes[max(earlier)] if earlier else (sum(changes.values()) if changes else 0)
area+=value*(right-left)
return str(Fraction(area,end-start))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')
check('regression 2', solve(*([], 0, 4)), '0')
check('regression 3', solve(*([(3, 5)], 0, 5)), '2')
check('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')
check('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')
check('regression 6', solve(*([(0, 2)], 3, 3)), None)
check('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')
check("variable duration weighting",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))
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 |
|---|---|---|---|
| regression 1 | 5 | 5 | Passed |
| regression 2 | 0 | 0 | Passed |
| regression 3 | 5 | 2 | Failed |
| regression 4 | 7 | 7 | Passed |
| regression 5 | 9/7 | 9/7 | Passed |
| regression 6 | None | None | Passed |
| regression 7 | 17/5 | 17/5 | Passed |
| variable duration weighting | 4 | 4 | Passed |
SHA-256 / 44cad82e29c0f855bc30aa151986d1234dc636bfd912c6063686d6d8a1efa60b
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
from collections import Counter, defaultdict
import math
import itertools
N = 1
observations = []
def solve(events, start, end):
if end<=start: return None
changes={}
for t,value in events:
changes[t]=value
points=sorted(set([start,end]+[t for t in changes if start<t<end]))
area=0
for left,right in zip(points,points[1:]):
earlier=[t for t in changes if t<=left]
value=changes[max(earlier)] if earlier else 0
area+=value*(right-left)
return str(Fraction(area,end-start))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('regression 1', solve(*([(0, 2), (3, 8)], 1, 5)), '5')
check('regression 2', solve(*([], 0, 4)), '0')
check('regression 3', solve(*([(3, 5)], 0, 5)), '2')
check('regression 4', solve(*([(0, 4), (0, 7), (4, 9)], 0, 4)), '7')
check('regression 5', solve(*([(2, -3), (-2, 8), (5, 1)], 0, 7)), '9/7')
check('regression 6', solve(*([(0, 2)], 3, 3)), None)
check('regression 7', solve(*([(0, 1), (1, 10), (2, 2)], 0, 5)), '17/5')
check("variable duration weighting",solve([(0,0),(N,6)],0,N+2),str(Fraction(12,N+2)))
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 |
|---|---|---|---|
| regression 1 | 5 | 5 | Passed |
| regression 2 | 0 | 0 | Passed |
| regression 3 | 2 | 2 | Passed |
| regression 4 | 7 | 7 | Passed |
| regression 5 | 9/7 | 9/7 | Passed |
| regression 6 | None | None | Passed |
| regression 7 | 17/5 | 17/5 | Passed |
| variable duration weighting | 4 | 4 | Passed |
SHA-256 / ec56b09168128a2cff596d10d65fb53579b28d586988114cb3e4e6f00788e2c7
Verification & scope
Small offline integer/rational inputs only; no performance, statistical inference, or production-library conformance claim. 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:39:08.981804+00:00.
Case digest / fc251177eb5217c8778373b18370071f2798846d06ebf9abdecc4143af5a622c