FA-81151 / Music interval and transposition theory / Open access
Written key signature for a transposing part: written key moved toward concert pitch · case 01
A Bb clarinet part (written a whole step up) for C major is given two flats instead of two sharps.
ROOT CAUSE
The fifths movement is subtracted from the concert signature, transposing the key the way the instrument sounds rather than the way it is written.
VERIFIED REPAIR
Restore the shift direction step so that it reads `r = concert + move`.
Unsuccessful approach: Subtracting the concert signature from the movement also flips the sign of the concert key itself.
Case contract
Input [concert_fifths, written_semitones_above_concert] with concert_fifths -7..7 and an integer semitone shift. The key moves by (7 * shift) mod 12 fifths; the written signature is concert_fifths plus that move, then normalised into -5..6 by adding or subtracting 12 (so six flats is written as six sharps). Invalid input returns None.
Why this case matters
Part extraction must print a transposed key signature consistent with the transposed notes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
if not isinstance(x, list) or len(x) != 2:
return None
concert, shift = x
if not isinstance(concert, int) or not isinstance(shift, int) or concert < -7 or concert > 7:
return None
move = (7 * shift) % 12
r = concert - move
while r > 6:
r -= 12
while r < -5:
r += 12
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 2], 2), ([-3, 2], -1), ([4, 2], 6), ([-6, 0], 6), ([6, 0], 6), ([0, 0], 0), ([0, 12], 0), ([8, 0], None)], [([0, -2], -2), ([0, 9], 3), ([1, 2], 3), ([5, 2], -5), ([0, 12], 0), ([8, 0], None), ([0, '2'], None), ([-8, 0], None)], [([0, 2], 2), ([0, -2], -2), ([-3, 2], -1), ([0, 3], -3), ([-1, 2], 1), ([7, 0], -5), ([-8, 0], None), ([-9, 2], None)], [([0, -2], -2), ([-3, 2], -1), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([-7, 0], 5)], [([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([2, -2], 0)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | -2 | 2 | Failed |
| oracle 1 | -5 | -1 | Failed |
| oracle 2 | 2 | 6 | Failed |
| oracle 3 | 6 | 6 | Passed |
| oracle 4 | 6 | 6 | Passed |
| oracle 5 | 0 | 0 | Passed |
| oracle 6 | 0 | 0 | Passed |
| oracle 7 | None | None | Passed |
SHA-256 / bf43a66756e902abf6838d2d4566b6cef2f670d874679b9847f534eafcd06348
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
if not isinstance(x, list) or len(x) != 2:
return None
concert, shift = x
if not isinstance(concert, int) or not isinstance(shift, int) or concert < -7 or concert > 7:
return None
move = (7 * shift) % 12
r = move - concert
while r > 6:
r -= 12
while r < -5:
r += 12
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 2], 2), ([-3, 2], -1), ([4, 2], 6), ([-6, 0], 6), ([6, 0], 6), ([0, 0], 0), ([0, 12], 0), ([8, 0], None)], [([0, -2], -2), ([0, 9], 3), ([1, 2], 3), ([5, 2], -5), ([0, 12], 0), ([8, 0], None), ([0, '2'], None), ([-8, 0], None)], [([0, 2], 2), ([0, -2], -2), ([-3, 2], -1), ([0, 3], -3), ([-1, 2], 1), ([7, 0], -5), ([-8, 0], None), ([-9, 2], None)], [([0, -2], -2), ([-3, 2], -1), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([-7, 0], 5)], [([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([2, -2], 0)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | 2 | 2 | Passed |
| oracle 1 | 5 | -1 | Failed |
| oracle 2 | -2 | 6 | Failed |
| oracle 3 | 6 | 6 | Passed |
| oracle 4 | 6 | 6 | Passed |
| oracle 5 | 0 | 0 | Passed |
| oracle 6 | 0 | 0 | Passed |
| oracle 7 | None | None | Passed |
SHA-256 / dc257703c73467975728fb631c55fc47cd804f8c88c4917d39403c2429ac395d
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
if not isinstance(x, list) or len(x) != 2:
return None
concert, shift = x
if not isinstance(concert, int) or not isinstance(shift, int) or concert < -7 or concert > 7:
return None
move = (7 * shift) % 12
r = concert + move
while r > 6:
r -= 12
while r < -5:
r += 12
return r
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 2], 2), ([-3, 2], -1), ([4, 2], 6), ([-6, 0], 6), ([6, 0], 6), ([0, 0], 0), ([0, 12], 0), ([8, 0], None)], [([0, -2], -2), ([0, 9], 3), ([1, 2], 3), ([5, 2], -5), ([0, 12], 0), ([8, 0], None), ([0, '2'], None), ([-8, 0], None)], [([0, 2], 2), ([0, -2], -2), ([-3, 2], -1), ([0, 3], -3), ([-1, 2], 1), ([7, 0], -5), ([-8, 0], None), ([-9, 2], None)], [([0, -2], -2), ([-3, 2], -1), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([-7, 0], 5)], [([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([2, -2], 0)]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("oracle %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | 2 | 2 | Passed |
| oracle 1 | -1 | -1 | Passed |
| oracle 2 | 6 | 6 | Passed |
| oracle 3 | 6 | 6 | Passed |
| oracle 4 | 6 | 6 | Passed |
| oracle 5 | 0 | 0 | Passed |
| oracle 6 | 0 | 0 | Passed |
| oracle 7 | None | None | Passed |
SHA-256 / d9b9585fdb3ec88f72bb0ed57d7c25c8f8b68e697c962a63f5a594c69970bdde
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:00.508491+00:00.
Case digest / 7c09a4a74a10a723cd8608026300757d40ff6d6600533834a63165afe1673978