FAILURE MAP
← Case archive

FA-71116 / Weather index computation / Open access

Beaufort force and marine warning: force bound inclusivity · case 01

A wind of exactly 17.2 m/s is reported as force 7.

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

ROOT CAUSE

The Beaufort upper bounds are treated as inclusive.

VERIFIED REPAIR

A speed equal to a bound belongs to the next force.

Unsuccessful approach: Subtracting 0.1 from each bound shifts values just below the bound upward.

Case contract

Convert knots to m/s (x0.514444) and round to 0.1 m/s. Beaufort force n is the first n with speed < bounds[n], bounds=[0.5,1.6,3.4,5.5,8.0,10.8,13.9,17.2,20.8,24.5,28.5,32.7], else 12. If the gust force is at least sustained force + 2 (and force < 12) upgrade by one. Warning: <6 none, <8 small craft, <10 gale, <12 storm, 12 hurricane force. Return [force, warning].

Why this case matters

Coastal marine forecasts issue small-craft, gale and storm warnings from Beaufort force.

1 / The failure

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

N = 1
observations = []
def solve(sustained_kt, gust_kt):
    bounds = [0.5, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.7]
    def force(kt):
        ms = round(kt * 0.514444, 1)
        for n, upper in enumerate(bounds):
            if ms <= upper:
                return n
        return 12
    b = force(sustained_kt)
    g = force(gust_kt)
    if g >= b + 2 and b < 12:
        b += 1
    if b < 6:
        warn = "none"
    elif b < 8:
        warn = "small craft"
    elif b < 10:
        warn = "gale"
    elif b < 12:
        warn = "storm"
    else:
        warn = "hurricane force"
    return [b, warn]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['sustained 0 kt gust +0', [0, 0], [0, 'none']], ['sustained 0 kt gust +2', [0, 2], [0, 'none']], ['sustained 0 kt gust +8', [0, 8], [1, 'none']], ['sustained 0 kt gust +16', [0, 16], [1, 'none']], ['sustained 0.9 kt gust +0', [0.9, 0.9], [1, 'none']], ['sustained 0.9 kt gust +2', [0.9, 2.9], [1, 'none']], ['sustained 0.9 kt gust +8', [0.9, 8.9], [2, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']]], [['sustained 0.9 kt gust +16', [0.9, 16.9], [2, 'none']], ['sustained 1 kt gust +0', [1, 1], [1, 'none']], ['sustained 1 kt gust +2', [1, 3], [1, 'none']], ['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 1 kt gust +16', [1, 17], [2, 'none']], ['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']], ['sustained 55.3 kt gust +8', [55.3, 63.3], [10, 'storm']]], [['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 3 kt gust +16', [3, 19], [2, 'none']], ['sustained 6.6 kt gust +0', [6.6, 6.6], [3, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 6.6 kt gust +8', [6.6, 14.6], [3, 'none']], ['sustained 6.6 kt gust +16', [6.6, 22.6], [4, 'none']], ['sustained 55.3 kt gust +0', [55.3, 55.3], [10, 'storm']]], [['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 10.7 kt gust +8', [10.7, 18.7], [4, 'none']], ['sustained 10.7 kt gust +16', [10.7, 26.7], [5, 'none']], ['sustained 16 kt gust +0', [16, 16], [5, 'none']], ['sustained 16 kt gust +2', [16, 18], [5, 'none']], ['sustained 16 kt gust +8', [16, 24], [5, 'none']]], [['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 21 kt gust +0', [21, 21], [6, 'small craft']], ['sustained 21 kt gust +2', [21, 23], [6, 'small craft']], ['sustained 21 kt gust +8', [21, 29], [6, 'small craft']], ['sustained 21 kt gust +16', [21, 37], [7, 'small craft']], ['sustained 27 kt gust +0', [27, 27], [7, 'small craft']], ['sustained 27 kt gust +2', [27, 29], [7, 'small craft']]]]
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
sustained 0 kt gust +0[0, 'none'][0, 'none']Passed
sustained 0 kt gust +2[0, 'none'][0, 'none']Passed
sustained 0 kt gust +8[1, 'none'][1, 'none']Passed
sustained 0 kt gust +16[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +0[0, 'none'][1, 'none']Failed
sustained 0.9 kt gust +2[0, 'none'][1, 'none']Failed
sustained 0.9 kt gust +8[1, 'none'][2, 'none']Failed
sustained 3 kt gust +2[1, 'none'][1, 'none']Passed

SHA-256 / 4fd27e7b410e2b47d5c3969f22e8061ee5e3b70e108a840d5989c3b4e8766b5e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(sustained_kt, gust_kt):
    bounds = [0.5, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.7]
    def force(kt):
        ms = round(kt * 0.514444, 1)
        for n, upper in enumerate(bounds):
            if ms < upper - 0.1:
                return n
        return 12
    b = force(sustained_kt)
    g = force(gust_kt)
    if g >= b + 2 and b < 12:
        b += 1
    if b < 6:
        warn = "none"
    elif b < 8:
        warn = "small craft"
    elif b < 10:
        warn = "gale"
    elif b < 12:
        warn = "storm"
    else:
        warn = "hurricane force"
    return [b, warn]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['sustained 0 kt gust +0', [0, 0], [0, 'none']], ['sustained 0 kt gust +2', [0, 2], [0, 'none']], ['sustained 0 kt gust +8', [0, 8], [1, 'none']], ['sustained 0 kt gust +16', [0, 16], [1, 'none']], ['sustained 0.9 kt gust +0', [0.9, 0.9], [1, 'none']], ['sustained 0.9 kt gust +2', [0.9, 2.9], [1, 'none']], ['sustained 0.9 kt gust +8', [0.9, 8.9], [2, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']]], [['sustained 0.9 kt gust +16', [0.9, 16.9], [2, 'none']], ['sustained 1 kt gust +0', [1, 1], [1, 'none']], ['sustained 1 kt gust +2', [1, 3], [1, 'none']], ['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 1 kt gust +16', [1, 17], [2, 'none']], ['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']], ['sustained 55.3 kt gust +8', [55.3, 63.3], [10, 'storm']]], [['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 3 kt gust +16', [3, 19], [2, 'none']], ['sustained 6.6 kt gust +0', [6.6, 6.6], [3, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 6.6 kt gust +8', [6.6, 14.6], [3, 'none']], ['sustained 6.6 kt gust +16', [6.6, 22.6], [4, 'none']], ['sustained 55.3 kt gust +0', [55.3, 55.3], [10, 'storm']]], [['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 10.7 kt gust +8', [10.7, 18.7], [4, 'none']], ['sustained 10.7 kt gust +16', [10.7, 26.7], [5, 'none']], ['sustained 16 kt gust +0', [16, 16], [5, 'none']], ['sustained 16 kt gust +2', [16, 18], [5, 'none']], ['sustained 16 kt gust +8', [16, 24], [5, 'none']]], [['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 21 kt gust +0', [21, 21], [6, 'small craft']], ['sustained 21 kt gust +2', [21, 23], [6, 'small craft']], ['sustained 21 kt gust +8', [21, 29], [6, 'small craft']], ['sustained 21 kt gust +16', [21, 37], [7, 'small craft']], ['sustained 27 kt gust +0', [27, 27], [7, 'small craft']], ['sustained 27 kt gust +2', [27, 29], [7, 'small craft']]]]
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
sustained 0 kt gust +0[0, 'none'][0, 'none']Passed
sustained 0 kt gust +2[0, 'none'][0, 'none']Passed
sustained 0 kt gust +8[1, 'none'][1, 'none']Passed
sustained 0 kt gust +16[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +0[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +2[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +8[2, 'none'][2, 'none']Passed
sustained 3 kt gust +2[2, 'none'][1, 'none']Failed

SHA-256 / 52447bb16c2be84dc76dea13d1995fd3248219b855e8ab0b505f88c723406ed3

3 / The verified repair

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

N = 1
observations = []
def solve(sustained_kt, gust_kt):
    bounds = [0.5, 1.6, 3.4, 5.5, 8.0, 10.8, 13.9, 17.2, 20.8, 24.5, 28.5, 32.7]
    def force(kt):
        ms = round(kt * 0.514444, 1)
        for n, upper in enumerate(bounds):
            if ms < upper:
                return n
        return 12
    b = force(sustained_kt)
    g = force(gust_kt)
    if g >= b + 2 and b < 12:
        b += 1
    if b < 6:
        warn = "none"
    elif b < 8:
        warn = "small craft"
    elif b < 10:
        warn = "gale"
    elif b < 12:
        warn = "storm"
    else:
        warn = "hurricane force"
    return [b, warn]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['sustained 0 kt gust +0', [0, 0], [0, 'none']], ['sustained 0 kt gust +2', [0, 2], [0, 'none']], ['sustained 0 kt gust +8', [0, 8], [1, 'none']], ['sustained 0 kt gust +16', [0, 16], [1, 'none']], ['sustained 0.9 kt gust +0', [0.9, 0.9], [1, 'none']], ['sustained 0.9 kt gust +2', [0.9, 2.9], [1, 'none']], ['sustained 0.9 kt gust +8', [0.9, 8.9], [2, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']]], [['sustained 0.9 kt gust +16', [0.9, 16.9], [2, 'none']], ['sustained 1 kt gust +0', [1, 1], [1, 'none']], ['sustained 1 kt gust +2', [1, 3], [1, 'none']], ['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 1 kt gust +16', [1, 17], [2, 'none']], ['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 3 kt gust +2', [3, 5], [1, 'none']], ['sustained 55.3 kt gust +8', [55.3, 63.3], [10, 'storm']]], [['sustained 1 kt gust +8', [1, 9], [2, 'none']], ['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 3 kt gust +16', [3, 19], [2, 'none']], ['sustained 6.6 kt gust +0', [6.6, 6.6], [3, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 6.6 kt gust +8', [6.6, 14.6], [3, 'none']], ['sustained 6.6 kt gust +16', [6.6, 22.6], [4, 'none']], ['sustained 55.3 kt gust +0', [55.3, 55.3], [10, 'storm']]], [['sustained 3 kt gust +8', [3, 11], [2, 'none']], ['sustained 6.6 kt gust +2', [6.6, 8.6], [3, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 10.7 kt gust +8', [10.7, 18.7], [4, 'none']], ['sustained 10.7 kt gust +16', [10.7, 26.7], [5, 'none']], ['sustained 16 kt gust +0', [16, 16], [5, 'none']], ['sustained 16 kt gust +2', [16, 18], [5, 'none']], ['sustained 16 kt gust +8', [16, 24], [5, 'none']]], [['sustained 3 kt gust +0', [3, 3], [1, 'none']], ['sustained 10.7 kt gust +2', [10.7, 12.7], [4, 'none']], ['sustained 21 kt gust +0', [21, 21], [6, 'small craft']], ['sustained 21 kt gust +2', [21, 23], [6, 'small craft']], ['sustained 21 kt gust +8', [21, 29], [6, 'small craft']], ['sustained 21 kt gust +16', [21, 37], [7, 'small craft']], ['sustained 27 kt gust +0', [27, 27], [7, 'small craft']], ['sustained 27 kt gust +2', [27, 29], [7, 'small craft']]]]
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
sustained 0 kt gust +0[0, 'none'][0, 'none']Passed
sustained 0 kt gust +2[0, 'none'][0, 'none']Passed
sustained 0 kt gust +8[1, 'none'][1, 'none']Passed
sustained 0 kt gust +16[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +0[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +2[1, 'none'][1, 'none']Passed
sustained 0.9 kt gust +8[2, 'none'][2, 'none']Passed
sustained 3 kt gust +2[1, 'none'][1, 'none']Passed

SHA-256 / 50b89eae6deda5b68933bd2e99be3bde5c23768f5e142c1d8637056a003cb1a2

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:26.806725+00:00.

Case digest / e986452643dd0d45ac10416254a92dd504967cd66194ede9763c9c8d31fbbde9