{"abstract":"Notes still held by the key or pedal when the events end are missing from the output.","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.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-sustain-pedal","failed_approach":"Flushing only pedal-held notes still loses notes whose keys were never released.","family":"w2-midi-event-timing-sustain-pedal-end-of-track-flush","id":"FA-81676","implementations":{"attempt":{"sha256":"4287ed64e028c8c4f5fd7487e70810c42897b8b316cc01d863c72798bee4d22f","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(held):\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], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]])], [([[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', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], [])], [([[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], [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], [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], [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', 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], [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]])]]\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":"ef5f23fe6d764d0b7589c0becb1d38ff197ea88289c2cf21ac08f2e298ee5bd4","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    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], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]])], [([[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', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], [])], [([[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], [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], [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], [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', 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], [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]])]]\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-end-of-track-flush","generated_at":"2026-09-29T14:50:05.120082+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":"The final flush of still-sounding notes is missing.","sha256":"b14f4971e5fa9475d457ef3a204dd3b40dfb940070c73f15b4fa4c94d9ca8cf1","title":"Sustain pedal note-off deferral: notes sounding at the end vanish · 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":39.833,"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],[64,1,12]],"check":"oracle 5","expected":[[60,0,8],[60,8,12],[64,1,12]],"passed":false},{"actual":[[60,0,5],[60,5,9]],"check":"oracle 6","expected":[[60,0,5],[60,5,9]],"passed":true},{"actual":[[60,0,9]],"check":"oracle 7","expected":[[60,0,9],[62,9,9]],"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], [64, 1, 12]], \"expected\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [[60, 0, 5], [60, 5, 9]], \"expected\": [[60, 0, 5], [60, 5, 9]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[60, 0, 9]], \"expected\": [[60, 0, 9], [62, 9, 9]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.374,"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],[64,1,12]],"check":"oracle 5","expected":[[60,0,8],[60,8,12],[64,1,12]],"passed":false},{"actual":[[60,0,5],[60,5,9]],"check":"oracle 6","expected":[[60,0,5],[60,5,9]],"passed":true},{"actual":[],"check":"oracle 7","expected":[[60,0,9],[62,9,9]],"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], [64, 1, 12]], \"expected\": [[60, 0, 8], [60, 8, 12], [64, 1, 12]], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [[60, 0, 5], [60, 5, 9]], \"expected\": [[60, 0, 5], [60, 5, 9]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [], \"expected\": [[60, 0, 9], [62, 9, 9]], \"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."}}