These are chat archives for dropbox/pyston

10th
Aug 2015
Travis Hance
@tjhance
Aug 10 2015 01:20 UTC
hm I’m kinda stuck on this bug
in one of my diffs
  • If I disable the baseline jit, the crash goes away
  • If I disable the use of the new rewriting feature, the crash goes away
But… the baseline jit never uses the new rewriting feature
Odd, huh?
Sun
@Daetalus
Aug 10 2015 02:16 UTC
Hi, I just rewrite float comparison base on CPython implementation, every was fine except 0L < float('nan') and 0L <= float('nan'). It could not fall back to floatEq correctly. The commit is in here. Daetalus/pyston@d429342
Only this commit head from official master.
Sun
@Daetalus
Aug 10 2015 02:25 UTC
Sorry, I forgot it still Sunday...
Kevin Modzelewski
@kmod
Aug 10 2015 11:25 UTC
hmm looks like it's falling back to floatGt / floatGe correctly
but those are returning True for nan
ie print float('nan').__gt__(0L)
Marius Wachtler
@undingen
Aug 10 2015 14:55 UTC
@tjhance do you have your current code pushed to your repo? Maybe I can find the issue with bjit + your change
Travis Hance
@tjhance
Aug 10 2015 16:50 UTC
dropbox/pyston#792
knock yourself out
Marius Wachtler
@undingen
Aug 10 2015 17:06 UTC
I took a brief look: the RSP adjustment code looks suspicious. changing the rsp would make the EH table invalid. But more importantly I think you don't 16Byte align the stack, if there is a odd number of args.
Travis Hance
@tjhance
Aug 10 2015 17:06 UTC
oh, really?
I thought RSP was fair game
oops
Marius Wachtler
@undingen
Aug 10 2015 17:09 UTC
I switched back to omitting frame pointers so the SP location is important again for the bjit (and runtime ICs always omitted frame pointers).
concerning the stack alignment: it's very important because when I got it wrong while implementing the bjit I run into very hard to debug problems. Which nearly always worked but in some rare case it crashed..
Travis Hance
@tjhance
Aug 10 2015 17:11 UTC
in this particular situation it should stay aligned though
Sun
@Daetalus
Aug 10 2015 17:11 UTC
@kmod I will continue to investigate it. I will very appreciate if anyone could give some hints about Daetalus/pyston@d429342. Thanks
Travis Hance
@tjhance
Aug 10 2015 17:12 UTC
thanks for the heads up though
Sun
@Daetalus
Aug 10 2015 17:12 UTC
My complex improvements need these...
Marius Wachtler
@undingen
Aug 10 2015 17:18 UTC
@tjhance where do the args for the second slowpath call get set up?
Marius Wachtler
@undingen
Aug 10 2015 17:29 UTC
why do you have todo the stack adjustment? Is there something special about this second slowpath or is this just because the case you are interested in needed more than the 6reg args?
Travis Hance
@tjhance
Aug 10 2015 17:30 UTC
um I just need somewhere to put the args so I can make a function call
hm
wait
I think I’m being dumb
we already have the ability to make function calls (obviously) so there must be stack space allocated already
for this purpose
I’m going to tentatively declare that I was just being dumb earlier
Travis Hance
@tjhance
Aug 10 2015 17:35 UTC
thanks marius
Marius Wachtler
@undingen
Aug 10 2015 17:37 UTC
@Daetalus It's probably your std::isinf call inside else if (std::isinf(i)) {. while cpython uses Py_IS_FINITE which is std::finite or (!Py_IS_INFINITY(X) && !Py_IS_NAN(X))
@tjhance I still didn't really understand the change. But if I could help you than it good, I just hope I didn't just confuse you and your code is already correct.
Marius Wachtler
@undingen
Aug 10 2015 17:42 UTC
but until now AFAIK the rewriter doesn't support passing args on the stack. The bjit therefore manually keeps two 8Byte slots next to the SP avaiable in order to pass up to two additional args. It set's up the two args manually if they are needed...
Marius Wachtler
@undingen
Aug 10 2015 17:54 UTC
and s/std::finite/std::isfinite but maybe we should just use the impl of Py_IS_FINITE
Kevin Modzelewski
@kmod
Aug 10 2015 19:04 UTC
@tjhance I think I've lost track of your PRs
are there any that should be in the "pending review" state?
Rudi Chen
@rudi-c
Aug 10 2015 19:05 UTC
I'm having internet connections issues with
my macbook -_-
Might have to type in my status update later
Kevin Modzelewski
@kmod
Aug 10 2015 19:11 UTC
from hacker news: Ignition: V8 Interpreter
Travis Hance
@tjhance
Aug 10 2015 19:11 UTC
@kmod no
Kevin Modzelewski
@kmod
Aug 10 2015 19:17 UTC
sorry to request those changes on the rearrangeArgs one
Travis Hance
@tjhance
Aug 10 2015 19:17 UTC
it’s been hard for me to find a big chunk of free time these days :(
Kevin Modzelewski
@kmod
Aug 10 2015 19:18 UTC
I'm hoping it's mostly a straightforward transformation
Marius Wachtler
@undingen
Aug 10 2015 19:18 UTC
same for me, but in the coming days it should get better
Kevin Modzelewski
@kmod
Aug 10 2015 19:19 UTC
marius, how's dublin??
Marius Wachtler
@undingen
Aug 10 2015 19:20 UTC
can't say much yet (arrived yesterday evening). But I like what I saw until now :-)
Kevin Modzelewski
@kmod
Aug 10 2015 19:21 UTC
:)
Marius Wachtler
@undingen
Aug 10 2015 19:22 UTC
tomorrow at 10am I have my first day at the office :-)
Kevin Modzelewski
@kmod
Aug 10 2015 19:24 UTC
nice!
how's the apartment / living situation?
Marius Wachtler
@undingen
Aug 10 2015 19:24 UTC
But I have to adopt to the left-hand traffic. Had today already a few incidents where I was looking into the wrong direction while crossing a street
Apartment is very nice, and not to far away from the office. So I plan to walk tomorrow. But there are no mountains to easily check in what direction one is walking?!? :-P
Marius Wachtler
@undingen
Aug 10 2015 19:31 UTC
good thing that there is gps
Kevin Modzelewski
@kmod
Aug 10 2015 19:32 UTC
:)
Marius Wachtler
@undingen
Aug 10 2015 19:35 UTC
I'm currently trying to rewrite nonzero calls. Is my assumption correct that I will need to add a call to a helper function which checks the returned type after calling __nonzero__. Because I can't assume that it's alays returning an int/long?
and I have to throw an exception if it's a different type and I can't directly emit the code for this with the rewriter
Kevin Modzelewski
@kmod
Aug 10 2015 19:48 UTC
that sounds right
Marius Wachtler
@undingen
Aug 10 2015 20:47 UTC
I just found this in the news and skimmed trough it: https://hal.inria.fr/hal-01100647/document Branch Prediction and the Performance of Interpreters - Don’t Trust Folklore
it contains graphs of python2/python3 perf change of using a threaded interpreter --> with ever new intel cpu generation it makes less a difference
Rudi Chen
@rudi-c
Aug 10 2015 21:09 UTC
attrs->attr_list = new (HCAttrs::AttrList*)gc_alloc(new_size, gc::GCKind::PRECISE); in objmodel.cpp
Is there any reason the new needs to be there?
Marius Wachtler
@undingen
Aug 10 2015 21:18 UTC
mmh I'm trying to parse what the new is going todo....
Is this a c++ quiz? ^^
Travis Hance
@tjhance
Aug 10 2015 21:18 UTC
I had no idea this was syntatically valid
Rudi Chen
@rudi-c
Aug 10 2015 21:21 UTC
Oh I'm just replacing the way HCAttrs:AttrList are allocated, trying to figure out if I'm missing something.