FA-71516 / Seismic magnitude estimation / Open access
Maximum-curvature completeness magnitude: bin assignment · case 01
Magnitudes such as 1.46 fall in the 1.4 bin, shifting Mc down.
ROOT CAUSE
Magnitudes are floored into bins instead of rounded.
VERIFIED REPAIR
Bin with floor((m + 5)/10).
Unsuccessful approach: Banker rounding sends exact halves like 2.5 to the even bin.
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 // 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 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['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 21', [[45, 45, 15]], 0.7]], [['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['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], ['half bin', [[25, 25, 35]], 0.5]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['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 12', [[25, 145, 150]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['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]]]
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.3 | 0.4 | Failed |
| raw catalogue 1 | 1.6 | 1.7 | Failed |
| raw catalogue 2 | 0.3 | 0.4 | Failed |
| raw catalogue 3 | 0.0 | 0.1 | Failed |
| raw catalogue 4 | 0.3 | 0.4 | Failed |
| raw catalogue 5 | 0.1 | 0.2 | Failed |
| raw catalogue 6 | 0.4 | 0.5 | Failed |
| raw catalogue 7 | 0.3 | 0.4 | Failed |
SHA-256 / 2173110d672b3f4fb76a8b65b62a7fc30857a677755cf4ebccebeeae1ded3569
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 = round(m / 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 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['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 21', [[45, 45, 15]], 0.7]], [['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['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], ['half bin', [[25, 25, 35]], 0.5]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['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 12', [[25, 145, 150]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['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]]]
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 | 0.4 | 1.7 | Failed |
| 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.2 | 0.5 | Failed |
| raw catalogue 7 | 0.4 | 0.4 | Passed |
SHA-256 / 17e78053b3f0900044fc448b90f6e480770d89dffdfc5855ac89725fb0f559bb
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 3', [[150, -12, 45, 24, -12, 55, 35, 55, 145]], 0.1], ['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 21', [[45, 45, 15]], 0.7]], [['raw catalogue 6', [[26, 25, 145, -5, 14, 155, 26, -5, 145]], 0.5], ['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], ['half bin', [[25, 25, 35]], 0.5]], [['raw catalogue 9', [[55, 14, -5, 5, 155, 26, 55]], 0.3], ['raw catalogue 14', [[5, 14, 16, 55]], 0.3], ['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 12', [[25, 145, 150]], 1.7], ['raw catalogue 24', [[-12, 25, 15, 14]], 0.1], ['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]]]
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 / 7233ccbc350acd09e17d32e1b62269d483daa68df8004d5ce411e39ae03bf6a6
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.367461+00:00.
Case digest / 25c8650e8e37c0401bf6dad7552478d31b517b40eba8ec87c04ab29e620ed7b6