FAILURE MAP
← Case archive

FA-71606 / Seismic magnitude estimation / Open access

Preferred magnitude selection: zero ML presence · case 01

A microearthquake with ML 0.0 falls through to Md.

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

ROOT CAUSE

Presence is tested by truthiness, so magnitude 0.0 counts as missing.

THE FAILURE

Presence is tested by truthiness, so magnitude 0.0 counts as missing.

Unsuccessful approach: Requiring ML > 0 also rejects negative local magnitudes.

Case contract

mags maps type to value (any value including 0 or negative is valid when the key is present). Choose in order: Mw; if depth > 70 km then mb; Ms if Ms >= 5.5; ML if delta <= 5 degrees; mb; Md; else None. Return [type, value].

Why this case matters

Catalogues publish one preferred magnitude chosen by a fixed authority ladder.

1 / The failure

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

N = 1
observations = []
def solve(mags, depth_km, delta_deg):
    if "Mw" in mags:
        return ["Mw", mags["Mw"]]
    if depth_km > 70 and "mb" in mags:
        return ["mb", mags["mb"]]
    if "Ms" in mags and mags["Ms"] >= 5.5:
        return ["Ms", mags["Ms"]]
    if delta_deg <= 5 and mags.get("ML"):
        return ["ML", mags["ML"]]
    for t in ("mb", "Md"):
        if t in mags:
            return [t, mags[t]]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[["['Ms', 'Mw', 'mb'] depth 10 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 5.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 70 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 70 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 5.0], ['Mw', 6.1]], ["['ML', 'Md'] depth 10 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 10, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 10 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 10, 5.0], ['ML', 0.0]]], [["['Ms', 'Mw', 'mb'] depth 70 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 5.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 300 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 1.0], ['Mw', 6.1]], ["['ML', 'Md'] depth 70 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 70, 5.0], ['ML', 0.0]], ["['ML', 'Md'] depth 300 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 300, 1.0], ['ML', 0.0]]], [["['Ms', 'Mw', 'mb'] depth 300 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 300 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 30.0], ['Mw', 6.1]], ["['ML', 'Ms', 'mb'] depth 10 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 1.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 5.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 5.5], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 30.0], ['Ms', 5.5]], ["['ML', 'Md'] depth 300 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 300, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 70 delta 5.0", [{'ML': -0.4, 'Md': 0.1}, 70, 5.0], ['ML', -0.4]]], [["['ML', 'Ms', 'mb'] depth 70 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 5.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 70 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 5.5], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 70 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 30.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 71 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 1.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 71 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 5.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 71 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 5.5], ['mb', 5.2]], ["['ML', 'Md'] depth 10 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 10, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 10 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 10, 5.0], ['ML', 0.0]]], [["['ML', 'Ms', 'mb'] depth 300 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 1.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 5.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 5.5], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 30.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 10 delta 1.0", [{'Ms': 5.4, 'ML': 5.1, 'mb': 5.0}, 10, 1.0], ['ML', 5.1]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.0", [{'Ms': 5.4, 'ML': 5.1, 'mb': 5.0}, 10, 5.0], ['ML', 5.1]], ["['ML', 'Md'] depth 71 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 71, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 71 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 71, 5.0], ['ML', 0.0]]]]
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
['Ms', 'Mw', 'mb'] depth 10 delta 1.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 5.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 5.5['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 30.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 70 delta 1.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 70 delta 5.0['Mw', 6.1]['Mw', 6.1]Passed
['ML', 'Md'] depth 10 delta 1.0['Md', 0.3]['ML', 0.0]Failed
['ML', 'Md'] depth 10 delta 5.0['Md', 0.3]['ML', 0.0]Failed

SHA-256 / 406d6a7747ebebb408440e66bff293d180d0d9ee5bdbd9478c6c63f8df01a1de

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(mags, depth_km, delta_deg):
    if "Mw" in mags:
        return ["Mw", mags["Mw"]]
    if depth_km > 70 and "mb" in mags:
        return ["mb", mags["mb"]]
    if "Ms" in mags and mags["Ms"] >= 5.5:
        return ["Ms", mags["Ms"]]
    if delta_deg <= 5 and mags.get("ML", 0) > 0:
        return ["ML", mags["ML"]]
    for t in ("mb", "Md"):
        if t in mags:
            return [t, mags[t]]
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[["['Ms', 'Mw', 'mb'] depth 10 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 5.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 10 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 10, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 70 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 70 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 5.0], ['Mw', 6.1]], ["['ML', 'Md'] depth 10 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 10, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 10 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 10, 5.0], ['ML', 0.0]]], [["['Ms', 'Mw', 'mb'] depth 70 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 70, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 1.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 5.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 5.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 71 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 71, 30.0], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 300 delta 1.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 1.0], ['Mw', 6.1]], ["['ML', 'Md'] depth 70 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 70, 5.0], ['ML', 0.0]], ["['ML', 'Md'] depth 300 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 300, 1.0], ['ML', 0.0]]], [["['Ms', 'Mw', 'mb'] depth 300 delta 5.5", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 5.5], ['Mw', 6.1]], ["['Ms', 'Mw', 'mb'] depth 300 delta 30.0", [{'Mw': 6.1, 'Ms': 6.3, 'mb': 5.9}, 300, 30.0], ['Mw', 6.1]], ["['ML', 'Ms', 'mb'] depth 10 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 1.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 5.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 5.5], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 10 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 10, 30.0], ['Ms', 5.5]], ["['ML', 'Md'] depth 300 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 300, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 70 delta 5.0", [{'ML': -0.4, 'Md': 0.1}, 70, 5.0], ['ML', -0.4]]], [["['ML', 'Ms', 'mb'] depth 70 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 5.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 70 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 5.5], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 70 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 70, 30.0], ['Ms', 5.5]], ["['ML', 'Ms', 'mb'] depth 71 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 1.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 71 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 5.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 71 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 71, 5.5], ['mb', 5.2]], ["['ML', 'Md'] depth 10 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 10, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 10 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 10, 5.0], ['ML', 0.0]]], [["['ML', 'Ms', 'mb'] depth 300 delta 1.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 1.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 5.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 5.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 5.5", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 5.5], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 300 delta 30.0", [{'Ms': 5.5, 'mb': 5.2, 'ML': 5.4}, 300, 30.0], ['mb', 5.2]], ["['ML', 'Ms', 'mb'] depth 10 delta 1.0", [{'Ms': 5.4, 'ML': 5.1, 'mb': 5.0}, 10, 1.0], ['ML', 5.1]], ["['ML', 'Ms', 'mb'] depth 10 delta 5.0", [{'Ms': 5.4, 'ML': 5.1, 'mb': 5.0}, 10, 5.0], ['ML', 5.1]], ["['ML', 'Md'] depth 71 delta 1.0", [{'ML': 0.0, 'Md': 0.3}, 71, 1.0], ['ML', 0.0]], ["['ML', 'Md'] depth 71 delta 5.0", [{'ML': 0.0, 'Md': 0.3}, 71, 5.0], ['ML', 0.0]]]]
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
['Ms', 'Mw', 'mb'] depth 10 delta 1.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 5.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 5.5['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 10 delta 30.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 70 delta 1.0['Mw', 6.1]['Mw', 6.1]Passed
['Ms', 'Mw', 'mb'] depth 70 delta 5.0['Mw', 6.1]['Mw', 6.1]Passed
['ML', 'Md'] depth 10 delta 1.0['Md', 0.3]['ML', 0.0]Failed
['ML', 'Md'] depth 10 delta 5.0['Md', 0.3]['ML', 0.0]Failed

SHA-256 / ccc59398f4ef46e9286f9a46f5f2e697d37936ce2e7dffb84b96765f8a9d8ecd

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated deterministic teaching model of a seismological magnitude procedure; constants and tables are fixed by the contract and no claim of agency or 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:31.134934+00:00.

Case digest / 24cb522689d5e6d10338af2bd67503f282962e081ffa397e0ba414d6b8683986