FA-30951 / Keyboard interactions / Open access
Simultaneous chord edge recognizer: Cancellation retains a partial chord across input ownership loss · case 01
The event trace violates the cancel reset rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Cancellation retains a partial chord across input ownership loss.
THE FAILURE
Cancellation retains a partial chord across input ownership loss.
Unsuccessful approach: The partial repair changes this transition to elif kind=='cancel': held.discard(key), which still violates the model contract on the explicit regression traces.
Case contract
Case is [required_keys, events]. Down/up update held keys; cancel clears state. A chord fires on the first transition from incomplete to all required keys held, with no extra keys. It rearms after becoming incomplete. Empty chord never fires. Return fire count, sorted held, armed state, last triggering key and current completeness. 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):
required,events=c
held=set(); armed=True; fires=0; last=None; complete=False
for kind,key in events:
if kind=='down': held.add(key)
elif kind=='up': held.discard(key)
elif kind=='cancel': pass
complete=bool(required) and held==set(required)
if complete and armed and kind=='down':
fires+=1
last=key
armed=False
elif not complete:
armed=True
return [fires,sorted(held),armed,last,complete]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('simultaneous-chord scenario 0', solve([[[], []]] * N), [[0, [], True, None, False]] * N)
check('simultaneous-chord scenario 1', solve([[[], [['down', 'x'], ['up', 'x'], ['down', 'x'], ['up', 'x']]]] * N), [[0, [], True, None, False]] * N)
check('simultaneous-chord scenario 2', solve([[['A', 'B'], [['down', 'A'], ['down', 'B'], ['down', 'B']]]] * N), [[1, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 3', solve([[['A', 'B'], [['down', 'A'], ['down', 'B'], ['up', 'B'], ['down', 'B']]]] * N), [[2, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 4', solve([[['A', 'B'], [['down', 'A'], ['down', 'X'], ['down', 'B'], ['up', 'X']]]] * N), [[0, ['A', 'B'], True, None, True]] * N)
check('simultaneous-chord scenario 5', solve([[['A', 'B'], [['down', 'A'], ['cancel', ''], ['down', 'B']]]] * N), [[0, ['B'], True, None, False]] * N)
check('simultaneous-chord scenario 6', solve([[['A', 'B'], [['down', 'A'], ['up', 'X'], ['down', 'B']]]] * N), [[1, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 7', solve([[['A'], [['down', 'A'], ['up', 'A'], ['down', 'A']]]] * N), [[2, ['A'], False, 'A', True]] * N)
check('simultaneous-chord scenario 8', solve([[['A', 'B'], [['down', 'B'], ['down', 'A']]]] * N), [[1, ['A', 'B'], False, 'A', True]] * 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 |
|---|---|---|---|
| simultaneous-chord scenario 0 | [[0, [], True, None, False]] | [[0, [], True, None, False]] | Passed |
| simultaneous-chord scenario 1 | [[0, [], True, None, False]] | [[0, [], True, None, False]] | Passed |
| simultaneous-chord scenario 2 | [[1, ['A', 'B'], False, 'B', True]] | [[1, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 3 | [[2, ['A', 'B'], False, 'B', True]] | [[2, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 4 | [[0, ['A', 'B'], True, None, True]] | [[0, ['A', 'B'], True, None, True]] | Passed |
| simultaneous-chord scenario 5 | [[1, ['A', 'B'], False, 'B', True]] | [[0, ['B'], True, None, False]] | Failed |
| simultaneous-chord scenario 6 | [[1, ['A', 'B'], False, 'B', True]] | [[1, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 7 | [[2, ['A'], False, 'A', True]] | [[2, ['A'], False, 'A', True]] | Passed |
| simultaneous-chord scenario 8 | [[1, ['A', 'B'], False, 'A', True]] | [[1, ['A', 'B'], False, 'A', True]] | Passed |
SHA-256 / 155ee27e2a84350e103f3ce5ca58b2742d1b4e03f081d7da654c974b98c04631
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):
required,events=c
held=set(); armed=True; fires=0; last=None; complete=False
for kind,key in events:
if kind=='down': held.add(key)
elif kind=='up': held.discard(key)
elif kind=='cancel': held.discard(key)
complete=bool(required) and held==set(required)
if complete and armed and kind=='down':
fires+=1
last=key
armed=False
elif not complete:
armed=True
return [fires,sorted(held),armed,last,complete]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('simultaneous-chord scenario 0', solve([[[], []]] * N), [[0, [], True, None, False]] * N)
check('simultaneous-chord scenario 1', solve([[[], [['down', 'x'], ['up', 'x'], ['down', 'x'], ['up', 'x']]]] * N), [[0, [], True, None, False]] * N)
check('simultaneous-chord scenario 2', solve([[['A', 'B'], [['down', 'A'], ['down', 'B'], ['down', 'B']]]] * N), [[1, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 3', solve([[['A', 'B'], [['down', 'A'], ['down', 'B'], ['up', 'B'], ['down', 'B']]]] * N), [[2, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 4', solve([[['A', 'B'], [['down', 'A'], ['down', 'X'], ['down', 'B'], ['up', 'X']]]] * N), [[0, ['A', 'B'], True, None, True]] * N)
check('simultaneous-chord scenario 5', solve([[['A', 'B'], [['down', 'A'], ['cancel', ''], ['down', 'B']]]] * N), [[0, ['B'], True, None, False]] * N)
check('simultaneous-chord scenario 6', solve([[['A', 'B'], [['down', 'A'], ['up', 'X'], ['down', 'B']]]] * N), [[1, ['A', 'B'], False, 'B', True]] * N)
check('simultaneous-chord scenario 7', solve([[['A'], [['down', 'A'], ['up', 'A'], ['down', 'A']]]] * N), [[2, ['A'], False, 'A', True]] * N)
check('simultaneous-chord scenario 8', solve([[['A', 'B'], [['down', 'B'], ['down', 'A']]]] * N), [[1, ['A', 'B'], False, 'A', True]] * 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 |
|---|---|---|---|
| simultaneous-chord scenario 0 | [[0, [], True, None, False]] | [[0, [], True, None, False]] | Passed |
| simultaneous-chord scenario 1 | [[0, [], True, None, False]] | [[0, [], True, None, False]] | Passed |
| simultaneous-chord scenario 2 | [[1, ['A', 'B'], False, 'B', True]] | [[1, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 3 | [[2, ['A', 'B'], False, 'B', True]] | [[2, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 4 | [[0, ['A', 'B'], True, None, True]] | [[0, ['A', 'B'], True, None, True]] | Passed |
| simultaneous-chord scenario 5 | [[1, ['A', 'B'], False, 'B', True]] | [[0, ['B'], True, None, False]] | Failed |
| simultaneous-chord scenario 6 | [[1, ['A', 'B'], False, 'B', True]] | [[1, ['A', 'B'], False, 'B', True]] | Passed |
| simultaneous-chord scenario 7 | [[2, ['A'], False, 'A', True]] | [[2, ['A'], False, 'A', True]] | Passed |
| simultaneous-chord scenario 8 | [[1, ['A', 'B'], False, 'A', True]] | [[1, ['A', 'B'], False, 'A', True]] | Passed |
SHA-256 / eccc88bf8c0a2b8a44adea73fb576b2e1c1794baf71b7b84b59f21e3213ac385
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:41:57.956607+00:00.
Case digest / 999d1c7acbb160310b5dedf49b57245a3f761e2a14f851dd974953f1e2ee8d11