FA-81666 / MIDI event timing / Open access
Sustain pedal note-off deferral: re-struck sustained note released early by the pedal · case 01
A note re-struck while sustained, and still held by the key, is cut off when the pedal lifts.
ROOT CAUSE
Re-striking ends the old instance but leaves the pitch in the pedal-held set, so the pedal-up releases the new instance.
VERIFIED REPAIR
Restore the re-strike held state step so that it reads `held.discard(value)`.
Unsuccessful approach: Clearing the whole held set on any re-strike also cancels the deferred release of other notes, which then ring to the end.
Case contract
Input time-ordered events [tick, kind, value]: kind on/off with a note number, or cc64 with a controller value (pedal down when value >= 64). A note-off while the pedal is down is deferred until the pedal goes up. Re-striking a note that is still sounding ends the previous instance at the new tick. Notes still sounding at the end end at the last event tick. Return sorted [note, start, end] triples.
Why this case matters
MIDI sequencers, file readers and synth drivers depend on exact event ordering and tick/time arithmetic.
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):
return None
down = False
sounding = {}
held = set()
done = []
last = 0
for tick, kind, value in x:
last = max(last, tick)
if kind == 'cc64':
now_down = value >= 64
if down and not now_down:
for n in sorted(held):
done.append([n, sounding.pop(n), tick])
held = set()
down = now_down
elif kind == 'on':
if value in sounding:
done.append([value, sounding.pop(value), tick])
sounding[value] = tick
elif kind == 'off':
if value not in sounding:
continue
if down:
held.add(value)
else:
done.append([value, sounding.pop(value), tick])
else:
return None
for n in sorted(sounding):
done.append([n, sounding[n], last])
done.sort()
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]
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 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 1 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 2 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 3 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 4 | [[60, 0, 8], [60, 8, 12]] | [[60, 0, 8], [60, 8, 30]] | Failed |
| oracle 5 | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | Passed |
| oracle 6 | [[60, 0, 5], [60, 5, 9]] | [[60, 0, 5], [60, 5, 9]] | Passed |
| oracle 7 | [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]] | [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]] | Passed |
SHA-256 / b0784e7b459cdbc00205a69d81f0b8c6d73c0410e33c15c1a99d75d12ee65935
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):
return None
down = False
sounding = {}
held = set()
done = []
last = 0
for tick, kind, value in x:
last = max(last, tick)
if kind == 'cc64':
now_down = value >= 64
if down and not now_down:
for n in sorted(held):
done.append([n, sounding.pop(n), tick])
held = set()
down = now_down
elif kind == 'on':
if value in sounding:
done.append([value, sounding.pop(value), tick])
held.clear()
sounding[value] = tick
elif kind == 'off':
if value not in sounding:
continue
if down:
held.add(value)
else:
done.append([value, sounding.pop(value), tick])
else:
return None
for n in sorted(sounding):
done.append([n, sounding[n], last])
done.sort()
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]
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 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 1 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 2 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 3 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 4 | [[60, 0, 8], [60, 8, 30]] | [[60, 0, 8], [60, 8, 30]] | Passed |
| oracle 5 | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | Passed |
| oracle 6 | [[60, 0, 5], [60, 5, 9]] | [[60, 0, 5], [60, 5, 9]] | Passed |
| oracle 7 | [[50, 1, 5], [50, 5, 12], [52, 2, 16], [70, 15, 16]] | [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]] | Failed |
SHA-256 / 93fc5a48c6a205743b23a1e1566c87f76953d1c8950392a6f5281dd0c7c0c881
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):
return None
down = False
sounding = {}
held = set()
done = []
last = 0
for tick, kind, value in x:
last = max(last, tick)
if kind == 'cc64':
now_down = value >= 64
if down and not now_down:
for n in sorted(held):
done.append([n, sounding.pop(n), tick])
held = set()
down = now_down
elif kind == 'on':
if value in sounding:
done.append([value, sounding.pop(value), tick])
held.discard(value)
sounding[value] = tick
elif kind == 'off':
if value not in sounding:
continue
if down:
held.add(value)
else:
done.append([value, sounding.pop(value), tick])
else:
return None
for n in sorted(sounding):
done.append([n, sounding[n], last])
done.sort()
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'on', 60], [0, 'on', 64], [7, 'off', 64]], [[60, 0, 7], [64, 0, 7]]), ([[0, 'cc64', 127], [0, 'on', 60], [4, 'off', 60], [9, 'on', 62]], [[60, 0, 9], [62, 9, 9]]), ([[0, 'cc64', 1], [0, 'on', 60], [3, 'off', 60], [9, 'cc64', 0]], [[60, 0, 3]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'pb', 0]], None), ([], []), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0]], [[50, 1, 5], [50, 5, 12], [52, 2, 12]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])], [([[0, 'on', 60], [10, 'off', 60]], [[60, 0, 10]]), ([[0, 'cc64', 127], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 20]]), ([[0, 'cc64', 64], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 63]], [[60, 0, 20]]), ([[0, 'cc64', 63], [0, 'on', 60], [10, 'off', 60], [20, 'cc64', 0]], [[60, 0, 10]]), ([[0, 'cc64', 100], [0, 'on', 60], [5, 'off', 60], [8, 'on', 60], [12, 'cc64', 0], [30, 'off', 60]], [[60, 0, 8], [60, 8, 30]]), ([[0, 'cc64', 100], [0, 'on', 60], [1, 'on', 64], [5, 'off', 60], [6, 'off', 64], [8, 'on', 60], [12, 'cc64', 0]], [[60, 0, 8], [60, 8, 12], [64, 1, 12]]), ([[0, 'on', 60], [5, 'on', 60], [9, 'off', 60]], [[60, 0, 5], [60, 5, 9]]), ([[0, 'cc64', 127], [1, 'on', 50], [2, 'on', 52], [3, 'off', 50], [4, 'off', 52], [5, 'on', 50], [9, 'off', 50], [12, 'cc64', 0], [15, 'on', 70], [16, 'off', 70]], [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]])]]
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 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 1 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 2 | [[60, 0, 20]] | [[60, 0, 20]] | Passed |
| oracle 3 | [[60, 0, 10]] | [[60, 0, 10]] | Passed |
| oracle 4 | [[60, 0, 8], [60, 8, 30]] | [[60, 0, 8], [60, 8, 30]] | Passed |
| oracle 5 | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | [[60, 0, 8], [60, 8, 12], [64, 1, 12]] | Passed |
| oracle 6 | [[60, 0, 5], [60, 5, 9]] | [[60, 0, 5], [60, 5, 9]] | Passed |
| oracle 7 | [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]] | [[50, 1, 5], [50, 5, 12], [52, 2, 12], [70, 15, 16]] | Passed |
SHA-256 / 11c295df88446e7492d7a7418f32c9754334f1e7bd36b1217d2198b42bbd1695
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:05.071101+00:00.
Case digest / dc51c1970406b576514e5f99094eab49393632e689b483cd94b66a3d631b8e9d