FAILURE MAP
← Case archive

FA-31081 / Keyboard interactions / Open access

Owned repeat deadline scheduler: Repeat advancement drifts with polling time or reuses initial delay · case 01

The event trace violates the deadline advance rule and produces incorrect keyboard state or command output.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Repeat advancement drifts with polling time or reuses initial delay.

THE FAILURE

Repeat advancement drifts with polling time or reuses initial delay.

Unsuccessful approach: The partial repair changes this transition to next_due[k]=due+delay, which still violates the model contract on the explicit regression traces.

Case contract

Case [delay,period,events], events [kind,key,time]. First down per key emits immediately and schedules first repeat at time+delay. Tick drains every deadline at or before time, ordered by deadline then key. Up removes only that key, blur clears all. Return emissions [key,time] and sorted pending deadlines. Positive delay and period; times nondecreasing. Inputs are finite ordered event traces; return the stated deterministic state. Batch entries are independent. N varies the number of independent input transactions.

Why this case matters

Controlled keyboard event processing model for debugging application event logic.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cases):
    def run(c):
        delay,period,events=c
        next_due={}; output=[]
        for kind,key,now in events:
            if kind=='down' and key not in next_due:
                output.append([key,now])
                next_due[key]=now+delay
            elif kind=='up':
                next_due.pop(key,None)
            elif kind=='blur':
                next_due.clear()
            elif kind=='tick':
                ready=sorted((t,k) for k,t in next_due.items() if t<=now)
                while ready:
                    due,k=ready[0]
                    output.append([k,due])
                    next_due[k]=now+period
                    ready=sorted((t,k) for k,t in next_due.items() if t<=now)
        return [output,sorted([[k,v] for k,v in next_due.items()])]
    return [run(c) for c in cases]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat-clock scenario 0', solve([[5, 2, []]] * N), [[[], []]] * N)
check('repeat-clock scenario 1', solve([[5, 2, [['down', 'A', 10], ['tick', '', 15]]]] * N), [[[['A', 10], ['A', 15]], [['A', 17]]]] * N)
check('repeat-clock scenario 2', solve([[5, 2, [['down', 'A', 10], ['down', 'A', 12], ['tick', '', 17]]]] * N), [[[['A', 10], ['A', 15], ['A', 17]], [['A', 19]]]] * N)
check('repeat-clock scenario 3', solve([[5, 2, [['down', 'Z', 0], ['down', 'A', 1], ['tick', '', 10]]]] * N), [[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6], ['Z', 7], ['A', 8], ['Z', 9], ['A', 10]], [['A', 12], ['Z', 11]]]] * N)
check('repeat-clock scenario 4', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 1], ['up', 'A', 2], ['tick', '', 9]]]] * N), [[[['A', 0], ['B', 1], ['B', 6], ['B', 8]], [['B', 10]]]] * N)
check('repeat-clock scenario 5', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 1], ['blur', '', 3], ['tick', '', 10]]]] * N), [[[['A', 0], ['B', 1]], []]] * N)
check('repeat-clock scenario 6', solve([[5, 2, [['down', 'A', 0], ['tick', '', 12]]]] * N), [[[['A', 0], ['A', 5], ['A', 7], ['A', 9], ['A', 11]], [['A', 13]]]] * N)
check('repeat-clock scenario 7', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 0], ['tick', '', 5]]]] * N), [[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 7], ['B', 7]]]] * N)
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 fixtureActualExpectedOutcome
repeat-clock scenario 0[[[], []]][[[], []]]Passed
repeat-clock scenario 1[[[['A', 10], ['A', 15]], [['A', 17]]]][[[['A', 10], ['A', 15]], [['A', 17]]]]Passed
repeat-clock scenario 2[[[['A', 10], ['A', 15]], [['A', 19]]]][[[['A', 10], ['A', 15], ['A', 17]], [['A', 19]]]]Failed
repeat-clock scenario 3[[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6]], [['A', 12], ['Z', 12]]]][[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6], ['Z', 7], ['A', 8], ['Z', 9], ['A', 10]], [['A', 12], ['Z', 11]]]]Failed
repeat-clock scenario 4[[[['A', 0], ['B', 1], ['B', 6]], [['B', 11]]]][[[['A', 0], ['B', 1], ['B', 6], ['B', 8]], [['B', 10]]]]Failed
repeat-clock scenario 5[[[['A', 0], ['B', 1]], []]][[[['A', 0], ['B', 1]], []]]Passed
repeat-clock scenario 6[[[['A', 0], ['A', 5]], [['A', 14]]]][[[['A', 0], ['A', 5], ['A', 7], ['A', 9], ['A', 11]], [['A', 13]]]]Failed
repeat-clock scenario 7[[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 7], ['B', 7]]]][[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 7], ['B', 7]]]]Passed

SHA-256 / a4e1b2acfdc1c228f6c34c9fb033b45ed6321626a51a9ef01c5b11c0dad69d82

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cases):
    def run(c):
        delay,period,events=c
        next_due={}; output=[]
        for kind,key,now in events:
            if kind=='down' and key not in next_due:
                output.append([key,now])
                next_due[key]=now+delay
            elif kind=='up':
                next_due.pop(key,None)
            elif kind=='blur':
                next_due.clear()
            elif kind=='tick':
                ready=sorted((t,k) for k,t in next_due.items() if t<=now)
                while ready:
                    due,k=ready[0]
                    output.append([k,due])
                    next_due[k]=due+delay
                    ready=sorted((t,k) for k,t in next_due.items() if t<=now)
        return [output,sorted([[k,v] for k,v in next_due.items()])]
    return [run(c) for c in cases]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('repeat-clock scenario 0', solve([[5, 2, []]] * N), [[[], []]] * N)
check('repeat-clock scenario 1', solve([[5, 2, [['down', 'A', 10], ['tick', '', 15]]]] * N), [[[['A', 10], ['A', 15]], [['A', 17]]]] * N)
check('repeat-clock scenario 2', solve([[5, 2, [['down', 'A', 10], ['down', 'A', 12], ['tick', '', 17]]]] * N), [[[['A', 10], ['A', 15], ['A', 17]], [['A', 19]]]] * N)
check('repeat-clock scenario 3', solve([[5, 2, [['down', 'Z', 0], ['down', 'A', 1], ['tick', '', 10]]]] * N), [[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6], ['Z', 7], ['A', 8], ['Z', 9], ['A', 10]], [['A', 12], ['Z', 11]]]] * N)
check('repeat-clock scenario 4', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 1], ['up', 'A', 2], ['tick', '', 9]]]] * N), [[[['A', 0], ['B', 1], ['B', 6], ['B', 8]], [['B', 10]]]] * N)
check('repeat-clock scenario 5', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 1], ['blur', '', 3], ['tick', '', 10]]]] * N), [[[['A', 0], ['B', 1]], []]] * N)
check('repeat-clock scenario 6', solve([[5, 2, [['down', 'A', 0], ['tick', '', 12]]]] * N), [[[['A', 0], ['A', 5], ['A', 7], ['A', 9], ['A', 11]], [['A', 13]]]] * N)
check('repeat-clock scenario 7', solve([[5, 2, [['down', 'A', 0], ['down', 'B', 0], ['tick', '', 5]]]] * N), [[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 7], ['B', 7]]]] * N)
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 fixtureActualExpectedOutcome
repeat-clock scenario 0[[[], []]][[[], []]]Passed
repeat-clock scenario 1[[[['A', 10], ['A', 15]], [['A', 20]]]][[[['A', 10], ['A', 15]], [['A', 17]]]]Failed
repeat-clock scenario 2[[[['A', 10], ['A', 15]], [['A', 20]]]][[[['A', 10], ['A', 15], ['A', 17]], [['A', 19]]]]Failed
repeat-clock scenario 3[[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6], ['Z', 10]], [['A', 11], ['Z', 15]]]][[[['Z', 0], ['A', 1], ['Z', 5], ['A', 6], ['Z', 7], ['A', 8], ['Z', 9], ['A', 10]], [['A', 12], ['Z', 11]]]]Failed
repeat-clock scenario 4[[[['A', 0], ['B', 1], ['B', 6]], [['B', 11]]]][[[['A', 0], ['B', 1], ['B', 6], ['B', 8]], [['B', 10]]]]Failed
repeat-clock scenario 5[[[['A', 0], ['B', 1]], []]][[[['A', 0], ['B', 1]], []]]Passed
repeat-clock scenario 6[[[['A', 0], ['A', 5], ['A', 10]], [['A', 15]]]][[[['A', 0], ['A', 5], ['A', 7], ['A', 9], ['A', 11]], [['A', 13]]]]Failed
repeat-clock scenario 7[[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 10], ['B', 10]]]][[[['A', 0], ['B', 0], ['A', 5], ['B', 5]], [['A', 7], ['B', 7]]]]Failed

SHA-256 / 333d33e6bd724385d46a37f9a7632c857878e6cea79f27703922f908576e3f6e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Offline stipulated event model, not a browser implementation or web standard conformance claim. 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:41:58.794810+00:00.

Case digest / ddada8771e560c0796b45007b034e9fad0a77642f809a4a1d51d099a370f6f8e