{"abstract":"A generator guarded by an Exception handler dies when throw() delivers ValueError.","category":"Bytecode virtual machines","checks":9,"contract":"A generator frame runs body ops push v, pop, add, yield (pop and hand out a value, suspend), return (pop, finish with StopIteration value), try exc target / endtry (handler stack; handler \"Exception\" catches any thrown name). Commands: next (= send None) and send v resume; resuming a suspended frame pushes the sent value as the result of its yield; sending non-None to a never-started generator is [\"TypeError\"]; a finished generator answers [\"StopIteration\", None]. throw into a created or finished generator finishes it with [\"raised\", exc]; otherwise the innermost matching handler is jumped to, or the generator finishes and re-raises. close finishes the generator. Frame faults are [\"vm-error\"].","evaluation_group":"w2-bytecode-virtual-machines-generator-resumption","failed_approach":"Prefix matching of names does not model the catch-all either.","family":"w2-bytecode-virtual-machines-generator-resumption-handler-matching","id":"FA-90196","implementations":{"attempt":{"sha256":"e090c62c52af53c6cb00dc2911f0d53741f5a4e3d69805b93df9d7253bb83293","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(body, commands):\n    state = 'created'\n    pc = 0\n    stack = []\n    handlers = []\n    out = []\n    def run(inject, exc):\n        nonlocal pc, state\n        if exc is not None:\n            while handlers and not exc.startswith(handlers[-1][0]):\n                handlers.pop()\n            if not handlers:\n                state = 'done'\n                return ['raised', exc]\n            pc = handlers.pop()[1]\n        elif state == 'suspended':\n            stack.append(inject)\n        state = 'running'\n        try:\n            while True:\n                ins = body[pc]\n                op = ins[0]\n                pc += 1\n                if op == 'push':\n                    stack.append(ins[1])\n                elif op == 'pop':\n                    stack.pop()\n                elif op == 'add':\n                    b = stack.pop()\n                    a = stack.pop()\n                    stack.append(a + b)\n                elif op == 'yield':\n                    state = 'suspended'\n                    return ['yielded', stack.pop()]\n                elif op == 'return':\n                    state = 'done'\n                    return ['StopIteration', stack.pop()]\n                elif op == 'try':\n                    handlers.append((ins[1], ins[2]))\n                elif op == 'endtry':\n                    handlers.pop()\n        except (IndexError, TypeError):\n            state = 'done'\n            return ['vm-error']\n    for cmd in commands:\n        kind = cmd[0]\n        if kind in ('next', 'send'):\n            value = cmd[1] if kind == 'send' else None\n            if state == 'done':\n                out.append(['StopIteration', None])\n            elif state == 'created' and value is not None:\n                out.append(['TypeError'])\n            else:\n                out.append(run(value, None))\n        elif kind == 'throw':\n            if state == 'created' or state == 'done':\n                state = 'done'\n                out.append(['raised', cmd[1]])\n            else:\n                out.append(run(None, cmd[1]))\n        else:\n            state = 'done'\n            out.append(['closed'])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 7], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 17], ['StopIteration', 6], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['send', 0], ['next'], ['send', 1]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 11]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 6]]),\n  ('yield hands out and removes the value',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 8], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 43],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 43], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 14], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 24], ['StopIteration', 7], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['send', 0], ['next'], ['send', 2]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 12]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 7]]),\n  ('yield hands out and removes the value',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 13], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 44],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 44], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 21], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 31], ['StopIteration', 8], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['send', 0], ['next'], ['send', 3]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 13]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 8]]),\n  ('yield hands out and removes the value',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 18], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 45],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 28], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 38], ['StopIteration', 9], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['send', 0], ['next'], ['send', 4]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 14]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 9]]),\n  ('yield hands out and removes the value',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 23], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 46],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 46], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 35], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 10], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['send', 0], ['next'], ['send', 5]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 15]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 10]]),\n  ('yield hands out and removes the value',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 28], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 47],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 47], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"2aa55257b2a4901cbdd4b76d8545fc864cc891a66f76fc64d6bfcb27ec7578b2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(body, commands):\n    state = 'created'\n    pc = 0\n    stack = []\n    handlers = []\n    out = []\n    def run(inject, exc):\n        nonlocal pc, state\n        if exc is not None:\n            while handlers and handlers[-1][0] != exc:\n                handlers.pop()\n            if not handlers:\n                state = 'done'\n                return ['raised', exc]\n            pc = handlers.pop()[1]\n        elif state == 'suspended':\n            stack.append(inject)\n        state = 'running'\n        try:\n            while True:\n                ins = body[pc]\n                op = ins[0]\n                pc += 1\n                if op == 'push':\n                    stack.append(ins[1])\n                elif op == 'pop':\n                    stack.pop()\n                elif op == 'add':\n                    b = stack.pop()\n                    a = stack.pop()\n                    stack.append(a + b)\n                elif op == 'yield':\n                    state = 'suspended'\n                    return ['yielded', stack.pop()]\n                elif op == 'return':\n                    state = 'done'\n                    return ['StopIteration', stack.pop()]\n                elif op == 'try':\n                    handlers.append((ins[1], ins[2]))\n                elif op == 'endtry':\n                    handlers.pop()\n        except (IndexError, TypeError):\n            state = 'done'\n            return ['vm-error']\n    for cmd in commands:\n        kind = cmd[0]\n        if kind in ('next', 'send'):\n            value = cmd[1] if kind == 'send' else None\n            if state == 'done':\n                out.append(['StopIteration', None])\n            elif state == 'created' and value is not None:\n                out.append(['TypeError'])\n            else:\n                out.append(run(value, None))\n        elif kind == 'throw':\n            if state == 'created' or state == 'done':\n                state = 'done'\n                out.append(['raised', cmd[1]])\n            else:\n                out.append(run(None, cmd[1]))\n        else:\n            state = 'done'\n            out.append(['closed'])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 7], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 17], ['StopIteration', 6], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['send', 0], ['next'], ['send', 1]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 11]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 6]]),\n  ('yield hands out and removes the value',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 8], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 43],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 43], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 14], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 24], ['StopIteration', 7], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['send', 0], ['next'], ['send', 2]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 12]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 7]]),\n  ('yield hands out and removes the value',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 13], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 44],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 44], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 21], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 31], ['StopIteration', 8], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['send', 0], ['next'], ['send', 3]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 13]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 8]]),\n  ('yield hands out and removes the value',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 18], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 45],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 28], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 38], ['StopIteration', 9], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['send', 0], ['next'], ['send', 4]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 14]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 9]]),\n  ('yield hands out and removes the value',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 23], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 46],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 46], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 35], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 10], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['send', 0], ['next'], ['send', 5]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 15]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 10]]),\n  ('yield hands out and removes the value',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 28], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 47],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 47], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"f8a019999cd82806d62c44a3a1ff8aaf08de22e15580af70a42780f489ed07cb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(body, commands):\n    state = 'created'\n    pc = 0\n    stack = []\n    handlers = []\n    out = []\n    def run(inject, exc):\n        nonlocal pc, state\n        if exc is not None:\n            while handlers and handlers[-1][0] not in (exc, 'Exception'):\n                handlers.pop()\n            if not handlers:\n                state = 'done'\n                return ['raised', exc]\n            pc = handlers.pop()[1]\n        elif state == 'suspended':\n            stack.append(inject)\n        state = 'running'\n        try:\n            while True:\n                ins = body[pc]\n                op = ins[0]\n                pc += 1\n                if op == 'push':\n                    stack.append(ins[1])\n                elif op == 'pop':\n                    stack.pop()\n                elif op == 'add':\n                    b = stack.pop()\n                    a = stack.pop()\n                    stack.append(a + b)\n                elif op == 'yield':\n                    state = 'suspended'\n                    return ['yielded', stack.pop()]\n                elif op == 'return':\n                    state = 'done'\n                    return ['StopIteration', stack.pop()]\n                elif op == 'try':\n                    handlers.append((ins[1], ins[2]))\n                elif op == 'endtry':\n                    handlers.pop()\n        except (IndexError, TypeError):\n            state = 'done'\n            return ['vm-error']\n    for cmd in commands:\n        kind = cmd[0]\n        if kind in ('next', 'send'):\n            value = cmd[1] if kind == 'send' else None\n            if state == 'done':\n                out.append(['StopIteration', None])\n            elif state == 'created' and value is not None:\n                out.append(['TypeError'])\n            else:\n                out.append(run(value, None))\n        elif kind == 'throw':\n            if state == 'created' or state == 'done':\n                state = 'done'\n                out.append(['raised', cmd[1]])\n            else:\n                out.append(run(None, cmd[1]))\n        else:\n            state = 'done'\n            out.append(['closed'])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 7], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 17], ['StopIteration', 6], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['send', 0], ['next'], ['send', 1]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 11]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 6]]),\n  ('yield hands out and removes the value',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 8], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 43],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 43], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 5], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 6], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 14], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 24], ['StopIteration', 7], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['send', 0], ['next'], ['send', 2]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 12]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 7]]),\n  ('yield hands out and removes the value',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 13], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 44],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 44], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 10], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 7], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 21], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 31], ['StopIteration', 8], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['send', 0], ['next'], ['send', 3]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 13]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 8]]),\n  ('yield hands out and removes the value',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 18], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 45],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 15], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 8], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 28], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 38], ['StopIteration', 9], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['send', 0], ['next'], ['send', 4]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 14]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 9]]),\n  ('yield hands out and removes the value',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 23], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 46],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 46], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 20], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 9], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])],\n [('regression: send values through two yields',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 35], ['next'], ['next']]),\n   [['yielded', 1], ['yielded', 45], ['StopIteration', 10], ['StopIteration', None]]),\n  ('non-None send to a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['send', 0], ['next'], ['send', 5]]),\n   [['TypeError'], ['yielded', 1], ['yielded', 15]]),\n  ('sending zero to a suspended generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['next'], ['send', 0], ['next']]),\n   [['yielded', 1], ['yielded', 10], ['StopIteration', 10]]),\n  ('yield hands out and removes the value',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['send', 3], ['next']]),\n   [['yielded', 1], ['StopIteration', 28], ['StopIteration', None]]),\n  ('thrown exception caught by catch-all handler',\n   ([['try', 'Exception', 7],\n     ['push', 1],\n     ['yield'],\n     ['pop'],\n     ['endtry'],\n     ['push', -1],\n     ['return'],\n     ['push', 47],\n     ['yield'],\n     ['pop'],\n     ['push', 0],\n     ['return']],\n    [['next'], ['throw', 'ValueError'], ['next']]),\n   [['yielded', 1], ['yielded', 47], ['StopIteration', 0]]),\n  ('uncaught throw finishes the generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['throw', 'KeyError'], ['next']]),\n   [['yielded', 1], ['raised', 'KeyError'], ['StopIteration', None]]),\n  ('closing a fresh generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['close'], ['next']]),\n   [['closed'], ['StopIteration', None]]),\n  ('closing a suspended generator',\n   ([['push', 25], ['push', 1], ['yield'], ['add'], ['return']], [['next'], ['close'], ['next']]),\n   [['yielded', 1], ['closed'], ['StopIteration', None]]),\n  ('control: throw into a fresh generator',\n   ([['push', 1], ['yield'], ['push', 10], ['add'], ['yield'], ['pop'], ['push', 10], ['return']],\n    [['throw', 'ValueError'], ['next']]),\n   [['raised', 'ValueError'], ['StopIteration', None]])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"A deterministic, bounded teaching model of one bytecode virtual machine mechanism with a stipulated instruction encoding; it is not a production VM and claims no conformance to any real specification. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-bytecode-virtual-machines-generator-resumption-handler-matching","generated_at":"2026-09-29T14:51:24.495198+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Generator state transitions (created/suspended/done) and send/throw semantics are easy to get subtly wrong.","repair":"Match the handler when it names the thrown exception or is the catch-all.","root_cause":"Handler matching compares names exactly, so the catch-all never matches.","sha256":"19cce343908d94666112ad0caf9a4f5cba7541504576b07fb11c92b67cf1b6e0","title":"Generators: catch-all handler ignores thrown exceptions · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.148,"exit_code":1,"observations":[{"actual":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"check":"regression: send values through two yields","expected":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"passed":true},{"actual":[["TypeError"],["yielded",1],["yielded",11]],"check":"non-None send to a fresh generator","expected":[["TypeError"],["yielded",1],["yielded",11]],"passed":true},{"actual":[["yielded",1],["yielded",10],["StopIteration",6]],"check":"sending zero to a suspended generator","expected":[["yielded",1],["yielded",10],["StopIteration",6]],"passed":true},{"actual":[["yielded",1],["StopIteration",8],["StopIteration",null]],"check":"yield hands out and removes the value","expected":[["yielded",1],["StopIteration",8],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["raised","ValueError"],["StopIteration",null]],"check":"thrown exception caught by catch-all handler","expected":[["yielded",1],["yielded",43],["StopIteration",0]],"passed":false},{"actual":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"check":"uncaught throw finishes the generator","expected":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"passed":true},{"actual":[["closed"],["StopIteration",null]],"check":"closing a fresh generator","expected":[["closed"],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["closed"],["StopIteration",null]],"check":"closing a suspended generator","expected":[["yielded",1],["closed"],["StopIteration",null]],"passed":true},{"actual":[["raised","ValueError"],["StopIteration",null]],"check":"control: throw into a fresh generator","expected":[["raised","ValueError"],["StopIteration",null]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: send values through two yields\", \"actual\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"non-None send to a fresh generator\", \"actual\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"expected\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"passed\": true}, {\"check\": \"sending zero to a suspended generator\", \"actual\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"expected\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"passed\": true}, {\"check\": \"yield hands out and removes the value\", \"actual\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"thrown exception caught by catch-all handler\", \"actual\": [[\"yielded\", 1], [\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"yielded\", 43], [\"StopIteration\", 0]], \"passed\": false}, {\"check\": \"uncaught throw finishes the generator\", \"actual\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a fresh generator\", \"actual\": [[\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a suspended generator\", \"actual\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"control: throw into a fresh generator\", \"actual\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"expected\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.442,"exit_code":1,"observations":[{"actual":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"check":"regression: send values through two yields","expected":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"passed":true},{"actual":[["TypeError"],["yielded",1],["yielded",11]],"check":"non-None send to a fresh generator","expected":[["TypeError"],["yielded",1],["yielded",11]],"passed":true},{"actual":[["yielded",1],["yielded",10],["StopIteration",6]],"check":"sending zero to a suspended generator","expected":[["yielded",1],["yielded",10],["StopIteration",6]],"passed":true},{"actual":[["yielded",1],["StopIteration",8],["StopIteration",null]],"check":"yield hands out and removes the value","expected":[["yielded",1],["StopIteration",8],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["raised","ValueError"],["StopIteration",null]],"check":"thrown exception caught by catch-all handler","expected":[["yielded",1],["yielded",43],["StopIteration",0]],"passed":false},{"actual":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"check":"uncaught throw finishes the generator","expected":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"passed":true},{"actual":[["closed"],["StopIteration",null]],"check":"closing a fresh generator","expected":[["closed"],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["closed"],["StopIteration",null]],"check":"closing a suspended generator","expected":[["yielded",1],["closed"],["StopIteration",null]],"passed":true},{"actual":[["raised","ValueError"],["StopIteration",null]],"check":"control: throw into a fresh generator","expected":[["raised","ValueError"],["StopIteration",null]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: send values through two yields\", \"actual\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"non-None send to a fresh generator\", \"actual\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"expected\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"passed\": true}, {\"check\": \"sending zero to a suspended generator\", \"actual\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"expected\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"passed\": true}, {\"check\": \"yield hands out and removes the value\", \"actual\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"thrown exception caught by catch-all handler\", \"actual\": [[\"yielded\", 1], [\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"yielded\", 43], [\"StopIteration\", 0]], \"passed\": false}, {\"check\": \"uncaught throw finishes the generator\", \"actual\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a fresh generator\", \"actual\": [[\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a suspended generator\", \"actual\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"control: throw into a fresh generator\", \"actual\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"expected\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.031,"exit_code":0,"observations":[{"actual":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"check":"regression: send values through two yields","expected":[["yielded",1],["yielded",17],["StopIteration",6],["StopIteration",null]],"passed":true},{"actual":[["TypeError"],["yielded",1],["yielded",11]],"check":"non-None send to a fresh generator","expected":[["TypeError"],["yielded",1],["yielded",11]],"passed":true},{"actual":[["yielded",1],["yielded",10],["StopIteration",6]],"check":"sending zero to a suspended generator","expected":[["yielded",1],["yielded",10],["StopIteration",6]],"passed":true},{"actual":[["yielded",1],["StopIteration",8],["StopIteration",null]],"check":"yield hands out and removes the value","expected":[["yielded",1],["StopIteration",8],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["yielded",43],["StopIteration",0]],"check":"thrown exception caught by catch-all handler","expected":[["yielded",1],["yielded",43],["StopIteration",0]],"passed":true},{"actual":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"check":"uncaught throw finishes the generator","expected":[["yielded",1],["raised","KeyError"],["StopIteration",null]],"passed":true},{"actual":[["closed"],["StopIteration",null]],"check":"closing a fresh generator","expected":[["closed"],["StopIteration",null]],"passed":true},{"actual":[["yielded",1],["closed"],["StopIteration",null]],"check":"closing a suspended generator","expected":[["yielded",1],["closed"],["StopIteration",null]],"passed":true},{"actual":[["raised","ValueError"],["StopIteration",null]],"check":"control: throw into a fresh generator","expected":[["raised","ValueError"],["StopIteration",null]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: send values through two yields\", \"actual\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"yielded\", 17], [\"StopIteration\", 6], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"non-None send to a fresh generator\", \"actual\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"expected\": [[\"TypeError\"], [\"yielded\", 1], [\"yielded\", 11]], \"passed\": true}, {\"check\": \"sending zero to a suspended generator\", \"actual\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"expected\": [[\"yielded\", 1], [\"yielded\", 10], [\"StopIteration\", 6]], \"passed\": true}, {\"check\": \"yield hands out and removes the value\", \"actual\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"StopIteration\", 8], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"thrown exception caught by catch-all handler\", \"actual\": [[\"yielded\", 1], [\"yielded\", 43], [\"StopIteration\", 0]], \"expected\": [[\"yielded\", 1], [\"yielded\", 43], [\"StopIteration\", 0]], \"passed\": true}, {\"check\": \"uncaught throw finishes the generator\", \"actual\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"raised\", \"KeyError\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a fresh generator\", \"actual\": [[\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"closing a suspended generator\", \"actual\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"expected\": [[\"yielded\", 1], [\"closed\"], [\"StopIteration\", null]], \"passed\": true}, {\"check\": \"control: throw into a fresh generator\", \"actual\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"expected\": [[\"raised\", \"ValueError\"], [\"StopIteration\", null]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}