{"abstract":"The neutral bend (lsb 0, msb 64) reports a nonzero offset instead of exactly 0 cents at wide ranges.","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":"Using 0x4000 (16384) puts the centre at the top of the range, so neutral reads as a full downward bend.","family":"w2-midi-event-timing-pitch-bend-cents-centre-value","id":"FA-81641","implementations":{"attempt":{"sha256":"8303014fc83b74ca6e396f3013a873ca42d38f58785437c29c09109f734ac11f","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 - 0x4000\n    den = 8191 if offset > 0 else 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, 96, 2], 100), ([0, 56, 1], -13), ([0, 40, 1], -38), ([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None)], [([0, 64, 2], 0), ([127, 127, 2], 200), ([0, 0, 2], -200), ([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([0, 24, 1], -63), ([0, 56, 3], -38)], [([0, 0, 2], -200), ([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, 96, 2], 100), ([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([0, 0, 48], -4800)], [([0, 32, 2], -100), ([0, 40, 1], -38), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([127, 127, 12], 1200), ([127, 127, 48], 4800), ([100, 127, 48], 4784)]]\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":"e31e3d75748b1ac6d77e910bc4c3c650817dc9870a88f736ab2f64c697d1b050","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 - 8191\n    den = 8191 if offset > 0 else 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, 96, 2], 100), ([0, 56, 1], -13), ([0, 40, 1], -38), ([0, 128, 2], None), ([128, 64, 2], None), ([0, 64, -1], None)], [([0, 64, 2], 0), ([127, 127, 2], 200), ([0, 0, 2], -200), ([0, 96, 2], 100), ([0, 32, 2], -100), ([0, 56, 1], -13), ([0, 24, 1], -63), ([0, 56, 3], -38)], [([0, 0, 2], -200), ([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, 96, 2], 100), ([0, 24, 1], -63), ([0, 40, 1], -38), ([1, 64, 2], 0), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([0, 0, 48], -4800)], [([0, 32, 2], -100), ([0, 40, 1], -38), ([127, 63, 2], 0), ([0, 72, 12], 150), ([0, 56, 3], -38), ([127, 127, 12], 1200), ([127, 127, 48], 4800), ([100, 127, 48], 4784)]]\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-centre-value","generated_at":"2026-09-29T14:50:05.010121+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 centre is taken as 8191 (the largest positive offset) instead of 8192.","sha256":"fc911b8cfce50ae19887f90d75c6d67f3dd056a747295cfa212f899fa1b2b4bf","title":"14-bit pitch bend to cents: centre position reads as a small upward bend · 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.365,"exit_code":1,"observations":[{"actual":-200,"check":"oracle 0","expected":0,"passed":false},{"actual":0,"check":"oracle 1","expected":200,"passed":false},{"actual":-100,"check":"oracle 2","expected":100,"passed":false},{"actual":-113,"check":"oracle 3","expected":-13,"passed":false},{"actual":-138,"check":"oracle 4","expected":-38,"passed":false},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"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\": -200, \"expected\": 0, \"passed\": false}, {\"check\": \"oracle 1\", \"actual\": 0, \"expected\": 200, \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": -100, \"expected\": 100, \"passed\": false}, {\"check\": \"oracle 3\", \"actual\": -113, \"expected\": -13, \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": -138, \"expected\": -38, \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"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.626,"exit_code":1,"observations":[{"actual":0,"check":"oracle 0","expected":0,"passed":true},{"actual":200,"check":"oracle 1","expected":200,"passed":true},{"actual":100,"check":"oracle 2","expected":100,"passed":true},{"actual":-12,"check":"oracle 3","expected":-13,"passed":false},{"actual":-37,"check":"oracle 4","expected":-38,"passed":false},{"actual":null,"check":"oracle 5","expected":null,"passed":true},{"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, \"expected\": 0, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 200, \"expected\": 200, \"passed\": true}, {\"check\": \"oracle 2\", \"actual\": 100, \"expected\": 100, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": -12, \"expected\": -13, \"passed\": false}, {\"check\": \"oracle 4\", \"actual\": -37, \"expected\": -38, \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"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."}}