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

N = 1
observations = []
def solve(s):
    return {
        'receiver': next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None),
        'bound_none': s['bound'],
        'locals': dict(s['inherited'],**s['local']),
        'null_shadow': s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'),
        'restore': s['saved'] if s['exited'] else s['current'],
        'trace': s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']),
        'sender': [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]],
        'invoke': not s['disposed'] and not s['exited'],
        'restore_disposed': 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset'),
        'unwind_trace': dict(s['saved_values']),
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 2: [({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': False, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 3: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 6}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 4: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'used', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 0, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 5: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': 'callback', 'disposed': False, 'sender_route': [], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 10}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'local'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': ['a'], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {'b': 10}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(s):
    return {
        'receiver': next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None),
        'bound_none': s['bound'],
        'locals': dict(s['inherited'],**s['local']),
        'null_shadow': s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'),
        'restore': s['saved'] if s['exited'] else s['current'],
        'trace': s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']),
        'sender': [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]],
        'invoke': not s['disposed'] and not s['exited'],
        'restore_disposed': 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset'),
        'unwind_trace': dict(s['current_values'],**s['saved_values']),
    }
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 2}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 2}, 'saved_values': {'a': 0, 'c': 3}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 2: [({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': False, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': 'sender', 'local': {'x': None}, 'inherited': {}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root'], 'exiting_span': 'missing', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'b': 4}}), ({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': False, 'receiver': 'receiver', 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 4}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 4}, 'saved_values': {'a': 0, 'c': 6}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 3: [({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 6}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root', 'a'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'used', 'unwind_trace': {}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 0, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 6}, 'saved_values': {'a': 0, 'c': 9}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 4: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': 'inner-context', 'trace': ['root'], 'sender': ['a'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': None, 'sender': 'sender', 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': [], 'sender': ['a', 'b'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'b', 'reset_token': 't', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': 'outer-context', 'trace': [], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {'x': None}, 'inherited': {}, 'saved': None, 'current': 'inner-context', 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': ['t'], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': None}, 'null_shadow': None, 'restore': 'inner-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'used', 'unwind_trace': {'a': 1, 'b': 8}}), ({'bound': False, 'receiver': 0, 'sender': None, 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 8}, 'saved_values': {'a': 0, 'c': 12}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})], 5: [({'bound': True, 'receiver': None, 'sender': None, 'local': {'x': None}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': False, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {'x': None, 'y': 'shared'}, 'null_shadow': None, 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b', 'a'], 'invoke': True, 'restore_disposed': 'wrong-context', 'unwind_trace': {'a': 0}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root'], 'segment': 'callback', 'disposed': False, 'sender_route': [], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': [], 'spans': ['root', 'a', 'b'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 1, 'b': 10}}), ({'bound': True, 'receiver': 'receiver', 'sender': None, 'local': {}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root', 'child'], 'segment': None, 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'outer', 'y': 'shared'}, 'null_shadow': 'outer', 'restore': None, 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {'x': 'local'}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'a', 'b', 'a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a', 'b'], 'spans': ['root'], 'exiting_span': 'b', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'a', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': False, 'locals': {'x': 'local'}, 'null_shadow': 'local', 'restore': None, 'trace': ['root'], 'sender': ['a', 'b', 'a'], 'invoke': False, 'restore_disposed': 'wrong-context', 'unwind_trace': {}}), ({'bound': True, 'receiver': 0, 'sender': 'sender', 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': 'failure', 'path': ['root'], 'segment': None, 'disposed': False, 'sender_route': ['a'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {}, 'modified_names': ['a'], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': []}, {'receiver': 'B', 'bound_none': True, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': ['a'], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {'b': 10}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': 'outer-context', 'current': None, 'exited': True, 'error': None, 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': [], 'current_values': {}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': [], 'spans': ['root'], 'exiting_span': 'a', 'reset_token': 'new', 'used_tokens': [], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', 'A'], ['inner', 'B']], 'finished_frames': ['inner']}, {'receiver': 'A', 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': 'outer-context', 'trace': ['root'], 'sender': [], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': False, 'receiver': None, 'sender': None, 'local': {}, 'inherited': {}, 'saved': None, 'current': None, 'exited': False, 'error': None, 'path': [], 'segment': None, 'disposed': False, 'sender_route': [], 'current_values': {}, 'saved_values': {}, 'modified_names': [], 'spans': [], 'exiting_span': 'a', 'reset_token': 't', 'used_tokens': [], 'token_context': 'a', 'active_context': 'a', 'receiver_frames': [], 'finished_frames': []}, {'receiver': None, 'bound_none': False, 'locals': {}, 'null_shadow': None, 'restore': None, 'trace': [], 'sender': [], 'invoke': True, 'restore_disposed': 'reset', 'unwind_trace': {}}), ({'bound': True, 'receiver': 'receiver', 'sender': 'sender', 'local': {'x': 'local'}, 'inherited': {'x': 'outer', 'y': 'shared'}, 'saved': 'outer-context', 'current': 'inner-context', 'exited': True, 'error': 'failure', 'path': ['root', 'child'], 'segment': 'callback', 'disposed': True, 'sender_route': ['a', 'b', 'b'], 'current_values': {'a': 1, 'b': 10}, 'saved_values': {'a': 0, 'c': 15}, 'modified_names': ['a', 'b'], 'spans': ['root', 'a', 'b'], 'exiting_span': 'missing', 'reset_token': 'new', 'used_tokens': ['t'], 'token_context': 'b', 'active_context': 'b', 'receiver_frames': [['outer', None], ['inner', 'B']], 'finished_frames': ['outer', 'inner']}, {'receiver': None, 'bound_none': True, 'locals': {'x': 'local', 'y': 'shared'}, 'null_shadow': 'local', 'restore': 'outer-context', 'trace': ['root', 'a', 'b'], 'sender': ['a', 'b'], 'invoke': False, 'restore_disposed': 'reset', 'unwind_trace': {'a': 0}})]}
for i,(state,expected) in enumerate(fixtures[N]):
    check("transition "+str(i), solve(state), 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)

prompt:
Context restoration overwrites locals that the callback never modified; the returned lifecycle plan violates the stated transition contract.

Plan an observer callback context frame. The bound receiver is independent from event sender. Explicit None receiver differs from no receiver binding. Context-local values shadow inherited values, including None. An exit restores the saved outer context even after callback failure. Nested callbacks append a trace segment without rewriting the existing path. A disposed binding rejects invocation but still permits frame restoration. A forwarded sender route collapses adjacent duplicate hops only; a later revisit after another sender is meaningful and preserved. Restore only names modified by the callback. Restore their saved values or delete them if previously absent; retain all unmodified current names. Only an exit matching the active top trace span may pop the stack; out-of-order exits are ignored until their span becomes current. A reset token is single-use and context-bound: report used before wrong-context, otherwise permit reset. Restore the nearest remaining receiver frame, scanning nested frames from inner to outer while skipping completed invocation identities. Inputs are finite state snapshots, including transitional and stale states; output fields are the exact independent actions/metadata defined by the corrected expression table. Numeric fixture capacities and counts vary with N.
Field definitions, each independently computed from the input snapshot: receiver = next((receiver for ident,receiver in reversed(s['receiver_frames']) if ident not in s['finished_frames']),None); bound_none = s['bound']; locals = dict(s['inherited'],**s['local']); null_shadow = s['local']['x'] if 'x' in s['local'] else s['inherited'].get('x'); restore = s['saved'] if s['exited'] else s['current']; trace = s['spans'][:-1] if s['spans'] and s['spans'][-1]==s['exiting_span'] else list(s['spans']); sender = [x for i,x in enumerate(s['sender_route']) if i==0 or x!=s['sender_route'][i-1]]; invoke = not s['disposed'] and not s['exited']; restore_disposed = 'used' if s['reset_token'] in s['used_tokens'] else ('wrong-context' if s['token_context']!=s['active_context'] else 'reset'); unwind_trace = {k:(s['saved_values'][k] if k in s['modified_names'] else s['current_values'][k]) for k in dict.fromkeys(list(s['current_values'])+list(s['saved_values'])) if (k in s['modified_names'] and k in s['saved_values']) or (k not in s['modified_names'] and k in s['current_values'])}

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return True
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return bool(a or b)
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Absent places are treated as aliases.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if False: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0] and len(a)==len(b): return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Different allocation roots become aliases when projection depths differ.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: return True
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y and isinstance(x,str): return True
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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 common field prefix suppresses later disjointness.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if False: return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' and y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Union storage is classified as disjoint sibling fields.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if False: return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' and y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Unresolved dereference provenance is treated as disjoint.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if False: continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and y == 0: continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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 symbolic left index loses possible overlap with a nonzero index.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if False: continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and x == 0: continue
        if isinstance(x, int) and isinstance(y, int): return False
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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 symbolic right index is omitted from alias symmetry.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return True
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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)

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

N = 1
observations = []
def solve(a, b):
    if not a or not b: return False
    if a[0] != b[0]: return False
    for x, y in zip(a[1:], b[1:]):
        if x == y: continue
        if x == '|' or y == '|': return True
        if x == '*' or y == '*': return True
        if x == '?' and isinstance(y, int): continue
        if y == '?' and isinstance(x, int): continue
        if isinstance(x, int) and isinstance(y, int): return abs(x-y)>1
        if isinstance(x, str) and isinstance(y, str): return False
        return False
    return True
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('absent',solve([],['r']),False)
check('both absent',solve([],[]),False)
check('roots depths',solve(['r'],['s','a']),False)
check('shared prefix',solve(['r','a','b'],['r','a','c']),False)
check('union',solve(['r','|'],['r','a']),True)
check('deref',solve(['r','*'],['r','a']),True)
check('dynamic left',solve(['r','?'],['r',N]),True)
check('dynamic right',solve(['r',N],['r','?']),True)
check('separated indices',solve(['r',N],['r',N+3]),False)
check('adjacent indices',solve(['r',N],['r',N+1]),False)
check('fields',solve(['r','a'],['r','b']),False)
check('parent',solve(['r'],['r','a']),True)
check('same',solve(['r',N],['r',N]),True)
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:
Different known array elements retain a false conflict.

Places are lists of projections: root name, then fields or integer indices. Different roots and unequal fields or known indices are disjoint. A wildcard index ? aliases any index. A union projection | overlaps any sibling. Dereference * conservatively overlaps another projection at that depth. Prefix places overlap; empty denotes no place. Return overlap.

split: open-access