Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

jit/backend/x86/test/test_loop_unroll.py::TestLoopSpec::()::test_interp_many_paths

self = <rpython.jit.backend.x86.test.test_loop_unroll.TestLoopSpec object at 0x00000201ebd05b78>

    def test_interp_many_paths(self):
        myjitdriver = JitDriver(greens = ['i'], reds = ['x', 'node'])
        NODE = self._get_NODE()
        bytecode = "xxxxxxxb"
        def f(node):
            x = 0
            i = 0
            while i < len(bytecode):
                myjitdriver.jit_merge_point(i=i, x=x, node=node)
                op = bytecode[i]
                if op == 'x':
                    if not node:
                        break
                    if node.value < 100:   # a pseudo-random choice
                        x += 1
                    node = node.next
                elif op == 'b':
                    i = 0
                    myjitdriver.can_enter_jit(i=i, x=x, node=node)
                    continue
                i += 1
            return x
    
        node1 = self.nullptr(NODE)
        for i in range(300):
            prevnode = self.malloc(NODE)
            prevnode.value = pow(47, i, 199)
            prevnode.next = node1
            node1 = prevnode
    
        expected = f(node1)
>       res = self.meta_interp(f, [node1])

jit\metainterp\test\test_loop.py:235: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
jit\metainterp\test\support.py:265: in meta_interp
    return ll_meta_interp(*args, **kwds)
jit\metainterp\warmspot.py:89: in ll_meta_interp
    return jittify_and_run(interp, graph, args, backendopt=backendopt, **kwds)
jit\metainterp\warmspot.py:127: in jittify_and_run
    res = interp.eval_graph(graph, args)
rtyper\llinterp.py:102: in eval_graph
    retval = llframe.eval()
rtyper\llinterp.py:300: in eval
    nextblock, args = self.eval_block(nextblock)
rtyper\llinterp.py:324: in eval_block
    self.eval_operation(op)
rtyper\llinterp.py:427: in eval_operation
    retval = ophandler(*vals)
rtyper\llinterp.py:702: in op_direct_call
    return self.perform_call(f, FTYPE.ARGS, args)
rtyper\llinterp.py:689: in perform_call
    return self.invoke_callable_with_pyexceptions(f, *args)
rtyper\llinterp.py:496: in invoke_callable_with_pyexceptions
    return obj._callable(*args)
jit\metainterp\warmspot.py:954: in ll_portal_runner
    portal_ptr)(*args)
jit\codewriter\support.py:163: in on_top_of_llinterp
    return llinterp.eval_graph(funcobj.graph, list(args))
rtyper\llinterp.py:102: in eval_graph
    retval = llframe.eval()
rtyper\llinterp.py:300: in eval
    nextblock, args = self.eval_block(nextblock)
rtyper\llinterp.py:324: in eval_block
    self.eval_operation(op)
rtyper\llinterp.py:427: in eval_operation
    retval = ophandler(*vals)
rtyper\llinterp.py:702: in op_direct_call
    return self.perform_call(f, FTYPE.ARGS, args)
rtyper\llinterp.py:689: in perform_call
    return self.invoke_callable_with_pyexceptions(f, *args)
rtyper\llinterp.py:512: in invoke_callable_with_pyexceptions
    self.make_llexception()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <rpython.rtyper.llinterp.LLFrame object at 0x00000201ebc3fbb0>
exc = RuntimeError('maximum recursion depth exceeded',)

    def make_llexception(self, exc=None):
        if exc is None:
            original = sys.exc_info()
            exc = original[1]
            # it makes no sense to convert some exception classes that
            # just mean something buggy crashed
            if isinstance(exc, (AssertionError, AttributeError,
                                TypeError, NameError,
                                KeyboardInterrupt, SystemExit,
                                ImportError, SyntaxError)):
                raise original[0], original[1], original[2]     # re-raise it
            # for testing the JIT (see ContinueRunningNormally) we need
            # to let some exceptions introduced by the JIT go through
            # the llinterpreter uncaught
            if getattr(exc, '_go_through_llinterp_uncaught_', False):
                raise original[0], original[1], original[2]     # re-raise it
            extraargs = (original,)
        else:
            extraargs = ()
        typer = self.llinterpreter.typer
        exdata = typer.exceptiondata
        evalue = exdata.get_standard_ll_exc_instance_by_class(exc.__class__)
        etype = self.op_direct_call(exdata.fn_type_of_exc_inst, evalue)
>       raise LLException(etype, evalue, *extraargs)
E       LLException: <LLException 'RuntimeError'
E        | Traceback (most recent call last):
E        |   File "D:\a\pypy\pypy\rpython\rtyper\llinterp.py", line 496, in invoke_callable_with_pyexceptions
E        |     return obj._callable(*args)
E        |   File "D:\a\pypy\pypy\rpython\jit\metainterp\warmspot.py", line 581, in maybe_enter_jit
E        |     crash_in_jit(e)
E        |   File "D:\a\pypy\pypy\rpython\jit\metainterp\warmspot.py", line 560, in crash_in_jit
E        |     raise e
E        | RuntimeError: maximum recursion depth exceeded
E        `------>

rtyper\llinterp.py:491: LLException
---------- Captured stderr call ----------
[platform:msg] Updated environment with vsver 160, using x64 True
[rtyper] -=- specialized 14 blocks -=-
[rtyper] -=- specialized 4 more blocks -=-
[rtyper] -=- specialized 2 more blocks -=-
[rtyper] -=- specialized 7 more blocks -=-
[rtyper] -=- specialized 6 more blocks -=-
[rtyper] -=- specialized 19 more blocks -=-
[rtyper] -=- specialized 12 more blocks -=-
[rtyper] -=- specialized 3 more blocks -=-
[jitcodewriter:info] making JitCodes...
[jitcodewriter:WARNING] found debug_assert in <FunctionGraph of (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg__rpy_stringPtr_Signed at 0x201eb95f408>; should have be removed
[jitcodewriter:WARNING] found debug_assert in <FunctionGraph of (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg__rpy_stringPtr_Signed at 0x201eb95f408>; should have be removed
[jitcodewriter:info] There are 2 JitCode instances.
[jitcodewriter:info] There are 8 -live- ops. Size of liveness is 10 bytes
[jitcodewriter] compute_bitstrings:
[jitcodewriter]   1 effectinfos:
[jitcodewriter]     0 descrs for arrays
[jitcodewriter]     0 descrs for fields
[jitcodewriter]     0 descrs for interiorfields
[jitcodewriter] -> 1 bitstrings, mean length 0.0, max length 0
builder: rpython-win-x86-64 build #767*
test: jit/backend/x86/test/test_loop_unroll.py::TestLoopSpec::()::test_interp_many_paths