broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(owner, position, event, pointer, delta):
    if event == 'down': return (pointer if owner is None else owner, position)
    if event == 'move' and pointer == owner: return (owner, position + delta)
    if event == 'up' and pointer == owner: return (None, position)
    if event == 'cancel' and pointer == owner: return (owner, position)
    if event == 'lost': return (None, position)
    return (owner, position)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial down', solve(None, 4, 'down', 1, 0), (1, 4))
check('second down', solve(1, 4, 'down', 2, 0), (1, 4))
check('other move', solve(1, 4, 'move', 2, 3), (1, 4))
check('owner move', solve(1, 4, 'move', 1, 3), (1, 7))
check('other up', solve(1, 4, 'up', 2, 0), (1, 4))
check('owner up', solve(1, 4, 'up', 1, 0), (None, 4))
check('cancel', solve(1, 4, 'cancel', 1, 0), (None, 4))
check('lost', solve(1, 4, 'lost', 2, 0), (None, 4))
check('parameterized pointer ownership', solve(N, N, 'move', N, N), (N,2*N))
for repetition in range(N):
    check('repeat lost', solve(1, 4, 'lost', 2, 0), (None, 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)

evaluation_group: xi-pointer-capture

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(owner, position, event, pointer, delta):
    if event == 'down': return (pointer if owner is None else owner, position)
    if event == 'move' and pointer == owner: return (owner, position + delta)
    if event == 'up' and pointer == owner: return (None, position)
    if event == 'cancel' and pointer == owner: return (None, 0)
    if event == 'lost': return (None, position)
    return (owner, position)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial down', solve(None, 4, 'down', 1, 0), (1, 4))
check('second down', solve(1, 4, 'down', 2, 0), (1, 4))
check('other move', solve(1, 4, 'move', 2, 3), (1, 4))
check('owner move', solve(1, 4, 'move', 1, 3), (1, 7))
check('other up', solve(1, 4, 'up', 2, 0), (1, 4))
check('owner up', solve(1, 4, 'up', 1, 0), (None, 4))
check('cancel', solve(1, 4, 'cancel', 1, 0), (None, 4))
check('lost', solve(1, 4, 'lost', 2, 0), (None, 4))
check('parameterized pointer ownership', solve(N, N, 'move', N, N), (N,2*N))
for repetition in range(N):
    check('repeat lost', solve(1, 4, 'lost', 2, 0), (None, 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)

prompt:
Cancelled pointer capture remains active.

First pointer captures ownership; only its movement and release affect a drag; cancellation and capture loss clear ownership while preserving position.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(owner, position, event, pointer, delta):
    if event == 'down': return (pointer if owner is None else owner, position)
    if event == 'move' and pointer == owner: return (owner, position + delta)
    if event == 'up' and pointer == owner: return (None, position)
    if event == 'cancel' and pointer == owner: return (None, position)
    if event == 'lost': return (owner, position)
    return (owner, position)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial down', solve(None, 4, 'down', 1, 0), (1, 4))
check('second down', solve(1, 4, 'down', 2, 0), (1, 4))
check('other move', solve(1, 4, 'move', 2, 3), (1, 4))
check('owner move', solve(1, 4, 'move', 1, 3), (1, 7))
check('other up', solve(1, 4, 'up', 2, 0), (1, 4))
check('owner up', solve(1, 4, 'up', 1, 0), (None, 4))
check('cancel', solve(1, 4, 'cancel', 1, 0), (None, 4))
check('lost', solve(1, 4, 'lost', 2, 0), (None, 4))
check('parameterized pointer ownership', solve(N, N, 'move', N, N), (N,2*N))
for repetition in range(N):
    check('repeat lost', solve(1, 4, 'lost', 2, 0), (None, 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

evaluation_group: xi-pointer-capture

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(owner, position, event, pointer, delta):
    if event == 'down': return (pointer if owner is None else owner, position)
    if event == 'move' and pointer == owner: return (owner, position + delta)
    if event == 'up' and pointer == owner: return (None, position)
    if event == 'cancel' and pointer == owner: return (None, position)
    if event == 'lost': return (None, 0)
    return (owner, position)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial down', solve(None, 4, 'down', 1, 0), (1, 4))
check('second down', solve(1, 4, 'down', 2, 0), (1, 4))
check('other move', solve(1, 4, 'move', 2, 3), (1, 4))
check('owner move', solve(1, 4, 'move', 1, 3), (1, 7))
check('other up', solve(1, 4, 'up', 2, 0), (1, 4))
check('owner up', solve(1, 4, 'up', 1, 0), (None, 4))
check('cancel', solve(1, 4, 'cancel', 1, 0), (None, 4))
check('lost', solve(1, 4, 'lost', 2, 0), (None, 4))
check('parameterized pointer ownership', solve(N, N, 'move', N, N), (N,2*N))
for repetition in range(N):
    check('repeat lost', solve(1, 4, 'lost', 2, 0), (None, 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)

prompt:
Lost capture leaves the UI in dragging state.

First pointer captures ownership; only its movement and release affect a drag; cancellation and capture loss clear ownership while preserving position.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if False: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

evaluation_group: xi-drop-acceptance

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if not disabled: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

prompt:
Disabled drop zones accept dragged content.

Accept only enabled, compatible targets outside the source subtree, with a supported move or copy effect.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if False: return None
    if source == target: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

evaluation_group: xi-drop-acceptance

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type in accepts: return None
    if source == target: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

prompt:
Targets accept incompatible payload types.

Accept only enabled, compatible targets outside the source subtree, with a supported move or copy effect.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if False: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

evaluation_group: xi-drop-acceptance

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if source != target: return None
    if target in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

prompt:
An item can be dropped into itself.

Accept only enabled, compatible targets outside the source subtree, with a supported move or copy effect.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if False: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

evaluation_group: xi-drop-acceptance

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if source in descendants: return None
    if effect not in ('move', 'copy'): return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

prompt:
Dragging a parent into its descendant creates a cycle.

Accept only enabled, compatible targets outside the source subtree, with a supported move or copy effect.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if target in descendants: return None
    if False: return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

evaluation_group: xi-drop-acceptance

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(drag_type, accepts, disabled, source, target, descendants, effect):
    if disabled: return None
    if drag_type not in accepts: return None
    if source == target: return None
    if target in descendants: return None
    if effect != 'move': return None
    return effect
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disabled', solve('node', ['node'], True, 'a', 'b', [], 'move'), None)
check('type', solve('file', ['node'], False, 'a', 'b', [], 'move'), None)
check('self', solve('node', ['node'], False, 'a', 'a', [], 'move'), None)
check('cycle', solve('node', ['node'], False, 'a', 'b', ['b'], 'move'), None)
check('unsupported', solve('node', ['node'], False, 'a', 'b', [], 'link'), None)
check('copy', solve('node', ['node'], False, 'a', 'b', [], 'copy'), 'copy')
check('move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
check('parameterized payload type', solve('type'+str(N), ['type'+str(N)], False, 'a', 'b', [], 'copy'), 'copy')
for repetition in range(N):
    check('repeat move', solve('node', ['node'], False, 'a', 'b', [], 'move'), 'move')
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)

prompt:
Unsupported drop effects reach the mutation handler.

Accept only enabled, compatible targets outside the source subtree, with a supported move or copy effect.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = end - viewport
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

evaluation_group: xi-scroll-reveal

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = offset
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

prompt:
An oversized item reveals its end instead of its leading edge.

Keep already-visible items stationary; reveal nearest edge; align oversized items at the start; clamp offset to the scrollable extent.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = end
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

evaluation_group: xi-scroll-reveal

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = offset
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

prompt:
Revealing an above-viewport item scrolls past its beginning.

Keep already-visible items stationary; reveal nearest edge; align oversized items at the start; clamp offset to the scrollable extent.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

evaluation_group: xi-scroll-reveal

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = start
    else: wanted = offset
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

prompt:
Revealing a lower item scrolls it above the viewport.

Keep already-visible items stationary; reveal nearest edge; align oversized items at the start; clamp offset to the scrollable extent.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = start
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

evaluation_group: xi-scroll-reveal

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = end
    return max(0, min(wanted, max(0, extent - viewport)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

prompt:
Visible targets unnecessarily change the scroll position.

Keep already-visible items stationary; reveal nearest edge; align oversized items at the start; clamp offset to the scrollable extent.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return wanted
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

evaluation_group: xi-scroll-reveal

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(start, end, offset, viewport, extent):
    if end - start > viewport: wanted = start
    elif start < offset: wanted = start
    elif end > offset + viewport: wanted = end - viewport
    else: wanted = offset
    return max(0, min(wanted, extent))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('oversized', solve(10, 40, 0, 20, 100), 10)
check('above', solve(10, 15, 30, 20, 100), 10)
check('below', solve(40, 45, 0, 20, 100), 25)
check('visible', solve(12, 15, 10, 20, 100), 10)
check('end clamp', solve(95, 105, 0, 20, 100), 80)
check('negative clamp', solve(-5, 0, 10, 20, 100), 0)
check('parameterized reveal distance', solve(10*N, 10*N+5, 0, 10, 100*N), 10*N-5)
for repetition in range(N):
    check('repeat negative clamp', solve(-5, 0, 10, 20, 100), 0)
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)

prompt:
Reveal requests scroll beyond the usable content extent.

Keep already-visible items stationary; reveal nearest edge; align oversized items at the start; clamp offset to the scrollable extent.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

evaluation_group: xi-virtual-window

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + 1)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

prompt:
Variable row heights are not accumulated into layout positions.

Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] >= offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

evaluation_group: xi-virtual-window

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i] >= offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

prompt:
A row ending exactly at the viewport top remains visible.

Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] <= offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

evaluation_group: xi-virtual-window

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i+1] <= offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

prompt:
A row starting at the viewport bottom is rendered as visible.

Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = visible[0]
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

evaluation_group: xi-virtual-window

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] + overscan)
    hi = min(len(heights), visible[-1] + 1 + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

prompt:
Overscan fails to include rows before the viewport.

Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = visible[-1] + 1
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

evaluation_group: xi-virtual-window

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(heights, offset, viewport, overscan):
    positions = [0]
    for height in heights: positions.append(positions[-1] + height)
    visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
    if not visible: return []
    lo = max(0, visible[0] - overscan)
    hi = min(len(heights), visible[-1] + overscan)
    return list(range(lo, hi))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
    check('repeat outside', solve([10,10], 30, 5, 1), [])
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)

prompt:
Overscan fails to include rows after the viewport.

Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = right
    below = bottom + gap
    y = below if below + height <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

evaluation_group: xi-anchored-overlay

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = top
    below = bottom + gap
    y = below if below + height <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

prompt:
An overlay aligns to the wrong horizontal anchor edge.

Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom
    y = below if below + height <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

evaluation_group: xi-anchored-overlay

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = top + gap
    y = below if below + height <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

prompt:
An overlay touches its anchor instead of respecting separation.

Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

evaluation_group: xi-anchored-overlay

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below + width <= vh else top - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

prompt:
Flip decisions ignore the overlay height.

Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below + height <= vh else top - gap
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

evaluation_group: xi-anchored-overlay

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below + height <= vh else bottom - gap - height
    x = max(0, min(x, vw - width))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

prompt:
Flipped overlays overlap the anchor instead of ending above it.

Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below + height <= vh else top - gap - height
    x = max(0, min(x, vw))
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

evaluation_group: xi-anchored-overlay

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(anchor, size, viewport, gap):
    left, top, right, bottom = anchor
    width, height = size
    vw, vh = viewport
    x = left
    below = bottom + gap
    y = below if below + height <= vh else top - gap - height
    x = min(x, vw - width)
    y = max(0, min(y, vh - height))
    return (x, y)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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)

prompt:
Overlay width is omitted from right-edge collision handling.

Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.

split: open-access


broken_source:
"""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 = (column-1) % columns
    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)

evaluation_group: xi-grid-navigation

source:
"""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-2)
    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)

prompt:
Left arrows wrap into the previous grid edge.

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

split: open-access


broken_source:
"""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 = (column+1) % columns
    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)

evaluation_group: xi-grid-navigation

source:
"""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(rows-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)

prompt:
Right arrows wrap instead of staying at the row edge.

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

split: open-access


broken_source:
"""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': column = max(0, column-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)

evaluation_group: xi-grid-navigation

source:
"""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 = min(rows-1, 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)

prompt:
Up arrows change the column instead of the row.

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

split: open-access


broken_source:
"""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
    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)

evaluation_group: xi-grid-navigation

source:
"""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 = 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)

prompt:
Home unexpectedly jumps to the first grid row.

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

split: open-access


broken_source:
"""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)

evaluation_group: xi-grid-navigation

source:
"""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)

prompt:
End unexpectedly jumps to the last grid row.

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

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.clear()
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

evaluation_group: xi-tree-navigation

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.update(kids)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

prompt:
Right-arrow fails to expand the focused parent.

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[-1]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

evaluation_group: xi-tree-navigation

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = node
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

prompt:
Right-arrow on an expanded parent focuses its last child.

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.clear()
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

evaluation_group: xi-tree-navigation

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.add(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

prompt:
Left-arrow collapses unrelated branches.

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = node
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

evaluation_group: xi-tree-navigation

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node)
    elif key == 'CollapseAll': expanded.clear()
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

prompt:
Left-arrow on a collapsed child does not move to its parent.

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.discard(node)
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

evaluation_group: xi-tree-navigation

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(node, expanded, parents, children, key):
    expanded = set(expanded)
    kids = children.get(node, [])
    if key == 'Right' and kids:
        if node not in expanded: expanded.add(node)
        else: node = kids[0]
    elif key == 'Left':
        if node in expanded: expanded.remove(node)
        else: node = parents.get(node, node)
    elif key == 'CollapseAll': expanded.add(node)
    return (node, sorted(expanded))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('expand', solve('a', ['z'], {}, {'a':['b','c']}, 'Right'), ('a', ['a', 'z']))
check('descend', solve('a', ['a'], {}, {'a':['b','c']}, 'Right'), ('b', ['a']))
check('collapse', solve('a', ['a','z'], {}, {'a':['b']}, 'Left'), ('a', ['z']))
check('parent', solve('b', [], {'b':'a'}, {}, 'Left'), ('a', []))
check('root', solve('a', [], {}, {}, 'Left'), ('a', []))
check('all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
check('parameterized child count', solve('a', [], {}, {'a':list(range(N))}, 'Right'), ('a',['a']))
for repetition in range(N):
    check('repeat all', solve('a', ['a','z'], {}, {}, 'CollapseAll'), ('a', []))
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)

prompt:
Collapse-all leaves unrelated expanded branches open.

Right expands then enters the first child; Left collapses only the current branch or focuses its parent; roots retain focus; collapse-all clears every expansion.

split: open-access