{"abstract":"When notes are listed out of time order, the later-listed earlier note is never truncated by the note that follows it in time.","category":"MIDI event timing","checks":8,"contract":"Input [notes, mode] where notes are [start, end, pitch] in any order and mode is poly or mono. Sort by start then pitch. Each note ends no later than the start of the next note that starts strictly later and has the same pitch (poly) or any pitch (mono). Notes whose length becomes zero or negative are removed. Return the notes in sorted order; unknown mode returns None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-overlap-truncation","failed_approach":"Sorting by end time does not order notes by when they start.","family":"w2-midi-event-timing-overlap-truncation-processing-order","id":"FA-81746","implementations":{"attempt":{"sha256":"59c1275d3ee8b25556f689c65c5aa59754c0c0d620e965f9c060094a77a5b1d3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    notes, mode = x\n    if mode not in ('poly', 'mono'):\n        return None\n    order = sorted(notes, key=lambda n: n[1])\n    out = []\n    for i, (s, e, p) in enumerate(order):\n        for s2, e2, p2 in order[i + 1:]:\n            if s2 > s and (mode == 'mono' or p2 == p):\n                e = min(e, s2)\n                break\n        if e > s:\n            out.append([s, e, p])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [5, 15, 62]], 'poly'], [[0, 10, 60], [5, 15, 62]]), ([[[0, 10, 60], [5, 15, 62]], 'mono'], [[0, 5, 60], [5, 15, 62]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 10, 60], [0, 10, 64]], 'mono'], [[0, 10, 60], [0, 10, 64]]), ([[[0, 10, 60], [10, 20, 60]], 'poly'], [[0, 10, 60], [10, 20, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]])], [([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [0, 10, 64]], 'mono'], [[0, 10, 60], [0, 10, 64]]), ([[[0, 10, 60], [10, 20, 60]], 'poly'], [[0, 10, 60], [10, 20, 60]]), ([[[0, 5, 60], [5, 6, 62]], 'mono'], [[0, 5, 60], [5, 6, 62]]), ([[[0, 1, 60], [0, 8, 60], [1, 9, 60]], 'poly'], [[0, 1, 60], [0, 1, 60], [1, 9, 60]]), ([[[3, 3, 60]], 'poly'], []), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])], [([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 1, 60], [0, 8, 60], [1, 9, 60]], 'poly'], [[0, 1, 60], [0, 1, 60], [1, 9, 60]]), ([[[3, 3, 60]], 'poly'], []), ([[[0, 10, 60]], 'legato'], None), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[1, 2, 60], [2, 3, 60], [3, 4, 60]], 'poly'], [[1, 2, 60], [2, 3, 60], [3, 4, 60]])], [([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]]), ([[[1, 2, 60], [2, 3, 60], [3, 4, 60]], 'poly'], [[1, 2, 60], [2, 3, 60], [3, 4, 60]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])], [([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [5, 15, 62]], 'poly'], [[0, 10, 60], [5, 15, 62]]), ([[[0, 10, 60], [5, 15, 62]], 'mono'], [[0, 5, 60], [5, 15, 62]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %d\" % i, 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":"5fb60bf1f13e79520b10549b08303f84fe914f16fbf74e9aa51de3beb64980c5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 2:\n        return None\n    notes, mode = x\n    if mode not in ('poly', 'mono'):\n        return None\n    order = list(notes)\n    out = []\n    for i, (s, e, p) in enumerate(order):\n        for s2, e2, p2 in order[i + 1:]:\n            if s2 > s and (mode == 'mono' or p2 == p):\n                e = min(e, s2)\n                break\n        if e > s:\n            out.append([s, e, p])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [5, 15, 62]], 'poly'], [[0, 10, 60], [5, 15, 62]]), ([[[0, 10, 60], [5, 15, 62]], 'mono'], [[0, 5, 60], [5, 15, 62]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 10, 60], [0, 10, 64]], 'mono'], [[0, 10, 60], [0, 10, 64]]), ([[[0, 10, 60], [10, 20, 60]], 'poly'], [[0, 10, 60], [10, 20, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]])], [([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [0, 10, 64]], 'mono'], [[0, 10, 60], [0, 10, 64]]), ([[[0, 10, 60], [10, 20, 60]], 'poly'], [[0, 10, 60], [10, 20, 60]]), ([[[0, 5, 60], [5, 6, 62]], 'mono'], [[0, 5, 60], [5, 6, 62]]), ([[[0, 1, 60], [0, 8, 60], [1, 9, 60]], 'poly'], [[0, 1, 60], [0, 1, 60], [1, 9, 60]]), ([[[3, 3, 60]], 'poly'], []), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])], [([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 1, 60], [0, 8, 60], [1, 9, 60]], 'poly'], [[0, 1, 60], [0, 1, 60], [1, 9, 60]]), ([[[3, 3, 60]], 'poly'], []), ([[[0, 10, 60]], 'legato'], None), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[1, 2, 60], [2, 3, 60], [3, 4, 60]], 'poly'], [[1, 2, 60], [2, 3, 60], [3, 4, 60]])], [([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 4, 60], [2, 3, 60]], 'poly'], [[0, 2, 60], [2, 3, 60]]), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]]), ([[[1, 2, 60], [2, 3, 60], [3, 4, 60]], 'poly'], [[1, 2, 60], [2, 3, 60], [3, 4, 60]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])], [([[[0, 10, 60], [5, 15, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 10, 60], [5, 15, 62]], 'poly'], [[0, 10, 60], [5, 15, 62]]), ([[[0, 10, 60], [5, 15, 62]], 'mono'], [[0, 5, 60], [5, 15, 62]]), ([[[5, 15, 60], [0, 10, 60]], 'poly'], [[0, 5, 60], [5, 15, 60]]), ([[[0, 20, 60], [2, 4, 62], [6, 8, 64]], 'mono'], [[0, 2, 60], [2, 4, 62], [6, 8, 64]]), ([[[0, 2, 60], [1, 9, 60], [3, 5, 60]], 'poly'], [[0, 1, 60], [1, 3, 60], [3, 5, 60]]), ([[[0, 10, 62], [4, 6, 60]], 'mono'], [[0, 4, 62], [4, 6, 60]]), ([[[0, 9, 70], [1, 5, 72], [2, 4, 70]], 'poly'], [[0, 2, 70], [1, 5, 72], [2, 4, 70]])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"oracle %d\" % i, 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":"A deterministic bounded teaching model with a stipulated toy contract; it is not a complete Standard MIDI File or MIDI 1.0/2.0 implementation. 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-midi-event-timing-overlap-truncation-processing-order","generated_at":"2026-09-29T14:50:05.757491+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"MIDI sequencers, file readers and synth drivers depend on exact event ordering and tick/time arithmetic.","root_cause":"Notes are processed in their input order instead of sorted by start.","sha256":"d90e28e6c49454919612ce5aba989d6d8eb4de1eaa147b8264369b397f373284","title":"Same-pitch and monophonic overlap truncation: overlaps resolved in input order · 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":40.7,"exit_code":1,"observations":[{"actual":[[0,5,60],[5,15,60]],"check":"oracle 0","expected":[[0,5,60],[5,15,60]],"passed":true},{"actual":[[0,10,60],[5,15,62]],"check":"oracle 1","expected":[[0,10,60],[5,15,62]],"passed":true},{"actual":[[0,5,60],[5,15,62]],"check":"oracle 2","expected":[[0,5,60],[5,15,62]],"passed":true},{"actual":[[0,5,60],[5,15,60]],"check":"oracle 3","expected":[[0,5,60],[5,15,60]],"passed":true},{"actual":[[2,3,60],[0,4,60]],"check":"oracle 4","expected":[[0,2,60],[2,3,60]],"passed":false},{"actual":[[0,10,60],[0,10,64]],"check":"oracle 5","expected":[[0,10,60],[0,10,64]],"passed":true},{"actual":[[0,10,60],[10,20,60]],"check":"oracle 6","expected":[[0,10,60],[10,20,60]],"passed":true},{"actual":[[4,6,60],[0,10,62]],"check":"oracle 7","expected":[[0,4,62],[4,6,60]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 5, 60], [5, 15, 60]], \"expected\": [[0, 5, 60], [5, 15, 60]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 10, 60], [5, 15, 62]], \"expected\": [[0, 10, 60], [5, 15, 62]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 5, 60], [5, 15, 62]], \"expected\": [[0, 5, 60], [5, 15, 62]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[0, 5, 60], [5, 15, 60]], \"expected\": [[0, 5, 60], [5, 15, 60]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[2, 3, 60], [0, 4, 60]], \"expected\": [[0, 2, 60], [2, 3, 60]], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [[0, 10, 60], [0, 10, 64]], \"expected\": [[0, 10, 60], [0, 10, 64]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 10, 60], [10, 20, 60]], \"expected\": [[0, 10, 60], [10, 20, 60]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[4, 6, 60], [0, 10, 62]], \"expected\": [[0, 4, 62], [4, 6, 60]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.606,"exit_code":1,"observations":[{"actual":[[0,5,60],[5,15,60]],"check":"oracle 0","expected":[[0,5,60],[5,15,60]],"passed":true},{"actual":[[0,10,60],[5,15,62]],"check":"oracle 1","expected":[[0,10,60],[5,15,62]],"passed":true},{"actual":[[0,5,60],[5,15,62]],"check":"oracle 2","expected":[[0,5,60],[5,15,62]],"passed":true},{"actual":[[5,15,60],[0,10,60]],"check":"oracle 3","expected":[[0,5,60],[5,15,60]],"passed":false},{"actual":[[0,2,60],[2,3,60]],"check":"oracle 4","expected":[[0,2,60],[2,3,60]],"passed":true},{"actual":[[0,10,60],[0,10,64]],"check":"oracle 5","expected":[[0,10,60],[0,10,64]],"passed":true},{"actual":[[0,10,60],[10,20,60]],"check":"oracle 6","expected":[[0,10,60],[10,20,60]],"passed":true},{"actual":[[0,4,62],[4,6,60]],"check":"oracle 7","expected":[[0,4,62],[4,6,60]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 5, 60], [5, 15, 60]], \"expected\": [[0, 5, 60], [5, 15, 60]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 10, 60], [5, 15, 62]], \"expected\": [[0, 10, 60], [5, 15, 62]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 5, 60], [5, 15, 62]], \"expected\": [[0, 5, 60], [5, 15, 62]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[5, 15, 60], [0, 10, 60]], \"expected\": [[0, 5, 60], [5, 15, 60]], \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": [[0, 2, 60], [2, 3, 60]], \"expected\": [[0, 2, 60], [2, 3, 60]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[0, 10, 60], [0, 10, 64]], \"expected\": [[0, 10, 60], [0, 10, 64]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 10, 60], [10, 20, 60]], \"expected\": [[0, 10, 60], [10, 20, 60]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[0, 4, 62], [4, 6, 60]], \"expected\": [[0, 4, 62], [4, 6, 60]], \"passed\": true}], \"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."}}