These are chat archives for dropbox/pyston

19th
May 2015
Chris Toshok
@toshok
May 19 2015 00:29
for user classes is it true that all attributes are set on the class before finishInitialization is called?
because it doesn’t appear to be true
Kevin Modzelewski
@kmod
May 19 2015 00:43
I believe none of them are
at least, currently
Chris Toshok
@toshok
May 19 2015 00:46
okay, cool. I’ll stop trying to prove myself wrong :)
Chris Toshok
@toshok
May 19 2015 19:40
so one thing I’m running into with the shape/typeLookup PR is that stat counts show a lot more slowpath hits
which doesn’t make a tremendous amount of sense to me
our tests aren’t really showing a lot of polymorphism, so the shape guards should just be expressing things in a different way
Chris Toshok
@toshok
May 19 2015 19:49
gist.github.com/toshok/7ac3e28e4ede26746165 shows the IC slot for a typical callattr IC
Marius Wachtler
@undingen
May 19 2015 20:03
intel should really but a FPGA inside there consumer x86 cpus, I want to have single custom instruction for this IC :-P
Chris Toshok
@toshok
May 19 2015 20:20
haha
yes
Chris Toshok
@toshok
May 19 2015 20:27
0x7ffff543a31d <<module>_e1_23+17181>   mov    (%rdi),%rcx
0x7ffff543a320 <<module>_e1_23+17184>   movabs $0x1270022088,%rcx
hmm
Marius Wachtler
@undingen
May 19 2015 20:43
first load guards against null pointers :-)
Chris Toshok
@toshok
May 19 2015 20:46
is that really it? because that’s awesome
:)
okay this gist seems to show a problem:
that comes from int(i*1.1) where i is an int
Rudi Chen
@rudi-c
May 19 2015 20:56
What is the difference between heads and full_heads in SmallArena?
Chris Toshok
@toshok
May 19 2015 20:57
full_heads are the blocks whose bitmaps were scanned and we couldn’t locate an empty Atom
heads are the ones we’re currently allocating from
Rudi Chen
@rudi-c
May 19 2015 20:59
More general question, does the data structure that SmallArena implements have a name?
Chris Toshok
@toshok
May 19 2015 20:59
btw, if anyone ever sees:
(gdb) print attr
$35 = (const std::string &) @0x1f50ea0: <incomplete type>
(gdb) print *(char**)&attr
$37 = 0x1f846a8 "__call__"
Kevin Modzelewski
@kmod
May 19 2015 20:59
oh nice
Chris Toshok
@toshok
May 19 2015 20:59
std::string stores a pointer to the char* at offset 0
@rudi-c hm, I don’t think so.. but I might be misunderstanding
Rudi Chen
@rudi-c
May 19 2015 21:05
Ok. What are ThreadBlockCache(s)?
Chris Toshok
@toshok
May 19 2015 21:05
ah, those are cached blocks that a thread can use without taking a small arena (i think, maybe heap?) lock
to reduce contention in the case where we have many allocating threads
Rudi Chen
@rudi-c
May 19 2015 21:07
So we can potentially have data in both the SmallArena heads and the ThreadBlockCache heads right?
Chris Toshok
@toshok
May 19 2015 21:07
yes
Rudi Chen
@rudi-c
May 19 2015 21:07
Ok. Just checking they don't end up referring to the same blocks.
Thanks
Chris Toshok
@toshok
May 19 2015 21:08
do we have any debug helpers for Box::getattr such that I can call it from gdb?
i.e. (gdb) print debuggetattr(box, “__init__”) or something?
Marius Wachtler
@undingen
May 19 2015 21:16
maybe calling PyObject_GetAttrString works?
Chris Toshok
@toshok
May 19 2015 21:39
oh, good ideaw
s/ideaw/idea
err, darn :)
(gdb) print PyObject_GetAttrString(obj, "__init__")
$1 = (PyObject *) 0x12700d3cc8
perfect
Marius Wachtler
@undingen
May 19 2015 21:59
:+1:
Marius Wachtler
@undingen
May 19 2015 22:12
Can someone please give me a hint why: dropbox/pyston#539 is failing? I can reproduce it locally by running make check but if I manually run the test it works.
Kevin Modzelewski
@kmod
May 19 2015 22:21
hmm I think they use different builds of the test extension
run_capi_slots uses the one in the source directory but check_capI_slots uses the one from the build directory
(sorry about that)
not sure why one is failing but not the other
Kevin Modzelewski
@kmod
May 19 2015 22:28
oh, nevermind that's a red herring
looks like the changes you added don't work in cpython for some reason :/
you can try make pyrun_capi_slots
Marius Wachtler
@undingen
May 19 2015 22:31
oh okay thanks
ok found it: one must set tp_new
thought it would default to PyType_GenericNew
Chris Toshok
@toshok
May 19 2015 22:58
okay, I think I see a problem wrt typeLookup
specifically with typeCalls
typeLookup looks up attributes in the box’s class
so if we’re calling int() we actually do typeLookups of __new__/__init__ vs int_cls->cls (i.e. type_cls)
Chris Toshok
@toshok
May 19 2015 23:04
hm, no we do the initial typeLookup (of __call__) against the class’s cls
Chris Toshok
@toshok
May 19 2015 23:18
heh, it was this:
RewriterVar* _mro_elts = _mro->getAttr(offsetof(BoxedTuple, elts));
RewriterVar* _mro_cls = _mro_elts->getAttr(index * sizeof(Box*));
that should have been:
RewriterVar* _mro_cls = _mro->getAttr(offsetof(BoxedTuple, elts) + index * sizeof(Box*));
one additional dereference
Chris Toshok
@toshok
May 19 2015 23:35
is the exit code of tests really supposed to be 1?
the ones that abort print out something like (exit status -6, expected 0)
but I have a couple of failing tests that print (exit status 0, expected 1)
ah I see. cpython exit status is 1 due to import __pyston__
so exit status is 1 if we exit due to unhandled exception
Chris Toshok
@toshok
May 19 2015 23:56
hm, looks like _multiprocessing.pyston.so is missing deps
i changed struct _typeobject and the .so still had the old version
do we have to list dependencies explicitly in cmake, or can we use a wildcard?
Kevin Modzelewski
@kmod
May 19 2015 23:58
oh hmm
Chris Toshok
@toshok
May 19 2015 23:58
i see it’s got some explicit deps on .c files
Kevin Modzelewski
@kmod
May 19 2015 23:58
_multiprocessing is tough because it's hidden behind a setup.py
yeah it's dependent on the .c files
I think in cmake it's dependent on pyston, so if anything changes the executable it should update
though maybe not
anyway, we can probably make it dependent on from_cpython/Include/*.h