cfbolz changed the topic of #pypy to: PyPy, the flexible snake (IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end ) | use cffi for calling C | if a pep adds a mere 25-30 [C-API] functions or so, it's a drop in the ocean (cough) - Armin
antocuni has quit [Ping timeout: 240 seconds]
jvesely has quit [Quit: jvesely]
_whitelogger has joined #pypy
tos9 has quit [Ping timeout: 240 seconds]
tos9_ has joined #pypy
tos9_ is now known as tos9
rabysh has joined #pypy
tsaka_ has joined #pypy
tsaka__ has quit [Ping timeout: 240 seconds]
rabysh has quit [Ping timeout: 260 seconds]
jcea has quit [Quit: jcea]
jvesely has joined #pypy
dddddd has quit [Ping timeout: 240 seconds]
jvesely has quit [Quit: jvesely]
jvesely has joined #pypy
<mattip> about issue 3107, the point of _Py_Finalizing is a sentinel to mark when inside space.finish()
<mattip> comparing Py_Finalize_Ex in cpython3.6.9 (in Python/pylifecycle.c) to space.finish(), we are missing much of that code
<mattip> running gc.collect till nothing changes, calling the equivalent of PyImport_Cleanup, dumping some statistics (that we probably don't collect in the first place)
jacob22 has quit [Ping timeout: 240 seconds]
<cfbolz> mattip: this is a documented difference
jvesely has quit [Quit: jvesely]
<mattip> this page needs some formatting for easy discovery https://doc.pypy.org/en/latest/cpython_differences.html
<mattip> cfbolz: I could not find anything about differences in shutting down there ^^^, is it somewhere else?
<mattip> that is only about gc.collect(). What about PyImport_Cleanup(), PyInterpreterState_Clear(interp)? Since we don't do any cleanup, we could just set "_Py_Finalizing=NULL" and be done
<mattip> maybe with a XXX comment in space.finish()
Ai9zO5AP has joined #pypy
i9zO5AP has joined #pypy
Ai9zO5AP has quit [Ping timeout: 240 seconds]
i9zO5AP has quit [Quit: WeeChat 2.5]
antocuni has joined #pypy
<arigato> shunning: ah, you mean converting the regular dict to a "module-dict" when we pass it to exec()? maybe
<arigato> shunning: can you open an issue about that so we don't forget?
<arigato> mattip: wrote a comment on that issue
<arigato> mainly, is it a good idea to ignore _Py_Finalizing, or will he want instead something closer to the `atexit` module
<arigato> fwiw, I see that there is a flag space.sys.finalizing in py3.6
<mattip> it is used in Numba to prevent doing things on generators during deallocation
<mattip> the other is used to get a random value (the first one) from a set
tsaka_ has quit [Ping timeout: 240 seconds]
<arigato> ah, but _PySet_NextEntry can be used to iterate over all set elements
<mattip> right
<arigato> similar to PyDict_Next()
<arigato> yes, we can certainly support that, though hackishly (see PyDict_Next implementation in pypy)
<arigato> if we decide it's a good idea given that it appears completely undocumented
<mattip> Soon we will be spending all of our time chasing obscure cpyext interfaces
<mattip> perhaps we could claim to only add them if the are part of the limited_api, or if they are particularily needed
<mattip> but in these cases the discussion will be more lengthy than just implementing them
<arigato> I think there's no point in arguing, we should just shrug and implement them
<arigato> as long as they are not a total mess, of course
<mattip> the first is quite simple, but numba still will not compile on PyPy without the second as well
<arigato> so let's implement it
<arigato> it's a matter of copying the "_tmpkeys" mentioned in cpyext/dictobject.py
<mattip> ok, maybe later today
<arigato> cool. I'll let you know if I do it instead
<arigato> (I'm still trying to add PyUnicode_New())
<mattip> ok, although IMO that would fall into "is this really needed"
<mattip> but I guess it exposed a memory leak and got some code cleanup, so probably a positive outcome already
<arigato> well, PyUnicode_New() is really the recommended way to make unicodes since 3.3
<kenaan> arigo default 195ceabd426e /pypy/interpreter/unicodehelper.py: Don't allocate a small list here
<kenaan> arigo py3.6 699e6250c3cc /pypy/module/cpyext/: PyUnicode_New()
<arigato> there's _PySet_Next and _PySet_NextEntry, and they are already in 2.7
<arigato> though _PySet_Next disappeared from py3.6
<arigato> ...from cpython master I mean
tsaka_ has joined #pypy
agates[m] has quit [Read error: Connection reset by peer]
extraymond[m] has quit [Remote host closed the connection]
edd[m] has quit [Write error: Connection reset by peer]
bendlas has quit [Write error: Connection reset by peer]
altendky has quit [Quit: Connection closed for inactivity]
bendlas has joined #pypy
antocuni has quit [Ping timeout: 240 seconds]
antocuni has joined #pypy
antocuni has quit [Ping timeout: 264 seconds]
edd[m] has joined #pypy
agates[m] has joined #pypy
extraymond[m] has joined #pypy
lritter has joined #pypy
Rhy0lite has joined #pypy
dddddd has joined #pypy
jcea has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
rjarry has quit [Read error: Connection reset by peer]
rjarry has joined #pypy
YannickJadoul has joined #pypy
<YannickJadoul> Started a draft PR to include PyPy in cibuildwheel: https://github.com/joerick/cibuildwheel/pull/185
<YannickJadoul> Tests are currently failing because the auditwheel version is too old (2.0), and doesn't include this PR (included in 2.1): https://github.com/pypa/manylinux/pull/293
<YannickJadoul> Fixing it might just be as easy as just creating a new docker image from the existing Dockerfile (since the base pypa docker image has been updated meanwhile), if anyone has access to the pypywheels account on dockerhub
jvesely has joined #pypy
rabysh has joined #pypy
antocuni has joined #pypy
<tos9> Wow, amazing
<tos9> Well done, I had that on my todo list forever but wasn't able to make any progress on it
* tos9 will look at your change
<mattip> antocuni ^^^
<YannickJadoul> tos9: Well, now that we finally have `manylinux2010` in cibuildwheel, it's a lot easier
<YannickJadoul> And this is still only the Linux, ofc, but any feedback/help is welcome :)
<antocuni> YannickJadoul: I have access to dockerhub's pypywheels account
<antocuni> what do you need me to do?
<YannickJadoul> antocuni: The Docker images would have to be rebuilt, I think, to get an update of auditwheel
<antocuni> ok, I restarted the build: https://travis-ci.org/pypy/manylinux/builds/533882511
<YannickJadoul> Amazing, thanks! :)
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6559 [mattip: test centos-based docker image]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6559 [mattip: test centos-based docker image]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6560 [mattip: test centos-based docker image]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6560 [mattip: test centos-based docker image]
jcea has quit [Quit: jcea]
<YannickJadoul> Progress :-) Now we're just failing because there's no dockcross image for PyPy's manylinux in our custom docker images test!
<YannickJadoul> Thanks!
<mattip> since pyrepl has a pure python _minimal_curses, do we need the built-in mixed module?
<arigato> uh what
<arigato> the pure python version pulls in ctypes?
jacob22 has joined #pypy
<mattip> I guess it was easier than cffi at the time
<arigato> well, but I think it's a recent addition
<arigato> e.g. it's missing from "default"
<arigato> ...ok, it's been there since the very start of the py3k branch in 2012
<mattip> hmm
<arigato> the point is that it's probably completely unused, shadowed by the builtin module
<mattip> and probably untested. Maybe we should just get rid of the ctypes-based one
<arigato> yes, we get <module '_minimal_curses' (built-in)>
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6561 [mattip: test centos-based docker image]
<arigato> so yes, remove it, I'm not sure why it is there in the first place
<arigato> it's only ever "imported" on __pypy__, and then it's shadowed by the builtin module
<antocuni> the commit be161e2bc46a suggests that it was copied from upstream's pyrepl
<mattip> +1. I would prefer to have fewer mixed modules, but it should be pretty light weight
<arigato> yes, and anyway to get rid of this mixed module we'd really prefer a cffi version
<arigato> which might not be a bad idea to have, actually, given the mess of locating the libtinfo
<fijal> wasn't there some bootstrapping issue?
<mattip> I'll open an issue. It seems someone is actively maintaining https://github.com/pypy/pyrepl, which is a fork of the bitbucket one
<mattip> they released a version in April
<antocuni> ah, maybe the module is there so that it's possible to use pyrepl on cpython?
<antocuni> mattip: yes, pyrepl is being maintained by blueyed nowadays
<mattip> right, but it could be cffi
<mattip> bootstrapping: maybe for pyinteractive?
<arigato> antocuni: no, as I said this module is only imported if we're "__pypy__"
<antocuni> ok, then no clue. The commit which introduced it is this: https://bitbucket.org/pypy/pyrepl/commits/19d9ded8abdcb9c5aa00722a807a1d628678a274
<antocuni> probably _minimal_curses was not available on the py3k branch at that time
<arigato> maybe, or maybe you're right and the goal was to run on CPython too (that commit doesn't seem to have the __pypy__ check yet)
<antocuni> if anybody is going to modify our version of pyrepl, I strongly suggest to get in touch with blueyed (who lurks here) and try to have a single version of it
<antocuni> because currently we have many slightly different forks here and there: we have pypy's pyrepl on defaul and py3.x branches which IIRC are different; then we have bitbucket's pyrepl, and finally github's pyrepl :(
<arigato> I guess the two versions are already pretty diverged
<blueyed> antocuni: at least bitbucket's should be out-of-date, given that we moved it to github.
<blueyed> I suggest getting it merged in pypy first, and then see how it compares to pypy/pyrepl on github.
<blueyed> There is at least one pending PR for me for pypy where I've tried to forward fixes etc, without any response/feedback.
<blueyed> pypy/pyrepl on github works ok nowadays for py2/py3 with pdbpp for me.
jacob22_ has joined #pypy
<antocuni> blueyed: do you need access to this, btw? https://pypi.org/project/pyrepl/
<blueyed> antocuni: no, but IIRC you wanted to configure a token there.
<mattip> I don't see a blueyed PR https://bitbucket.org/pypy/pypy/pull-requests/
jacob22 has quit [Ping timeout: 252 seconds]
<blueyed> mattip: likely an issue/patch - hg is a pain to use for me.
* blueyed is looking for it
<YannickJadoul> antocuni, tos9: Except for AppVeyor and Travis's being waaay behind on the build queue, seems like building manylinux wheels works perfectly, now :)
<kenaan> mattip py3.6 140497be04d3 /: issue 2970: add ncursesw to _minimal_curses
<antocuni> YannickJadoul: wow!
<YannickJadoul> Now we 'just' need to add things for Windows and macOS
<YannickJadoul> Fun fact: even manylinux1 wheels are being built, somehow
jvesely has quit [Quit: jvesely]
<tos9> Hooray!!!
<tos9> YannickJadoul: Do you have an example of how to set that up somewhere? (Is it as simple as using cibuildwheel 'normally'?)
<YannickJadoul> tos9: Once that PR would get merged, yes!
<YannickJadoul> I've got two new build tags: pp271-manylinux_pypy_x86_64 & pp371-manylinux_pypy_x86_64, to be selected/deselected with CIBW_BUILD and CIBW_SKIP
<YannickJadoul> And then an option CIBW_MANYLINUX_PYPY_X86_64_IMAGE that defaults to using pypywheels/manylinux2010-pypy_x86_64
<YannickJadoul> (Though it would be even better if the PyPy binaries would be part of PyPA's manylinux images?)
ekaologik has joined #pypy
lritter has quit [Ping timeout: 240 seconds]
xtarget has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6561 [mattip: test centos-based docker image]
jcea has joined #pypy
jacob22_ has quit [Ping timeout: 268 seconds]
<kenaan> mattip py3.6 97cf5afa67c7 /: issue 2971: update from upstream package, should fix failing tests
tsaka_ has quit [Ping timeout: 265 seconds]
Rhy0lite has quit [Quit: Leaving]
antocuni has quit [Ping timeout: 265 seconds]
Acacia has joined #pypy
Acacia has left #pypy [#pypy]
khandha has joined #pypy
YannickJadoul has quit [Quit: Leaving]
khandha has left #pypy [#pypy]
ssbr` has quit [Remote host closed the connection]
<kenaan> mattip default bba4a466169d /pypy/module/_minimal_curses/fficurses.py: issue 2970: add ncursesw to _minimal_curses
svanheulen has joined #pypy
<svanheulen> in the cffi documentation it says you "can use literally ... at various places in the cdef(), and the missing information will be completed with the help of the C compiler." with no further explanation of how to do that. can anyone give me some details?
jacob22_ has joined #pypy
<cfbolz> svanheulen: it's probably easiest to look at some of the examples
<cfbolz> the passwd struct in this section
jvesely has joined #pypy
<svanheulen> cfbolz: so for the passwd struct why do they have one of the memebers defined?
<cfbolz> svanheulen: the defined one is the one that can be accessed from python
<cfbolz> but there might be others, that the python code doesn't care about
<cfbolz> that's what the ... is for
<svanheulen> ah so you still have to define things that you need to access. what about if the one i want to access is in the middle of the struct? do i need to define everything up to that point? or can i have a "..." before and after it?
<cfbolz> svanheulen: not sure, I think it should work before and after
<svanheulen> ah ok, thanks for the info
<cfbolz> svanheulen: I always with for a few more examples in the docs too ;-)
<mattip> s/with/wish/
<cfbolz> yep
svanheulen has quit [Quit: WeeChat 2.6]
jvesely has quit [Quit: jvesely]
shunning has joined #pypy
<shunning> I'm back :( it seems like for small workloads, the hack works. For bigger workloads which we had no issue using pypy for python 2.7, those trampoline dict accesses are back. I wonder again if there is anything changed from python2 to python3?
<shunning> I can see for some of the functions, there are trampoline dict accesses inside the trace, but for other functions there are no trampoline dict accesses
shunning has quit [Remote host closed the connection]
<cfbolz> shunning: unfortunately I don't have time to look in detail atm. However, I wanted to point out that it might be interesting for you to look at *unoptimized* traces to see whether there's a big difference there
<cfbolz> The unoptimized traces are the basis of inlining decisions
<cfbolz> You can see them by looking at the jit-log-no categories
<kenaan> rlamy default ef97a01d2e01 /pypy/interpreter/test/test_function.py: Fix uses of raises()
ekaologik has quit [Quit: https://quassel-irc.org - Komfortabler Chat. Überall.]
jvesely has joined #pypy
tsaka_ has joined #pypy
tsaka_ has quit [Ping timeout: 265 seconds]
rabysh has quit [Remote host closed the connection]
jcea has quit [Quit: jcea]
ionelmc has joined #pypy
Ai9zO5AP has joined #pypy
shunning has joined #pypy
<shunning> Thanks Carl, hope everything goes well with you
<shunning> It's just seem to me that the limit of how many function the JIT can inline in a single trace is limited
<shunning> Right now I have a dynamically compiled function with 100 function calls inside, and the first thirty inlines well without the actual dict lookup. However, after that, each function call turns into ll_call_lookup_function_trampoline__v1434___simple_call__function_.
zmt00 has joined #pypy
zmt01 has quit [Ping timeout: 245 seconds]