FAILURE MAP
← Case archive

FA-71226 / Weather index computation / Open access

Antecedent precipitation index: chronological ordering · case 01

Backfilled late reports make the API grow instead of decay.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Observations are processed in arrival order.

VERIFIED REPAIR

Sort observations by day before decaying.

Unsuccessful approach: Sorting descending decays backward in time.

Case contract

obs are [day, precip_mm] in any order; process in ascending day order (stable for equal days). Between observations API decays by k^(day gap); several reports on the same day accumulate without decay; negative precipitation is a sensor glitch treated as 0. Return API after each observation, rounded to 0.01.

Why this case matters

Flash-flood guidance and soil wetness models use API as a moisture state.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(k, obs):
    api = 0.0
    last = None
    out = []
    for day, p in obs:
        if last is not None:
            api *= k ** (day - last)
        api += max(p, 0.0)
        last = day
        out.append(round(api, 2))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 2', [0.85, [[2, 12.5], [2, 30.0], [3, -1.0], [7, 30.0], [8, 30.0], [9, 30.0], [10, 5.0]]], [12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]], ['basin 3', [0.9, [[0, 5.0], [6, 2.0], [7, 12.5], [2, 2.0]]], [5.0, 6.05, 5.97, 17.87]], ['basin 4', [0.85, [[2, 30.0], [2, 12.5], [4, 30.0], [4, 12.5], [4, 12.5], [4, 12.5], [5, 5.0]]], [30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]], ['basin 5', [0.9, [[6, 2.0], [4, 30.0], [4, 2.0], [14, 12.5], [10, 0.0], [2, 30.0]]], [30.0, 54.3, 56.3, 47.6, 31.23, 32.99]], ['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]]], [['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]], ['basin 8', [0.85, [[0, 2.0], [0, 5.0], [1, -1.0], [3, 5.0], [4, 30.0], [5, 2.0], [6, 2.0]]], [2.0, 7.0, 5.95, 9.3, 37.9, 34.22, 31.09]], ['basin 9', [0.9, [[1, -1.0], [2, 2.0], [2, 30.0], [3, 12.5], [5, 30.0], [7, 2.0], [9, 30.0]]], [0.0, 2.0, 32.0, 41.3, 63.45, 53.4, 73.25]], ['basin 10', [0.85, [[6, 2.0], [3, 30.0], [4, -1.0], [4, 5.0]]], [30.0, 25.5, 30.5, 24.04]], ['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 12', [0.85, [[2, 30.0], [4, -1.0], [5, 30.0], [6, 0.0], [6, 0.0]]], [30.0, 21.67, 48.42, 41.16, 41.16]], ['basin 13', [0.9, [[0, 12.5], [4, -1.0], [5, 5.0], [7, 12.5]]], [12.5, 8.2, 12.38, 22.53]]], [['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 14', [0.85, [[0, -1.0], [0, 30.0], [1, 5.0], [2, 0.0], [4, 5.0], [8, -1.0]]], [0.0, 30.0, 30.5, 25.93, 23.73, 12.39]], ['basin 15', [0.9, [[6, 5.0], [6, 30.0], [3, 0.0], [1, 5.0], [4, 12.5], [7, 12.5]]], [5.0, 4.05, 16.14, 18.08, 48.08, 55.77]], ['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 17', [0.9, [[7, 5.0], [4, 12.5], [0, 0.0], [6, 30.0]]], [0.0, 12.5, 40.12, 41.11]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 19', [0.9, [[2, 2.0], [6, 2.0], [7, 2.0], [11, 2.0], [13, 0.0], [15, 0.0]]], [2.0, 3.31, 4.98, 5.27, 4.27, 3.46]], ['basin 20', [0.85, [[2, -1.0], [3, 5.0], [4, 0.0], [8, -1.0], [12, -1.0], [13, 12.5], [17, 12.5]]], [0.0, 5.0, 4.25, 2.22, 1.16, 13.48, 19.54]]], [['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 22', [0.85, [[0, 2.0], [1, -1.0], [1, -1.0], [2, 5.0], [3, 0.0], [7, 2.0], [8, 5.0]]], [2.0, 1.7, 1.7, 6.45, 5.48, 4.86, 9.13]], ['basin 23', [0.9, [[3, 30.0], [4, 30.0], [8, -1.0], [8, -1.0], [10, 0.0]]], [30.0, 57.0, 37.4, 37.4, 30.29]], ['basin 24', [0.85, [[2, 0.0], [4, -1.0], [5, -1.0], [5, 0.0], [6, 2.0], [7, 30.0], [7, 2.0]]], [0.0, 0.0, 0.0, 0.0, 2.0, 31.7, 33.7]], ['basin 25', [0.9, [[3, 0.0], [1, -1.0], [0, -1.0], [4, 2.0]]], [0.0, 0.0, 0.0, 2.0]], ['basin 26', [0.85, [[3, 30.0], [4, 2.0], [8, 0.0], [12, 0.0], [16, 12.5]]], [30.0, 27.5, 14.36, 7.49, 16.41]]], [['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 28', [0.85, [[2, 30.0], [3, 2.0], [5, 2.0], [6, 30.0], [10, 2.0], [10, 5.0], [14, 5.0]]], [30.0, 27.5, 21.87, 48.59, 27.36, 32.36, 21.89]], ['basin 29', [0.9, [[4, 5.0], [1, 30.0], [1, 5.0], [3, 30.0]]], [30.0, 35.0, 58.35, 57.52]], ['two gauges same day', [0.9, [[1, 10.0], [1, 5.0], [3, 0.0]]], [10.0, 15.0, 12.15]], ['negative glitch', [0.8, [[0, 10.0], [1, -3.0]]], [10.0, 8.0]], ['week gap', [0.9, [[0, 20.0], [7, 0.0]]], [20.0, 9.57]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
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 fixtureActualExpectedOutcome
basin 0[0.0, 0.0, 0.0, 0.0, 12.5, 40.62][0.0, 0.0, 0.0, 0.0, 12.5, 40.62]Passed
basin 1[2.0, 1.46, 14.12, 26.57, 21.76, 26.87][0.0, 2.0, 14.12, 12.71, 11.44, 21.76]Failed
basin 2[12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18][12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]Passed
basin 3[5.0, 4.66, 16.69, 30.27][5.0, 6.05, 5.97, 17.87]Failed
basin 4[30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48][30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]Passed
basin 5[2.0, 32.47, 34.47, 24.52, 37.37, 116.81][30.0, 54.3, 56.3, 47.6, 31.23, 32.99]Failed
basin 6[0.0, 5.0, 11.92, 11.22, 59.76, 24.26][30.0, 25.5, 26.68, 24.27, 22.54, 24.26]Failed
basin 7[2.0, 4.22, 7.79, 12.01][2.0, 6.8, 7.51, 8.76]Failed

SHA-256 / e694a2687466e3493a31f3d08c4884e010239a6168886d95f748868355f6dc15

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(k, obs):
    api = 0.0
    last = None
    out = []
    for day, p in sorted(obs, key=lambda r: r[0], reverse=True):
        if last is not None:
            api *= k ** (day - last)
        api += max(p, 0.0)
        last = day
        out.append(round(api, 2))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 2', [0.85, [[2, 12.5], [2, 30.0], [3, -1.0], [7, 30.0], [8, 30.0], [9, 30.0], [10, 5.0]]], [12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]], ['basin 3', [0.9, [[0, 5.0], [6, 2.0], [7, 12.5], [2, 2.0]]], [5.0, 6.05, 5.97, 17.87]], ['basin 4', [0.85, [[2, 30.0], [2, 12.5], [4, 30.0], [4, 12.5], [4, 12.5], [4, 12.5], [5, 5.0]]], [30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]], ['basin 5', [0.9, [[6, 2.0], [4, 30.0], [4, 2.0], [14, 12.5], [10, 0.0], [2, 30.0]]], [30.0, 54.3, 56.3, 47.6, 31.23, 32.99]], ['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]]], [['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]], ['basin 8', [0.85, [[0, 2.0], [0, 5.0], [1, -1.0], [3, 5.0], [4, 30.0], [5, 2.0], [6, 2.0]]], [2.0, 7.0, 5.95, 9.3, 37.9, 34.22, 31.09]], ['basin 9', [0.9, [[1, -1.0], [2, 2.0], [2, 30.0], [3, 12.5], [5, 30.0], [7, 2.0], [9, 30.0]]], [0.0, 2.0, 32.0, 41.3, 63.45, 53.4, 73.25]], ['basin 10', [0.85, [[6, 2.0], [3, 30.0], [4, -1.0], [4, 5.0]]], [30.0, 25.5, 30.5, 24.04]], ['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 12', [0.85, [[2, 30.0], [4, -1.0], [5, 30.0], [6, 0.0], [6, 0.0]]], [30.0, 21.67, 48.42, 41.16, 41.16]], ['basin 13', [0.9, [[0, 12.5], [4, -1.0], [5, 5.0], [7, 12.5]]], [12.5, 8.2, 12.38, 22.53]]], [['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 14', [0.85, [[0, -1.0], [0, 30.0], [1, 5.0], [2, 0.0], [4, 5.0], [8, -1.0]]], [0.0, 30.0, 30.5, 25.93, 23.73, 12.39]], ['basin 15', [0.9, [[6, 5.0], [6, 30.0], [3, 0.0], [1, 5.0], [4, 12.5], [7, 12.5]]], [5.0, 4.05, 16.14, 18.08, 48.08, 55.77]], ['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 17', [0.9, [[7, 5.0], [4, 12.5], [0, 0.0], [6, 30.0]]], [0.0, 12.5, 40.12, 41.11]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 19', [0.9, [[2, 2.0], [6, 2.0], [7, 2.0], [11, 2.0], [13, 0.0], [15, 0.0]]], [2.0, 3.31, 4.98, 5.27, 4.27, 3.46]], ['basin 20', [0.85, [[2, -1.0], [3, 5.0], [4, 0.0], [8, -1.0], [12, -1.0], [13, 12.5], [17, 12.5]]], [0.0, 5.0, 4.25, 2.22, 1.16, 13.48, 19.54]]], [['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 22', [0.85, [[0, 2.0], [1, -1.0], [1, -1.0], [2, 5.0], [3, 0.0], [7, 2.0], [8, 5.0]]], [2.0, 1.7, 1.7, 6.45, 5.48, 4.86, 9.13]], ['basin 23', [0.9, [[3, 30.0], [4, 30.0], [8, -1.0], [8, -1.0], [10, 0.0]]], [30.0, 57.0, 37.4, 37.4, 30.29]], ['basin 24', [0.85, [[2, 0.0], [4, -1.0], [5, -1.0], [5, 0.0], [6, 2.0], [7, 30.0], [7, 2.0]]], [0.0, 0.0, 0.0, 0.0, 2.0, 31.7, 33.7]], ['basin 25', [0.9, [[3, 0.0], [1, -1.0], [0, -1.0], [4, 2.0]]], [0.0, 0.0, 0.0, 2.0]], ['basin 26', [0.85, [[3, 30.0], [4, 2.0], [8, 0.0], [12, 0.0], [16, 12.5]]], [30.0, 27.5, 14.36, 7.49, 16.41]]], [['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 28', [0.85, [[2, 30.0], [3, 2.0], [5, 2.0], [6, 30.0], [10, 2.0], [10, 5.0], [14, 5.0]]], [30.0, 27.5, 21.87, 48.59, 27.36, 32.36, 21.89]], ['basin 29', [0.9, [[4, 5.0], [1, 30.0], [1, 5.0], [3, 30.0]]], [30.0, 35.0, 58.35, 57.52]], ['two gauges same day', [0.9, [[1, 10.0], [1, 5.0], [3, 0.0]]], [10.0, 15.0, 12.15]], ['negative glitch', [0.8, [[0, 10.0], [1, -3.0]]], [10.0, 8.0]], ['week gap', [0.9, [[0, 20.0], [7, 0.0]]], [20.0, 9.57]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
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 fixtureActualExpectedOutcome
basin 0[30.0, 47.79, 56.23, 66.15, 77.82, 77.82][0.0, 0.0, 0.0, 0.0, 12.5, 40.62]Failed
basin 1[12.5, 15.43, 17.15, 31.55, 40.95, 62.42][0.0, 2.0, 14.12, 12.71, 11.44, 21.76]Failed
basin 2[5.0, 35.88, 72.21, 114.96, 220.22, 271.59, 301.59][12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]Failed
basin 3[12.5, 15.89, 26.22, 37.37][5.0, 6.05, 5.97, 17.87]Failed
basin 4[5.0, 35.88, 48.38, 60.88, 73.38, 131.57, 144.07][30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]Failed
basin 5[12.5, 19.05, 31.04, 68.32, 70.32, 116.81][30.0, 54.3, 56.3, 47.6, 31.23, 32.99]Failed
basin 6[12.5, 28.95, 45.06, 67.37, 79.26, 123.25][30.0, 25.5, 26.68, 24.27, 22.54, 24.26]Failed
basin 7[2.0, 4.22, 10.21, 13.35][2.0, 6.8, 7.51, 8.76]Failed

SHA-256 / 2a609124aa4e4ac7ab86e05ae8b3f41243e236c4722c3ded4a5c07c647dc0e4c

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(k, obs):
    api = 0.0
    last = None
    out = []
    for day, p in sorted(obs, key=lambda r: r[0]):
        if last is not None:
            api *= k ** (day - last)
        api += max(p, 0.0)
        last = day
        out.append(round(api, 2))
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 2', [0.85, [[2, 12.5], [2, 30.0], [3, -1.0], [7, 30.0], [8, 30.0], [9, 30.0], [10, 5.0]]], [12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]], ['basin 3', [0.9, [[0, 5.0], [6, 2.0], [7, 12.5], [2, 2.0]]], [5.0, 6.05, 5.97, 17.87]], ['basin 4', [0.85, [[2, 30.0], [2, 12.5], [4, 30.0], [4, 12.5], [4, 12.5], [4, 12.5], [5, 5.0]]], [30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]], ['basin 5', [0.9, [[6, 2.0], [4, 30.0], [4, 2.0], [14, 12.5], [10, 0.0], [2, 30.0]]], [30.0, 54.3, 56.3, 47.6, 31.23, 32.99]], ['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]]], [['basin 6', [0.85, [[1, 0.0], [4, 5.0], [2, 5.0], [6, 5.0], [0, 30.0], [10, 12.5]]], [30.0, 25.5, 26.68, 24.27, 22.54, 24.26]], ['basin 7', [0.9, [[7, 2.0], [6, 2.0], [3, 2.0], [4, 5.0]]], [2.0, 6.8, 7.51, 8.76]], ['basin 8', [0.85, [[0, 2.0], [0, 5.0], [1, -1.0], [3, 5.0], [4, 30.0], [5, 2.0], [6, 2.0]]], [2.0, 7.0, 5.95, 9.3, 37.9, 34.22, 31.09]], ['basin 9', [0.9, [[1, -1.0], [2, 2.0], [2, 30.0], [3, 12.5], [5, 30.0], [7, 2.0], [9, 30.0]]], [0.0, 2.0, 32.0, 41.3, 63.45, 53.4, 73.25]], ['basin 10', [0.85, [[6, 2.0], [3, 30.0], [4, -1.0], [4, 5.0]]], [30.0, 25.5, 30.5, 24.04]], ['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 12', [0.85, [[2, 30.0], [4, -1.0], [5, 30.0], [6, 0.0], [6, 0.0]]], [30.0, 21.67, 48.42, 41.16, 41.16]], ['basin 13', [0.9, [[0, 12.5], [4, -1.0], [5, 5.0], [7, 12.5]]], [12.5, 8.2, 12.38, 22.53]]], [['basin 11', [0.9, [[3, -1.0], [5, 2.0], [6, 30.0], [7, -1.0], [9, -1.0], [10, 0.0], [14, 12.5]]], [0.0, 2.0, 31.8, 28.62, 23.18, 20.86, 26.19]], ['basin 14', [0.85, [[0, -1.0], [0, 30.0], [1, 5.0], [2, 0.0], [4, 5.0], [8, -1.0]]], [0.0, 30.0, 30.5, 25.93, 23.73, 12.39]], ['basin 15', [0.9, [[6, 5.0], [6, 30.0], [3, 0.0], [1, 5.0], [4, 12.5], [7, 12.5]]], [5.0, 4.05, 16.14, 18.08, 48.08, 55.77]], ['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 17', [0.9, [[7, 5.0], [4, 12.5], [0, 0.0], [6, 30.0]]], [0.0, 12.5, 40.12, 41.11]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 19', [0.9, [[2, 2.0], [6, 2.0], [7, 2.0], [11, 2.0], [13, 0.0], [15, 0.0]]], [2.0, 3.31, 4.98, 5.27, 4.27, 3.46]], ['basin 20', [0.85, [[2, -1.0], [3, 5.0], [4, 0.0], [8, -1.0], [12, -1.0], [13, 12.5], [17, 12.5]]], [0.0, 5.0, 4.25, 2.22, 1.16, 13.48, 19.54]]], [['basin 16', [0.85, [[1, 30.0], [13, -1.0], [5, 30.0], [9, 30.0]]], [30.0, 45.66, 53.83, 28.1]], ['basin 18', [0.85, [[4, 12.5], [4, -1.0], [3, 2.0], [4, 12.5]]], [2.0, 14.2, 14.2, 26.7]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 22', [0.85, [[0, 2.0], [1, -1.0], [1, -1.0], [2, 5.0], [3, 0.0], [7, 2.0], [8, 5.0]]], [2.0, 1.7, 1.7, 6.45, 5.48, 4.86, 9.13]], ['basin 23', [0.9, [[3, 30.0], [4, 30.0], [8, -1.0], [8, -1.0], [10, 0.0]]], [30.0, 57.0, 37.4, 37.4, 30.29]], ['basin 24', [0.85, [[2, 0.0], [4, -1.0], [5, -1.0], [5, 0.0], [6, 2.0], [7, 30.0], [7, 2.0]]], [0.0, 0.0, 0.0, 0.0, 2.0, 31.7, 33.7]], ['basin 25', [0.9, [[3, 0.0], [1, -1.0], [0, -1.0], [4, 2.0]]], [0.0, 0.0, 0.0, 2.0]], ['basin 26', [0.85, [[3, 30.0], [4, 2.0], [8, 0.0], [12, 0.0], [16, 12.5]]], [30.0, 27.5, 14.36, 7.49, 16.41]]], [['basin 0', [0.85, [[1, 0.0], [1, -1.0], [2, -1.0], [3, 0.0], [4, 12.5], [5, 30.0]]], [0.0, 0.0, 0.0, 0.0, 12.5, 40.62]], ['basin 1', [0.9, [[7, 2.0], [10, -1.0], [9, 12.5], [3, 0.0], [13, 12.5], [11, -1.0]]], [0.0, 2.0, 14.12, 12.71, 11.44, 21.76]], ['basin 21', [0.9, [[2, 12.5], [2, 30.0], [4, -1.0], [3, 0.0], [7, 0.0], [5, -1.0]]], [12.5, 42.5, 38.25, 34.43, 30.98, 25.1]], ['basin 28', [0.85, [[2, 30.0], [3, 2.0], [5, 2.0], [6, 30.0], [10, 2.0], [10, 5.0], [14, 5.0]]], [30.0, 27.5, 21.87, 48.59, 27.36, 32.36, 21.89]], ['basin 29', [0.9, [[4, 5.0], [1, 30.0], [1, 5.0], [3, 30.0]]], [30.0, 35.0, 58.35, 57.52]], ['two gauges same day', [0.9, [[1, 10.0], [1, 5.0], [3, 0.0]]], [10.0, 15.0, 12.15]], ['negative glitch', [0.8, [[0, 10.0], [1, -3.0]]], [10.0, 8.0]], ['week gap', [0.9, [[0, 20.0], [7, 0.0]]], [20.0, 9.57]]]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
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 fixtureActualExpectedOutcome
basin 0[0.0, 0.0, 0.0, 0.0, 12.5, 40.62][0.0, 0.0, 0.0, 0.0, 12.5, 40.62]Passed
basin 1[0.0, 2.0, 14.12, 12.71, 11.44, 21.76][0.0, 2.0, 14.12, 12.71, 11.44, 21.76]Passed
basin 2[12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18][12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18]Passed
basin 3[5.0, 6.05, 5.97, 17.87][5.0, 6.05, 5.97, 17.87]Passed
basin 4[30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48][30.0, 42.5, 60.71, 73.21, 85.71, 98.21, 88.48]Passed
basin 5[30.0, 54.3, 56.3, 47.6, 31.23, 32.99][30.0, 54.3, 56.3, 47.6, 31.23, 32.99]Passed
basin 6[30.0, 25.5, 26.68, 24.27, 22.54, 24.26][30.0, 25.5, 26.68, 24.27, 22.54, 24.26]Passed
basin 7[2.0, 6.8, 7.51, 8.76][2.0, 6.8, 7.51, 8.76]Passed

SHA-256 / c03e48fe914d58874f05bd9ab9a8ac447c7059a3a4869af5c556072a281d9f9b

Verification & scope

Stipulated deterministic teaching model of an operational weather index; coefficients and thresholds are fixed by the contract and no claim of standards conformance is made. 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:48:27.814176+00:00.

Case digest / 2fd4ac9627c84abf9815154c275ec3af61405b8d1d5394061b18f777365370f9