FAILURE MAP
← Case archive

FA-71666 / Seismic magnitude estimation / Open access

Estimated Mercalli intensity: intensity rounding · case 01

Intensity 6.7 is reported as VI.

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

ROOT CAUSE

The intensity estimate is truncated.

VERIFIED REPAIR

Round half up.

Unsuccessful approach: Rounding up to be conservative reports 6.1 as VII.

Case contract

R = max(hypocentral distance, 1 km). I = 1.45M - 2.46 log10(R) + 1.5, rounded half up to an integer and clamped to 1..12. Return [I, Roman numeral].

Why this case matters

ShakeMap-style intensity summaries are published as Roman numerals.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mag, epi_km, depth_km):
    roman = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"]
    r = max(math.hypot(epi_km, depth_km), 1.0)
    i = 1.45 * mag - 2.46 * math.log10(r) + 1.5
    v = int(i)
    v = min(max(v, 1), 12)
    return [v, roman[v - 1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['M2.0 at 0 km depth 0.5', [2.0, 0, 0.5], [4, 'IV']], ['M2.0 at 0 km depth 5', [2.0, 0, 5], [3, 'III']], ['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M2.0 at 20 km depth 10', [2.0, 20, 10], [1, 'I']], ['M2.0 at 80 km depth 15', [2.0, 80, 15], [1, 'I']], ['M2.0 at 300 km depth 30', [2.0, 300, 30], [1, 'I']], ['M2.0 at 900 km depth 10', [2.0, 900, 10], [1, 'I']], ['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']]], [['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']], ['M4.5 at 0 km depth 5', [4.5, 0, 5], [6, 'VI']], ['M4.5 at 3 km depth 2', [4.5, 3, 2], [7, 'VII']], ['M4.5 at 20 km depth 10', [4.5, 20, 10], [5, 'V']], ['M4.5 at 80 km depth 15', [4.5, 80, 15], [3, 'III']], ['M4.5 at 300 km depth 30', [4.5, 300, 30], [2, 'II']], ['M4.5 at 900 km depth 10', [4.5, 900, 10], [1, 'I']], ['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M6.0 at 0 km depth 5', [6.0, 0, 5], [8, 'VIII']], ['M6.0 at 3 km depth 2', [6.0, 3, 2], [9, 'IX']], ['M6.0 at 20 km depth 10', [6.0, 20, 10], [7, 'VII']], ['M6.0 at 80 km depth 15', [6.0, 80, 15], [5, 'V']], ['M6.0 at 300 km depth 30', [6.0, 300, 30], [4, 'IV']], ['M6.0 at 900 km depth 10', [6.0, 900, 10], [3, 'III']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']]], [['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M7.2 at 0 km depth 0.5', [7.2, 0, 0.5], [12, 'XII']], ['M7.2 at 0 km depth 5', [7.2, 0, 5], [10, 'X']], ['M7.2 at 3 km depth 2', [7.2, 3, 2], [11, 'XI']], ['M7.2 at 20 km depth 10', [7.2, 20, 10], [9, 'IX']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']], ['M7.2 at 300 km depth 30', [7.2, 300, 30], [6, 'VI']], ['M7.2 at 900 km depth 10', [7.2, 900, 10], [5, 'V']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M8.5 at 0 km depth 0.5', [8.5, 0, 0.5], [12, 'XII']], ['M8.5 at 0 km depth 5', [8.5, 0, 5], [12, 'XII']], ['M8.5 at 3 km depth 2', [8.5, 3, 2], [12, 'XII']], ['M8.5 at 20 km depth 10', [8.5, 20, 10], [11, 'XI']], ['M8.5 at 80 km depth 15', [8.5, 80, 15], [9, 'IX']], ['M8.5 at 300 km depth 30', [8.5, 300, 30], [8, 'VIII']], ['M8.5 at 900 km depth 10', [8.5, 900, 10], [7, 'VII']]]]
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
M2.0 at 0 km depth 0.5[4, 'IV'][4, 'IV']Passed
M2.0 at 0 km depth 5[2, 'II'][3, 'III']Failed
M2.0 at 3 km depth 2[3, 'III'][3, 'III']Passed
M2.0 at 20 km depth 10[1, 'I'][1, 'I']Passed
M2.0 at 80 km depth 15[1, 'I'][1, 'I']Passed
M2.0 at 300 km depth 30[1, 'I'][1, 'I']Passed
M2.0 at 900 km depth 10[1, 'I'][1, 'I']Passed
M4.5 at 0 km depth 0.5[8, 'VIII'][8, 'VIII']Passed

SHA-256 / 237ed64de2bc6fde49e18a507d64a100b5fbbc4290062bc1b52d29caf066a653

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mag, epi_km, depth_km):
    roman = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"]
    r = max(math.hypot(epi_km, depth_km), 1.0)
    i = 1.45 * mag - 2.46 * math.log10(r) + 1.5
    v = int(math.ceil(i))
    v = min(max(v, 1), 12)
    return [v, roman[v - 1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['M2.0 at 0 km depth 0.5', [2.0, 0, 0.5], [4, 'IV']], ['M2.0 at 0 km depth 5', [2.0, 0, 5], [3, 'III']], ['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M2.0 at 20 km depth 10', [2.0, 20, 10], [1, 'I']], ['M2.0 at 80 km depth 15', [2.0, 80, 15], [1, 'I']], ['M2.0 at 300 km depth 30', [2.0, 300, 30], [1, 'I']], ['M2.0 at 900 km depth 10', [2.0, 900, 10], [1, 'I']], ['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']]], [['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']], ['M4.5 at 0 km depth 5', [4.5, 0, 5], [6, 'VI']], ['M4.5 at 3 km depth 2', [4.5, 3, 2], [7, 'VII']], ['M4.5 at 20 km depth 10', [4.5, 20, 10], [5, 'V']], ['M4.5 at 80 km depth 15', [4.5, 80, 15], [3, 'III']], ['M4.5 at 300 km depth 30', [4.5, 300, 30], [2, 'II']], ['M4.5 at 900 km depth 10', [4.5, 900, 10], [1, 'I']], ['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M6.0 at 0 km depth 5', [6.0, 0, 5], [8, 'VIII']], ['M6.0 at 3 km depth 2', [6.0, 3, 2], [9, 'IX']], ['M6.0 at 20 km depth 10', [6.0, 20, 10], [7, 'VII']], ['M6.0 at 80 km depth 15', [6.0, 80, 15], [5, 'V']], ['M6.0 at 300 km depth 30', [6.0, 300, 30], [4, 'IV']], ['M6.0 at 900 km depth 10', [6.0, 900, 10], [3, 'III']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']]], [['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M7.2 at 0 km depth 0.5', [7.2, 0, 0.5], [12, 'XII']], ['M7.2 at 0 km depth 5', [7.2, 0, 5], [10, 'X']], ['M7.2 at 3 km depth 2', [7.2, 3, 2], [11, 'XI']], ['M7.2 at 20 km depth 10', [7.2, 20, 10], [9, 'IX']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']], ['M7.2 at 300 km depth 30', [7.2, 300, 30], [6, 'VI']], ['M7.2 at 900 km depth 10', [7.2, 900, 10], [5, 'V']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M8.5 at 0 km depth 0.5', [8.5, 0, 0.5], [12, 'XII']], ['M8.5 at 0 km depth 5', [8.5, 0, 5], [12, 'XII']], ['M8.5 at 3 km depth 2', [8.5, 3, 2], [12, 'XII']], ['M8.5 at 20 km depth 10', [8.5, 20, 10], [11, 'XI']], ['M8.5 at 80 km depth 15', [8.5, 80, 15], [9, 'IX']], ['M8.5 at 300 km depth 30', [8.5, 300, 30], [8, 'VIII']], ['M8.5 at 900 km depth 10', [8.5, 900, 10], [7, 'VII']]]]
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
M2.0 at 0 km depth 0.5[5, 'V'][4, 'IV']Failed
M2.0 at 0 km depth 5[3, 'III'][3, 'III']Passed
M2.0 at 3 km depth 2[4, 'IV'][3, 'III']Failed
M2.0 at 20 km depth 10[2, 'II'][1, 'I']Failed
M2.0 at 80 km depth 15[1, 'I'][1, 'I']Passed
M2.0 at 300 km depth 30[1, 'I'][1, 'I']Passed
M2.0 at 900 km depth 10[1, 'I'][1, 'I']Passed
M4.5 at 0 km depth 0.5[9, 'IX'][8, 'VIII']Failed

SHA-256 / fa6a590e3fee89ec72dc3d4f5c184bff6d94112011abbf75fe10fcc5cd1f63d6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(mag, epi_km, depth_km):
    roman = ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII"]
    r = max(math.hypot(epi_km, depth_km), 1.0)
    i = 1.45 * mag - 2.46 * math.log10(r) + 1.5
    v = int(math.floor(i + 0.5))
    v = min(max(v, 1), 12)
    return [v, roman[v - 1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['M2.0 at 0 km depth 0.5', [2.0, 0, 0.5], [4, 'IV']], ['M2.0 at 0 km depth 5', [2.0, 0, 5], [3, 'III']], ['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M2.0 at 20 km depth 10', [2.0, 20, 10], [1, 'I']], ['M2.0 at 80 km depth 15', [2.0, 80, 15], [1, 'I']], ['M2.0 at 300 km depth 30', [2.0, 300, 30], [1, 'I']], ['M2.0 at 900 km depth 10', [2.0, 900, 10], [1, 'I']], ['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']]], [['M4.5 at 0 km depth 0.5', [4.5, 0, 0.5], [8, 'VIII']], ['M4.5 at 0 km depth 5', [4.5, 0, 5], [6, 'VI']], ['M4.5 at 3 km depth 2', [4.5, 3, 2], [7, 'VII']], ['M4.5 at 20 km depth 10', [4.5, 20, 10], [5, 'V']], ['M4.5 at 80 km depth 15', [4.5, 80, 15], [3, 'III']], ['M4.5 at 300 km depth 30', [4.5, 300, 30], [2, 'II']], ['M4.5 at 900 km depth 10', [4.5, 900, 10], [1, 'I']], ['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M6.0 at 0 km depth 5', [6.0, 0, 5], [8, 'VIII']], ['M6.0 at 3 km depth 2', [6.0, 3, 2], [9, 'IX']], ['M6.0 at 20 km depth 10', [6.0, 20, 10], [7, 'VII']], ['M6.0 at 80 km depth 15', [6.0, 80, 15], [5, 'V']], ['M6.0 at 300 km depth 30', [6.0, 300, 30], [4, 'IV']], ['M6.0 at 900 km depth 10', [6.0, 900, 10], [3, 'III']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']]], [['M2.0 at 3 km depth 2', [2.0, 3, 2], [3, 'III']], ['M7.2 at 0 km depth 0.5', [7.2, 0, 0.5], [12, 'XII']], ['M7.2 at 0 km depth 5', [7.2, 0, 5], [10, 'X']], ['M7.2 at 3 km depth 2', [7.2, 3, 2], [11, 'XI']], ['M7.2 at 20 km depth 10', [7.2, 20, 10], [9, 'IX']], ['M7.2 at 80 km depth 15', [7.2, 80, 15], [7, 'VII']], ['M7.2 at 300 km depth 30', [7.2, 300, 30], [6, 'VI']], ['M7.2 at 900 km depth 10', [7.2, 900, 10], [5, 'V']]], [['M6.0 at 0 km depth 0.5', [6.0, 0, 0.5], [10, 'X']], ['M8.5 at 0 km depth 0.5', [8.5, 0, 0.5], [12, 'XII']], ['M8.5 at 0 km depth 5', [8.5, 0, 5], [12, 'XII']], ['M8.5 at 3 km depth 2', [8.5, 3, 2], [12, 'XII']], ['M8.5 at 20 km depth 10', [8.5, 20, 10], [11, 'XI']], ['M8.5 at 80 km depth 15', [8.5, 80, 15], [9, 'IX']], ['M8.5 at 300 km depth 30', [8.5, 300, 30], [8, 'VIII']], ['M8.5 at 900 km depth 10', [8.5, 900, 10], [7, 'VII']]]]
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
M2.0 at 0 km depth 0.5[4, 'IV'][4, 'IV']Passed
M2.0 at 0 km depth 5[3, 'III'][3, 'III']Passed
M2.0 at 3 km depth 2[3, 'III'][3, 'III']Passed
M2.0 at 20 km depth 10[1, 'I'][1, 'I']Passed
M2.0 at 80 km depth 15[1, 'I'][1, 'I']Passed
M2.0 at 300 km depth 30[1, 'I'][1, 'I']Passed
M2.0 at 900 km depth 10[1, 'I'][1, 'I']Passed
M4.5 at 0 km depth 0.5[8, 'VIII'][8, 'VIII']Passed

SHA-256 / 5149452493077ceb9c0eba97bd8567a92d2669bc61f30f80f40c0fa165ef8169

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

Case digest / 693098be3a30d758d42c7ee349ddd3917a4aa0999f72b2522ececaa5025468b5