{"abstract":"A repeated note whose off and next on share a tick is emitted on-then-off, so a receiver cuts the new note immediately.","category":"MIDI event timing","checks":8,"contract":"Input a list of [tick, kind, note] with kind on or off in any order. Emit events sorted by tick; at equal ticks note-offs precede note-ons, and otherwise input order is kept. Each output is [delta from the previous emitted event (the first from tick 0), kind, note]. A negative tick returns None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-delta-serialise","failed_approach":"Removing the priority keeps input order, which still places an on before an off when listed that way.","family":"w2-midi-event-timing-delta-serialise-same-tick-priority","id":"FA-81461","implementations":{"attempt":{"sha256":"571d69e9cbdf3d7d0d51419b2352132538b51175c41a17b5e4ad11ed38075b2d","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    for e in x:\n        if e[0] < 0:\n            return None\n    order = sorted(range(len(x)), key=lambda i: (x[i][0], 0, i))\n    out = []\n    prev = 0\n    for i in order:\n        tick, kind, note = x[i]\n        out.append([tick - prev, kind, note])\n        prev = tick\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([], []), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]])], [([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([], []), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]]), ([[-1, 'on', 60]], None), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]]), ([[12, 'on', 70]], [[12, 'on', 70]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]]), ([[12, 'on', 70]], [[12, 'on', 70]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([], []), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]])]]\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":"0c63e475088da1bc9199c4fe1c5473abf5e823987b9f0d569c87e7572fd9fe72","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    for e in x:\n        if e[0] < 0:\n            return None\n    order = sorted(range(len(x)), key=lambda i: (x[i][0], 0 if x[i][1] == 'on' else 1, i))\n    out = []\n    prev = 0\n    for i in order:\n        tick, kind, note = x[i]\n        out.append([tick - prev, kind, note])\n        prev = tick\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([], []), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]])], [([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([], []), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]]), ([[-1, 'on', 60]], None), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]]), ([[12, 'on', 70]], [[12, 'on', 70]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]]), ([[12, 'on', 70]], [[12, 'on', 70]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[10, 'on', 62], [10, 'off', 60], [0, 'on', 60]], [[0, 'on', 60], [10, 'off', 60], [0, 'on', 62]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([[7, 'off', 60], [7, 'on', 60], [7, 'off', 61]], [[7, 'off', 60], [0, 'off', 61], [0, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]])], [([[0, 'on', 60], [10, 'off', 60]], [[0, 'on', 60], [10, 'off', 60]]), ([[5, 'on', 60], [15, 'off', 60]], [[5, 'on', 60], [10, 'off', 60]]), ([[20, 'on', 64], [0, 'on', 60], [20, 'off', 60]], [[0, 'on', 60], [20, 'off', 60], [0, 'on', 64]]), ([[0, 'on', 60], [0, 'on', 64], [0, 'off', 59]], [[0, 'off', 59], [0, 'on', 60], [0, 'on', 64]]), ([[3, 'on', 1], [3, 'on', 2], [3, 'on', 3]], [[3, 'on', 1], [0, 'on', 2], [0, 'on', 3]]), ([], []), ([[100, 'on', 60], [50, 'on', 61], [75, 'off', 61]], [[50, 'on', 61], [25, 'off', 61], [25, 'on', 60]]), ([[30, 'on', 60], [30, 'off', 60], [40, 'off', 60]], [[30, 'off', 60], [0, 'on', 60], [10, 'off', 60]])]]\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-delta-serialise-same-tick-priority","generated_at":"2026-09-29T14:50:03.150773+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 tie-break ranks note-ons ahead of note-offs at equal ticks.","sha256":"39592753795797a7f4257af35df9b81a551246b8dfaa79ff506aa9cdfb125a48","title":"Absolute events to delta-time serialisation: note-on emitted before simultaneous note-off · 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":43.874,"exit_code":1,"observations":[{"actual":[[0,"on",60],[10,"off",60]],"check":"oracle 0","expected":[[0,"on",60],[10,"off",60]],"passed":true},{"actual":[[0,"on",60],[10,"on",62],[0,"off",60]],"check":"oracle 1","expected":[[0,"on",60],[10,"off",60],[0,"on",62]],"passed":false},{"actual":[[5,"on",60],[10,"off",60]],"check":"oracle 2","expected":[[5,"on",60],[10,"off",60]],"passed":true},{"actual":[[0,"on",60],[0,"on",64],[0,"off",59]],"check":"oracle 3","expected":[[0,"off",59],[0,"on",60],[0,"on",64]],"passed":false},{"actual":[[3,"on",1],[0,"on",2],[0,"on",3]],"check":"oracle 4","expected":[[3,"on",1],[0,"on",2],[0,"on",3]],"passed":true},{"actual":[],"check":"oracle 5","expected":[],"passed":true},{"actual":[[7,"off",60],[0,"on",60],[0,"off",61]],"check":"oracle 6","expected":[[7,"off",60],[0,"off",61],[0,"on",60]],"passed":false},{"actual":[[50,"on",61],[25,"off",61],[25,"on",60]],"check":"oracle 7","expected":[[50,"on",61],[25,"off",61],[25,"on",60]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, \"on\", 60], [10, \"off\", 60]], \"expected\": [[0, \"on\", 60], [10, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, \"on\", 60], [10, \"on\", 62], [0, \"off\", 60]], \"expected\": [[0, \"on\", 60], [10, \"off\", 60], [0, \"on\", 62]], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [[5, \"on\", 60], [10, \"off\", 60]], \"expected\": [[5, \"on\", 60], [10, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[0, \"on\", 60], [0, \"on\", 64], [0, \"off\", 59]], \"expected\": [[0, \"off\", 59], [0, \"on\", 60], [0, \"on\", 64]], \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": [[3, \"on\", 1], [0, \"on\", 2], [0, \"on\", 3]], \"expected\": [[3, \"on\", 1], [0, \"on\", 2], [0, \"on\", 3]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[7, \"off\", 60], [0, \"on\", 60], [0, \"off\", 61]], \"expected\": [[7, \"off\", 60], [0, \"off\", 61], [0, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [[50, \"on\", 61], [25, \"off\", 61], [25, \"on\", 60]], \"expected\": [[50, \"on\", 61], [25, \"off\", 61], [25, \"on\", 60]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.536,"exit_code":1,"observations":[{"actual":[[0,"on",60],[10,"off",60]],"check":"oracle 0","expected":[[0,"on",60],[10,"off",60]],"passed":true},{"actual":[[0,"on",60],[10,"on",62],[0,"off",60]],"check":"oracle 1","expected":[[0,"on",60],[10,"off",60],[0,"on",62]],"passed":false},{"actual":[[5,"on",60],[10,"off",60]],"check":"oracle 2","expected":[[5,"on",60],[10,"off",60]],"passed":true},{"actual":[[0,"on",60],[0,"on",64],[0,"off",59]],"check":"oracle 3","expected":[[0,"off",59],[0,"on",60],[0,"on",64]],"passed":false},{"actual":[[3,"on",1],[0,"on",2],[0,"on",3]],"check":"oracle 4","expected":[[3,"on",1],[0,"on",2],[0,"on",3]],"passed":true},{"actual":[],"check":"oracle 5","expected":[],"passed":true},{"actual":[[7,"on",60],[0,"off",60],[0,"off",61]],"check":"oracle 6","expected":[[7,"off",60],[0,"off",61],[0,"on",60]],"passed":false},{"actual":[[50,"on",61],[25,"off",61],[25,"on",60]],"check":"oracle 7","expected":[[50,"on",61],[25,"off",61],[25,"on",60]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, \"on\", 60], [10, \"off\", 60]], \"expected\": [[0, \"on\", 60], [10, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, \"on\", 60], [10, \"on\", 62], [0, \"off\", 60]], \"expected\": [[0, \"on\", 60], [10, \"off\", 60], [0, \"on\", 62]], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [[5, \"on\", 60], [10, \"off\", 60]], \"expected\": [[5, \"on\", 60], [10, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [[0, \"on\", 60], [0, \"on\", 64], [0, \"off\", 59]], \"expected\": [[0, \"off\", 59], [0, \"on\", 60], [0, \"on\", 64]], \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": [[3, \"on\", 1], [0, \"on\", 2], [0, \"on\", 3]], \"expected\": [[3, \"on\", 1], [0, \"on\", 2], [0, \"on\", 3]], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[7, \"on\", 60], [0, \"off\", 60], [0, \"off\", 61]], \"expected\": [[7, \"off\", 60], [0, \"off\", 61], [0, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [[50, \"on\", 61], [25, \"off\", 61], [25, \"on\", 60]], \"expected\": [[50, \"on\", 61], [25, \"off\", 61], [25, \"on\", 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."}}