{"abstract":"A concert C for Bb clarinet is written as Bb instead of D: the written part moves the same way as the sounding pitch.","category":"Music interval and transposition theory","checks":8,"contract":"Input [instrument, pitch, direction]. Each instrument has a stipulated sounding offset in semitones (concert = written + offset): Bb clarinet -2, A clarinet -3, F horn -7, Eb alto sax -9, Bb tenor sax -14, Eb baritone sax -21, guitar -12, piccolo +12, D trumpet +2, flute 0. direction to_concert adds the offset, to_written subtracts it. pitch and result must be MIDI 0..127; otherwise, or for unknown instrument or direction, return None.","contract_signature":"x","evaluation_group":"w2-music-interval-transposing-instrument","failed_approach":"Subtracting the magnitude of the offset works for downward-sounding instruments but writes piccolo and D trumpet parts in the wrong direction.","family":"w2-music-interval-transposing-instrument-written-direction","id":"FA-81116","implementations":{"attempt":{"sha256":"c23f326d3c913e180d3816a83b8c1620510eda642f71f3c74fe8b084d3c89973","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    table = {'Bb clarinet': -2, 'A clarinet': -3, 'F horn': -7, 'Eb alto sax': -9, 'Bb tenor sax': -14, 'Eb baritone sax': -21, 'guitar': -12, 'piccolo': 12, 'D trumpet': 2, 'flute': 0}\n    if not isinstance(x, list) or len(x) != 3:\n        return None\n    inst, pitch, direction = x\n    if inst not in table or not isinstance(pitch, int) or not 0 <= pitch <= 127:\n        return None\n    if direction == 'to_concert':\n        out = pitch + table[inst]\n    elif direction == 'to_written':\n        out = pitch - abs(table[inst])\n    else:\n        return None\n    if out < 0 or out > 127:\n        return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['Bb clarinet', 62, 'to_concert'], 60), (['Bb clarinet', 60, 'to_written'], 62), (['F horn', 67, 'to_concert'], 60), (['Eb alto sax', 69, 'to_concert'], 60), (['Eb alto sax', 60, 'to_written'], 69), (['Bb tenor sax', 74, 'to_concert'], 60), (['Bb tenor sax', 60, 'to_written'], 74), (['piccolo', 60, 'to_concert'], 72)], [(['F horn', 60, 'to_written'], 67), (['Bb tenor sax', 74, 'to_concert'], 60), (['Bb tenor sax', 60, 'to_written'], 74), (['piccolo', 60, 'to_concert'], 72), (['D trumpet', 60, 'to_concert'], 62), (['guitar', 64, 'to_concert'], 52), (['flute', 60, 'to_concert'], 60), (['Bb clarinet', 127, 'to_written'], None)], [(['Eb alto sax', 60, 'to_written'], 69), (['piccolo', 72, 'to_written'], 60), (['guitar', 64, 'to_concert'], 52), (['flute', 60, 'to_concert'], 60), (['flute', 60, 'to_written'], 60), (['flute', 127, 'to_concert'], 127), (['piccolo', 115, 'to_concert'], 127), (['A clarinet', 60, 'to_written'], 63)], [(['Bb tenor sax', 60, 'to_written'], 74), (['D trumpet', 62, 'to_written'], 60), (['flute', 127, 'to_concert'], 127), (['piccolo', 115, 'to_concert'], 127), (['Eb baritone sax', 10, 'to_concert'], None), (['piccolo', 120, 'to_concert'], None), (['Bb clarinet', 1, 'to_concert'], None), (['F horn', 126, 'to_written'], None)], [(['Bb clarinet', 60, 'to_written'], 62), (['piccolo', 72, 'to_written'], 60), (['piccolo', 120, 'to_concert'], None), (['Bb clarinet', 1, 'to_concert'], None), (['Bb clarinet', 127, 'to_written'], None), (['Bb clarinet', 128, 'to_concert'], None), (['Bb clarinet', -1, 'to_written'], None), (['oboe', 60, 'to_concert'], None)]]\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":"26f44634027d155a6807b010f7ba68b66fef3969e3cc92fb7ceb4e5c654f2ff1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    table = {'Bb clarinet': -2, 'A clarinet': -3, 'F horn': -7, 'Eb alto sax': -9, 'Bb tenor sax': -14, 'Eb baritone sax': -21, 'guitar': -12, 'piccolo': 12, 'D trumpet': 2, 'flute': 0}\n    if not isinstance(x, list) or len(x) != 3:\n        return None\n    inst, pitch, direction = x\n    if inst not in table or not isinstance(pitch, int) or not 0 <= pitch <= 127:\n        return None\n    if direction == 'to_concert':\n        out = pitch + table[inst]\n    elif direction == 'to_written':\n        out = pitch + table[inst]\n    else:\n        return None\n    if out < 0 or out > 127:\n        return None\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[(['Bb clarinet', 62, 'to_concert'], 60), (['Bb clarinet', 60, 'to_written'], 62), (['F horn', 67, 'to_concert'], 60), (['Eb alto sax', 69, 'to_concert'], 60), (['Eb alto sax', 60, 'to_written'], 69), (['Bb tenor sax', 74, 'to_concert'], 60), (['Bb tenor sax', 60, 'to_written'], 74), (['piccolo', 60, 'to_concert'], 72)], [(['F horn', 60, 'to_written'], 67), (['Bb tenor sax', 74, 'to_concert'], 60), (['Bb tenor sax', 60, 'to_written'], 74), (['piccolo', 60, 'to_concert'], 72), (['D trumpet', 60, 'to_concert'], 62), (['guitar', 64, 'to_concert'], 52), (['flute', 60, 'to_concert'], 60), (['Bb clarinet', 127, 'to_written'], None)], [(['Eb alto sax', 60, 'to_written'], 69), (['piccolo', 72, 'to_written'], 60), (['guitar', 64, 'to_concert'], 52), (['flute', 60, 'to_concert'], 60), (['flute', 60, 'to_written'], 60), (['flute', 127, 'to_concert'], 127), (['piccolo', 115, 'to_concert'], 127), (['A clarinet', 60, 'to_written'], 63)], [(['Bb tenor sax', 60, 'to_written'], 74), (['D trumpet', 62, 'to_written'], 60), (['flute', 127, 'to_concert'], 127), (['piccolo', 115, 'to_concert'], 127), (['Eb baritone sax', 10, 'to_concert'], None), (['piccolo', 120, 'to_concert'], None), (['Bb clarinet', 1, 'to_concert'], None), (['F horn', 126, 'to_written'], None)], [(['Bb clarinet', 60, 'to_written'], 62), (['piccolo', 72, 'to_written'], 60), (['piccolo', 120, 'to_concert'], None), (['Bb clarinet', 1, 'to_concert'], None), (['Bb clarinet', 127, 'to_written'], None), (['Bb clarinet', 128, 'to_concert'], None), (['Bb clarinet', -1, 'to_written'], None), (['oboe', 60, 'to_concert'], None)]]\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 music notation or theory engine. 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-music-interval-transposing-instrument-written-direction","generated_at":"2026-09-29T14:49:59.962780+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Score and part generators convert between written and sounding pitch for every transposing instrument.","root_cause":"The to_written branch adds the sounding offset instead of subtracting it.","sha256":"ddefa3fceb1b4fe74416273248da14164189627677863551561e9f2042933c90","title":"Transposing instrument written and concert pitch: written part transposed toward concert pitch · 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":38.977,"exit_code":1,"observations":[{"actual":60,"check":"oracle 0","expected":60,"passed":true},{"actual":58,"check":"oracle 1","expected":62,"passed":false},{"actual":60,"check":"oracle 2","expected":60,"passed":true},{"actual":60,"check":"oracle 3","expected":60,"passed":true},{"actual":51,"check":"oracle 4","expected":69,"passed":false},{"actual":60,"check":"oracle 5","expected":60,"passed":true},{"actual":46,"check":"oracle 6","expected":74,"passed":false},{"actual":72,"check":"oracle 7","expected":72,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 58, \"expected\": 62, \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": 51, \"expected\": 69, \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 46, \"expected\": 74, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": 72, \"expected\": 72, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.867,"exit_code":1,"observations":[{"actual":60,"check":"oracle 0","expected":60,"passed":true},{"actual":58,"check":"oracle 1","expected":62,"passed":false},{"actual":60,"check":"oracle 2","expected":60,"passed":true},{"actual":60,"check":"oracle 3","expected":60,"passed":true},{"actual":51,"check":"oracle 4","expected":69,"passed":false},{"actual":60,"check":"oracle 5","expected":60,"passed":true},{"actual":46,"check":"oracle 6","expected":74,"passed":false},{"actual":72,"check":"oracle 7","expected":72,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"oracle 0\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 1\", \"actual\": 58, \"expected\": 62, \"passed\": false}, {\"check\": \"oracle 2\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 3\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 4\", \"actual\": 51, \"expected\": 69, \"passed\": false}, {\"check\": \"oracle 5\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"oracle 6\", \"actual\": 46, \"expected\": 74, \"passed\": false}, {\"check\": \"oracle 7\", \"actual\": 72, \"expected\": 72, \"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."}}