FAILURE MAP
← Case archive

FA-8376 / Keyboard accessibility / Open access

Grid-cell keyboard movement: End unexpectedly jumps to the last grid row · case 01

End unexpectedly jumps to the last grid row.

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

ROOT CAUSE

The end modifier operation uses `row = rows-1` where the contract requires `row = rows-1 if ctrl else row`.

VERIFIED REPAIR

Implement the end modifier operation as `row = rows-1 if ctrl else row`.

Unsuccessful approach: Never updating the row makes Control-End fail.

Case contract

Arrow keys move one cell and clamp without wrapping; Home/End target row edges; Control additionally targets the first/last row.

Why this case matters

A deterministic model of grid-cell keyboard movement; this isolates one interface invariant without requiring a browser.

1 / The failure

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

N = 1
observations = []
def solve(rows, columns, row, column, key, ctrl):
    if key == 'Left': column = max(0, column-1)
    elif key == 'Right': column = min(columns-1, column+1)
    elif key == 'Up': row = max(0, row-1)
    elif key == 'Down': row = min(rows-1, row+1)
    elif key == 'Home': column = 0; row = 0 if ctrl else row
    elif key == 'End': column = columns-1; row = rows-1
    return (row, column)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
    check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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
left boundary[1, 0][1, 0]Passed
left step[1, 2][1, 2]Passed
right boundary[1, 4][1, 4]Passed
right step[1, 4][1, 4]Passed
up[0, 3][0, 3]Passed
home[1, 0][1, 0]Passed
ctrl home[0, 0][0, 0]Passed
end[2, 4][1, 4]Failed
ctrl end[2, 4][2, 4]Passed
parameterized grid shape[1, 2][1, 2]Passed
repeat ctrl end[2, 4][2, 4]Passed

SHA-256 / 98141909fa15c199e71af27adad84e9a36dc78e4a889dcba7365ab666b0c870d

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(rows, columns, row, column, key, ctrl):
    if key == 'Left': column = max(0, column-1)
    elif key == 'Right': column = min(columns-1, column+1)
    elif key == 'Up': row = max(0, row-1)
    elif key == 'Down': row = min(rows-1, row+1)
    elif key == 'Home': column = 0; row = 0 if ctrl else row
    elif key == 'End': column = columns-1; row = row
    return (row, column)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
    check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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
left boundary[1, 0][1, 0]Passed
left step[1, 2][1, 2]Passed
right boundary[1, 4][1, 4]Passed
right step[1, 4][1, 4]Passed
up[0, 3][0, 3]Passed
home[1, 0][1, 0]Passed
ctrl home[0, 0][0, 0]Passed
end[1, 4][1, 4]Passed
ctrl end[1, 4][2, 4]Failed
parameterized grid shape[1, 2][1, 2]Passed
repeat ctrl end[1, 4][2, 4]Failed

SHA-256 / d1d9abcab2d6a6f2e1e702dc88f1ed2563e47e4e6c331ac7acc86f5818c416f2

3 / The verified repair

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

N = 1
observations = []
def solve(rows, columns, row, column, key, ctrl):
    if key == 'Left': column = max(0, column-1)
    elif key == 'Right': column = min(columns-1, column+1)
    elif key == 'Up': row = max(0, row-1)
    elif key == 'Down': row = min(rows-1, row+1)
    elif key == 'Home': column = 0; row = 0 if ctrl else row
    elif key == 'End': column = columns-1; row = rows-1 if ctrl else row
    return (row, column)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
    check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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
left boundary[1, 0][1, 0]Passed
left step[1, 2][1, 2]Passed
right boundary[1, 4][1, 4]Passed
right step[1, 4][1, 4]Passed
up[0, 3][0, 3]Passed
home[1, 0][1, 0]Passed
ctrl home[0, 0][0, 0]Passed
end[1, 4][1, 4]Passed
ctrl end[2, 4][2, 4]Passed
parameterized grid shape[1, 2][1, 2]Passed
repeat ctrl end[2, 4][2, 4]Passed

SHA-256 / 08124ba6b65cc3f2bd3bca53c5632ac0f44721143cf2998bf0c58251541957cb

Verification & scope

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:38:20.783411+00:00.

Case digest / 7746d72d79b0f42ffe5bebf9b77119c89c422091835d82c645e566620407845b