FAILURE MAP
← Case archive

FA-39091 / Tree accessibility / Open access

Virtual tree active-descendant lease: Logical active row is not repaired after branch collapse · case 01

Logical active row is not repaired after branch collapse 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 `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))` by replacing it with `d['active']`.

VERIFIED REPAIR

Restore `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))` at this fault site while retaining the other tree state decisions.

Unsuccessful approach: The partial repair `visible[0] if visible else None` 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']
    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['b', 'tree:b', None, None, ['a'], None, ['b']]['a', 'tree:a', None, None, ['a'], None, ['a']]Failed
collapse offscreen['b', None, 'b', None, ['a'], ['b', 1], []]['a', None, 'a', 1, ['a'], ['a', 1], []]Failed
empty tree['b', None, 'b', None, ['a'], ['b', 1], []][None, None, None, None, ['a'], None, []]Failed
no ack['b', None, 'b', None, ['a'], ['b', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Passed

SHA-256 / 5f76d9774cb35c13e68c232ff03adedfd1ded8e9e0615d81bfc534572cb45b93

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=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['r', None, 'r', 0, ['a'], ['r', 1], []]['b', 'tree:b', None, None, ['a'], None, ['b']]Failed
old ack['r', None, 'r', 0, ['a'], ['r', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed
recycled ack['r', None, 'r', 0, ['a'], ['r', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed
offscreen['r', None, 'r', None, ['a'], ['r', 1], []]['b', None, 'b', 2, ['a'], ['b', 1], []]Failed
collapse['r', None, 'r', 0, ['a'], ['r', 1], []]['a', 'tree:a', None, None, ['a'], None, ['a']]Failed
collapse offscreen['r', None, 'r', 0, ['a'], ['r', 1], []]['a', None, 'a', 1, ['a'], ['a', 1], []]Failed
empty tree[None, None, None, None, ['a'], None, []][None, None, None, None, ['a'], None, []]Passed
no ack['r', None, 'r', 0, ['a'], ['r', 1], []]['b', None, 'b', None, ['a'], ['b', 1], []]Failed

SHA-256 / 80c701bc5bdd052561f2fbd1693b28098a215baef2de09355026315119f1d053

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

Case digest / 4ef679fa5479289a4eb6f8dd8ab16e9cd0dc09257e8a32e7181a1ecd75124a2b