{"abstract":"Full upward bend (127, 127) on a 48-semitone MPE range reports 4799 cents instead of exactly 4800.","category":"MIDI event timing","checks":8,"contract":"Input [lsb, msb, range_semitones] with 7-bit data bytes. value = msb*128 + lsb, offset = value - 8192. Positive offsets scale to +range by dividing by 8191, negative ones by 8192. cents = offset * range * 100 / divisor, rounded half away from zero. Invalid bytes or negative range return None.","contract_signature":"x","evaluation_group":"w2-midi-event-timing-pitch-bend-cents","failed_approach":"Dividing negative offsets by 8191 makes full downward bend overshoot the range.","family":"w2-midi-event-timing-pitch-bend-cents-asymmetric-scaling","id":"FA-81646","implementations":{"attempt":{"sha256":"510afda3f261a6c8cce22b5f9f9bd77a89278bcf0ecbf62736a5f9235c35e23d","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    lsb, msb, rng = x\n    if not all(isinstance(v, int) and 0 <= v <= 127 for v in (lsb, msb)) or rng < 0:\n        return None\n    value = (msb << 7) | lsb\n    offset = value - 8192\n    den = 8191\n    c = Fraction(abs(offset) * rng * 100, den)\n    cents = int(c + Fraction(1, 2))\n    return cents if offset >= 0 else -cents\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 64, 2], 0), ([127, 127, 2], 200), ([0, 0, 2], -200), ([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None), ([127, 127, 12], 1200), ([0, 0, 12], -1200), ([64, 100, 2], 114), ([127, 127, 48], 4800), ([0, 0, 48], -4800)]]\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":"7ca004f52803f2a779e726bfbf33d6deeef69095d35f450154909c19a9849d19","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    lsb, msb, rng = x\n    if not all(isinstance(v, int) and 0 <= v <= 127 for v in (lsb, msb)) or rng < 0:\n        return None\n    value = (msb << 7) | lsb\n    offset = value - 8192\n    den = 8192\n    c = Fraction(abs(offset) * rng * 100, den)\n    cents = int(c + Fraction(1, 2))\n    return cents if offset >= 0 else -cents\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([0, 64, 2], 0), ([127, 127, 2], 200), ([0, 0, 2], -200), ([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None), ([127, 127, 48], 4800), ([0, 0, 48], -4800)], [([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None), ([127, 127, 12], 1200), ([0, 0, 12], -1200), ([64, 100, 2], 114), ([127, 127, 48], 4800), ([0, 0, 48], -4800)]]\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-pitch-bend-cents-asymmetric-scaling","generated_at":"2026-09-29T14:50:05.029182+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":"Positive offsets are divided by 8192 although only 8191 steps exist above the centre.","sha256":"0be8fe46622a0630035763656ca42e9262610df84fda5bd704146de34525e12c","title":"14-bit pitch bend to cents: maximum bend falls short of the range · 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":41.56,"exit_code":1,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":200,"check":"oracle 1","expected":200,"passed":true},{"actual":-200,"check":"oracle 2","expected":-200,"passed":true},{"actual":100,"check":"oracle 3","expected":100,"passed":true},{"actual":-100,"check":"oracle 4","expected":-100,"passed":true},{"actual":-13,"check":"oracle 5","expected":-13,"passed":true},{"actual":4800,"check":"oracle 6","expected":4800,"passed":true},{"actual":-4801,"check":"oracle 7","expected":-4800,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 200, \"expected\": 200, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -200, \"expected\": -200, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 100, \"expected\": 100, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": -13, \"expected\": -13, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 4800, \"expected\": 4800, \"passed\": true}, {\"check\": \"oracle 7\", \"actual\": -4801, \"expected\": -4800, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.488,"exit_code":1,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":200,"check":"oracle 1","expected":200,"passed":true},{"actual":-200,"check":"oracle 2","expected":-200,"passed":true},{"actual":100,"check":"oracle 3","expected":100,"passed":true},{"actual":-100,"check":"oracle 4","expected":-100,"passed":true},{"actual":-13,"check":"oracle 5","expected":-13,"passed":true},{"actual":4799,"check":"oracle 6","expected":4800,"passed":false},{"actual":-4800,"check":"oracle 7","expected":-4800,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 200, \"expected\": 200, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": -200, \"expected\": -200, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 100, \"expected\": 100, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": -100, \"expected\": -100, \"passed\": true}, {\"check\": \"oracle 5\", \"actual\": -13, \"expected\": -13, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 4799, \"expected\": 4800, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": -4800, \"expected\": -4800, \"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."}}