FA-81051 / Music interval and transposition theory / Open access
Pitch-class set prime form (right-packed): normal form not transposed to zero · case 01
A major triad on D returns [2,6,9]-shaped values rather than [0,3,7].
ROOT CAUSE
The normal form is reduced mod 12 but never transposed so that its first member is 0.
VERIFIED REPAIR
Restore the transposition to zero step so that it reads `[p - best[1][0] for p in best[1]]`.
Unsuccessful approach: Subtracting the lowest pitch class rather than the first member of the chosen rotation mis-transposes wrapped forms.
Case contract
Input a list of integers. Compute the right-packed normal form of the set and of its inversion (p -> -p mod 12), transpose each to start on 0, and return whichever is more packed: compare the last value, then the penultimate, and so on toward the second (the original wins ties). Empty input returns []; non-integers return None.
Why this case matters
Set-class labelling depends on prime forms being computed identically for every member of a class.
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 not all(isinstance(v, int) for v in x):
return None
def normal(values):
pcs = sorted(set(p % 12 for p in values))
n = len(pcs)
best = None
for r in range(n):
rot = pcs[r:] + [p + 12 for p in pcs[:r]]
key = [rot[-1] - rot[0]] + [rot[j] - rot[0] for j in range(n - 2, 0, -1)]
if best is None or (key, rot[0]) < best[0]:
best = ((key, rot[0]), rot)
return [p % 12 for p in best[1]]
if not x:
return []
a = normal(x)
b = normal([(-p) % 12 for p in x])
ka = [a[-1]] + a[-2:0:-1]
kb = [b[-1]] + b[-2:0:-1]
return a if ka <= kb else b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 4, 8], [0, 4, 8]), ([0, 3, 6, 9], [0, 3, 6, 9]), ([0, 5, 7], [0, 2, 7]), ([], [])], [([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([7, 11, 2, 5], [0, 2, 5, 8])], [([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([10, 1, 5], [0, 3, 7])], [([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([0, 3, 6, 10], [0, 2, 5, 8])], [([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([1, 2, 4, 8], [0, 1, 3, 7]), ([0, 1, 5], [0, 1, 5]), ([7, 11, 2, 5], [0, 2, 5, 8]), ([0, 2, 6, 7], [0, 1, 5, 7])]]
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 | [5, 8, 0] | [0, 3, 7] | Failed |
| oracle 1 | [5, 9, 0] | [0, 3, 7] | Failed |
| oracle 2 | [2, 6, 9] | [0, 3, 7] | Failed |
| oracle 3 | [4, 6, 7, 11, 0] | [0, 1, 5, 6, 8] | Failed |
| oracle 4 | [0, 4, 8] | [0, 4, 8] | Passed |
| oracle 5 | [0, 3, 6, 9] | [0, 3, 6, 9] | Passed |
| oracle 6 | [5, 7, 0] | [0, 2, 7] | Failed |
| oracle 7 | [] | [] | Passed |
SHA-256 / 5737bbe166ffa5c4d7570e148f029de4f07b00e68ab5b075548da84a5bf84817
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 not all(isinstance(v, int) for v in x):
return None
def normal(values):
pcs = sorted(set(p % 12 for p in values))
n = len(pcs)
best = None
for r in range(n):
rot = pcs[r:] + [p + 12 for p in pcs[:r]]
key = [rot[-1] - rot[0]] + [rot[j] - rot[0] for j in range(n - 2, 0, -1)]
if best is None or (key, rot[0]) < best[0]:
best = ((key, rot[0]), rot)
return [p - pcs[0] for p in best[1]]
if not x:
return []
a = normal(x)
b = normal([(-p) % 12 for p in x])
ka = [a[-1]] + a[-2:0:-1]
kb = [b[-1]] + b[-2:0:-1]
return a if ka <= kb else b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 4, 8], [0, 4, 8]), ([0, 3, 6, 9], [0, 3, 6, 9]), ([0, 5, 7], [0, 2, 7]), ([], [])], [([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([7, 11, 2, 5], [0, 2, 5, 8])], [([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([10, 1, 5], [0, 3, 7])], [([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([0, 3, 6, 10], [0, 2, 5, 8])], [([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([1, 2, 4, 8], [0, 1, 3, 7]), ([0, 1, 5], [0, 1, 5]), ([7, 11, 2, 5], [0, 2, 5, 8]), ([0, 2, 6, 7], [0, 1, 5, 7])]]
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 | [0, 4, 7] | [0, 3, 7] | Failed |
| oracle 1 | [0, 3, 7] | [0, 3, 7] | Passed |
| oracle 2 | [0, 3, 7] | [0, 3, 7] | Passed |
| oracle 3 | [0, 1, 5, 6, 8] | [0, 1, 5, 6, 8] | Passed |
| oracle 4 | [0, 4, 8] | [0, 4, 8] | Passed |
| oracle 5 | [0, 3, 6, 9] | [0, 3, 6, 9] | Passed |
| oracle 6 | [5, 7, 12] | [0, 2, 7] | Failed |
| oracle 7 | [] | [] | Passed |
SHA-256 / 143ea1fcedd153cccd640ca887f3130bff1175296d46fba993273516594563a8
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 not all(isinstance(v, int) for v in x):
return None
def normal(values):
pcs = sorted(set(p % 12 for p in values))
n = len(pcs)
best = None
for r in range(n):
rot = pcs[r:] + [p + 12 for p in pcs[:r]]
key = [rot[-1] - rot[0]] + [rot[j] - rot[0] for j in range(n - 2, 0, -1)]
if best is None or (key, rot[0]) < best[0]:
best = ((key, rot[0]), rot)
return [p - best[1][0] for p in best[1]]
if not x:
return []
a = normal(x)
b = normal([(-p) % 12 for p in x])
ka = [a[-1]] + a[-2:0:-1]
kb = [b[-1]] + b[-2:0:-1]
return a if ka <= kb else b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 4, 8], [0, 4, 8]), ([0, 3, 6, 9], [0, 3, 6, 9]), ([0, 5, 7], [0, 2, 7]), ([], [])], [([0, 4, 7], [0, 3, 7]), ([0, 3, 7], [0, 3, 7]), ([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([7, 11, 2, 5], [0, 2, 5, 8])], [([2, 6, 9], [0, 3, 7]), ([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([10, 1, 5], [0, 3, 7])], [([0, 1, 5, 6, 8], [0, 1, 5, 6, 8]), ([0, 2, 3, 6, 7, 9], [0, 2, 3, 6, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 3, 4], [0, 1, 4]), ([4, 5, 8], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([0, 3, 6, 10], [0, 2, 5, 8])], [([0, 1, 3, 5, 8, 9], [0, 1, 4, 5, 7, 9]), ([0, 1, 4], [0, 1, 4]), ([0, 2, 7], [0, 2, 7]), ([0, 5, 7], [0, 2, 7]), ([1, 2, 4, 8], [0, 1, 3, 7]), ([0, 1, 5], [0, 1, 5]), ([7, 11, 2, 5], [0, 2, 5, 8]), ([0, 2, 6, 7], [0, 1, 5, 7])]]
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 | [0, 3, 7] | [0, 3, 7] | Passed |
| oracle 1 | [0, 3, 7] | [0, 3, 7] | Passed |
| oracle 2 | [0, 3, 7] | [0, 3, 7] | Passed |
| oracle 3 | [0, 1, 5, 6, 8] | [0, 1, 5, 6, 8] | Passed |
| oracle 4 | [0, 4, 8] | [0, 4, 8] | Passed |
| oracle 5 | [0, 3, 6, 9] | [0, 3, 6, 9] | Passed |
| oracle 6 | [0, 2, 7] | [0, 2, 7] | Passed |
| oracle 7 | [] | [] | Passed |
SHA-256 / 943a14c8e1971c755d91acafc40e5e1a84b4ee3aba4d52200999508bd7e5924e
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:49:59.345534+00:00.
Case digest / 5f9800301c0150ee9189c8936a90ce0efb82e0d9e9c90786389a0f09659c0546