cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://botbot.me/freenode/pypy/ ) | use cffi for calling C | the secret reason for us trying to get PyPy users: to test the JIT well enough that we're somewhat confident about it
TheAdversary has quit [Ping timeout: 240 seconds]
Hasimir has quit [Ping timeout: 244 seconds]
bbot2 has quit [Killed (Sigyn (Spam is off topic on freenode.))]
_whitelogger has joined #pypy
_whitelogger has joined #pypy
lritter has joined #pypy
jcea has quit [Quit: jcea]
lritter has quit [Ping timeout: 252 seconds]
lritter has joined #pypy
Garen has joined #pypy
forgottenone has joined #pypy
_whitelogger has joined #pypy
user24 has joined #pypy
user24 has quit [Remote host closed the connection]
_whitelogger has joined #pypy
vpelletier has joined #pypy
<vpelletier> hi. out of curiosity, I diff'ed dis.dis output on one of my projects' module, one with cpython 2.7 and one with pypy 6.0.0
<vpelletier> most of the (rather few) difference types are in favour of pypy
<vpelletier> one does not seem so, though: jump to jump
<vpelletier> for example, if both compilers produce the sequence "<i> JUMP_FORWARD <i+1>", pypy would jump to <i> while cpython would skip <i> and directly jump to <i+1>
<vpelletier> IOW: pypy: <n> JUMP_FORWARD <i>; [...] <i> JUMP_FORWARD <i+1>; <i+1> do_stuff
<vpelletier> cpython: <n> JUMP_FORWARD <i+1>; [...] <i> JUMP_FORWARD <i+1>; <i+1> do_stuff
<vpelletier> is it intentional ?
<simpson> CPython does some bytecode optimizations, IIRC.
<simpson> This jump-to-jump case is interesting.
<vpelletier> pypy seems to do too, for example it removed a few occurrences of dead code that cpython did not catch
<vpelletier> like, "try: return ...; ecxept ...:" produces "RETURN_VALUE; POP_BLOCK; JUMP_FORWARD <after_except>;"
<LarstiQ> vpelletier: is the code to trigger the jump case simple enough for a bugreport?
<vpelletier> python -c "import dis, pprofile; dis.dis(pprofile)" > cpython.pprofile.pydis
<vpelletier> pypy -c "import dis, pprofile; dis.dis(pprofile)" > pypy.pprofile.pydis
<vpelletier> the first case I found is at line 119's bytecode
<vpelletier> LarstiQ: I should be able to produce a minimal code
<vpelletier> LarstiQ: https://pastebin.com/PeTgQrJh
<LarstiQ> vpelletier: that looks nicely minimal
<vpelletier> oh, I think I found it, in astcompiler/assemble.py: _resolve_block_targets
<vpelletier> if op == ops.JUMP_ABSOLUTE or op == ops.JUMP_FORWARD: [...] if target_op == ops.JUMP_ABSOLUTE: [...] elif target_op == ops.RETURN_VALUE:
<vpelletier> I guess this should also cover jumps to JUMP_FORWARD
<vpelletier> problem is, I do not know the difference between JUMP_ABSOLUTE and JUMP_FORWARD...
<vpelletier> in assembly, they typically differ by the span the jump can skip
<vpelletier> in my reading of bytecode addresses, both instructions take 3 bytes. Assuming a constant-size instruction prefix, it would mean the same span...
yaewa has joined #pypy
moei has quit [Ping timeout: 260 seconds]
<vpelletier> woah, the mandelbrot got colors now
* vpelletier did not build pypy for a long time
jamesaxl has quit [Quit: WeeChat 2.2]
<vpelletier> translation failed, and test suites fail too
<vpelletier> tests: "ImportError: cannot import name 'revdb_stop'"
<vpelletier> translation: data_rpython_jit_metainterp.c:45905:2: error: ‘EVP_MD_CTX_destroy’ undeclared here (not in a function); did you mean ‘EVP_MD_CTX_reset’?
<vpelletier> I think I understand why translation failed
<vpelletier> I installed packages to run tests, which updated libssl
oberstet has joined #pypy
yaewa has quit [Quit: Leaving...]
Garen has quit [Remote host closed the connection]
lritter has quit [Ping timeout: 244 seconds]
_whitelogger has joined #pypy
<kenaan> arigo cffi/cffi 603d417606ae /cffi/setuptools_ext.py: "python setup.py sdist" should not list the generated ABI module. See ``"python3 setup.py sdist" wrongly package...
antocuni has joined #pypy
oberstet has quit [Ping timeout: 252 seconds]
_whitelogger has joined #pypy
oberstet has joined #pypy
<cfbolz> vpelletier: note that the machine code the jit generates is independent of this bytecode optimization
<cfbolz> So we might not care too much
<fijal> cfbolz: cool about the json stuff!
<cfbolz> fijal: it's using maps basically
<cfbolz> and interning strings while parsing
infinite has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
infinite has joined #pypy
_whitelogger has joined #pypy
<vpelletier> cfbolz: oh, I see
<cfbolz> vpelletier: sorry, that sounded discouraging. if somebody wants to fix it we would be happy to accept the patch
<vpelletier> cfbolz: I have a patch, which fixes for this case. the only diff with cpython is a jump_absolute vs. jump_forward. Also, pypy/interpreter/test/test_compiler.py is happy with it. But it's not a minimal patch...
<cfbolz> vpelletier: you would have to add a test to the patch, to check the new behaviour
<vpelletier> gah, and it contains my debug prints...
<vpelletier> I also tried it against the same test code plus a "while True" so return cannot be reached, and I still get a jump-to-jump
<vpelletier> which is when the patch started packing weight, to no success
<cfbolz> yes, looks a little bit complicated indeed
<vpelletier> it does 2 things compared to original code: follow more than one level of jump, and follow jumps for any kind of original instruction (as long as it jumps)
<cfbolz> vpelletier: yes, just saying that those new features need new tests
<vpelletier> sure
<vpelletier> checking test_compiler.py right now, to see how I can integrate
<vpelletier> I also looked for code which would have exercised the original code, but did not find... maybe I am not looking for the right thing
dddddd has joined #pypy
<fijal> I'll read it on the plane
<fijal> or is it mostly done?
<cfbolz> fijal: it's mostly done, I think
<cfbolz> fijal: where are you flying to?
<fijal> cool
<fijal> Prague
<cfbolz> fijal: it didn't change much since you read it, actually
<cfbolz> cool!
<fijal> then driving to Poland (Hejszowina)
<fijal> and chilling for next week or two
<cfbolz> awesome
<cfbolz> fijal: do you want me to wait? or can I post?
<fijal> as far as I'm concerned feel free to post
<fijal> if I may have a say, posting on Monday is better than Sunday
<fijal> but it's an open question how much we care about publicity here
<cfbolz> :-)
<cfbolz> fijal: it's mostly sunday that I have some time to do the actual posting
<fijal> it's just clicking "publish" right?
<fijal> I can do it for you :]
<cfbolz> no no :P
antocuni has joined #pypy
<vpelletier> oh, I'm an idiot
<vpelletier> with my pypy patch, the "while True" version skips now one more jump than cpython
<vpelletier> I was reading the disassembly diff backwards...
<vpelletier> then was surprised to see the test case pass...
moei has joined #pypy
jcea has joined #pypy
<ronan> cfbolz: great post!
<cfbolz> thank you :-)
vpelletier has quit [Ping timeout: 244 seconds]
antocuni has quit [Ping timeout: 245 seconds]
jcea has quit [Quit: jcea]
jamesaxl has joined #pypy
forgottenone has quit [Read error: No route to host]
forgottenone has joined #pypy
adamholmberg has joined #pypy
adamholmberg has quit [Read error: Connection reset by peer]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 252 seconds]
_whitelogger has joined #pypy
antocuni has joined #pypy
antocuni has quit [Ping timeout: 244 seconds]
<LarstiQ> cfbolz: nice reading so far!
<LarstiQ> cfbolz: I was a little confused at "2010: Implementing Python Objects with Maps" where you say "I am going to write about two exemplary ones here." and then there is only one paragraph before "2011: Container Storage Strategies", which probably is the second one
<LarstiQ> very minor, but first potential for confusion in my reading
<cfbolz> Thanks
<LarstiQ> and none other such in the rest, thanks for writing :)
<cfbolz> LarstiQ: cool, thanks
<cfbolz> LarstiQ: I've rewritten it to: "I am going to write about two exemplary ones here, maps and storage strategies"
<simpson> Maps and storage strategies are both things that I borrowed and implemented in Typhon, and I think that maps also made it into one of the Smalltalk or SOM experiments?
<cfbolz> simpson: maps are from self
<simpson> Definitely exemplary!
<cfbolz> basically everybody has maps :-)
<cfbolz> storage strategies are original from us, though the V8 people were working on something similar at the same time
<simpson> Basically everybody except for CPython and MRI and oh hey now I'm sad.
<cfbolz> cpython does the strange dictionary sharing
<cfbolz> which is a similar idea
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 250 seconds]
forgottenone has quit [Quit: Konversation terminated!]
<kenaan> arigo default 32f623879d94 /rpython/doc/examples.rst: Typo (indent mistake)
arigato has joined #pypy
jcea has joined #pypy
antocuni has joined #pypy
_whitelogger has joined #pypy
vpelletier has joined #pypy
lritter has joined #pypy
danieljabailey has quit [Quit: ZNC 1.6.5+deb2build2 - http://znc.in]
danieljabailey has joined #pypy
lritter has quit [Remote host closed the connection]
<kenaan> antocuni extradoc 53fb8572d9f1 /blog/draft/2018-09-cpyext/cpyext.rst: write the section about conversion costs
antocuni has quit [Ping timeout: 252 seconds]