FA-81446 / MIDI event timing / Open access
Note-on and note-off pairing into durations: hanging notes collapsed to zero length · case 01
A note never switched off is reported with end equal to its start instead of the final tick.
ROOT CAUSE
The end-of-track flush closes open notes at their own start tick.
VERIFIED REPAIR
Restore the unterminated note end step so that it reads `done.append([start, last, c, n, v])`.
Unsuccessful approach: Writing the remaining duration instead of the end tick mixes a length into the end column.
Case contract
Input time-ordered events [tick, kind, channel, note, velocity] with kind on or off. A note-on with velocity 0 acts as a note-off. Each off ends the earliest still-open note with the same channel and note (FIFO); unmatched offs are ignored. Notes still open at the end end at the last event tick. Return [start, end, channel, note, on-velocity] sorted by start, note, channel, end.
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
active = {}
done = []
last = 0
for tick, kind, ch, note, vel in x:
last = max(last, tick)
key = (ch, note)
if kind == 'on' and vel > 0:
active.setdefault(key, []).append((tick, vel, ch, note))
elif kind in ('on', 'off'):
if active.get(key):
start, v, c, n = active[key].pop(0)
done.append([start, tick, c, n, v])
for stack in active.values():
for start, v, c, n in stack:
done.append([start, start, c, n, v])
done.sort(key=lambda e: (e[0], e[3], e[2], e[1]))
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]
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, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 1 | [[0, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 2 | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | Passed |
| oracle 3 | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | Passed |
| oracle 4 | [[0, 0, 0, 60, 100], [30, 30, 0, 64, 90]] | [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]] | Failed |
| oracle 5 | [[5, 9, 0, 62, 70]] | [[5, 9, 0, 62, 70]] | Passed |
| oracle 6 | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | Passed |
| oracle 7 | [[1, 7, 0, 60, 100], [3, 3, 0, 60, 50], [9, 9, 0, 72, 10]] | [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]] | Failed |
SHA-256 / 3344cffa1719d4574d8df8940578d9c86ae9d0e5326104ab91aec3c55fa23d9d
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
active = {}
done = []
last = 0
for tick, kind, ch, note, vel in x:
last = max(last, tick)
key = (ch, note)
if kind == 'on' and vel > 0:
active.setdefault(key, []).append((tick, vel, ch, note))
elif kind in ('on', 'off'):
if active.get(key):
start, v, c, n = active[key].pop(0)
done.append([start, tick, c, n, v])
for stack in active.values():
for start, v, c, n in stack:
done.append([start, last - start, c, n, v])
done.sort(key=lambda e: (e[0], e[3], e[2], e[1]))
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]
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, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 1 | [[0, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 2 | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | Passed |
| oracle 3 | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | Passed |
| oracle 4 | [[0, 30, 0, 60, 100], [30, 0, 0, 64, 90]] | [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]] | Failed |
| oracle 5 | [[5, 9, 0, 62, 70]] | [[5, 9, 0, 62, 70]] | Passed |
| oracle 6 | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | Passed |
| oracle 7 | [[1, 7, 0, 60, 100], [3, 6, 0, 60, 50], [9, 0, 0, 72, 10]] | [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]] | Failed |
SHA-256 / 998685e20d09c2943f60901b35009c0ca4971086389c2dff29883c0431819c23
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
active = {}
done = []
last = 0
for tick, kind, ch, note, vel in x:
last = max(last, tick)
key = (ch, note)
if kind == 'on' and vel > 0:
active.setdefault(key, []).append((tick, vel, ch, note))
elif kind in ('on', 'off'):
if active.get(key):
start, v, c, n = active[key].pop(0)
done.append([start, tick, c, n, v])
for stack in active.values():
for start, v, c, n in stack:
done.append([start, last, c, n, v])
done.sort(key=lambda e: (e[0], e[3], e[2], e[1]))
return done
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[0, 'on', 0, 64, 100], [0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0], [12, 'off', 0, 64, 0]], [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 2, 60, 100], [4, 'on', 2, 60, 90], [8, 'on', 2, 60, 0], [9, 'on', 2, 60, 0]], [[0, 8, 2, 60, 100], [4, 9, 2, 60, 90]]), ([[0, 'on', 0, 60, 1], [3, 'off', 0, 60, 64]], [[0, 3, 0, 60, 1]]), ([], []), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'on', 0, 60, 100], [5, 'off', 0, 60, 64], [6, 'on', 0, 60, 100], [9, 'off', 0, 60, 64]], [[0, 5, 0, 60, 100], [6, 9, 0, 60, 100]]), ([[0, 'on', 0, 62, 100], [2, 'on', 0, 60, 100], [4, 'off', 0, 62, 0], [8, 'off', 0, 60, 0]], [[0, 4, 0, 62, 100], [2, 8, 0, 60, 100]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 0, 60, 100], [2, 'on', 1, 60, 50], [4, 'off', 0, 60, 0], [6, 'off', 1, 60, 0]], [[0, 4, 0, 60, 100], [2, 6, 1, 60, 50]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])], [([[0, 'on', 0, 60, 100], [10, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [10, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'on', 0, 60, 100], [5, 'on', 0, 60, 80], [10, 'off', 0, 60, 0], [20, 'off', 0, 60, 0]], [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]]), ([[0, 'on', 0, 60, 100], [5, 'on', 1, 60, 80], [10, 'off', 1, 60, 0], [20, 'off', 0, 60, 0]], [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]]), ([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[1, 'on', 0, 60, 100], [3, 'on', 0, 60, 50], [7, 'off', 0, 60, 0], [9, 'on', 0, 72, 10]], [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]]), ([[0, 'on', 3, 70, 100], [1, 'on', 4, 70, 100], [5, 'off', 3, 70, 0], [6, 'off', 4, 70, 0]], [[0, 5, 3, 70, 100], [1, 6, 4, 70, 100]])]]
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, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 1 | [[0, 10, 0, 60, 100]] | [[0, 10, 0, 60, 100]] | Passed |
| oracle 2 | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | [[0, 10, 0, 60, 100], [5, 20, 0, 60, 80]] | Passed |
| oracle 3 | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | [[0, 20, 0, 60, 100], [5, 10, 1, 60, 80]] | Passed |
| oracle 4 | [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]] | [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]] | Passed |
| oracle 5 | [[5, 9, 0, 62, 70]] | [[5, 9, 0, 62, 70]] | Passed |
| oracle 6 | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | [[0, 10, 0, 60, 100], [0, 12, 0, 64, 100]] | Passed |
| oracle 7 | [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]] | [[1, 7, 0, 60, 100], [3, 9, 0, 60, 50], [9, 9, 0, 72, 10]] | Passed |
SHA-256 / 7340f7194c5b41fce09815a295a4fce7f7538b1606acdc9cd3e2df87de8d7d66
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:03.134222+00:00.
Case digest / dc646d9c3cef86336ddcdeecdc0bf8dc270633b143a3ff7a9f9647f604d2694f