Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
I would not be surprised if static methods are simply unsupported by the JIT (but likely for no good reason) On Sat, Oct 25, 2014 at 12:37 AM, Timothy Baldridge tbaldri...@gmail.com wrote: I'm in the process of adding FFI to pixie. It translates and runs fine (I'm sure there's still bugs). But the trace is a bit verbose, so I decided I'd unroll the loop that packs the arguments in the exchange buffer. However then I get this error: [translation:info]File 388-codegen /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rtyper.py:540, line 4, in translate_op_call_args [translation:info] return r_arg1.rtype_call_args(hop) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rpbc.py, line 659, in rtype_call_args [translation:info] return self.redispatch_call(hop, call_args=True) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rpbc.py, line 686, in redispatch_call [translation:info] hop.llops, hop) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rclass.py, line 1075, in rtype_new_instance [translation:info] return rinstance.new_instance(llops, classcallhop) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rclass.py, line 715, in new_instance [translation:info] r.convert_desc_or_const(value)) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/rmodel.py, line 115, in convert_desc_or_const [translation:info] return self.convert_const(desc_or_const.value) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/rtyper/lltypesystem/rpbc.py, line 158, in convert_const [translation:info] funcdesc = self.rtyper.annotator.bookkeeper.getdesc(value) [translation:info]File /Users/tim/oss-not-dropbox/externals/pypy/rpython/annotator/bookkeeper.py, line 396, in getdesc [translation:info] raise Exception(%s: %r % (msg, pyobj)) [translation:ERROR] Exception: unexpected prebuilt constant: staticmethod object at 0x10a8d5bb0 The line I'm un-commenting is here: https://github.com/pixie-lang/pixie/blob/master/pixie/vm/libs/ffi.py#L150 From what I can tell this bug is from the translator trying to do something with the static methods in CallDescr. Why this is happening, I haven't a clue. Timothy ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
Hi, On 25 October 2014 10:10, Maciej Fijalkowski fij...@gmail.com wrote: I would not be surprised if static methods are simply unsupported by the JIT (but likely for no good reason) That's not a crash of the JIT: /Users/tim/oss-not-dropbox/externals/pypy/rpython/annotator/bookkeeper.py, line 396, in getdesc [translation:info] raise Exception(%s: %r % (msg, pyobj)) [translation:ERROR] Exception: unexpected prebuilt constant: staticmethod object at 0x10a8d5bb0 What is unsupported at all is staticmethod objects in RPython. I have no clue why uncommenting that jit.unroll_safe makes the annotator sees some staticmethod object... You have to figure out what this pyobj is. A bientôt, Armin. ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
On 25/10/14 14:24, Armin Rigo wrote: Hi, On 25 October 2014 10:10, Maciej Fijalkowski fij...@gmail.com wrote: I would not be surprised if static methods are simply unsupported by the JIT (but likely for no good reason) That's not a crash of the JIT: /Users/tim/oss-not-dropbox/externals/pypy/rpython/annotator/bookkeeper.py, line 396, in getdesc [translation:info] raise Exception(%s: %r % (msg, pyobj)) [translation:ERROR] Exception: unexpected prebuilt constant: staticmethod object at 0x10a8d5bb0 What is unsupported at all is staticmethod objects in RPython. I have no clue why uncommenting that jit.unroll_safe makes the annotator sees some staticmethod object... You have to figure out what this pyobj is. I don't understand what you mean by staticmethod objects being unsupported. We use staticmethod a bit everywhere in PyPy, no? Anyway, I tried to run translation of pixie to debug the error, and am getting this problem: https://bpaste.net/show/4eb70f41ce44 (which is unrelated) Cheers, Carl Friedrich ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
Hi Armin, OK, that's a very nice statement for people that know the internals of the annotator, but for not really helpful for people like me who don't ;-). What does that mean on the language level? How do you 'ask the bookkeeper for a desc'? Maybe we can document that somewhere, or improve the error message. Cheers, Carl Friedrich On October 25, 2014 2:55:34 PM CEST, Armin Rigo ar...@tunes.org wrote: Hi Carl Friedrich, On 25 October 2014 14:42, Carl Friedrich Bolz cfb...@gmx.de wrote: I don't understand what you mean by staticmethod objects being unsupported. We use staticmethod a bit everywhere in PyPy, no? Unsupported as in asking the bookkeeper for a desc for a staticmethod object is not supported and will crash as reported. For the common use case of staticmethod objects which come out of classes, and are read as normal functions, there is a special case in description.py. A bientôt, Armin. ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
Hi Carl Friedrich, On 25 October 2014 15:00, Carl Friedrich Bolz cfb...@gmx.de wrote: OK, that's a very nice statement for people that know the internals of the annotator, but for not really helpful for people like me who don't ;-). What does that mean on the language level? How do you 'ask the bookkeeper for a desc'? Maybe we can document that somewhere, or improve the error message. Sorry :-) We have some staticmethod object that comes from somewhere unexpected. That's all I can guess by seeing Timothy's partial traceback. I only mentioned this because Maciej's two-lines message was IMHO mistaken, to avoid that Timothy or someone else spends time looking at the wrong place. I would need to reproduce the crash to know more precisely, but your experience with trying to do so discourages me from trying :-) A bientôt, Armin. ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev
Re: [pypy-dev] translation error on jit.unroll_safe with jit_libffi
Hi Timothy, On 25 October 2014 15:48, Timothy Baldridge tbaldri...@gmail.com wrote: If you get latest, you should be able to get the PBC error on linux now. I mostly develop on OSX so that was an error I needed to fix for the Linux people. Fixed in 76cd145da640 - 41343203ab73. I'm not 100% sure to understand the reasons, but this was definitely pushing the barriers of what is or is not RPython. A bientôt, Armin. ___ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev