FA-81431 / MIDI event timing / Open access
Note-on and note-off pairing into durations: velocity-zero note-on opens a new note · case 01
Running-status style note-offs (note-on with velocity 0) never end notes; every note lasts to the end of the track.
ROOT CAUSE
Note-on events are always treated as starts regardless of velocity.
VERIFIED REPAIR
Restore the velocity zero note-off step so that it reads `kind == 'on' and vel > 0`.
Unsuccessful approach: Classifying by velocity alone turns note-offs that carry a release velocity into new note starts.
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':
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]]), ([], [])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[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]]), ([], []), ([[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, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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, 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, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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', 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, '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]])]]
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], [10, 10, 0, 60, 0]] | [[0, 10, 0, 60, 100]] | Failed |
| 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 | [] | [] | Passed |
SHA-256 / 08950fec880e2ec3b2b35b1a9a1ab170c7c29e42178804b0b83a6dd3ce8fd0d0
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 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]]), ([], [])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[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]]), ([], []), ([[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, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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, 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, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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', 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, '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]])]]
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], [9, 9, 0, 62, 40]] | [[5, 9, 0, 62, 70]] | Failed |
| 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 | [] | [] | Passed |
SHA-256 / a3b103c827b18e95d5cbdafe5e848d9ab342e35c5cb22667578d369eb2251d0b
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]]), ([], [])], [([[0, 'on', 0, 60, 100], [30, 'on', 0, 64, 90]], [[0, 30, 0, 60, 100], [30, 30, 0, 64, 90]]), ([[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]]), ([], []), ([[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, 'on', 0, 60, 0]], [[0, 10, 0, 60, 100]]), ([[0, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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, 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, 'off', 0, 60, 0], [5, 'on', 0, 62, 70], [9, 'off', 0, 62, 40]], [[5, 9, 0, 62, 70]]), ([[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', 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, '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]])]]
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 | [] | [] | Passed |
SHA-256 / 7eadfe5cecba983c8183a7119efd40de21a98e947bb5d039f4d055a7baf366c8
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.058111+00:00.
Case digest / 3b1a0626ae08b5de6efad74bd261153e8bf7fec25a11e7803e2ade32162cf261