{"abstract":"Converting 480 ppq to 96 ppq multiplies ticks by five instead of dividing.","category":"MIDI event timing","checks":8,"contract":"Input [events, source_ppq, target_ppq] with events [tick, kind, note] in time order. Each tick maps to tick*target/source rounded half up. A note-off (matched FIFO to the earliest open note-on of the same note) whose original length was positive but whose converted tick is not after its note-on is moved to note-on + 1. Invalid resolutions return None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-ppq-rescale","failed_approach":"Using the target resolution as the rounding bias skews every rounded tick.","family":"w2-midi-event-timing-ppq-rescale-conversion-direction","id":"FA-81706","implementations":{"attempt":{"sha256":"73e1cd7d625c389f5d7b262cd87280da2571d8a31495aa05621b9c43acaf171a","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) != 3:\n        return None\n    events, src, dst = x\n    if src <= 0 or dst <= 0:\n        return None\n    out = []\n    open_on = {}\n    for tick, kind, note in events:\n        t = (2 * tick * dst + dst) // (2 * src)\n        if kind == 'on':\n            open_on.setdefault(note, []).append((tick, t))\n        elif open_on.get(note):\n            otick, ot = open_on[note].pop(0)\n            if tick > otick and t <= ot:\n                t = ot + 1\n        out.append([t, kind, note])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[[0, 'on', 60], [480, 'off', 60]], 480, 96], [[0, 'on', 60], [96, 'off', 60]]), ([[[0, 'on', 60], [1, 'off', 60]], 480, 96], [[0, 'on', 60], [1, 'off', 60]]), ([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [0, 'off', 60]], 480, 96], [[0, 'on', 60], [0, 'off', 60]]), ([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60]], 0, 96], None)], [([[[0, 'on', 60], [1, 'off', 60]], 480, 96], [[0, 'on', 60], [1, 'off', 60]]), ([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]])], [([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]]), ([[[0, 'on', 60], [5, 'on', 60], [6, 'off', 60], [40, 'off', 60]], 10, 1], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [4, 'off', 60]]), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]])], [([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]]), ([[[0, 'on', 60], [5, 'on', 60], [6, 'off', 60], [40, 'off', 60]], 10, 1], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [4, 'off', 60]]), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]]), ([[[3, 'on', 64], [5, 'off', 64]], 6, 4], [[2, 'on', 64], [3, 'off', 64]]), ([[[0, 'on', 60], [1, 'on', 60], [2, 'off', 60], [3, 'off', 60]], 10, 1], [[0, 'on', 60], [0, 'on', 60], [1, 'off', 60], [1, 'off', 60]])], [([[[0, 'on', 60], [480, 'off', 60]], 480, 96], [[0, 'on', 60], [96, 'off', 60]]), ([[[0, 'on', 60], [0, 'off', 60]], 480, 96], [[0, 'on', 60], [0, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60]], 0, 96], None), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]]), ([[[3, 'on', 64], [5, 'off', 64]], 6, 4], [[2, 'on', 64], [3, 'off', 64]]), ([[[0, 'on', 60], [1, 'on', 60], [2, 'off', 60], [3, 'off', 60]], 10, 1], [[0, 'on', 60], [0, 'on', 60], [1, 'off', 60], [1, '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":"7766d3e4814321e6266b764f439306da143d4984ae463bb63d21232632276d31","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) != 3:\n        return None\n    events, src, dst = x\n    if src <= 0 or dst <= 0:\n        return None\n    out = []\n    open_on = {}\n    for tick, kind, note in events:\n        t = (2 * tick * src + dst) // (2 * dst)\n        if kind == 'on':\n            open_on.setdefault(note, []).append((tick, t))\n        elif open_on.get(note):\n            otick, ot = open_on[note].pop(0)\n            if tick > otick and t <= ot:\n                t = ot + 1\n        out.append([t, kind, note])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[[0, 'on', 60], [480, 'off', 60]], 480, 96], [[0, 'on', 60], [96, 'off', 60]]), ([[[0, 'on', 60], [1, 'off', 60]], 480, 96], [[0, 'on', 60], [1, 'off', 60]]), ([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [0, 'off', 60]], 480, 96], [[0, 'on', 60], [0, 'off', 60]]), ([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60]], 0, 96], None)], [([[[0, 'on', 60], [1, 'off', 60]], 480, 96], [[0, 'on', 60], [1, 'off', 60]]), ([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]])], [([[[1, 'on', 60], [3, 'off', 60]], 2, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]]), ([[[0, 'on', 60], [5, 'on', 60], [6, 'off', 60], [40, 'off', 60]], 10, 1], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [4, 'off', 60]]), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]])], [([[[5, 'on', 60], [7, 'off', 60]], 10, 1], [[1, 'on', 60], [2, 'off', 60]]), ([[[3, 'on', 60]], 2, 1], [[2, 'on', 60]]), ([[[0, 'on', 60], [100, 'off', 60]], 96, 480], [[0, 'on', 60], [500, 'off', 60]]), ([[[7, 'on', 62], [250, 'off', 62]], 480, 96], [[1, 'on', 62], [50, 'off', 62]]), ([[[0, 'on', 60], [5, 'on', 60], [6, 'off', 60], [40, 'off', 60]], 10, 1], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [4, 'off', 60]]), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]]), ([[[3, 'on', 64], [5, 'off', 64]], 6, 4], [[2, 'on', 64], [3, 'off', 64]]), ([[[0, 'on', 60], [1, 'on', 60], [2, 'off', 60], [3, 'off', 60]], 10, 1], [[0, 'on', 60], [0, 'on', 60], [1, 'off', 60], [1, 'off', 60]])], [([[[0, 'on', 60], [480, 'off', 60]], 480, 96], [[0, 'on', 60], [96, 'off', 60]]), ([[[0, 'on', 60], [0, 'off', 60]], 480, 96], [[0, 'on', 60], [0, 'off', 60]]), ([[[1, 'on', 60]], 2, 1], [[1, 'on', 60]]), ([[[0, 'on', 60], [2, 'on', 60], [3, 'off', 60], [9, 'off', 60]], 8, 2], [[0, 'on', 60], [1, 'on', 60], [1, 'off', 60], [2, 'off', 60]]), ([[[0, 'on', 60]], 0, 96], None), ([[[12, 'on', 61], [13, 'off', 61]], 24, 1], [[1, 'on', 61], [2, 'off', 61]]), ([[[3, 'on', 64], [5, 'off', 64]], 6, 4], [[2, 'on', 64], [3, 'off', 64]]), ([[[0, 'on', 60], [1, 'on', 60], [2, 'off', 60], [3, 'off', 60]], 10, 1], [[0, 'on', 60], [0, 'on', 60], [1, 'off', 60], [1, '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-ppq-rescale-conversion-direction","generated_at":"2026-09-29T14:50:05.553286+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 scale factor uses source/target instead of target/source.","sha256":"1e2234d59ddac3fde18204576627141ca6e26739d592e7b6d318199ab19a1e21","title":"Tick resolution conversion preserving note length: ratio applied upside down · 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.937,"exit_code":1,"observations":[{"actual":[[0,"on",60],[96,"off",60]],"check":"oracle 0","expected":[[0,"on",60],[96,"off",60]],"passed":true},{"actual":[[0,"on",60],[1,"off",60]],"check":"oracle 1","expected":[[0,"on",60],[1,"off",60]],"passed":true},{"actual":[[0,"on",60],[1,"off",60]],"check":"oracle 2","expected":[[1,"on",60],[2,"off",60]],"passed":false},{"actual":[[0,"on",60],[0,"off",60]],"check":"oracle 3","expected":[[0,"on",60],[0,"off",60]],"passed":true},{"actual":[[0,"on",60],[1,"off",60]],"check":"oracle 4","expected":[[1,"on",60],[2,"off",60]],"passed":false},{"actual":[[0,"on",60]],"check":"oracle 5","expected":[[1,"on",60]],"passed":false},{"actual":[[1,"on",60]],"check":"oracle 6","expected":[[2,"on",60]],"passed":false},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, \"on\", 60], [96, \"off\", 60]], \"expected\": [[0, \"on\", 60], [96, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [[0, \"on\", 60], [1, \"off\", 60]], \"expected\": [[0, \"on\", 60], [1, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": [[0, \"on\", 60], [1, \"off\", 60]], \"expected\": [[1, \"on\", 60], [2, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [[0, \"on\", 60], [0, \"off\", 60]], \"expected\": [[0, \"on\", 60], [0, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[0, \"on\", 60], [1, \"off\", 60]], \"expected\": [[1, \"on\", 60], [2, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [[0, \"on\", 60]], \"expected\": [[1, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [[1, \"on\", 60]], \"expected\": [[2, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.691,"exit_code":1,"observations":[{"actual":[[0,"on",60],[2400,"off",60]],"check":"oracle 0","expected":[[0,"on",60],[96,"off",60]],"passed":false},{"actual":[[0,"on",60],[5,"off",60]],"check":"oracle 1","expected":[[0,"on",60],[1,"off",60]],"passed":false},{"actual":[[2,"on",60],[6,"off",60]],"check":"oracle 2","expected":[[1,"on",60],[2,"off",60]],"passed":false},{"actual":[[0,"on",60],[0,"off",60]],"check":"oracle 3","expected":[[0,"on",60],[0,"off",60]],"passed":true},{"actual":[[50,"on",60],[70,"off",60]],"check":"oracle 4","expected":[[1,"on",60],[2,"off",60]],"passed":false},{"actual":[[2,"on",60]],"check":"oracle 5","expected":[[1,"on",60]],"passed":false},{"actual":[[6,"on",60]],"check":"oracle 6","expected":[[2,"on",60]],"passed":false},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [[0, \"on\", 60], [2400, \"off\", 60]], \"expected\": [[0, \"on\", 60], [96, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 1\", \"actual\": [[0, \"on\", 60], [5, \"off\", 60]], \"expected\": [[0, \"on\", 60], [1, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [[2, \"on\", 60], [6, \"off\", 60]], \"expected\": [[1, \"on\", 60], [2, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": [[0, \"on\", 60], [0, \"off\", 60]], \"expected\": [[0, \"on\", 60], [0, \"off\", 60]], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [[50, \"on\", 60], [70, \"off\", 60]], \"expected\": [[1, \"on\", 60], [2, \"off\", 60]], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [[2, \"on\", 60]], \"expected\": [[1, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": [[6, \"on\", 60]], \"expected\": [[2, \"on\", 60]], \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"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."}}