{"abstract":"A note re-struck while sustained, and still held by the key, is cut off when the pedal lifts.","category":"MIDI event timing","checks":8,"contract":"Input time-ordered events [tick, kind, value]: kind on/off with a note number, or cc64 with a controller value (pedal down when value >= 64). A note-off while the pedal is down is deferred until the pedal goes up. Re-striking a note that is still sounding ends the previous instance at the new tick. Notes still sounding at the end end at the last event tick. Return sorted [note, start, end] triples.","evaluation_group":"w2-midi-event-timing-sustain-pedal","failed_approach":"Clearing the whole held set on any re-strike also cancels the deferred release of other notes, which then ring to the end.","family":"w2-midi-event-timing-sustain-pedal-re-strike-held-state","id":"FA-81666","implementations":{"attempt":{"sha256":"93fc5a48c6a205743b23a1e1566c87f76953d1c8950392a6f5281dd0c7c0c881","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    down = False\n    sounding = {}\n    held = set()\n    done = []\n    last = 0\n    for tick, kind, value in x:\n        last = max(last, tick)\n        if kind == 'cc64':\n            now_down = value >= 64\n            if down and not now_down:\n                for n in sorted(held):\n                    done.append([n, sounding.pop(n), tick])\n                held = set()\n            down = now_down\n        elif kind == 'on':\n            if value in sounding:\n                done.append([value, sounding.pop(value), tick])\n                held.clear()\n            sounding[value] = tick\n        elif kind == 'off':\n            if value not in sounding:\n                continue\n            if down:\n                held.add(value)\n            else:\n                done.append([value, sounding.pop(value), tick])\n        else:\n            return None\n    for n in sorted(sounding):\n        done.append([n, sounding[n], last])\n    done.sort()\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]\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":"b0784e7b459cdbc00205a69d81f0b8c6d73c0410e33c15c1a99d75d12ee65935","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    down = False\n    sounding = {}\n    held = set()\n    done = []\n    last = 0\n    for tick, kind, value in x:\n        last = max(last, tick)\n        if kind == 'cc64':\n            now_down = value >= 64\n            if down and not now_down:\n                for n in sorted(held):\n                    done.append([n, sounding.pop(n), tick])\n                held = set()\n            down = now_down\n        elif kind == 'on':\n            if value in sounding:\n                done.append([value, sounding.pop(value), tick])\n            sounding[value] = tick\n        elif kind == 'off':\n            if value not in sounding:\n                continue\n            if down:\n                held.add(value)\n            else:\n                done.append([value, sounding.pop(value), tick])\n        else:\n            return None\n    for n in sorted(sounding):\n        done.append([n, sounding[n], last])\n    done.sort()\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]\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":"11c295df88446e7492d7a7418f32c9754334f1e7bd36b1217d2198b42bbd1695","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    down = False\n    sounding = {}\n    held = set()\n    done = []\n    last = 0\n    for tick, kind, value in x:\n        last = max(last, tick)\n        if kind == 'cc64':\n            now_down = value >= 64\n            if down and not now_down:\n                for n in sorted(held):\n                    done.append([n, sounding.pop(n), tick])\n                held = set()\n            down = now_down\n        elif kind == 'on':\n            if value in sounding:\n                done.append([value, sounding.pop(value), tick])\n                held.discard(value)\n            sounding[value] = tick\n        elif kind == 'off':\n            if value not in sounding:\n                continue\n            if down:\n                held.add(value)\n            else:\n                done.append([value, sounding.pop(value), tick])\n        else:\n            return None\n    for n in sorted(sounding):\n        done.append([n, sounding[n], last])\n    done.sort()\n    return done\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]\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-sustain-pedal-re-strike-held-state","generated_at":"2026-09-29T14:50:05.071101+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 re-strike held state step so that it reads `held.discard(value)`.","root_cause":"Re-striking ends the old instance but leaves the pitch in the pedal-held set, so the pedal-up releases the new instance.","sha256":"dc51c1970406b576514e5f99094eab49393632e689b483cd94b66a3d631b8e9d","title":"Sustain pedal note-off deferral: re-struck sustained note released early by the pedal · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.64,"exit_code":1,"observations":[{"actual":[[60,0,10]],"check":"oracle 0","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 1","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 2","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,10]],"check":"oracle 3","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,8],[60,8,30]],"check":"oracle 4","expected":[[60,0,8],[60,8,30]],"passed":true},{"actual":[[60,0,8],[60,8,12],[64,1,12]],"check":"oracle 5","expected":[[60,0,8],[60,8,12],[64,1,12]],"passed":true},{"actual":[[60,0,5],[60,5,9]],"check":"oracle 6","expected":[[60,0,5],[60,5,9]],"passed":true},{"actual":[[50,1,5],[50,5,12],[52,2,16],[70,15,16]],"check":"oracle 7","expected":[[50,1,5],[50,5,12],[52,2,12],[70,15,16]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[60, 0, 8], [60, 8, 30]], \"expected\": [[60, 0, 8], [60, 8, 30]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"expected\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[60, 0, 5], [60, 5, 9]], \"expected\": [[60, 0, 5], [60, 5, 9]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[50, 1, 5], [50, 5, 12], [52, 2, 16], [70, 15, 16]], \"expected\": [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.706,"exit_code":1,"observations":[{"actual":[[60,0,10]],"check":"oracle 0","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 1","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 2","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,10]],"check":"oracle 3","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,8],[60,8,12]],"check":"oracle 4","expected":[[60,0,8],[60,8,30]],"passed":false},{"actual":[[60,0,8],[60,8,12],[64,1,12]],"check":"oracle 5","expected":[[60,0,8],[60,8,12],[64,1,12]],"passed":true},{"actual":[[60,0,5],[60,5,9]],"check":"oracle 6","expected":[[60,0,5],[60,5,9]],"passed":true},{"actual":[[50,1,5],[50,5,12],[52,2,12],[70,15,16]],"check":"oracle 7","expected":[[50,1,5],[50,5,12],[52,2,12],[70,15,16]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[60, 0, 8], [60, 8, 12]], \"expected\": [[60, 0, 8], [60, 8, 30]], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"expected\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[60, 0, 5], [60, 5, 9]], \"expected\": [[60, 0, 5], [60, 5, 9]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]], \"expected\": [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.729,"exit_code":0,"observations":[{"actual":[[60,0,10]],"check":"oracle 0","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 1","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,20]],"check":"oracle 2","expected":[[60,0,20]],"passed":true},{"actual":[[60,0,10]],"check":"oracle 3","expected":[[60,0,10]],"passed":true},{"actual":[[60,0,8],[60,8,30]],"check":"oracle 4","expected":[[60,0,8],[60,8,30]],"passed":true},{"actual":[[60,0,8],[60,8,12],[64,1,12]],"check":"oracle 5","expected":[[60,0,8],[60,8,12],[64,1,12]],"passed":true},{"actual":[[60,0,5],[60,5,9]],"check":"oracle 6","expected":[[60,0,5],[60,5,9]],"passed":true},{"actual":[[50,1,5],[50,5,12],[52,2,12],[70,15,16]],"check":"oracle 7","expected":[[50,1,5],[50,5,12],[52,2,12],[70,15,16]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[60, 0, 20]], \"expected\": [[60, 0, 20]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[60, 0, 10]], \"expected\": [[60, 0, 10]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[60, 0, 8], [60, 8, 30]], \"expected\": [[60, 0, 8], [60, 8, 30]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"expected\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[60, 0, 5], [60, 5, 9]], \"expected\": [[60, 0, 5], [60, 5, 9]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]], \"expected\": [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}