FA-71521 / Seismic magnitude estimation / Open access
Maximum-curvature completeness magnitude: tie-break direction · case 01
Ties choose the higher bin and Mc is overstated.
ROOT CAUSE
Tied modal bins resolve to the largest magnitude.
VERIFIED REPAIR
Choose the lowest tied bin.
Unsuccessful approach: Taking the first bin in insertion order depends on catalogue order.
Case contract
Magnitudes in hundredths are binned to 0.1 by rounding half up (floor((m+5)/10) tenths). Mc is the bin with the highest count (ties: lowest bin) plus a 0.2 correction. Return Mc in magnitude units rounded 0.1, or None when empty.
Why this case matters
Completeness magnitude determines which events enter rate and b-value estimates.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mags_x100):
if not mags_x100:
return None
counts = {}
for m in mags_x100:
b = (m + 5) // 10
counts[b] = counts.get(b, 0) + 1
best = max(counts.values())
mode = max(k for k, c in counts.items() if c == best)
return round((mode + 2) / 10, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['raw catalogue 0', [[16]], 0.4], ['raw catalogue 1', [[25, 145, 55, 150, 150, 145, 15]], 1.7], ['raw catalogue 2', [[15, 15, 25, 45, 14, -12, 24, 24, 35, 35, 55, 145, 145]], 0.4], ['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 4', [[15]], 0.4], ['raw catalogue 5', [[-5, 24, 55]], 0.2], ['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['raw catalogue 7', [[26, 15]], 0.4]], [['raw catalogue 7', [[26, 15]], 0.4], ['raw catalogue 8', [[155, 35, 16]], 0.4], ['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 10', [[45, 24, 5, 16, 155]], 0.4], ['raw catalogue 11', [[35, 35, 15, 55, 35]], 0.6], ['raw catalogue 12', [[25, 145, 150]], 1.7], ['raw catalogue 13', [[55, -5, 150, 24, 35, 150]], 1.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['raw catalogue 15', [[45, 55, 15, 26, 45, 15]], 0.4], ['raw catalogue 16', [[16, 5, 15, 35, 15, 5, 150, 16, 5, 16]], 0.4], ['raw catalogue 17', [[25, 45, 45, 14, 145, 15, 14, 45, 45, 150, 155, 155, 14, 16]], 0.7], ['raw catalogue 18', [[155, -5, 15, 155, 155, 35, 24, -5, 16, 16, -5, 55]], 0.4], ['raw catalogue 19', [[14]], 0.3], ['raw catalogue 20', [[14, -5]], 0.2]], [['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 21', [[45, 45, 15]], 0.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3], ['raw catalogue 23', [[5, 150, 145, 24, 45, 145, 155, 145, 55, -12, 25, 15]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['raw catalogue 25', [[15, 145, 26, 16, 45, 15]], 0.4], ['raw catalogue 26', [[5, 5, 5, 45, 26, 15]], 0.3], ['raw catalogue 28', [[35, 145]], 0.6]], [['raw catalogue 20', [[14, -5]], 0.2], ['raw catalogue 28', [[35, 145]], 0.6], ['raw catalogue 29', [[25, 35, -12, 5, 55, 150, 155, 45, -12, 5]], 0.1], ['raw catalogue 30', [[15]], 0.4], ['raw catalogue 31', [[16]], 0.4], ['raw catalogue 32', [[35, 5, 150, -12]], 0.1], ['raw catalogue 33', [[24, 55, 25, 150, 155, 35, 45, 26, 15]], 0.4], ['tie between bins', [[14, 15, 24, 25]], 0.4]]]
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 |
|---|---|---|---|
| raw catalogue 0 | 0.4 | 0.4 | Passed |
| raw catalogue 1 | 1.7 | 1.7 | Passed |
| raw catalogue 2 | 0.4 | 0.4 | Passed |
| raw catalogue 3 | 1.7 | 0.1 | Failed |
| raw catalogue 4 | 0.4 | 0.4 | Passed |
| raw catalogue 5 | 0.8 | 0.2 | Failed |
| raw catalogue 6 | 0.5 | 0.5 | Passed |
| raw catalogue 7 | 0.5 | 0.4 | Failed |
SHA-256 / 207c8fd3524a62c6b29f977b435d5c87f8b424b16d1b3b7e0f4815411228cbae
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mags_x100):
if not mags_x100:
return None
counts = {}
for m in mags_x100:
b = (m + 5) // 10
counts[b] = counts.get(b, 0) + 1
best = max(counts.values())
mode = next(k for k, c in counts.items() if c == best)
return round((mode + 2) / 10, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['raw catalogue 0', [[16]], 0.4], ['raw catalogue 1', [[25, 145, 55, 150, 150, 145, 15]], 1.7], ['raw catalogue 2', [[15, 15, 25, 45, 14, -12, 24, 24, 35, 35, 55, 145, 145]], 0.4], ['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 4', [[15]], 0.4], ['raw catalogue 5', [[-5, 24, 55]], 0.2], ['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['raw catalogue 7', [[26, 15]], 0.4]], [['raw catalogue 7', [[26, 15]], 0.4], ['raw catalogue 8', [[155, 35, 16]], 0.4], ['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 10', [[45, 24, 5, 16, 155]], 0.4], ['raw catalogue 11', [[35, 35, 15, 55, 35]], 0.6], ['raw catalogue 12', [[25, 145, 150]], 1.7], ['raw catalogue 13', [[55, -5, 150, 24, 35, 150]], 1.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['raw catalogue 15', [[45, 55, 15, 26, 45, 15]], 0.4], ['raw catalogue 16', [[16, 5, 15, 35, 15, 5, 150, 16, 5, 16]], 0.4], ['raw catalogue 17', [[25, 45, 45, 14, 145, 15, 14, 45, 45, 150, 155, 155, 14, 16]], 0.7], ['raw catalogue 18', [[155, -5, 15, 155, 155, 35, 24, -5, 16, 16, -5, 55]], 0.4], ['raw catalogue 19', [[14]], 0.3], ['raw catalogue 20', [[14, -5]], 0.2]], [['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 21', [[45, 45, 15]], 0.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3], ['raw catalogue 23', [[5, 150, 145, 24, 45, 145, 155, 145, 55, -12, 25, 15]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['raw catalogue 25', [[15, 145, 26, 16, 45, 15]], 0.4], ['raw catalogue 26', [[5, 5, 5, 45, 26, 15]], 0.3], ['raw catalogue 28', [[35, 145]], 0.6]], [['raw catalogue 20', [[14, -5]], 0.2], ['raw catalogue 28', [[35, 145]], 0.6], ['raw catalogue 29', [[25, 35, -12, 5, 55, 150, 155, 45, -12, 5]], 0.1], ['raw catalogue 30', [[15]], 0.4], ['raw catalogue 31', [[16]], 0.4], ['raw catalogue 32', [[35, 5, 150, -12]], 0.1], ['raw catalogue 33', [[24, 55, 25, 150, 155, 35, 45, 26, 15]], 0.4], ['tie between bins', [[14, 15, 24, 25]], 0.4]]]
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 |
|---|---|---|---|
| raw catalogue 0 | 0.4 | 0.4 | Passed |
| raw catalogue 1 | 1.7 | 1.7 | Passed |
| raw catalogue 2 | 0.4 | 0.4 | Passed |
| raw catalogue 3 | 1.7 | 0.1 | Failed |
| raw catalogue 4 | 0.4 | 0.4 | Passed |
| raw catalogue 5 | 0.2 | 0.2 | Passed |
| raw catalogue 6 | 0.5 | 0.5 | Passed |
| raw catalogue 7 | 0.5 | 0.4 | Failed |
SHA-256 / 70654619661e1141d346342b67d2299e8872a96609f443dfb2042a50b7c19cb1
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(mags_x100):
if not mags_x100:
return None
counts = {}
for m in mags_x100:
b = (m + 5) // 10
counts[b] = counts.get(b, 0) + 1
best = max(counts.values())
mode = min(k for k, c in counts.items() if c == best)
return round((mode + 2) / 10, 1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['raw catalogue 0', [[16]], 0.4], ['raw catalogue 1', [[25, 145, 55, 150, 150, 145, 15]], 1.7], ['raw catalogue 2', [[15, 15, 25, 45, 14, -12, 24, 24, 35, 35, 55, 145, 145]], 0.4], ['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 4', [[15]], 0.4], ['raw catalogue 5', [[-5, 24, 55]], 0.2], ['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['raw catalogue 7', [[26, 15]], 0.4]], [['raw catalogue 7', [[26, 15]], 0.4], ['raw catalogue 8', [[155, 35, 16]], 0.4], ['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 10', [[45, 24, 5, 16, 155]], 0.4], ['raw catalogue 11', [[35, 35, 15, 55, 35]], 0.6], ['raw catalogue 12', [[25, 145, 150]], 1.7], ['raw catalogue 13', [[55, -5, 150, 24, 35, 150]], 1.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['raw catalogue 15', [[45, 55, 15, 26, 45, 15]], 0.4], ['raw catalogue 16', [[16, 5, 15, 35, 15, 5, 150, 16, 5, 16]], 0.4], ['raw catalogue 17', [[25, 45, 45, 14, 145, 15, 14, 45, 45, 150, 155, 155, 14, 16]], 0.7], ['raw catalogue 18', [[155, -5, 15, 155, 155, 35, 24, -5, 16, 16, -5, 55]], 0.4], ['raw catalogue 19', [[14]], 0.3], ['raw catalogue 20', [[14, -5]], 0.2]], [['raw catalogue 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['raw catalogue 21', [[45, 45, 15]], 0.7], ['raw catalogue 22', [[25, 16, 35, 5, 25, 5, 55, -5]], 0.3], ['raw catalogue 23', [[5, 150, 145, 24, 45, 145, 155, 145, 55, -12, 25, 15]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['raw catalogue 25', [[15, 145, 26, 16, 45, 15]], 0.4], ['raw catalogue 26', [[5, 5, 5, 45, 26, 15]], 0.3], ['raw catalogue 28', [[35, 145]], 0.6]], [['raw catalogue 20', [[14, -5]], 0.2], ['raw catalogue 28', [[35, 145]], 0.6], ['raw catalogue 29', [[25, 35, -12, 5, 55, 150, 155, 45, -12, 5]], 0.1], ['raw catalogue 30', [[15]], 0.4], ['raw catalogue 31', [[16]], 0.4], ['raw catalogue 32', [[35, 5, 150, -12]], 0.1], ['raw catalogue 33', [[24, 55, 25, 150, 155, 35, 45, 26, 15]], 0.4], ['tie between bins', [[14, 15, 24, 25]], 0.4]]]
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 |
|---|---|---|---|
| raw catalogue 0 | 0.4 | 0.4 | Passed |
| raw catalogue 1 | 1.7 | 1.7 | Passed |
| raw catalogue 2 | 0.4 | 0.4 | Passed |
| raw catalogue 3 | 0.1 | 0.1 | Passed |
| raw catalogue 4 | 0.4 | 0.4 | Passed |
| raw catalogue 5 | 0.2 | 0.2 | Passed |
| raw catalogue 6 | 0.5 | 0.5 | Passed |
| raw catalogue 7 | 0.4 | 0.4 | Passed |
SHA-256 / 504329f3d9a18699c06f57ab6fd812ab50eb4a6879bc27179f3c81a8e04dd52f
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:30.373471+00:00.
Case digest / 0ec4ca5788343e4277fea2eed49a9c571972109dd2645f066b9d0fd4642ab585