{"abstract":"A program change on channel 2 (C1) swallows the next delta byte as a second data byte and desynchronises the track.","category":"MIDI event timing","checks":8,"contract":"Input the bytes of a track body: each event is a variable-length delta then either a meta event (FF type len data...), a status byte (bit 7 set) with its data bytes, or data bytes reusing the previous channel status (running status). Program change (Cx) and channel pressure (Dx) take one data byte, other channel messages two. Meta events cancel running status. Return [absolute tick, status, data...] for channel events and [tick, \"meta\", type] for meta events, or None on truncation or data without a running status.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-running-status-parse","failed_approach":"Parenthesising the mask but listing only program change leaves channel pressure with two data bytes.","family":"w2-midi-event-timing-running-status-parse-data-length-classification","id":"FA-81406","implementations":{"attempt":{"sha256":"8f04f6138d6dfee3997b8fb9f054f80c4ed9ddb2eeef73bfbef029f5cba71c27","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    out = []\n    i = 0\n    tick = 0\n    running = None\n    while i < len(x):\n        delta = 0\n        while True:\n            if i >= len(x):\n                return None\n            b = x[i]\n            i += 1\n            delta = (delta << 7) | (b & 0x7F)\n            if not b & 0x80:\n                break\n        tick += delta\n        if i >= len(x):\n            return None\n        status = x[i]\n        if status == 0xFF:\n            if i + 2 >= len(x):\n                return None\n            kind = x[i + 1]\n            i += 3 + x[i + 2]\n            if i > len(x):\n                return None\n            running = None\n            out.append([tick, 'meta', kind])\n            continue\n        if status & 0x80:\n            i += 1\n            running = status\n        elif running is None:\n            return None\n        else:\n            status = running\n        size = 1 if (status & 0xF0) in (0xC0,) else 2\n        if i + size > len(x):\n            return None\n        out.append([tick, status] + x[i:i + size])\n        i += size\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 144, 60, 100, 10, 60, 0], [[0, 144, 60, 100], [10, 144, 60, 0]]), ([0, 192, 5, 0, 6], [[0, 192, 5], [0, 192, 6]]), ([0, 208, 64, 0, 50], [[0, 208, 64], [0, 208, 50]]), ([0, 144, 60, 100, 0, 255, 1, 0, 0, 62, 100], None), ([0, 144, 60, 100, 0, 255, 1, 1, 65, 0, 62, 100], None), ([0, 176, 7, 100, 20, 10, 90], [[0, 176, 7, 100], [20, 176, 10, 90]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 144, 60, 100, 0, 255, 1, 1, 65, 0, 62, 100], None), ([0, 176, 7, 100, 20, 10, 90], [[0, 176, 7, 100], [20, 176, 10, 90]]), ([127, 144, 60, 1], [[127, 144, 60, 1]]), ([128, 0, 144, 60, 1], [[0, 144, 60, 1]]), ([129, 0, 144, 60, 1], [[128, 144, 60, 1]]), ([0, 208, 10, 0, 20], [[0, 208, 10], [0, 208, 20]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]])], [([128, 0, 144, 60, 1], [[0, 144, 60, 1]]), ([129, 0, 144, 60, 1], [[128, 144, 60, 1]]), ([0, 144, 60], None), ([0, 62, 100], None), ([0, 192, 5, 7, 6, 0, 144, 64, 90], [[0, 192, 5], [7, 192, 6], [7, 144, 64, 90]]), ([0, 255, 47, 0], [[0, 'meta', 47]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 208, 64, 0, 50], [[0, 208, 64], [0, 208, 50]]), ([0, 62, 100], None), ([0, 192, 5, 7, 6, 0, 144, 64, 90], [[0, 192, 5], [7, 192, 6], [7, 144, 64, 90]]), ([0, 255, 47, 0], [[0, 'meta', 47]]), ([0, 255, 81, 3, 7, 161, 32, 0, 144, 60, 64], [[0, 'meta', 81], [0, 144, 60, 64]]), ([0, 224, 0, 64, 16, 0, 65], [[0, 224, 0, 64], [16, 224, 0, 65]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 255, 81, 3, 7, 161, 32, 0, 144, 60, 64], [[0, 'meta', 81], [0, 144, 60, 64]]), ([0, 224, 0, 64, 16, 0, 65], [[0, 224, 0, 64], [16, 224, 0, 65]]), ([5, 144, 60, 100, 5, 128, 60, 0, 5, 62, 0], [[5, 144, 60, 100], [10, 128, 60, 0], [15, 128, 62, 0]]), ([0, 208, 10, 0, 20], [[0, 208, 10], [0, 208, 20]]), ([0, 255, 3], None), ([0, 255, 3, 5, 65], None), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]])]]\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":"0ccbc3e78df655687fc5d8fc21bb95a3aa46cd2890a87a6fddfaa3c75cb0e8e8","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    out = []\n    i = 0\n    tick = 0\n    running = None\n    while i < len(x):\n        delta = 0\n        while True:\n            if i >= len(x):\n                return None\n            b = x[i]\n            i += 1\n            delta = (delta << 7) | (b & 0x7F)\n            if not b & 0x80:\n                break\n        tick += delta\n        if i >= len(x):\n            return None\n        status = x[i]\n        if status == 0xFF:\n            if i + 2 >= len(x):\n                return None\n            kind = x[i + 1]\n            i += 3 + x[i + 2]\n            if i > len(x):\n                return None\n            running = None\n            out.append([tick, 'meta', kind])\n            continue\n        if status & 0x80:\n            i += 1\n            running = status\n        elif running is None:\n            return None\n        else:\n            status = running\n        size = 1 if status in (0xC0, 0xD0) else 2\n        if i + size > len(x):\n            return None\n        out.append([tick, status] + x[i:i + size])\n        i += size\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 144, 60, 100, 10, 60, 0], [[0, 144, 60, 100], [10, 144, 60, 0]]), ([0, 192, 5, 0, 6], [[0, 192, 5], [0, 192, 6]]), ([0, 208, 64, 0, 50], [[0, 208, 64], [0, 208, 50]]), ([0, 144, 60, 100, 0, 255, 1, 0, 0, 62, 100], None), ([0, 144, 60, 100, 0, 255, 1, 1, 65, 0, 62, 100], None), ([0, 176, 7, 100, 20, 10, 90], [[0, 176, 7, 100], [20, 176, 10, 90]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 144, 60, 100, 0, 255, 1, 1, 65, 0, 62, 100], None), ([0, 176, 7, 100, 20, 10, 90], [[0, 176, 7, 100], [20, 176, 10, 90]]), ([127, 144, 60, 1], [[127, 144, 60, 1]]), ([128, 0, 144, 60, 1], [[0, 144, 60, 1]]), ([129, 0, 144, 60, 1], [[128, 144, 60, 1]]), ([0, 208, 10, 0, 20], [[0, 208, 10], [0, 208, 20]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]])], [([128, 0, 144, 60, 1], [[0, 144, 60, 1]]), ([129, 0, 144, 60, 1], [[128, 144, 60, 1]]), ([0, 144, 60], None), ([0, 62, 100], None), ([0, 192, 5, 7, 6, 0, 144, 64, 90], [[0, 192, 5], [7, 192, 6], [7, 144, 64, 90]]), ([0, 255, 47, 0], [[0, 'meta', 47]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 208, 64, 0, 50], [[0, 208, 64], [0, 208, 50]]), ([0, 62, 100], None), ([0, 192, 5, 7, 6, 0, 144, 64, 90], [[0, 192, 5], [7, 192, 6], [7, 144, 64, 90]]), ([0, 255, 47, 0], [[0, 'meta', 47]]), ([0, 255, 81, 3, 7, 161, 32, 0, 144, 60, 64], [[0, 'meta', 81], [0, 144, 60, 64]]), ([0, 224, 0, 64, 16, 0, 65], [[0, 224, 0, 64], [16, 224, 0, 65]]), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 194, 1, 4, 144, 60, 1], [[0, 194, 1], [4, 144, 60, 1]])], [([0, 255, 81, 3, 7, 161, 32, 0, 144, 60, 64], [[0, 'meta', 81], [0, 144, 60, 64]]), ([0, 224, 0, 64, 16, 0, 65], [[0, 224, 0, 64], [16, 224, 0, 65]]), ([5, 144, 60, 100, 5, 128, 60, 0, 5, 62, 0], [[5, 144, 60, 100], [10, 128, 60, 0], [15, 128, 62, 0]]), ([0, 208, 10, 0, 20], [[0, 208, 10], [0, 208, 20]]), ([0, 255, 3], None), ([0, 255, 3, 5, 65], None), ([0, 193, 5, 0, 6], [[0, 193, 5], [0, 193, 6]]), ([0, 209, 64, 0, 50], [[0, 209, 64], [0, 209, 50]])]]\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-running-status-parse-data-length-classification","generated_at":"2026-09-29T14:50:02.547104+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 one-data-byte test compares the whole status byte instead of its message-type nibble, so only channel 1 matches.","sha256":"d3148210113e7382f8b238aa8fbc8c16d8001e610b57ec926835031b5f1d3618","title":"Track event parser with running status: one-byte messages recognised only on channel 1 · 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":40.375,"exit_code":1,"observations":[{"actual":[[0,144,60,100],[10,144,60,0]],"check":"oracle 0","expected":[[0,144,60,100],[10,144,60,0]],"passed":true},{"actual":[[0,192,5],[0,192,6]],"check":"oracle 1","expected":[[0,192,5],[0,192,6]],"passed":true},{"actual":null,"check":"oracle 2","expected":[[0,208,64],[0,208,50]],"passed":false},{"actual":null,"check":"oracle 3","expected":null,"passed":true},{"actual":null,"check":"oracle 4","expected":null,"passed":true},{"actual":[[0,176,7,100],[20,176,10,90]],"check":"oracle 5","expected":[[0,176,7,100],[20,176,10,90]],"passed":true},{"actual":[[0,193,5],[0,193,6]],"check":"oracle 6","expected":[[0,193,5],[0,193,6]],"passed":true},{"actual":[[0,194,1],[4,144,60,1]],"check":"oracle 7","expected":[[0,194,1],[4,144,60,1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 144, 60, 100], [10, 144, 60, 0]], \"expected\": [[0, 144, 60, 100], [10, 144, 60, 0]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 192, 5], [0, 192, 6]], \"expected\": [[0, 192, 5], [0, 192, 6]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": null, \"expected\": [[0, 208, 64], [0, 208, 50]], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[0, 176, 7, 100], [20, 176, 10, 90]], \"expected\": [[0, 176, 7, 100], [20, 176, 10, 90]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": [[0, 193, 5], [0, 193, 6]], \"expected\": [[0, 193, 5], [0, 193, 6]], \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [[0, 194, 1], [4, 144, 60, 1]], \"expected\": [[0, 194, 1], [4, 144, 60, 1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.424,"exit_code":1,"observations":[{"actual":[[0,144,60,100],[10,144,60,0]],"check":"oracle 0","expected":[[0,144,60,100],[10,144,60,0]],"passed":true},{"actual":[[0,192,5],[0,192,6]],"check":"oracle 1","expected":[[0,192,5],[0,192,6]],"passed":true},{"actual":[[0,208,64],[0,208,50]],"check":"oracle 2","expected":[[0,208,64],[0,208,50]],"passed":true},{"actual":null,"check":"oracle 3","expected":null,"passed":true},{"actual":null,"check":"oracle 4","expected":null,"passed":true},{"actual":[[0,176,7,100],[20,176,10,90]],"check":"oracle 5","expected":[[0,176,7,100],[20,176,10,90]],"passed":true},{"actual":null,"check":"oracle 6","expected":[[0,193,5],[0,193,6]],"passed":false},{"actual":null,"check":"oracle 7","expected":[[0,194,1],[4,144,60,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, 144, 60, 100], [10, 144, 60, 0]], \"expected\": [[0, 144, 60, 100], [10, 144, 60, 0]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, 192, 5], [0, 192, 6]], \"expected\": [[0, 192, 5], [0, 192, 6]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, 208, 64], [0, 208, 50]], \"expected\": [[0, 208, 64], [0, 208, 50]], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": [[0, 176, 7, 100], [20, 176, 10, 90]], \"expected\": [[0, 176, 7, 100], [20, 176, 10, 90]], \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": [[0, 193, 5], [0, 193, 6]], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": [[0, 194, 1], [4, 144, 60, 1]], \"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."}}