FA-32231 / Keyboard interactions / Open access
Keyboard matrix rectangle ghost quarantine: Matrix keyboard presses include released or unchanged accepted cells · case 01
The event trace violates the press delta rule and produces incorrect keyboard state or command output.
ROOT CAUSE
Matrix keyboard presses include released or unchanged accepted cells.
VERIFIED REPAIR
Use the contract transition `sorted(accepted-old)` at the press delta fault site; preserve the other state transitions.
Unsuccessful approach: The partial repair changes this transition to sorted(accepted), which still violates the model contract on the explicit regression traces.
Case contract
Case [rows,columns,reports]. Reports contain [row,column] cells. Ignore out-of-bounds coordinates. Any full observed rectangle with two distinct rows and columns makes its four corners ambiguous. Newly ambiguous presses are quarantined, but already accepted cells remain held while still observed. Emit sorted release edges then sorted press edges for each report. Return edges, accepted cells and final quarantined cells. 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):
rows,columns,reports=c
old=set(); output=[]; quarantined=set()
for report in reports:
raw={(r,col) for r,col in report if 0<=r<rows and 0<=col<columns}
ambiguous=set()
for r1 in range(rows):
for r2 in range(r1+1,rows):
for c1 in range(columns):
for c2 in range(c1+1,columns):
rectangle={(r1,c1),(r1,c2),(r2,c1),(r2,c2)}
if rectangle<=raw: ambiguous|=rectangle
accepted=(raw-ambiguous)|(old&raw)
for r,col in sorted(old-accepted): output.append(['up',r,col])
for r,col in sorted(old-accepted): output.append(['down',r,col])
quarantined=raw-accepted
old=accepted
return [output,[list(x) for x in sorted(old)],[list(x) for x in sorted(quarantined)]]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matrix-ghost-quarantine scenario 0', solve([[2, 2, []]] * N), [[[], [], []]] * N)
check('matrix-ghost-quarantine scenario 1', solve([[2, 2, [[[0, 0], [0, 1], [1, 0]]]]] * N), [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] * N)
check('matrix-ghost-quarantine scenario 2', solve([[2, 2, [[[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 3', solve([[2, 2, [[[0, 0], [0, 1]], [[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 4', solve([[2, 2, [[[0, 0]], []]]] * N), [[[['down', 0, 0], ['up', 0, 0]], [], []]] * N)
check('matrix-ghost-quarantine scenario 5', solve([[2, 2, [[[-1, 0], [0, -1], [2, 0], [0, 2], [1, 1]]]]] * N), [[[['down', 1, 1]], [[1, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 6', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] * N)
check('matrix-ghost-quarantine scenario 7', solve([[2, 2, [[[0, 0]], [[0, 0]], [[0, 1]]]]] * N), [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 8', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [2, 2]]]]] * N), [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 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 |
|---|---|---|---|
| matrix-ghost-quarantine scenario 0 | [[[], [], []]] | [[[], [], []]] | Passed |
| matrix-ghost-quarantine scenario 1 | [[[], [[0, 0], [0, 1], [1, 0]], []]] | [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] | Failed |
| matrix-ghost-quarantine scenario 2 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Passed |
| matrix-ghost-quarantine scenario 3 | [[[], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | Failed |
| matrix-ghost-quarantine scenario 4 | [[[['up', 0, 0], ['down', 0, 0]], [], []]] | [[[['down', 0, 0], ['up', 0, 0]], [], []]] | Failed |
| matrix-ghost-quarantine scenario 5 | [[[], [[1, 1]], []]] | [[[['down', 1, 1]], [[1, 1]], []]] | Failed |
| matrix-ghost-quarantine scenario 6 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | Passed |
| matrix-ghost-quarantine scenario 7 | [[[['up', 0, 0], ['down', 0, 0]], [[0, 1]], []]] | [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] | Failed |
| matrix-ghost-quarantine scenario 8 | [[[], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Failed |
SHA-256 / 5ed78682a2f06abafa204e586bed3ede83191b58ac35600c119cc2ad64d875da
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):
rows,columns,reports=c
old=set(); output=[]; quarantined=set()
for report in reports:
raw={(r,col) for r,col in report if 0<=r<rows and 0<=col<columns}
ambiguous=set()
for r1 in range(rows):
for r2 in range(r1+1,rows):
for c1 in range(columns):
for c2 in range(c1+1,columns):
rectangle={(r1,c1),(r1,c2),(r2,c1),(r2,c2)}
if rectangle<=raw: ambiguous|=rectangle
accepted=(raw-ambiguous)|(old&raw)
for r,col in sorted(old-accepted): output.append(['up',r,col])
for r,col in sorted(accepted): output.append(['down',r,col])
quarantined=raw-accepted
old=accepted
return [output,[list(x) for x in sorted(old)],[list(x) for x in sorted(quarantined)]]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matrix-ghost-quarantine scenario 0', solve([[2, 2, []]] * N), [[[], [], []]] * N)
check('matrix-ghost-quarantine scenario 1', solve([[2, 2, [[[0, 0], [0, 1], [1, 0]]]]] * N), [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] * N)
check('matrix-ghost-quarantine scenario 2', solve([[2, 2, [[[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 3', solve([[2, 2, [[[0, 0], [0, 1]], [[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 4', solve([[2, 2, [[[0, 0]], []]]] * N), [[[['down', 0, 0], ['up', 0, 0]], [], []]] * N)
check('matrix-ghost-quarantine scenario 5', solve([[2, 2, [[[-1, 0], [0, -1], [2, 0], [0, 2], [1, 1]]]]] * N), [[[['down', 1, 1]], [[1, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 6', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] * N)
check('matrix-ghost-quarantine scenario 7', solve([[2, 2, [[[0, 0]], [[0, 0]], [[0, 1]]]]] * N), [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 8', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [2, 2]]]]] * N), [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 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 |
|---|---|---|---|
| matrix-ghost-quarantine scenario 0 | [[[], [], []]] | [[[], [], []]] | Passed |
| matrix-ghost-quarantine scenario 1 | [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] | [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] | Passed |
| matrix-ghost-quarantine scenario 2 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Passed |
| matrix-ghost-quarantine scenario 3 | [[[['down', 0, 0], ['down', 0, 1], ['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | Failed |
| matrix-ghost-quarantine scenario 4 | [[[['down', 0, 0], ['up', 0, 0]], [], []]] | [[[['down', 0, 0], ['up', 0, 0]], [], []]] | Passed |
| matrix-ghost-quarantine scenario 5 | [[[['down', 1, 1]], [[1, 1]], []]] | [[[['down', 1, 1]], [[1, 1]], []]] | Passed |
| matrix-ghost-quarantine scenario 6 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | Passed |
| matrix-ghost-quarantine scenario 7 | [[[['down', 0, 0], ['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] | [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] | Failed |
| matrix-ghost-quarantine scenario 8 | [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Passed |
SHA-256 / 3237e0699e2b22bccaf54aa6cdc5397aa0c75cc86f7444f92e52d5b1bf917b54
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(cases):
def run(c):
rows,columns,reports=c
old=set(); output=[]; quarantined=set()
for report in reports:
raw={(r,col) for r,col in report if 0<=r<rows and 0<=col<columns}
ambiguous=set()
for r1 in range(rows):
for r2 in range(r1+1,rows):
for c1 in range(columns):
for c2 in range(c1+1,columns):
rectangle={(r1,c1),(r1,c2),(r2,c1),(r2,c2)}
if rectangle<=raw: ambiguous|=rectangle
accepted=(raw-ambiguous)|(old&raw)
for r,col in sorted(old-accepted): output.append(['up',r,col])
for r,col in sorted(accepted-old): output.append(['down',r,col])
quarantined=raw-accepted
old=accepted
return [output,[list(x) for x in sorted(old)],[list(x) for x in sorted(quarantined)]]
return [run(c) for c in cases]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('matrix-ghost-quarantine scenario 0', solve([[2, 2, []]] * N), [[[], [], []]] * N)
check('matrix-ghost-quarantine scenario 1', solve([[2, 2, [[[0, 0], [0, 1], [1, 0]]]]] * N), [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] * N)
check('matrix-ghost-quarantine scenario 2', solve([[2, 2, [[[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 3', solve([[2, 2, [[[0, 0], [0, 1]], [[0, 0], [0, 1], [1, 0], [1, 1]]]]] * N), [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] * N)
check('matrix-ghost-quarantine scenario 4', solve([[2, 2, [[[0, 0]], []]]] * N), [[[['down', 0, 0], ['up', 0, 0]], [], []]] * N)
check('matrix-ghost-quarantine scenario 5', solve([[2, 2, [[[-1, 0], [0, -1], [2, 0], [0, 2], [1, 1]]]]] * N), [[[['down', 1, 1]], [[1, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 6', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]]] * N), [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] * N)
check('matrix-ghost-quarantine scenario 7', solve([[2, 2, [[[0, 0]], [[0, 0]], [[0, 1]]]]] * N), [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] * N)
check('matrix-ghost-quarantine scenario 8', solve([[3, 3, [[[0, 0], [0, 1], [1, 0], [1, 1], [2, 2]]]]] * N), [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 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 |
|---|---|---|---|
| matrix-ghost-quarantine scenario 0 | [[[], [], []]] | [[[], [], []]] | Passed |
| matrix-ghost-quarantine scenario 1 | [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] | [[[['down', 0, 0], ['down', 0, 1], ['down', 1, 0]], [[0, 0], [0, 1], [1, 0]], []]] | Passed |
| matrix-ghost-quarantine scenario 2 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Passed |
| matrix-ghost-quarantine scenario 3 | [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | [[[['down', 0, 0], ['down', 0, 1]], [[0, 0], [0, 1]], [[1, 0], [1, 1]]]] | Passed |
| matrix-ghost-quarantine scenario 4 | [[[['down', 0, 0], ['up', 0, 0]], [], []]] | [[[['down', 0, 0], ['up', 0, 0]], [], []]] | Passed |
| matrix-ghost-quarantine scenario 5 | [[[['down', 1, 1]], [[1, 1]], []]] | [[[['down', 1, 1]], [[1, 1]], []]] | Passed |
| matrix-ghost-quarantine scenario 6 | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | [[[], [], [[0, 0], [0, 1], [1, 0], [1, 1], [1, 2], [2, 1], [2, 2]]]] | Passed |
| matrix-ghost-quarantine scenario 7 | [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] | [[[['down', 0, 0], ['up', 0, 0], ['down', 0, 1]], [[0, 1]], []]] | Passed |
| matrix-ghost-quarantine scenario 8 | [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | [[[['down', 2, 2]], [[2, 2]], [[0, 0], [0, 1], [1, 0], [1, 1]]]] | Passed |
SHA-256 / 56ecec69d4038d34b336d75e6dbd9c4962025c0f95449131c2a0f52b5e18037e
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:10.049881+00:00.
Case digest / 454097ba53e2efb7c77f77374b064b83a27c8e3a7531d314f1f5181a2d31fd2e