{"abstract":"A velocity-0 note-on is emitted in note-on form even without running status, instead of a note-off message.","category":"MIDI event timing","checks":8,"contract":"Input [events, running_status] with events [kind, channel 1..16, note, velocity]. A note-on with velocity > 0 encodes as 0x90|(channel-1), note, velocity. A note-off (or note-on with velocity 0) encodes as 0x90|(channel-1), note, 0 when running status is enabled; otherwise as 0x80|(channel-1), note, velocity for an off and note, 64 for a velocity-0 on. With running status enabled, a status byte equal to the previous one is omitted. Invalid values return None.","evaluation_group":"w2-midi-event-timing-note-message-encode","failed_approach":"Raising the threshold to 1 also turns quiet velocity-1 note-ons into note-offs.","family":"w2-midi-event-timing-note-message-encode-note-on-velocity-split","id":"FA-81796","implementations":{"attempt":{"sha256":"e81210e6dfc740df688fd8b37cf4e025090835d9b05b3c8507e97867c29a0cb2","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    events, rs = x\n    out = []\n    last = None\n    for kind, ch, note, vel in events:\n        if not 1 <= ch <= 16 or not 0 <= note <= 127 or not 0 <= vel <= 127:\n            return None\n        if kind == 'on' and vel > 1:\n            status, data = 0x90 | (ch - 1), [note, vel]\n        elif kind in ('on', 'off'):\n            if rs:\n                status, data = 0x90 | (ch - 1), [note, 0]\n            else:\n                status, data = 0x80 | (ch - 1), [note, vel if kind == 'off' else 64]\n        else:\n            return None\n        if not (rs and status == last):\n            out.append(status)\n        out.extend(data)\n        last = status\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])]]\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":"148232c2467206d97d80cc0fe01bc8cdd61f5336ecd0f15d5d12e69bded0f33a","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    events, rs = x\n    out = []\n    last = None\n    for kind, ch, note, vel in events:\n        if not 1 <= ch <= 16 or not 0 <= note <= 127 or not 0 <= vel <= 127:\n            return None\n        if kind == 'on':\n            status, data = 0x90 | (ch - 1), [note, vel]\n        elif kind in ('on', 'off'):\n            if rs:\n                status, data = 0x90 | (ch - 1), [note, 0]\n            else:\n                status, data = 0x80 | (ch - 1), [note, vel if kind == 'off' else 64]\n        else:\n            return None\n        if not (rs and status == last):\n            out.append(status)\n        out.extend(data)\n        last = status\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])]]\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":"daceb9294b2e508842f7eb70d384d64da55da5f764265fbb0d62f6ddca3723bf","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    events, rs = x\n    out = []\n    last = None\n    for kind, ch, note, vel in events:\n        if not 1 <= ch <= 16 or not 0 <= note <= 127 or not 0 <= vel <= 127:\n            return None\n        if kind == 'on' and vel > 0:\n            status, data = 0x90 | (ch - 1), [note, vel]\n        elif kind in ('on', 'off'):\n            if rs:\n                status, data = 0x90 | (ch - 1), [note, 0]\n            else:\n                status, data = 0x80 | (ch - 1), [note, vel if kind == 'off' else 64]\n        else:\n            return None\n        if not (rs and status == last):\n            out.append(status)\n        out.extend(data)\n        last = status\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 16, 60, 100]], False], [159, 60, 100]), ([[['on', 0, 60, 100]], False], None), ([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 17, 60, 100]], False], None), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 2, 60, 0]], True], [145, 60, 0]), ([[['off', 3, 60, 0]], False], [130, 60, 0]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 1, 60, 1]], True], [144, 60, 1])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 1, 60, 100], ['on', 2, 60, 100]], True], [144, 60, 100, 145, 60, 100]), ([[['on', 1, 128, 100]], False], None), ([[['cc', 1, 7, 100]], False], None), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])], [([[['on', 1, 60, 100], ['off', 1, 60, 40]], False], [144, 60, 100, 128, 60, 40]), ([[['on', 1, 60, 100], ['off', 1, 60, 40]], True], [144, 60, 100, 60, 0]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], True], [144, 60, 100, 64, 90]), ([[['on', 1, 60, 100], ['on', 1, 64, 90]], False], [144, 60, 100, 144, 64, 90]), ([[['on', 2, 60, 0]], False], [129, 60, 64]), ([[['on', 10, 36, 127], ['off', 10, 36, 0], ['on', 10, 38, 127]], True], [153, 36, 127, 36, 0, 38, 127]), ([[['on', 1, 60, 1]], True], [144, 60, 1]), ([[['off', 5, 70, 90], ['off', 5, 71, 90]], True], [148, 70, 0, 71, 0])]]\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-message-encode-note-on-velocity-split","generated_at":"2026-09-29T14:50:06.304223+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 note-on velocity split step so that it reads `kind == 'on' and vel > 0`.","root_cause":"Every note-on is encoded as a start regardless of its velocity.","sha256":"0f3019d5929a1b9217f18e8fa57b1b893b06cf5fdfffa2500f2d61af4dd8cf20","title":"Channel note message encoder with running status: velocity-zero note-on sent as note-on · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.53,"exit_code":1,"observations":[{"actual":[144,60,100,128,60,40],"check":"oracle 0","expected":[144,60,100,128,60,40],"passed":true},{"actual":[144,60,100,60,0],"check":"oracle 1","expected":[144,60,100,60,0],"passed":true},{"actual":[144,60,100,64,90],"check":"oracle 2","expected":[144,60,100,64,90],"passed":true},{"actual":[144,60,100,144,64,90],"check":"oracle 3","expected":[144,60,100,144,64,90],"passed":true},{"actual":[159,60,100],"check":"oracle 4","expected":[159,60,100],"passed":true},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"actual":[129,60,64],"check":"oracle 6","expected":[129,60,64],"passed":true},{"actual":[144,60,0],"check":"oracle 7","expected":[144,60,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [144, 60, 100, 128, 60, 40], \"expected\": [144, 60, 100, 128, 60, 40], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [144, 60, 100, 60, 0], \"expected\": [144, 60, 100, 60, 0], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [144, 60, 100, 64, 90], \"expected\": [144, 60, 100, 64, 90], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [144, 60, 100, 144, 64, 90], \"expected\": [144, 60, 100, 144, 64, 90], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [159, 60, 100], \"expected\": [159, 60, 100], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [129, 60, 64], \"expected\": [129, 60, 64], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [144, 60, 0], \"expected\": [144, 60, 1], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.057,"exit_code":1,"observations":[{"actual":[144,60,100,128,60,40],"check":"oracle 0","expected":[144,60,100,128,60,40],"passed":true},{"actual":[144,60,100,60,0],"check":"oracle 1","expected":[144,60,100,60,0],"passed":true},{"actual":[144,60,100,64,90],"check":"oracle 2","expected":[144,60,100,64,90],"passed":true},{"actual":[144,60,100,144,64,90],"check":"oracle 3","expected":[144,60,100,144,64,90],"passed":true},{"actual":[159,60,100],"check":"oracle 4","expected":[159,60,100],"passed":true},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"actual":[145,60,0],"check":"oracle 6","expected":[129,60,64],"passed":false},{"actual":[144,60,1],"check":"oracle 7","expected":[144,60,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [144, 60, 100, 128, 60, 40], \"expected\": [144, 60, 100, 128, 60, 40], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [144, 60, 100, 60, 0], \"expected\": [144, 60, 100, 60, 0], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [144, 60, 100, 64, 90], \"expected\": [144, 60, 100, 64, 90], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [144, 60, 100, 144, 64, 90], \"expected\": [144, 60, 100, 144, 64, 90], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [159, 60, 100], \"expected\": [159, 60, 100], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [145, 60, 0], \"expected\": [129, 60, 64], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": [144, 60, 1], \"expected\": [144, 60, 1], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.487,"exit_code":0,"observations":[{"actual":[144,60,100,128,60,40],"check":"oracle 0","expected":[144,60,100,128,60,40],"passed":true},{"actual":[144,60,100,60,0],"check":"oracle 1","expected":[144,60,100,60,0],"passed":true},{"actual":[144,60,100,64,90],"check":"oracle 2","expected":[144,60,100,64,90],"passed":true},{"actual":[144,60,100,144,64,90],"check":"oracle 3","expected":[144,60,100,144,64,90],"passed":true},{"actual":[159,60,100],"check":"oracle 4","expected":[159,60,100],"passed":true},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"actual":[129,60,64],"check":"oracle 6","expected":[129,60,64],"passed":true},{"actual":[144,60,1],"check":"oracle 7","expected":[144,60,1],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [144, 60, 100, 128, 60, 40], \"expected\": [144, 60, 100, 128, 60, 40], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [144, 60, 100, 60, 0], \"expected\": [144, 60, 100, 60, 0], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [144, 60, 100, 64, 90], \"expected\": [144, 60, 100, 64, 90], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [144, 60, 100, 144, 64, 90], \"expected\": [144, 60, 100, 144, 64, 90], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [159, 60, 100], \"expected\": [159, 60, 100], \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [129, 60, 64], \"expected\": [129, 60, 64], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [144, 60, 1], \"expected\": [144, 60, 1], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}