JIT Failure on lltype.Array access

As best I can tell, the JIT cannot handle my code properly, it corrupts memory and returns 0.0 for float arrays. I don't know whether the true problem is in my code or the JIT, but I need to get this resolved quickly. I know the JIT and my code are interacting badly because py.py works fine (though slow) and translated pypy-c with jit and --jit threshold=9999999 both work fine. Here's what I've tried to resolve the issue: Removing my _immutable_fields_ hints. Hand implementing bh_{get,set}arrayitem_raw_{r,i,f} (though I don't know my implementation was right, I simply copied the gc version and removed the first offset (since raw arrays have no header right? Although I expect that the gc version would have simply gotten 0 for the header size... I tried it anyways) A few thoughts: descr.py alludes to a FloatArrayDescr which I never raw defined Could the asm backend be part of the problem? Rather than the code in llmodel.py? Unfortunately I'm ill equipped to resolve this issue, so any help is appreciated (I'm on my phone but I'll happily furnish exact errors upon request)

Hi Dan, The issue was that the JIT was silently and incorrectly accepting the type lltype.Array(), which is a non-GC but with-length-prefix array, and it was (by mistake) considering it to be a GC array. That's where the errors come from. Now the JIT explicitly refuses to work with such arrays. As explained on IRC, you need anyway in micronumpy to use the type rffi.CArray(), which does not contain the length prefix. A bientot, Armin.

Hi Dan, The issue was that the JIT was silently and incorrectly accepting the type lltype.Array(), which is a non-GC but with-length-prefix array, and it was (by mistake) considering it to be a GC array. That's where the errors come from. Now the JIT explicitly refuses to work with such arrays. As explained on IRC, you need anyway in micronumpy to use the type rffi.CArray(), which does not contain the length prefix. A bientot, Armin.
participants (2)
-
Armin Rigo
-
Dan Roberts