{"abstract":"Frame 21 (pieces 5 and 1) decodes as frame 81, which carries into several extra seconds.","category":"MIDI event timing","checks":8,"contract":"Input the data bytes of received quarter-frame messages. The last eight must carry piece numbers 0..7 (high nibble) in order; low nibbles give frames (pieces 0,1 as low/high nibble), seconds (2,3), minutes (4,5) and hours (6 low nibble, piece 7 bit 0 as hours bit 4); piece 7 bits 1-2 give the rate code (0: 24, 1: 25, 2: 30 drop, 3: 30 fps). The reported time is the decoded time plus 2 frames, carried into seconds, minutes and hours (mod 24). Return [h, m, s, f, rate_code] or None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-mtc-quarter-frames","failed_approach":"Shifting the high nibble by three overlaps the two nibbles.","family":"w2-midi-event-timing-mtc-quarter-frames-frame-nibble-order","id":"FA-81801","implementations":{"attempt":{"sha256":"5f007539667391805674f29fe0f7d20d41e36c0393e49c1e52c8d19cf8591b7b","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) < 8:\n        return None\n    last8 = x[-8:]\n    if [b >> 4 for b in last8] != list(range(8)):\n        return None\n    nib = [b & 0x0F for b in last8]\n    frames = nib[0] | (nib[1] << 3)\n    secs = nib[2] | (nib[3] << 4)\n    mins = nib[4] | (nib[5] << 4)\n    hours = nib[6] | ((nib[7] & 0x1) << 4)\n    rate = (nib[7] >> 1) & 0x3\n    fps = [24, 25, 30, 30][rate]\n    frames += 2\n    secs += frames // fps\n    frames %= fps\n    mins += secs // 60\n    secs %= 60\n    hours = (hours + mins // 60) % 24\n    mins %= 60\n    return [hours, mins, secs, frames, rate]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 16, 32, 48, 64, 80, 96, 112], [0, 0, 0, 2, 0]), ([5, 17, 32, 48, 64, 80, 96, 114], [0, 0, 0, 23, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([0, 16, 32, 48, 64, 80, 100, 119], [20, 0, 0, 2, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([0, 16, 32, 48, 64, 80, 96], None), ([16, 32, 48, 64, 80, 96, 112, 0], None), ([3, 0, 16, 32, 48, 64, 80, 98, 112], [2, 0, 0, 2, 0])], [([5, 17, 32, 48, 64, 80, 96, 114], [0, 0, 0, 23, 1]), ([4, 16, 35, 48, 66, 80, 97, 114], [1, 2, 3, 6, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([16, 32, 48, 64, 80, 96, 112, 0], None), ([3, 0, 16, 32, 48, 64, 80, 98, 112], [2, 0, 0, 2, 0])], [([4, 16, 35, 48, 66, 80, 97, 114], [1, 2, 3, 6, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0])], [([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0]), ([4, 17, 40, 51, 66, 82, 108, 118], [12, 34, 56, 22, 3]), ([8, 17, 43, 51, 75, 83, 103, 115], [0, 0, 0, 1, 1])], [([0, 16, 32, 48, 64, 80, 96, 112], [0, 0, 0, 2, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0]), ([4, 17, 40, 51, 66, 82, 108, 118], [12, 34, 56, 22, 3]), ([8, 17, 43, 51, 75, 83, 103, 115], [0, 0, 0, 1, 1]), ([9, 16, 41, 48, 73, 80, 105, 112], [9, 9, 9, 11, 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":"f30a2f653d7c39be22fec40db7789a07d4fc229cf1dc9c4da37ee44f9c0bb2a0","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) < 8:\n        return None\n    last8 = x[-8:]\n    if [b >> 4 for b in last8] != list(range(8)):\n        return None\n    nib = [b & 0x0F for b in last8]\n    frames = (nib[0] << 4) | nib[1]\n    secs = nib[2] | (nib[3] << 4)\n    mins = nib[4] | (nib[5] << 4)\n    hours = nib[6] | ((nib[7] & 0x1) << 4)\n    rate = (nib[7] >> 1) & 0x3\n    fps = [24, 25, 30, 30][rate]\n    frames += 2\n    secs += frames // fps\n    frames %= fps\n    mins += secs // 60\n    secs %= 60\n    hours = (hours + mins // 60) % 24\n    mins %= 60\n    return [hours, mins, secs, frames, rate]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 16, 32, 48, 64, 80, 96, 112], [0, 0, 0, 2, 0]), ([5, 17, 32, 48, 64, 80, 96, 114], [0, 0, 0, 23, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([0, 16, 32, 48, 64, 80, 100, 119], [20, 0, 0, 2, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([0, 16, 32, 48, 64, 80, 96], None), ([16, 32, 48, 64, 80, 96, 112, 0], None), ([3, 0, 16, 32, 48, 64, 80, 98, 112], [2, 0, 0, 2, 0])], [([5, 17, 32, 48, 64, 80, 96, 114], [0, 0, 0, 23, 1]), ([4, 16, 35, 48, 66, 80, 97, 114], [1, 2, 3, 6, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([16, 32, 48, 64, 80, 96, 112, 0], None), ([3, 0, 16, 32, 48, 64, 80, 98, 112], [2, 0, 0, 2, 0])], [([4, 16, 35, 48, 66, 80, 97, 114], [1, 2, 3, 6, 1]), ([10, 16, 47, 48, 78, 81, 97, 117], [17, 30, 15, 12, 2]), ([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0])], [([7, 17, 43, 51, 75, 83, 103, 113], [0, 0, 0, 1, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([8, 17, 43, 51, 75, 83, 97, 114], [2, 0, 0, 1, 1]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0]), ([4, 17, 40, 51, 66, 82, 108, 118], [12, 34, 56, 22, 3]), ([8, 17, 43, 51, 75, 83, 103, 115], [0, 0, 0, 1, 1])], [([0, 16, 32, 48, 64, 80, 96, 112], [0, 0, 0, 2, 0]), ([12, 17, 43, 51, 75, 83, 103, 119], [0, 0, 0, 0, 3]), ([7, 16, 38, 48, 69, 80, 96, 115], [16, 5, 6, 9, 1]), ([13, 17, 43, 51, 64, 80, 99, 117], [19, 1, 0, 1, 2]), ([6, 17, 43, 51, 75, 83, 102, 113], [23, 0, 0, 0, 0]), ([4, 17, 40, 51, 66, 82, 108, 118], [12, 34, 56, 22, 3]), ([8, 17, 43, 51, 75, 83, 103, 115], [0, 0, 0, 1, 1]), ([9, 16, 41, 48, 73, 80, 105, 112], [9, 9, 9, 11, 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-mtc-quarter-frames-frame-nibble-order","generated_at":"2026-09-29T14:50:06.349222+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 frame count treats piece 0 as the high nibble and piece 1 as the low nibble.","sha256":"029748569570ccca0bf98b1741bc6ef6259770391b61a0ab3aa6c61be6e9301b","title":"MIDI Time Code quarter-frame assembly: frame count nibbles swapped · 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":42.44,"exit_code":1,"observations":[{"actual":[0,0,0,2,0],"check":"oracle 0","expected":[0,0,0,2,0],"passed":true},{"actual":[0,0,0,15,1],"check":"oracle 1","expected":[0,0,0,23,1],"passed":false},{"actual":[17,30,15,12,2],"check":"oracle 2","expected":[17,30,15,12,2],"passed":true},{"actual":[20,0,0,2,3],"check":"oracle 3","expected":[20,0,0,2,3],"passed":true},{"actual":[1,59,59,10,1],"check":"oracle 4","expected":[2,0,0,1,1],"passed":false},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":[2,0,0,2,0],"check":"oracle 7","expected":[2,0,0,2,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 0, 0, 2, 0], \"expected\": [0, 0, 0, 2, 0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [0, 0, 0, 15, 1], \"expected\": [0, 0, 0, 23, 1], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [17, 30, 15, 12, 2], \"expected\": [17, 30, 15, 12, 2], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [20, 0, 0, 2, 3], \"expected\": [20, 0, 0, 2, 3], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [1, 59, 59, 10, 1], \"expected\": [2, 0, 0, 1, 1], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [2, 0, 0, 2, 0], \"expected\": [2, 0, 0, 2, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.877,"exit_code":1,"observations":[{"actual":[0,0,0,2,0],"check":"oracle 0","expected":[0,0,0,2,0],"passed":true},{"actual":[0,0,3,8,1],"check":"oracle 1","expected":[0,0,0,23,1],"passed":false},{"actual":[17,30,20,12,2],"check":"oracle 2","expected":[17,30,15,12,2],"passed":false},{"actual":[20,0,0,2,3],"check":"oracle 3","expected":[20,0,0,2,3],"passed":true},{"actual":[2,0,4,6,1],"check":"oracle 4","expected":[2,0,0,1,1],"passed":false},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":[2,0,0,2,0],"check":"oracle 7","expected":[2,0,0,2,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 0, 0, 2, 0], \"expected\": [0, 0, 0, 2, 0], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [0, 0, 3, 8, 1], \"expected\": [0, 0, 0, 23, 1], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [17, 30, 20, 12, 2], \"expected\": [17, 30, 15, 12, 2], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [20, 0, 0, 2, 3], \"expected\": [20, 0, 0, 2, 3], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [2, 0, 4, 6, 1], \"expected\": [2, 0, 0, 1, 1], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": [2, 0, 0, 2, 0], \"expected\": [2, 0, 0, 2, 0], \"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."}}