{"abstract":"A quiet sample right after the pick terminates the coda before the S wave peak.","category":"Seismic magnitude estimation","checks":8,"contract":"envelope is a list of amplitude samples, dt s per sample, p_index the P pick sample, noise the pre-event noise level. From the peak at or after the pick (first maximum), the coda ends at the first sample with amplitude <= 2*noise. tau = (end - p_index)*dt; Md = -0.87 + 2.0 log10(tau) + 0.0035 epi_km. Return [tau rounded 0.01, Md rounded 0.01] or None when no end or tau <= 0.","contract_signature":"envelope, dt, p_index, noise, epi_km","evaluation_group":"w2-seismic_magnitude_estimation-coda-duration-md","failed_approach":"Stopping one sample early misses a coda that ends on the last sample.","family":"w2-seismic_magnitude_estimation-coda-duration-md-termination-search-start","id":"FA-71481","implementations":{"attempt":{"sha256":"da04233313b1b196a8c5bd3e1d8684cf4e672c7e0204ca45a096c116bdf297e5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(envelope, dt, p_index, noise, epi_km):\n    if p_index >= len(envelope):\n        return None\n    peak = max(range(p_index, len(envelope)), key=lambda i: envelope[i])\n    end = None\n    for i in range(peak, len(envelope) - 1):\n        if envelope[i] <= 2 * noise:\n            end = i\n            break\n    if end is None:\n        return None\n    tau = (end - p_index) * dt\n    if tau <= 0:\n        return None\n    md = -0.87 + 2.0 * math.log10(tau) + 0.0035 * epi_km\n    return [round(tau, 2), round(md, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['coda 0', [[1, 0, 1, 1, 19, 59, 29, 23, 13, 6, 4, 2, 1], 1.0, 4, 1, 30], [7.0, 0.93]], ['coda 1', [[0, 1, 3, 3, 1, 23, 70, 49, 39, 31, 21, 14, 7, 4, 2, 3, 3, 1], 0.5, 5, 3, 5], [4.0, 0.35]], ['coda 2', [[0, 2, 26, 78, 39, 27, 21, 14, 8, 4, 2, 0], 0.5, 2, 3, 5], [3.5, 0.24]], ['coda 3', [[0, 2, 2, 0, 1, 14, 44, 30, 21, 14, 9, 7, 5, 3, 1, 2, 0, 2], 0.5, 5, 2, 5], [4.0, 0.35]], ['coda 4', [[0, 1, 1, 19, 59, 35, 21, 12, 7, 5, 2, 1], 0.5, 3, 1, 5], [3.5, 0.24]], ['coda 5', [[2, 0, 0, 24, 72, 43, 25, 17, 13, 9, 4, 3, 1, 1, 1, 1], 2.0, 3, 2, 120], [14.0, 1.84]], ['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]]], [['coda 7', [[0, 0, 1, 0, 0, 16, 50, 35, 21, 12, 8, 4, 2, 1, 1], 1.0, 5, 1, 30], [7.0, 0.93]], ['coda 8', [[0, 0, 1, 2, 9, 27, 18, 10, 7, 4, 2], 0.5, 4, 2, 5], [2.5, -0.06]], ['coda 9', [[1, 1, 17, 53, 42, 29, 23, 18, 14, 9, 6, 4, 2, 1, 1, 1, 1], 1.0, 2, 1, 30], [10.0, 1.23]], ['coda 10', [[1, 2, 0, 2, 10, 30, 18, 12, 7, 5, 2, 0, 1], 2.0, 4, 2, 120], [12.0, 1.71]], ['coda 11', [[1, 0, 10, 31, 24, 16, 8, 4, 2, 1, 0], 1.0, 2, 1, 30], [6.0, 0.79]], ['coda 12', [[2, 1, 9, 28, 22, 13, 9, 7, 5, 4, 2, 2], 1.0, 2, 2, 30], [7.0, 0.93]], ['ends on last sample', [[0, 50, 20, 8, 2], 1.0, 1, 1, 10], [3.0, 0.12]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 14', [[0, 1, 0, 25, 75, 45, 36, 25, 17, 13, 6, 4, 2, 1, 0, 0], 0.5, 3, 1, 5], [4.5, 0.45]], ['coda 15', [[2, 1, 2, 1, 1, 25, 75, 60, 42, 25, 15, 12, 6, 3, 0], 0.5, 5, 3, 5], [3.5, 0.24]], ['coda 16', [[0, 1, 1, 1, 0, 23, 69, 55, 27, 21, 10, 6, 3, 1, 0], 1.0, 5, 1, 30], [8.0, 1.04]], ['coda 17', [[1, 2, 22, 68, 40, 28, 19, 15, 12, 8, 6, 4, 2, 0, 2], 2.0, 2, 2, 120], [18.0, 2.06]], ['coda 18', [[1, 1, 1, 1, 10, 31, 24, 12, 9, 7, 4, 2, 1, 1, 0, 1], 0.5, 4, 1, 5], [3.5, 0.24]], ['coda 19', [[1, 1, 11, 33, 16, 12, 6, 3, 2, 1], 2.0, 2, 3, 120], [8.0, 1.36]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 21', [[0, 1, 0, 8, 26, 18, 10, 6, 3, 2, 1], 0.5, 3, 1, 5], [3.0, 0.1]], ['coda 22', [[1, 1, 0, 0, 1, 23, 69, 34, 23, 13, 9, 5, 4, 3, 2, 1, 1, 0], 0.5, 5, 1, 5], [4.5, 0.45]], ['coda 23', [[0, 2, 0, 2, 1, 16, 48, 28, 19, 15, 9, 4, 3, 1, 1, 2], 1.0, 5, 2, 30], [6.0, 0.79]], ['coda 24', [[1, 0, 1, 1, 0, 11, 35, 24, 19, 15, 9, 7, 5, 3, 2, 1, 1, 1, 0], 2.0, 5, 1, 120], [18.0, 2.06]], ['coda 25', [[1, 0, 12, 36, 18, 14, 8, 4, 3, 1, 1, 1], 1.0, 2, 2, 30], [5.0, 0.63]], ['coda 26', [[0, 0, 1, 11, 34, 17, 11, 7, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['coda 28', [[1, 2, 3, 7, 21, 16, 12, 9, 5, 3, 1, 0, 0], 0.5, 3, 3, 5], [2.5, -0.06]], ['coda 29', [[0, 0, 1, 17, 53, 42, 33, 16, 12, 9, 6, 3, 2, 1], 2.0, 3, 1, 120], [18.0, 2.06]], ['coda 30', [[2, 2, 0, 1, 2, 19, 58, 34, 27, 16, 11, 7, 5, 4, 2, 1], 2.0, 5, 2, 120], [16.0, 1.96]], ['coda 31', [[2, 3, 1, 19, 59, 47, 23, 13, 10, 6, 3, 0, 1, 3], 0.5, 3, 3, 5], [3.0, 0.1]], ['coda 32', [[1, 0, 12, 38, 26, 15, 9, 4, 3, 2, 1], 0.5, 2, 2, 5], [2.5, -0.06]], ['coda 33', [[2, 0, 11, 34, 23, 16, 8, 4, 2, 1, 0, 3], 2.0, 2, 3, 120], [10.0, 1.55]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"c1a94ff62619629f58ff0773ebd144ec21ed3d2d66b884814c25dbde8264a896","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(envelope, dt, p_index, noise, epi_km):\n    if p_index >= len(envelope):\n        return None\n    peak = max(range(p_index, len(envelope)), key=lambda i: envelope[i])\n    end = None\n    for i in range(p_index, len(envelope)):\n        if envelope[i] <= 2 * noise:\n            end = i\n            break\n    if end is None:\n        return None\n    tau = (end - p_index) * dt\n    if tau <= 0:\n        return None\n    md = -0.87 + 2.0 * math.log10(tau) + 0.0035 * epi_km\n    return [round(tau, 2), round(md, 2)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['coda 0', [[1, 0, 1, 1, 19, 59, 29, 23, 13, 6, 4, 2, 1], 1.0, 4, 1, 30], [7.0, 0.93]], ['coda 1', [[0, 1, 3, 3, 1, 23, 70, 49, 39, 31, 21, 14, 7, 4, 2, 3, 3, 1], 0.5, 5, 3, 5], [4.0, 0.35]], ['coda 2', [[0, 2, 26, 78, 39, 27, 21, 14, 8, 4, 2, 0], 0.5, 2, 3, 5], [3.5, 0.24]], ['coda 3', [[0, 2, 2, 0, 1, 14, 44, 30, 21, 14, 9, 7, 5, 3, 1, 2, 0, 2], 0.5, 5, 2, 5], [4.0, 0.35]], ['coda 4', [[0, 1, 1, 19, 59, 35, 21, 12, 7, 5, 2, 1], 0.5, 3, 1, 5], [3.5, 0.24]], ['coda 5', [[2, 0, 0, 24, 72, 43, 25, 17, 13, 9, 4, 3, 1, 1, 1, 1], 2.0, 3, 2, 120], [14.0, 1.84]], ['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]]], [['coda 7', [[0, 0, 1, 0, 0, 16, 50, 35, 21, 12, 8, 4, 2, 1, 1], 1.0, 5, 1, 30], [7.0, 0.93]], ['coda 8', [[0, 0, 1, 2, 9, 27, 18, 10, 7, 4, 2], 0.5, 4, 2, 5], [2.5, -0.06]], ['coda 9', [[1, 1, 17, 53, 42, 29, 23, 18, 14, 9, 6, 4, 2, 1, 1, 1, 1], 1.0, 2, 1, 30], [10.0, 1.23]], ['coda 10', [[1, 2, 0, 2, 10, 30, 18, 12, 7, 5, 2, 0, 1], 2.0, 4, 2, 120], [12.0, 1.71]], ['coda 11', [[1, 0, 10, 31, 24, 16, 8, 4, 2, 1, 0], 1.0, 2, 1, 30], [6.0, 0.79]], ['coda 12', [[2, 1, 9, 28, 22, 13, 9, 7, 5, 4, 2, 2], 1.0, 2, 2, 30], [7.0, 0.93]], ['ends on last sample', [[0, 50, 20, 8, 2], 1.0, 1, 1, 10], [3.0, 0.12]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 14', [[0, 1, 0, 25, 75, 45, 36, 25, 17, 13, 6, 4, 2, 1, 0, 0], 0.5, 3, 1, 5], [4.5, 0.45]], ['coda 15', [[2, 1, 2, 1, 1, 25, 75, 60, 42, 25, 15, 12, 6, 3, 0], 0.5, 5, 3, 5], [3.5, 0.24]], ['coda 16', [[0, 1, 1, 1, 0, 23, 69, 55, 27, 21, 10, 6, 3, 1, 0], 1.0, 5, 1, 30], [8.0, 1.04]], ['coda 17', [[1, 2, 22, 68, 40, 28, 19, 15, 12, 8, 6, 4, 2, 0, 2], 2.0, 2, 2, 120], [18.0, 2.06]], ['coda 18', [[1, 1, 1, 1, 10, 31, 24, 12, 9, 7, 4, 2, 1, 1, 0, 1], 0.5, 4, 1, 5], [3.5, 0.24]], ['coda 19', [[1, 1, 11, 33, 16, 12, 6, 3, 2, 1], 2.0, 2, 3, 120], [8.0, 1.36]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 21', [[0, 1, 0, 8, 26, 18, 10, 6, 3, 2, 1], 0.5, 3, 1, 5], [3.0, 0.1]], ['coda 22', [[1, 1, 0, 0, 1, 23, 69, 34, 23, 13, 9, 5, 4, 3, 2, 1, 1, 0], 0.5, 5, 1, 5], [4.5, 0.45]], ['coda 23', [[0, 2, 0, 2, 1, 16, 48, 28, 19, 15, 9, 4, 3, 1, 1, 2], 1.0, 5, 2, 30], [6.0, 0.79]], ['coda 24', [[1, 0, 1, 1, 0, 11, 35, 24, 19, 15, 9, 7, 5, 3, 2, 1, 1, 1, 0], 2.0, 5, 1, 120], [18.0, 2.06]], ['coda 25', [[1, 0, 12, 36, 18, 14, 8, 4, 3, 1, 1, 1], 1.0, 2, 2, 30], [5.0, 0.63]], ['coda 26', [[0, 0, 1, 11, 34, 17, 11, 7, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['emergent onset lull', [[1, 0, 8, 2, 4, 90, 50, 20, 6, 2], 0.5, 2, 1, 60], [3.5, 0.43]]], [['coda 27', [[1, 1, 0, 8, 24, 16, 9, 5, 3, 1], 2.0, 3, 1, 120], [12.0, 1.71]], ['coda 28', [[1, 2, 3, 7, 21, 16, 12, 9, 5, 3, 1, 0, 0], 0.5, 3, 3, 5], [2.5, -0.06]], ['coda 29', [[0, 0, 1, 17, 53, 42, 33, 16, 12, 9, 6, 3, 2, 1], 2.0, 3, 1, 120], [18.0, 2.06]], ['coda 30', [[2, 2, 0, 1, 2, 19, 58, 34, 27, 16, 11, 7, 5, 4, 2, 1], 2.0, 5, 2, 120], [16.0, 1.96]], ['coda 31', [[2, 3, 1, 19, 59, 47, 23, 13, 10, 6, 3, 0, 1, 3], 0.5, 3, 3, 5], [3.0, 0.1]], ['coda 32', [[1, 0, 12, 38, 26, 15, 9, 4, 3, 2, 1], 0.5, 2, 2, 5], [2.5, -0.06]], ['coda 33', [[2, 0, 11, 34, 23, 16, 8, 4, 2, 1, 0, 3], 2.0, 2, 3, 120], [10.0, 1.55]], ['quiet gap before S peak', [[0, 0, 3, 1, 60, 30, 10, 2, 1], 1.0, 2, 1, 20], [5.0, 0.6]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-seismic_magnitude_estimation-coda-duration-md-termination-search-start","generated_at":"2026-09-29T14:48:30.008728+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Duration magnitude is robust for small events with clipped or noisy amplitudes.","root_cause":"The termination scan starts at the P pick instead of the envelope peak.","sha256":"c51a77492a4d26f8273f27ddf97cd22d15f57048bf5ff733917e4af5a9ff5178","title":"Coda duration magnitude: termination search start · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.302,"exit_code":1,"observations":[{"actual":[7.0,0.93],"check":"coda 0","expected":[7.0,0.93],"passed":true},{"actual":[4.0,0.35],"check":"coda 1","expected":[4.0,0.35],"passed":true},{"actual":[3.5,0.24],"check":"coda 2","expected":[3.5,0.24],"passed":true},{"actual":[4.0,0.35],"check":"coda 3","expected":[4.0,0.35],"passed":true},{"actual":[3.5,0.24],"check":"coda 4","expected":[3.5,0.24],"passed":true},{"actual":[14.0,1.84],"check":"coda 5","expected":[14.0,1.84],"passed":true},{"actual":null,"check":"coda 27","expected":[12.0,1.71],"passed":false},{"actual":[5.0,0.6],"check":"quiet gap before S peak","expected":[5.0,0.6],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"coda 0\", \"actual\": [7.0, 0.93], \"expected\": [7.0, 0.93], \"passed\": true}, {\"check\": \"coda 1\", \"actual\": [4.0, 0.35], \"expected\": [4.0, 0.35], \"passed\": true}, {\"check\": \"coda 2\", \"actual\": [3.5, 0.24], \"expected\": [3.5, 0.24], \"passed\": true}, {\"check\": \"coda 3\", \"actual\": [4.0, 0.35], \"expected\": [4.0, 0.35], \"passed\": true}, {\"check\": \"coda 4\", \"actual\": [3.5, 0.24], \"expected\": [3.5, 0.24], \"passed\": true}, {\"check\": \"coda 5\", \"actual\": [14.0, 1.84], \"expected\": [14.0, 1.84], \"passed\": true}, {\"check\": \"coda 27\", \"actual\": null, \"expected\": [12.0, 1.71], \"passed\": false}, {\"check\": \"quiet gap before S peak\", \"actual\": [5.0, 0.6], \"expected\": [5.0, 0.6], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.097,"exit_code":1,"observations":[{"actual":[7.0,0.93],"check":"coda 0","expected":[7.0,0.93],"passed":true},{"actual":[4.0,0.35],"check":"coda 1","expected":[4.0,0.35],"passed":true},{"actual":[3.5,0.24],"check":"coda 2","expected":[3.5,0.24],"passed":true},{"actual":[4.0,0.35],"check":"coda 3","expected":[4.0,0.35],"passed":true},{"actual":[3.5,0.24],"check":"coda 4","expected":[3.5,0.24],"passed":true},{"actual":[14.0,1.84],"check":"coda 5","expected":[14.0,1.84],"passed":true},{"actual":[12.0,1.71],"check":"coda 27","expected":[12.0,1.71],"passed":true},{"actual":[1.0,-0.8],"check":"quiet gap before S peak","expected":[5.0,0.6],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"coda 0\", \"actual\": [7.0, 0.93], \"expected\": [7.0, 0.93], \"passed\": true}, {\"check\": \"coda 1\", \"actual\": [4.0, 0.35], \"expected\": [4.0, 0.35], \"passed\": true}, {\"check\": \"coda 2\", \"actual\": [3.5, 0.24], \"expected\": [3.5, 0.24], \"passed\": true}, {\"check\": \"coda 3\", \"actual\": [4.0, 0.35], \"expected\": [4.0, 0.35], \"passed\": true}, {\"check\": \"coda 4\", \"actual\": [3.5, 0.24], \"expected\": [3.5, 0.24], \"passed\": true}, {\"check\": \"coda 5\", \"actual\": [14.0, 1.84], \"expected\": [14.0, 1.84], \"passed\": true}, {\"check\": \"coda 27\", \"actual\": [12.0, 1.71], \"expected\": [12.0, 1.71], \"passed\": true}, {\"check\": \"quiet gap before S peak\", \"actual\": [1.0, -0.8], \"expected\": [5.0, 0.6], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}