FA-31726 / Keyboard interactions / Open access
Adjacent keyboard repeat batch coalescing: A raw event leaves the previous repeat batch active for later merging · case 01
The event trace violates the barrier reset rule and produces incorrect keyboard state or command output.
ROOT CAUSE
A raw event leaves the previous repeat batch active for later merging.
THE FAILURE
A raw event leaves the previous repeat batch active for later merging.
Unsuccessful approach: The partial repair changes this transition to batch[4]=0 out.append, which still violates the model contract on the explicit regression traces.
Case contract
Events [kind,device,code,time,repeat]. Consecutive repeated down events for the same device/code coalesce into [device,code,first,last,count]; any nonrepeat or non-down event flushes the batch and is emitted as a raw event. A repeated down for a different token flushes and starts another. Return ordered entries tagged repeat or raw. 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):
out=[]; batch=None
for kind,device,code,now,repeat in c:
eligible=kind=='down' and repeat
if eligible:
if batch is not None and batch[0]==device and batch[1]==code:
batch[3]=now
batch[4]+=1
else:
if batch is not None: out.append(['repeat']+batch)
batch=[device,code,now,now,1]
else:
if batch is not None:
out.append(['repeat']+batch)
batch=batch
out.append(['raw',kind,device,code,now])
if batch is not None: out.append(['repeat']+batch)
return out
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-coalescing scenario 0', solve([[]] * N), [[]] * N)
check('repeat-coalescing scenario 1', solve([[['down', 'a', 'A', 10, False]]] * N), [[['raw', 'down', 'a', 'A', 10]]] * N)
check('repeat-coalescing scenario 2', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'A', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 12, 2]]] * N)
check('repeat-coalescing scenario 3', solve([[['down', 'a', 'A', 10, True], ['down', 'b', 'A', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] * N)
check('repeat-coalescing scenario 4', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'B', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] * N)
check('repeat-coalescing scenario 5', solve([[['down', 'a', 'A', 10, True], ['up', 'a', 'A', 12, False], ['down', 'a', 'A', 14, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] * N)
check('repeat-coalescing scenario 6', solve([[['up', 'a', 'A', 10, True]]] * N), [[['raw', 'up', 'a', 'A', 10]]] * N)
check('repeat-coalescing scenario 7', solve([[['down', 'a', 'A', 10, True], ['text', 'a', 'A', 12, False]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12]]] * N)
check('repeat-coalescing scenario 8', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'A', 12, False], ['down', 'a', 'A', 14, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] * 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| repeat-coalescing scenario 0 | [[]] | [[]] | Passed |
| repeat-coalescing scenario 1 | [[['raw', 'down', 'a', 'A', 10]]] | [[['raw', 'down', 'a', 'A', 10]]] | Passed |
| repeat-coalescing scenario 2 | [[['repeat', 'a', 'A', 10, 12, 2]]] | [[['repeat', 'a', 'A', 10, 12, 2]]] | Passed |
| repeat-coalescing scenario 3 | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] | Passed |
| repeat-coalescing scenario 4 | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] | Passed |
| repeat-coalescing scenario 5 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 14, 2]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] | Failed |
| repeat-coalescing scenario 6 | [[['raw', 'up', 'a', 'A', 10]]] | [[['raw', 'up', 'a', 'A', 10]]] | Passed |
| repeat-coalescing scenario 7 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 10, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12]]] | Failed |
| repeat-coalescing scenario 8 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 14, 2]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] | Failed |
SHA-256 / dce183d8b98140c4759113050eced2aebec334293c66413d90f61ef834bd7abe
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):
out=[]; batch=None
for kind,device,code,now,repeat in c:
eligible=kind=='down' and repeat
if eligible:
if batch is not None and batch[0]==device and batch[1]==code:
batch[3]=now
batch[4]+=1
else:
if batch is not None: out.append(['repeat']+batch)
batch=[device,code,now,now,1]
else:
if batch is not None:
out.append(['repeat']+batch)
batch[4]=0
out.append(['raw',kind,device,code,now])
if batch is not None: out.append(['repeat']+batch)
return out
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-coalescing scenario 0', solve([[]] * N), [[]] * N)
check('repeat-coalescing scenario 1', solve([[['down', 'a', 'A', 10, False]]] * N), [[['raw', 'down', 'a', 'A', 10]]] * N)
check('repeat-coalescing scenario 2', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'A', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 12, 2]]] * N)
check('repeat-coalescing scenario 3', solve([[['down', 'a', 'A', 10, True], ['down', 'b', 'A', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] * N)
check('repeat-coalescing scenario 4', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'B', 12, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] * N)
check('repeat-coalescing scenario 5', solve([[['down', 'a', 'A', 10, True], ['up', 'a', 'A', 12, False], ['down', 'a', 'A', 14, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] * N)
check('repeat-coalescing scenario 6', solve([[['up', 'a', 'A', 10, True]]] * N), [[['raw', 'up', 'a', 'A', 10]]] * N)
check('repeat-coalescing scenario 7', solve([[['down', 'a', 'A', 10, True], ['text', 'a', 'A', 12, False]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12]]] * N)
check('repeat-coalescing scenario 8', solve([[['down', 'a', 'A', 10, True], ['down', 'a', 'A', 12, False], ['down', 'a', 'A', 14, True]]] * N), [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] * 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| repeat-coalescing scenario 0 | [[]] | [[]] | Passed |
| repeat-coalescing scenario 1 | [[['raw', 'down', 'a', 'A', 10]]] | [[['raw', 'down', 'a', 'A', 10]]] | Passed |
| repeat-coalescing scenario 2 | [[['repeat', 'a', 'A', 10, 12, 2]]] | [[['repeat', 'a', 'A', 10, 12, 2]]] | Passed |
| repeat-coalescing scenario 3 | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'b', 'A', 12, 12, 1]]] | Passed |
| repeat-coalescing scenario 4 | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['repeat', 'a', 'B', 12, 12, 1]]] | Passed |
| repeat-coalescing scenario 5 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 14, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'up', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] | Failed |
| repeat-coalescing scenario 6 | [[['raw', 'up', 'a', 'A', 10]]] | [[['raw', 'up', 'a', 'A', 10]]] | Passed |
| repeat-coalescing scenario 7 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 10, 0]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'text', 'a', 'A', 12]]] | Failed |
| repeat-coalescing scenario 8 | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 10, 14, 1]]] | [[['repeat', 'a', 'A', 10, 10, 1], ['raw', 'down', 'a', 'A', 12], ['repeat', 'a', 'A', 14, 14, 1]]] | Failed |
SHA-256 / d65f583662f2b7300a7d4fd83266c0d91415eb9cfdb01b64eef7657b054ec2dd
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 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:42:05.057461+00:00.
Case digest / e0e614bba161d8f0fb45c63dd6e8d57baa304541d20dac3144bdf17f8b7bb4ed