FA-71231 / Weather index computation / Open access
Antecedent precipitation index: sensor glitch clamp · case 01
A negative tipping-bucket glitch lowers soil moisture.
ROOT CAUSE
Negative precipitation values are added directly.
VERIFIED REPAIR
Treat negative precipitation as zero.
Unsuccessful approach: Taking the absolute value turns a glitch into rain.
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 sorted(obs, key=lambda r: r[0]):
if last is not None:
api *= k ** (day - last)
api += p
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 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 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 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 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 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 27', [0.9, [[1, 0.0], [4, 0.0], [4, 12.5], [2, 5.0]]], [0.0, 5.0, 4.05, 16.55]]], [['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 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 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 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| basin 0 | [0.0, -1.0, -1.85, -1.57, 11.16, 39.49] | [0.0, 0.0, 0.0, 0.0, 12.5, 40.62] | Failed |
| basin 1 | [0.0, 2.0, 14.12, 11.71, 9.54, 20.23] | [0.0, 2.0, 14.12, 12.71, 11.44, 21.76] | Failed |
| basin 2 | [12.5, 42.5, 35.12, 48.34, 71.09, 90.42, 81.86] | [12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18] | Failed |
| 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 / d4692cdf4b6df0146dbe059d302e03ef64d488b07e81dce570cd80184b54bf53
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]):
if last is not None:
api *= k ** (day - last)
api += abs(p)
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 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 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 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 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 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 27', [0.9, [[1, 0.0], [4, 0.0], [4, 12.5], [2, 5.0]]], [0.0, 5.0, 4.05, 16.55]]], [['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 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 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 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| basin 0 | [0.0, 1.0, 1.85, 1.57, 13.84, 41.76] | [0.0, 0.0, 0.0, 0.0, 12.5, 40.62] | Failed |
| basin 1 | [0.0, 2.0, 14.12, 13.71, 13.34, 23.3] | [0.0, 2.0, 14.12, 12.71, 11.44, 21.76] | Failed |
| basin 2 | [12.5, 42.5, 37.12, 49.38, 71.97, 91.18, 82.5] | [12.5, 42.5, 36.12, 48.86, 71.53, 90.8, 82.18] | Failed |
| 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 / 2bee96cd7c470f66f31710a0ea68c84b837b04b67fc4364bb80206d4226cc683
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 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 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 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 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 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 27', [0.9, [[1, 0.0], [4, 0.0], [4, 12.5], [2, 5.0]]], [0.0, 5.0, 4.05, 16.55]]], [['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 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 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 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 / 6d1043f68da758899b910292d6f3acca77eae6aefa9b8158b967acf338ae15ed
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.874154+00:00.
Case digest / c695623bbf5d97aaafe98968cb1527168f473620eda9650266c4462302c03e51