{"abstract":"A long note that starts first is listed after shorter notes that start later.","category":"MIDI event timing","checks":8,"contract":"Input time-ordered events [tick, kind, channel, note, velocity] with kind on or off. A note-on with velocity 0 acts as a note-off. Each off ends the earliest still-open note with the same channel and note (FIFO); unmatched offs are ignored. Notes still open at the end end at the last event tick. Return [start, end, channel, note, on-velocity] sorted by start, note, channel, end.","evaluation_group":"w2-midi-event-timing-note-pairing","failed_approach":"Sorting by pitch first groups notes by key and loses chronological order.","family":"w2-midi-event-timing-note-pairing-output-ordering","id":"FA-81451","implementations":{"attempt":{"sha256":"51f65383b5a85f137adec94449a2ad8b641c3e028704c69abbc370086f611489","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list):\n        return None\n    active = {}\n    done = []\n    last = 0\n    for tick, kind, ch, note, vel in x:\n        last = max(last, tick)\n        key = (ch, note)\n        if kind == 'on' and vel > 0:\n            active.setdefault(key, []).append((tick, vel, ch, note))\n        elif kind in ('on', 'off'):\n            if active.get(key):\n                start, v, c, n = active[key].pop(0)\n                done.append([start, tick, c, n, v])\n    for stack in active.values():\n        for start, v, c, n in stack:\n            done.append([start, last, c, n, v])\n    done.sort(key=lambda e: (e[3], e[0], e[2], e[1]))\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]\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":"836e803859365bc8945da49a4a0ff2d052ef55a9659f4f2d83da9a7454ccb01e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list):\n        return None\n    active = {}\n    done = []\n    last = 0\n    for tick, kind, ch, note, vel in x:\n        last = max(last, tick)\n        key = (ch, note)\n        if kind == 'on' and vel > 0:\n            active.setdefault(key, []).append((tick, vel, ch, note))\n        elif kind in ('on', 'off'):\n            if active.get(key):\n                start, v, c, n = active[key].pop(0)\n                done.append([start, tick, c, n, v])\n    for stack in active.values():\n        for start, v, c, n in stack:\n            done.append([start, last, c, n, v])\n    done.sort(key=lambda e: (e[1], e[0], e[3], e[2]))\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]\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"},"fixed":{"sha256":"e64af1139a23dc68caa50f7865669fc3e6cc129669fd0a401ca17c81263448d6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list):\n        return None\n    active = {}\n    done = []\n    last = 0\n    for tick, kind, ch, note, vel in x:\n        last = max(last, tick)\n        key = (ch, note)\n        if kind == 'on' and vel > 0:\n            active.setdefault(key, []).append((tick, vel, ch, note))\n        elif kind in ('on', 'off'):\n            if active.get(key):\n                start, v, c, n = active[key].pop(0)\n                done.append([start, tick, c, n, v])\n    for stack in active.values():\n        for start, v, c, n in stack:\n            done.append([start, last, c, n, v])\n    done.sort(key=lambda e: (e[0], e[3], e[2], e[1]))\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]\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-note-pairing-output-ordering","generated_at":"2026-09-29T14:50:03.138473+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.","repair":"Restore the output ordering step so that it reads `key=lambda e: (e[0], e[3], e[2], e[1])`.","root_cause":"The result is sorted primarily by end tick rather than start tick.","sha256":"f53379e8fb1c47ec039babde02ed9df37287c97be120a282cf0390018ef9fd3d","title":"Note-on and note-off pairing into durations: notes ordered by release time · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.422,"exit_code":1,"observations":[{"actual":[[0,10,0,60,100]],"check":"oracle 0","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100]],"check":"oracle 1","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100],[5,20,0,60,80]],"check":"oracle 2","expected":[[0,10,0,60,100],[5,20,0,60,80]],"passed":true},{"actual":[[0,20,0,60,100],[5,10,1,60,80]],"check":"oracle 3","expected":[[0,20,0,60,100],[5,10,1,60,80]],"passed":true},{"actual":[[0,30,0,60,100],[30,30,0,64,90]],"check":"oracle 4","expected":[[0,30,0,60,100],[30,30,0,64,90]],"passed":true},{"actual":[[5,9,0,62,70]],"check":"oracle 5","expected":[[5,9,0,62,70]],"passed":true},{"actual":[[0,10,0,60,100],[0,12,0,64,100]],"check":"oracle 6","expected":[[0,10,0,60,100],[0,12,0,64,100]],"passed":true},{"actual":[[2,8,0,60,100],[0,4,0,62,100]],"check":"oracle 7","expected":[[0,4,0,62,100],[2,8,0,60,100]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"expected\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]], \"expected\": [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"expected\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[5, 9, 0, 62, 70]], \"expected\": [[5, 9, 0, 62, 70]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"expected\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[2, 8, 0, 60, 100], [0, 4, 0, 62, 100]], \"expected\": [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.715,"exit_code":1,"observations":[{"actual":[[0,10,0,60,100]],"check":"oracle 0","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100]],"check":"oracle 1","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100],[5,20,0,60,80]],"check":"oracle 2","expected":[[0,10,0,60,100],[5,20,0,60,80]],"passed":true},{"actual":[[5,10,1,60,80],[0,20,0,60,100]],"check":"oracle 3","expected":[[0,20,0,60,100],[5,10,1,60,80]],"passed":false},{"actual":[[0,30,0,60,100],[30,30,0,64,90]],"check":"oracle 4","expected":[[0,30,0,60,100],[30,30,0,64,90]],"passed":true},{"actual":[[5,9,0,62,70]],"check":"oracle 5","expected":[[5,9,0,62,70]],"passed":true},{"actual":[[0,10,0,60,100],[0,12,0,64,100]],"check":"oracle 6","expected":[[0,10,0,60,100],[0,12,0,64,100]],"passed":true},{"actual":[[0,4,0,62,100],[2,8,0,60,100]],"check":"oracle 7","expected":[[0,4,0,62,100],[2,8,0,60,100]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"expected\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[5, 10, 1, 60, 80], [0, 20, 0, 60, 100]], \"expected\": [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]], \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"expected\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[5, 9, 0, 62, 70]], \"expected\": [[5, 9, 0, 62, 70]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"expected\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]], \"expected\": [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.832,"exit_code":0,"observations":[{"actual":[[0,10,0,60,100]],"check":"oracle 0","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100]],"check":"oracle 1","expected":[[0,10,0,60,100]],"passed":true},{"actual":[[0,10,0,60,100],[5,20,0,60,80]],"check":"oracle 2","expected":[[0,10,0,60,100],[5,20,0,60,80]],"passed":true},{"actual":[[0,20,0,60,100],[5,10,1,60,80]],"check":"oracle 3","expected":[[0,20,0,60,100],[5,10,1,60,80]],"passed":true},{"actual":[[0,30,0,60,100],[30,30,0,64,90]],"check":"oracle 4","expected":[[0,30,0,60,100],[30,30,0,64,90]],"passed":true},{"actual":[[5,9,0,62,70]],"check":"oracle 5","expected":[[5,9,0,62,70]],"passed":true},{"actual":[[0,10,0,60,100],[0,12,0,64,100]],"check":"oracle 6","expected":[[0,10,0,60,100],[0,12,0,64,100]],"passed":true},{"actual":[[0,4,0,62,100],[2,8,0,60,100]],"check":"oracle 7","expected":[[0,4,0,62,100],[2,8,0,60,100]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 10, 0, 60, 100]], \"expected\": [[0, 10, 0, 60, 100]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"expected\": [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]], \"expected\": [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"expected\": [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[5, 9, 0, 62, 70]], \"expected\": [[5, 9, 0, 62, 70]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"expected\": [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]], \"expected\": [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}