FA-81625 / MIDI event timing / Member archive
Lookahead scheduler dispatch windows: event on the window edge dispatched early · case 05
An event exactly at now + lookahead is sent in the current window and the next window misses nothing, so it fires one window early.
Case contract
Input [events, windows]: events are [time_ms, id]; windows are [now, lookahead] processed in order. In each window, walk not-yet-handled events in time order: an event more than 20 ms late (time < now - 20) is dropped (reported once); an event with time < now + lookahead is dispatched in that window (late events within tolerance included). Return {"batches": ids per window, "dropped": ids}.
Why this case matters
MIDI sequencers, file readers and synth drivers depend on exact event ordering and tick/time arithmetic.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oracle 0 | {"batches": [["a", "b"], ["c"], []], "dropped": []} | {"batches": [["a"], ["b"], ["c"]], "dropped": []} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗