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

N = 1
observations = []
def solve(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'lane': seed, 'ordinary': payload[:], 'urgent': [seed+9], 'inflight': [seed-1], 'budget': 0, 'bindings': int(phase in ('urgent','throttled','draining'))}
    frames = []
    observed = []
    table = {('ordinary', 'request_urgent'): ('requested', 'send_lane_request'), ('requested', 'lane_granted'): ('urgent', 'bind_lane'), ('requested', 'lane_denied'): ('ordinary', 'notify_denied'), ('urgent', 'budget_empty'): ('throttled', 'queue_urgent'), ('throttled', 'budget_grant'): ('urgent', 'drain_urgent'), ('urgent', 'lane_revoked'): ('ordinary', 'relabel_inflight'), ('draining', 'inflight_empty'): ('ordinary', 'release_lane'), ('throttled', 'ordinary_message'): ('throttled', 'send_ordinary'), ('urgent', 'ordinary_message'): ('urgent', 'send_ordinary'), ('ordinary', 'urgent_receipt'): ('ordinary', 'reject_unbound')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'send_lane_request':
            frames.append(['REQUEST_URGENT',seed])
        elif action == 'bind_lane':
            r['lane']=seed+1; r['budget']=len(payload)
        elif action == 'notify_denied':
            frames.append(['URGENT_DENIED',seed])
        elif action == 'queue_urgent':
            r['urgent'].extend(payload)
        elif action == 'drain_urgent':
            frames.append(['URGENT',r['urgent'][:]]); r['urgent']=[]
        elif action == 'stop_admission':
            r['budget']=0
        elif action == 'release_lane':
            r['bindings']=0
        elif action == 'send_ordinary':
            frames.append(['ORDINARY',payload])
        elif action == 'reject_unbound':
            frames.append(['UNBOUND_RECEIPT',seed])
        elif action == 'send_urgent':
            frames.append(['URGENT',payload])
        elif action == 'mark_payload':
            frames.append(['URGENT',payload])
        elif action == 'bind_default':
            r['lane']=0
        elif action == 'drop_queued':
            r['ordinary']=[]; r['urgent']=[]
        elif action == 'drop_urgent':
            r['urgent']=[]
        elif action == 'drain_ordinary':
            frames.append(['ORDINARY',r['ordinary'][:]]); r['ordinary']=[]
        elif action == 'relabel_inflight':
            r['ordinary'].extend(r['inflight']); r['inflight']=[]
        elif action == 'keep_binding':
            r['budget']=0
        elif action == 'queue_ordinary':
            r['ordinary'].extend(payload)
        elif action == 'credit_budget':
            r['budget']+=1
        else:
            if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
                frames.append([action, payload[:]])
        observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
    return observed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 3, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 1]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10, 1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [1, 2, 3]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [1, 2, 3]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 1]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1]]}, {'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1]]}, {'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1], ['REQUEST_URGENT', 1]]}, {'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1], ['REQUEST_URGENT', 1], ['URGENT_DENIED', 1]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10, 1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]]]}, {'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]], ['ORDINARY', [1, 2, 3]]]}, {'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]], ['ORDINARY', [1, 2, 3]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 4, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 2]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11, 2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [2, 3, 4, 5]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [2, 3, 4, 5]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 2]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent'], [{'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2]]}, {'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2]]}, {'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2]]}, {'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2], ['URGENT_DENIED', 2]]}, {'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11, 2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]]]}, {'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}, {'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}, {'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 5, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 3]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12, 3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [3, 4, 5, 6, 7]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [3, 4, 5, 6, 7]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 3]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}, {'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}, {'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12, 3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]]]}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['URGENT', [3, 4, 5, 6, 7]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 6, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 4]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13, 4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [4, 5, 6, 7, 8, 9]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [4, 5, 6, 7, 8, 9]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 4]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent'], [{'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant', 'budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13, 4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]]]}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['URGENT', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['URGENT', [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 6, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 7, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 5]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14, 5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 5]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant', 'budget_empty', 'budget_grant'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14, 5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), 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(phase, events, seed):
    payload = list(range(seed, seed * 2 + 2))
    r = {'lane': seed, 'ordinary': payload[:], 'urgent': [seed+9], 'inflight': [seed-1], 'budget': 0, 'bindings': int(phase in ('urgent','throttled','draining'))}
    frames = []
    observed = []
    table = {('ordinary', 'request_urgent'): ('requested', 'send_lane_request'), ('requested', 'lane_granted'): ('urgent', 'bind_lane'), ('requested', 'lane_denied'): ('ordinary', 'notify_denied'), ('urgent', 'budget_empty'): ('throttled', 'queue_urgent'), ('throttled', 'budget_grant'): ('urgent', 'drain_urgent'), ('urgent', 'lane_revoked'): ('urgent', 'ignore'), ('draining', 'inflight_empty'): ('ordinary', 'release_lane'), ('throttled', 'ordinary_message'): ('throttled', 'send_ordinary'), ('urgent', 'ordinary_message'): ('urgent', 'send_ordinary'), ('ordinary', 'urgent_receipt'): ('ordinary', 'reject_unbound')}
    for event in events:
        phase, action = table.get((phase, event), (phase, "reject"))
        if action == 'send_lane_request':
            frames.append(['REQUEST_URGENT',seed])
        elif action == 'bind_lane':
            r['lane']=seed+1; r['budget']=len(payload)
        elif action == 'notify_denied':
            frames.append(['URGENT_DENIED',seed])
        elif action == 'queue_urgent':
            r['urgent'].extend(payload)
        elif action == 'drain_urgent':
            frames.append(['URGENT',r['urgent'][:]]); r['urgent']=[]
        elif action == 'stop_admission':
            r['budget']=0
        elif action == 'release_lane':
            r['bindings']=0
        elif action == 'send_ordinary':
            frames.append(['ORDINARY',payload])
        elif action == 'reject_unbound':
            frames.append(['UNBOUND_RECEIPT',seed])
        elif action == 'send_urgent':
            frames.append(['URGENT',payload])
        elif action == 'mark_payload':
            frames.append(['URGENT',payload])
        elif action == 'bind_default':
            r['lane']=0
        elif action == 'drop_queued':
            r['ordinary']=[]; r['urgent']=[]
        elif action == 'drop_urgent':
            r['urgent']=[]
        elif action == 'drain_ordinary':
            frames.append(['ORDINARY',r['ordinary'][:]]); r['ordinary']=[]
        elif action == 'relabel_inflight':
            r['ordinary'].extend(r['inflight']); r['inflight']=[]
        elif action == 'keep_binding':
            r['budget']=0
        elif action == 'queue_ordinary':
            r['ordinary'].extend(payload)
        elif action == 'credit_budget':
            r['budget']+=1
        else:
            if action not in ("wait", "ignore", "keep", "retain", "keep_peer", "keep_offer", "keep_hold", "keep_batch", "retain_staging", "keep_staging", "keep_local_owner", "keep_old_session", "keep_address", "keep_old_expiry", "ignore_conflict", "keep_service", "keep_subscription", "retain_shadow", "keep_live", "keep_suspicion", "keep_roles", "keep_staged"):
                frames.append([action, payload[:]])
        observed.append(json.loads(json.dumps({"phase": phase, "registers": r, "frames": frames})))
    return observed
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 3, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 1]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10, 1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [1, 2, 3]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [1, 2, 3]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 1]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1]]}, {'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1]]}, {'phase': 'requested', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1], ['REQUEST_URGENT', 1]]}, {'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 1], ['URGENT_DENIED', 1], ['REQUEST_URGENT', 1], ['URGENT_DENIED', 1]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10, 1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]]]}, {'phase': 'urgent', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]], ['ORDINARY', [1, 2, 3]]]}, {'phase': 'throttled', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [1, 2, 3], 'inflight': [0], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [10, 1, 2, 3]], ['ORDINARY', [1, 2, 3]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 1, 'ordinary': [1, 2, 3], 'urgent': [10], 'inflight': [0], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [1, 2, 3]]]}])], 2: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 4, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 2]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11, 2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [2, 3, 4, 5]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [2, 3, 4, 5]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 2]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent'], [{'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2]]}, {'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2]]}, {'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2]]}, {'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2], ['URGENT_DENIED', 2]]}, {'phase': 'requested', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2], ['URGENT_DENIED', 2], ['REQUEST_URGENT', 2]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11, 2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]]]}, {'phase': 'urgent', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}, {'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}, {'phase': 'throttled', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [2, 3, 4, 5], 'inflight': [1], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [11, 2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]], ['ORDINARY', [2, 3, 4, 5]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 2, 'ordinary': [2, 3, 4, 5], 'urgent': [11], 'inflight': [1], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [2, 3, 4, 5]]]}])], 3: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 5, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 3]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12, 3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [3, 4, 5, 6, 7]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [3, 4, 5, 6, 7]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 3]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}, {'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}, {'phase': 'requested', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3]]}, {'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3], ['REQUEST_URGENT', 3], ['URGENT_DENIED', 3]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant'], [{'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12, 3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]]]}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'throttled', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [3, 4, 5, 6, 7], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]]]}, {'phase': 'urgent', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [], 'inflight': [2], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [12, 3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['ORDINARY', [3, 4, 5, 6, 7]], ['URGENT', [3, 4, 5, 6, 7]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 3, 'ordinary': [3, 4, 5, 6, 7], 'urgent': [12], 'inflight': [2], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [3, 4, 5, 6, 7]]]}])], 4: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 6, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 4]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13, 4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [4, 5, 6, 7, 8, 9]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [4, 5, 6, 7, 8, 9]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 4]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent'], [{'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}, {'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4]]}, {'phase': 'requested', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4], ['URGENT_DENIED', 4], ['REQUEST_URGENT', 4]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant', 'budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13, 4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]]]}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'urgent', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['URGENT', [4, 5, 6, 7, 8, 9]]]}, {'phase': 'throttled', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [4, 5, 6, 7, 8, 9], 'inflight': [3], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [13, 4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['ORDINARY', [4, 5, 6, 7, 8, 9]], ['URGENT', [4, 5, 6, 7, 8, 9]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 4, 'ordinary': [4, 5, 6, 7, 8, 9], 'urgent': [13], 'inflight': [3], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [4, 5, 6, 7, 8, 9]]]}])], 5: [('ordinary/request_urgent', 'ordinary', ['request_urgent'], [{'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5]]}]), ('requested/lane_granted', 'requested', ['lane_granted'], [{'phase': 'urgent', 'registers': {'lane': 6, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 7, 'bindings': 0}, 'frames': []}]), ('requested/lane_denied', 'requested', ['lane_denied'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['URGENT_DENIED', 5]]}]), ('urgent/budget_empty', 'urgent', ['budget_empty'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14, 5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('throttled/budget_grant', 'throttled', ['budget_grant'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14]]]}]), ('urgent/lane_revoked', 'urgent', ['lane_revoked'], [{'phase': 'draining', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}]), ('draining/inflight_empty', 'draining', ['inflight_empty'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': []}]), ('throttled/ordinary_message', 'throttled', ['ordinary_message'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}]), ('urgent/ordinary_message', 'urgent', ['ordinary_message'], [{'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}]), ('ordinary/urgent_receipt', 'ordinary', ['urgent_receipt'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['UNBOUND_RECEIPT', 5]]}]), ('ordered trace 0', 'ordinary', ['request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied', 'request_urgent', 'lane_denied'], [{'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}, {'phase': 'requested', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5]]}, {'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5], ['REQUEST_URGENT', 5], ['URGENT_DENIED', 5]]}]), ('ordered trace 3', 'urgent', ['budget_empty', 'budget_grant', 'ordinary_message', 'budget_empty', 'ordinary_message', 'budget_grant', 'budget_empty', 'budget_grant'], [{'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14, 5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': []}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'throttled', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [5, 6, 7, 8, 9, 10, 11], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}, {'phase': 'urgent', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [], 'inflight': [4], 'budget': 0, 'bindings': 1}, 'frames': [['URGENT', [14, 5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['ORDINARY', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]], ['URGENT', [5, 6, 7, 8, 9, 10, 11]]]}]), ('empty input', 'ordinary', [], []), ('unknown event', 'ordinary', ['unsupported'], [{'phase': 'ordinary', 'registers': {'lane': 5, 'ordinary': [5, 6, 7, 8, 9, 10, 11], 'urgent': [14], 'inflight': [4], 'budget': 0, 'bindings': 0}, 'frames': [['reject', [5, 6, 7, 8, 9, 10, 11]]]}])]}
for label, phase, events, expected in cases[N]:
    check(label, solve(phase, events, N), 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:
While urgent, event lane_revoked produces ordinary/relabel_inflight instead of draining/stop_admission.

For the stipulated Negotiated urgent-message lane controller, initialize the explicitly shown resource registers from seed (1..5), then consume classified events sequentially. After each event return a deep snapshot of phase, resource registers, and cumulative emitted control frames. The explicit ten phase/event rules and their resource effects define admission and response semantics. Unlisted events preserve phase and emit rejection. Payload is the consecutive integers seed through 2*seed+1. Empty event input returns no observations.

split: open-access