FAILURE MAP
← Case archive

FA-39101 / Tree accessibility / Open access

Virtual tree active-descendant lease: Mounted row lookup confuses recycled slot with logical ID · case 01

Mounted row lookup confuses recycled slot with logical ID produces the wrong hierarchical widget state in a regression fixture.

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

ROOT CAUSE

The virtual-focus-lease contract is violated at `row==logical` by replacing it with `slot==logical`.

VERIFIED REPAIR

Restore `row==logical` at this fault site while retaining the other tree state decisions.

Unsuccessful approach: The partial repair `row==d['active']` still violates a boundary or preservation case.

Case contract

A virtualized active row keeps its identity while offscreen. Expose an active descendant only after a matching mount generation acknowledges the row; scrolling requests mount without changing selection. A recycled slot must not satisfy an old lease. Collapse repairs the logical active row to the closest visible ancestor before mounting.

Why this case matters

Offline executable model of a hierarchical accessibility interaction; inputs are bounded and valid as stipulated. No browser, assistive technology, or normative ARIA conformance is claimed.

1 / The failure

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

N = 1
observations = []
def solve(d):
    visible=d['visible']
    logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
    slot=next((slot for slot,row in d['slots'].items() if slot==logical),None)
    ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
    aria=(d['tree']+':'+logical) if ack else None
    request=logical if logical is not None and not ack else None
    scroll=visible.index(logical) if logical in visible and slot is None else None
    selection=d['selection']
    lease=[logical,d['generation']] if request is not None else None
    pinned=[logical] if ack else []
    return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
    check(label, solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mounted lease['b', None, 'b', 2, ['a'], ['b', 1], []]['b', 'tree:b', None, None, ['a'], None, ['b']]Failed
old ack['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed
recycled ack['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed
offscreen['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', 2, ['a'], ['b', 1], []]Passed
collapse['a', None, 'a', 1, ['a'], ['a', 1], []]['a', 'tree:a', None, None, ['a'], None, ['a']]Failed
collapse offscreen['a', None, 'a', 1, ['a'], ['a', 1], []]['a', None, 'a', 1, ['a'], ['a', 1], []]Passed
empty tree[None, None, None, None, ['a'], None, []][None, None, None, None, ['a'], None, []]Passed
no ack['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed

SHA-256 / 620f23059fd6c4606bed86a40e253b378f1a0f6f4a15ac044980e66700ecebde

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    visible=d['visible']
    logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
    slot=next((slot for slot,row in d['slots'].items() if row==d['active']),None)
    ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
    aria=(d['tree']+':'+logical) if ack else None
    request=logical if logical is not None and not ack else None
    scroll=visible.index(logical) if logical in visible and slot is None else None
    selection=d['selection']
    lease=[logical,d['generation']] if request is not None else None
    pinned=[logical] if ack else []
    return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
    check(label, solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mounted lease['b', 'tree:b', None, None, ['a'], None, ['b']]['b', 'tree:b', None, None, ['a'], None, ['b']]Passed
old ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed
recycled ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed
offscreen['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', 2, ['a'], ['b', 1], []]Passed
collapse['a', None, 'a', None, ['a'], ['a', 1], []]['a', 'tree:a', None, None, ['a'], None, ['a']]Failed
collapse offscreen['a', None, 'a', 1, ['a'], ['a', 1], []]['a', None, 'a', 1, ['a'], ['a', 1], []]Passed
empty tree[None, None, None, None, ['a'], None, []][None, None, None, None, ['a'], None, []]Passed
no ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed

SHA-256 / 59752a6f95ffff8b2afa721ea0c687489e47baffb1f9c7fe5ce2cf1c5e43e8e7

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    visible=d['visible']
    logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
    slot=next((slot for slot,row in d['slots'].items() if row==logical),None)
    ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
    aria=(d['tree']+':'+logical) if ack else None
    request=logical if logical is not None and not ack else None
    scroll=visible.index(logical) if logical in visible and slot is None else None
    selection=d['selection']
    lease=[logical,d['generation']] if request is not None else None
    pinned=[logical] if ack else []
    return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
    check(label, solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
mounted lease['b', 'tree:b', None, None, ['a'], None, ['b']]['b', 'tree:b', None, None, ['a'], None, ['b']]Passed
old ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed
recycled ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed
offscreen['b', None, 'b', 2, ['a'], ['b', 1], []]['b', None, 'b', 2, ['a'], ['b', 1], []]Passed
collapse['a', 'tree:a', None, None, ['a'], None, ['a']]['a', 'tree:a', None, None, ['a'], None, ['a']]Passed
collapse offscreen['a', None, 'a', 1, ['a'], ['a', 1], []]['a', None, 'a', 1, ['a'], ['a', 1], []]Passed
empty tree[None, None, None, None, ['a'], None, []][None, None, None, None, ['a'], None, []]Passed
no ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed

SHA-256 / 3c7cd20b733546b54a016d1b01122f7cf354a1d29a4c6142582405ed7b37b39d

Verification & scope

Synthetic deterministic hierarchical-widget data contract; not an implementation of a browser accessibility tree. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:43:17.921902+00:00.

Case digest / c1d40322eb26c8ec673f092b97006c9d2cdf95066092dfd2810322d7578c6b4a