{"abstract":"Some swung notes land one tick later than the stipulated floored position.","category":"MIDI event timing","checks":8,"contract":"Input [ticks, ppq, swing] with even ppq > 0 and swing 50..75 percent. Within each beat, positions in the first half [0, ppq/2) scale linearly onto [0, split) and positions in the second half onto [split, ppq), where split = ppq*swing/100. The remapped position is floored. Invalid parameters return None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-swing-remap","failed_approach":"Taking the ceiling for any fractional part moves every inexact position a tick late.","family":"w2-midi-event-timing-swing-remap-remapped-position-rounding","id":"FA-81571","implementations":{"attempt":{"sha256":"e5bbac675fe012d90543c8e1bd74b34f02cb095dfcbf4fdc44109714bc5013c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 3:\n        return None\n    ticks, ppq, swing = x\n    if ppq <= 0 or ppq % 2 or not 50 <= swing <= 75:\n        return None\n    half = ppq // 2\n    split = Fraction(ppq * swing, 100)\n    out = []\n    for t in ticks:\n        beat, pos = divmod(t, ppq)\n        if pos < half:\n            new = pos * split / half\n        else:\n            new = split + (pos - half) * (ppq - split) / half\n        out.append(beat * ppq + int(new) + (1 if new % 1 else 0))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[120, 360], 480, 60], [144, 384]), ([[960, 1200, 1320], 480, 75], [960, 1320, 1380]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[0, 240], 480, 49], None), ([[0, 240], 480, 76], None)], [([[240, 300, 479], 480, 66], [316, 357, 479]), ([[0, 60], 120, 58], [0, 69]), ([[0, 240], 480, 49], None), ([[0, 240], 480, 76], None), ([[0, 240], 481, 60], None), ([[100, 300], 480, 55], [110, 318]), ([[90], 120, 62], [97]), ([[250, 470], 480, 50], [250, 470])], [([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[240, 300, 479], 480, 66], [316, 357, 479]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[100, 300], 480, 55], [110, 318]), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[250, 470], 480, 50], [250, 470])], [([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[240, 300, 479], 480, 66], [316, 357, 479]), ([[120, 360], 480, 60], [144, 384]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[30, 100], 120, 67], [40, 106])], [([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[120, 360], 480, 60], [144, 384]), ([[960, 1200, 1320], 480, 75], [960, 1320, 1380]), ([[0, 240], 480, 49], None), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[30, 100], 120, 67], [40, 106])]]\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":"8f6d87bd7cdd8591095cabc63f3d220c606eb69de3710cce1d9d7c4cb61a4943","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    if not isinstance(x, list) or len(x) != 3:\n        return None\n    ticks, ppq, swing = x\n    if ppq <= 0 or ppq % 2 or not 50 <= swing <= 75:\n        return None\n    half = ppq // 2\n    split = Fraction(ppq * swing, 100)\n    out = []\n    for t in ticks:\n        beat, pos = divmod(t, ppq)\n        if pos < half:\n            new = pos * split / half\n        else:\n            new = split + (pos - half) * (ppq - split) / half\n        out.append(beat * ppq + round(new))\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[120, 360], 480, 60], [144, 384]), ([[960, 1200, 1320], 480, 75], [960, 1320, 1380]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[0, 240], 480, 49], None), ([[0, 240], 480, 76], None)], [([[240, 300, 479], 480, 66], [316, 357, 479]), ([[0, 60], 120, 58], [0, 69]), ([[0, 240], 480, 49], None), ([[0, 240], 480, 76], None), ([[0, 240], 481, 60], None), ([[100, 300], 480, 55], [110, 318]), ([[90], 120, 62], [97]), ([[250, 470], 480, 50], [250, 470])], [([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[240, 300, 479], 480, 66], [316, 357, 479]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[100, 300], 480, 55], [110, 318]), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[250, 470], 480, 50], [250, 470])], [([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[240, 300, 479], 480, 66], [316, 357, 479]), ([[120, 360], 480, 60], [144, 384]), ([[1, 239, 241], 480, 70], [1, 334, 336]), ([[0, 60], 120, 58], [0, 69]), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[30, 100], 120, 67], [40, 106])], [([[0, 240, 480, 720], 480, 50], [0, 240, 480, 720]), ([[0, 240, 480, 720], 480, 66], [0, 316, 480, 796]), ([[120, 360], 480, 60], [144, 384]), ([[960, 1200, 1320], 480, 75], [960, 1320, 1380]), ([[0, 240], 480, 49], None), ([[90], 120, 62], [97]), ([[5, 55], 100, 64], [6, 67]), ([[30, 100], 120, 67], [40, 106])]]\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-swing-remap-remapped-position-rounding","generated_at":"2026-09-29T14:50:04.355517+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 remapped position is rounded to nearest instead of floored.","sha256":"05b19c53c45a701fe924fd87c15a014b723eca8fe9a45f670afc9e4ec9f79e28","title":"Eighth-note swing time remapping: swung positions rounded to nearest · 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.156,"exit_code":1,"observations":[{"actual":[0,240,480,720],"check":"oracle 0","expected":[0,240,480,720],"passed":true},{"actual":[0,317,480,797],"check":"oracle 1","expected":[0,316,480,796],"passed":false},{"actual":[144,384],"check":"oracle 2","expected":[144,384],"passed":true},{"actual":[960,1320,1380],"check":"oracle 3","expected":[960,1320,1380],"passed":true},{"actual":[2,335,337],"check":"oracle 4","expected":[1,334,336],"passed":false},{"actual":[0,70],"check":"oracle 5","expected":[0,69],"passed":false},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 240, 480, 720], \"expected\": [0, 240, 480, 720], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [0, 317, 480, 797], \"expected\": [0, 316, 480, 796], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [144, 384], \"expected\": [144, 384], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [960, 1320, 1380], \"expected\": [960, 1320, 1380], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [2, 335, 337], \"expected\": [1, 334, 336], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [0, 70], \"expected\": [0, 69], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.09,"exit_code":1,"observations":[{"actual":[0,240,480,720],"check":"oracle 0","expected":[0,240,480,720],"passed":true},{"actual":[0,317,480,797],"check":"oracle 1","expected":[0,316,480,796],"passed":false},{"actual":[144,384],"check":"oracle 2","expected":[144,384],"passed":true},{"actual":[960,1320,1380],"check":"oracle 3","expected":[960,1320,1380],"passed":true},{"actual":[1,335,337],"check":"oracle 4","expected":[1,334,336],"passed":false},{"actual":[0,70],"check":"oracle 5","expected":[0,69],"passed":false},{"actual":null,"check":"oracle 6","expected":null,"passed":true},{"actual":null,"check":"oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": [0, 240, 480, 720], \"expected\": [0, 240, 480, 720], \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": [0, 317, 480, 797], \"expected\": [0, 316, 480, 796], \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": [144, 384], \"expected\": [144, 384], \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": [960, 1320, 1380], \"expected\": [960, 1320, 1380], \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": [1, 335, 337], \"expected\": [1, 334, 336], \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": [0, 70], \"expected\": [0, 69], \"passed\": false}, {\"check\": \"oracle 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"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."}}