FAILURE MAP
← Case archive

FA-81146 / Music interval and transposition theory / Open access

Written key signature for a transposing part: flat keys folded into sharp side · case 01

An F major part with no shift is written with eleven sharps instead of one flat.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The written key is reduced into 0..11 as a pitch class rather than into a signed signature window.

VERIFIED REPAIR

Restore the normalisation window step so that it reads `while r > 6: r -= 12 while r < -5: r += 12`.

Unsuccessful approach: Folding into -6..5 writes F# major (six sharps) as six flats, contradicting the stipulated -5..6 window.

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
    r = r % 12
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 2], 2), ([0, -2], -2), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([3, -3], 6)], [([-3, 2], -1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([-6, 0], 6), ([-7, 0], 5)], [([0, 3], -3), ([-6, 0], 6), ([6, 0], 6), ([7, 0], -5), ([-7, 0], 5), ([0, 0], 0), ([2, -2], 0), ([0, -1], 5)], [([5, 2], -5), ([6, 0], 6), ([0, 1], -5), ([0, -1], 5), ([-2, 9], 1), ([3, -3], 6), ([0, 12], 0), ([8, 0], None)], [([4, 2], 6), ([7, 0], -5), ([3, -3], 6), ([8, 0], None), ([0, '2'], None), ([-5, 7], -4), ([6, 5], 5), ([-8, 0], None)]]
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 fixtureActualExpectedOutcome
oracle 022Passed
oracle 110-2Failed
oracle 233Passed
oracle 39-3Failed
oracle 411Passed
oracle 522Passed
oracle 666Passed
oracle 766Passed

SHA-256 / b84e17ff78fda7f4ddb0f1beb4ebf78a2aaebce7fc9acc8e9614a5ad9eeb0977

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 = concert + move
    r = (r + 6) % 12 - 6
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 2], 2), ([0, -2], -2), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([3, -3], 6)], [([-3, 2], -1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([-6, 0], 6), ([-7, 0], 5)], [([0, 3], -3), ([-6, 0], 6), ([6, 0], 6), ([7, 0], -5), ([-7, 0], 5), ([0, 0], 0), ([2, -2], 0), ([0, -1], 5)], [([5, 2], -5), ([6, 0], 6), ([0, 1], -5), ([0, -1], 5), ([-2, 9], 1), ([3, -3], 6), ([0, 12], 0), ([8, 0], None)], [([4, 2], 6), ([7, 0], -5), ([3, -3], 6), ([8, 0], None), ([0, '2'], None), ([-5, 7], -4), ([6, 5], 5), ([-8, 0], None)]]
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 fixtureActualExpectedOutcome
oracle 022Passed
oracle 1-2-2Passed
oracle 233Passed
oracle 3-3-3Passed
oracle 411Passed
oracle 522Passed
oracle 6-66Failed
oracle 7-66Failed

SHA-256 / 63adc95d6b3b0862ed75f6f2395108a8839adb89fd82895d5944ecb453fe92c7

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), ([0, -2], -2), ([0, 9], 3), ([0, 3], -3), ([0, 7], 1), ([0, 14], 2), ([4, 2], 6), ([3, -3], 6)], [([-3, 2], -1), ([0, 14], 2), ([1, 2], 3), ([-1, 2], 1), ([4, 2], 6), ([5, 2], -5), ([-6, 0], 6), ([-7, 0], 5)], [([0, 3], -3), ([-6, 0], 6), ([6, 0], 6), ([7, 0], -5), ([-7, 0], 5), ([0, 0], 0), ([2, -2], 0), ([0, -1], 5)], [([5, 2], -5), ([6, 0], 6), ([0, 1], -5), ([0, -1], 5), ([-2, 9], 1), ([3, -3], 6), ([0, 12], 0), ([8, 0], None)], [([4, 2], 6), ([7, 0], -5), ([3, -3], 6), ([8, 0], None), ([0, '2'], None), ([-5, 7], -4), ([6, 5], 5), ([-8, 0], None)]]
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 fixtureActualExpectedOutcome
oracle 022Passed
oracle 1-2-2Passed
oracle 233Passed
oracle 3-3-3Passed
oracle 411Passed
oracle 522Passed
oracle 666Passed
oracle 766Passed

SHA-256 / e0d903220354f37d9fece77e895d4f7824bd07f47a8130a7ed37d843914b91ac

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.464096+00:00.

Case digest / 2be756c379e6654688fd72aec6887112f63389adf887cc35c48d97e408c6748b