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
KindOne has quit [Ping timeout: 272 seconds]
KindOne has joined #pypy
lritter has quit [Ping timeout: 256 seconds]
KindTwo has joined #pypy
lritter has joined #pypy
KindOne has quit [Ping timeout: 272 seconds]
KindTwo has quit [Ping timeout: 256 seconds]
KindOne has joined #pypy
the_rat_ has joined #pypy
the_rat has quit [Quit: ZNC - http://znc.in]
jcea has quit [Quit: jcea]
alexge50 has quit [Read error: Connection reset by peer]
alexge50 has joined #pypy
<jneen> hey do any of yall know if there's a guide out there on how to properly write a scheduler
<jneen> concurrency is... hard
<jneen> like, i've *written* a scheduler, it's just full of bugs and deadlocks
<jneen> and i'm kind of suspicious i might have gone about it in a non-optimal way
oberstet has joined #pypy
otisolsen70 has joined #pypy
dddddd has quit [Ping timeout: 260 seconds]
alexge50_ has joined #pypy
alexge50 has quit [Ping timeout: 272 seconds]
oberstet has quit [Remote host closed the connection]
lritter has quit [Quit: Leaving]
thrnciar has quit [Remote host closed the connection]
jacob22_ has joined #pypy
thrnciar has joined #pypy
jacob22 has quit [Ping timeout: 260 seconds]
otisolsen70_ has joined #pypy
otisolsen70 has quit [Ping timeout: 260 seconds]
otisolsen70_ has quit [Quit: Leaving]
otisolsen70 has joined #pypy
thrnciar has quit [Ping timeout: 264 seconds]
thrnciar has joined #pypy
thrnciar_ has joined #pypy
thrnciar has quit [Ping timeout: 258 seconds]
ionelmc has joined #pypy
dnshane has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
dnshane has joined #pypy
xcm has quit [Remote host closed the connection]
tsaka__ has joined #pypy
xcm has joined #pypy
Dejan has joined #pypy
Dejan has quit [Changing host]
Dejan has joined #pypy
ronan__ is now known as ronan
BPL has joined #pypy
jacob22_ has quit [Read error: Connection reset by peer]
jacob22_ has joined #pypy
<arigo> cfbolz: is that a new issue? I'm still seeing it in the untranslated current py3.6 branch:
<arigo> >>>> t = 'Fête\n'
<arigo> >>>> len(t)
<arigo> 6
<arigo> >>>> re.match('(?s).*', t)
<arigo> <_sre.SRE_Match object; span=(0, 8), match='F\xc3\xaate\n'>
<arigo> the span ends farther than the end of the unicode string
dddddd has joined #pypy
<cfbolz> Ouch
<cfbolz> arigo: it's possible that I broke that
<arigo> it's also this way at least in 7.3.1
<arigo> ah
<arigo> calling .span() returns the correct value, (0, 6)
<arigo> it's only in the repr
* arigo fixes
<mattip> tos9: your solution is working!
<arigo> ah bah
<arigo> another bug in the same repr
<arigo> it displays the match, truncated if it is too long
<arigo> truncation occurs after 50 bytes, so it may leave a malformed utf-8
<cfbolz> arigo: ouch
<cfbolz> arigo: but it has always been like that? or that's due to my recent changes?
<arigo> I guess it was always like that
<cfbolz> :-(
<cfbolz> thanks for hunting it down
<arigo> ah no, the invalid span was always there (my fault I guess, I forgot when I ported sre to utf8)
<arigo> ...and, actually yes, the invalid utf8 comes from around the same time but it's mattip fwiw
<mattip> oops
<arigo> NP
<arigo> just saying it's been broken since 08-2018
<cfbolz> arigo: our tests for unicode re are a bit thin in general
<arigo> yes
<cfbolz> (I'll have to continue doing sre work soon again, but probably not until the semester is over)
jcea has joined #pypy
<arigo> (same problem with SRE_Pattern)
<arigo> pff completely unrelated but I'm fighting regular expressions for cffi now
vstinner has joined #pypy
<cfbolz> arigo: now you've got two problems :-P
<arigo> ah ah haa haaaaa glub cough
<arigo> time to refactor, it's either very hard or completely impossible to do with regexps
<vstinner> hello. how do you run benchmarks on PyPy?
<vstinner> pyperformance doesn't seem to be tuned at all for PyPy JIT compiler
<vstinner> i'm about about https://speed.pypy.org/
<vstinner> a colleague wants to compare PyPy performances without/with -fno-semantic-interposition
<vstinner> in Fedora, pypy is linked to libpypy
<vstinner> CPython is way faster (like 10% faster) with gcc -fno-semantic-interposition, since 99,9% of CPython code lives in libpython, and there are many function calls from libpython to libpython
<vstinner> -fno-semantic-interposition helps LTO
<vstinner> hello arigo & cfbolz
<mjacob> vstinner: you could try to benchmark non-jitted pypy, where i'd expect the differences to be bigger, as all of the run code is compiled by the C compiler
<vstinner> mjacob: do you mean disable the JIT?
<vstinner> like "pypy3 --jit off"?
<cfbolz> vstinner: we didn't investigate lto in a while
<mjacob> vstinner: either disable the JIT with flags, or compile without JIT
<cfbolz> But it doesn't help the jit generated code, of course
<vstinner> thrnciar_: ^^
<vstinner> thrnciar_: do you know if PyPy is built with LTO?
<mjacob> vstinner: i'd expect that, for both non-jitted and jitted pypy, the speedup will not be large, as pypy sets the symbol visibility to hidden more aggressively than cpython
<vstinner> mjacob: CPython changed the visibility to hidden by default in Python 3.9 :) but even with that, CPython does tons of function calls to itself
<vstinner> mjacob: basic example, checking if there is an exception "if (PyErr_Occurred())" is a function call to libpython. without -fno-semantic-interposition, it couldn't be inlined because the "semantic interposition" requires to go through PLT indirection
<vstinner> to support LD_PRELOAD
<vstinner> and it's the same for all function calls to libpython
<mattip> vstinner: speed.pypy.org is driven by https://foss.heptapod.net/pypy/benchmarks, which is driven by runner.py
<vstinner> mattip: ok, thanks
<mattip> this is what a call looks like on the buildbot
<vstinner> by the way, https://pyperf.readthedocs.io/ project moved under the PSF organization on GitHub: https://github.com/psf/pyperf which makes it more independent of myself :) previously, it was in /vstinner/ "organization". also, it got two more maintainers ;)
<mattip> it calls both with "--jit off" and without
<vstinner> mattip: oh ok
<mattip> yeah, but as you point out it is alot of work to set the baseline for the benchmarks
<mjacob> vstinner: PyErr_Occurred() is not hidden, is it?
<vstinner> mjacob: it's part of the public C API, and Python consumes its own public C API
<mjacob> vstinner: that's less the case in pypy
<vstinner> mjacob: (well, about this exact function, I added a private _PyErr_Occurred(tstate) to Python 3.9. it takes a Python thread state argument, and this function is a static inline function)
<arigo> vstinner: also, no-semantic-interposition has no effect on pypy unless you're talking about the cpyext C extension module compatibility
<arigo> we use systematically "visibility hidden"
<arigo> you can see with objdump that libpypy-c.so exposes almost no symbol apart from the thousands of Py*() compatibility symbols
<vstinner> "libpypy-c.so exposes almost no symbol" oh ok
<mattip> searching "lto" on the issue tracker, we discussed this in the past. Maybe compilers have improved since this last one
<mjacob> vstinner: it could of course still be the case that a visible symbol is in the hot path, so it's still worth trying, but don't expect a 10%-ish speedup
<vstinner> mjacob: the first time I tried LTO, I got tons of compiler bugs :) like crashes in gcc
<mattip> there is report of a +5-6% overall speedup with a -45% speed up on nbody with PGO https://foss.heptapod.net/pypy/pypy/merge_requests/540
<vstinner> mjacob: honestly, it's *way* better nowadays (in 2020)
<vstinner> mjacob: one week ago, sometimes reported a compiler crash in Python bug tracker. he was using Ubuntu 16.04. the fix is to upgrade Ubuntu to get newer GCC :)
<vstinner> clang is also better than gcc on LTO
<vstinner> too bad, PYPY_IRC_TOPIC=1 feature doesn't work in pypy3 :-(
<vstinner> i was checking if there an env var to control PyPy JIT (to turn it off)
<mattip> vstinner: works for me? Are you using one of our downloads or a different provider?
<vstinner> mattip: it's the Fedora package: pypy3-7.3.1-1.fc32.x86_64
<mattip> maybe they messed with it. https://paste.centos.org/view/097f31fd In any case, it seems the JIT cannot be controlled from env variables
<arigo> "of course", the following multiline regexp: {.*}|//.*?$
<arigo> matches stuff line {hello} or everything from // to the end of the line
<arigo> but "of course" if there is a line ending in "// {"
<arigo> then which of the two rules would match?
<arigo> (assuming there is a "}" on a following line, and "." is allowed to match newlines)
<arigo> the answer is: it's the second rule, i.e. "//.*?$", eating the "{", because that rule happens to start before the first rule in the string
<arigo> that means my attempt to split this regexp in two parts is doomed
<arigo> ...in really two regexps, I mean
<arigo> for whatever order you run the two regexps, there is a counter-example string that is matched differently
<arigo> (the counter-examples are "// {" like above, and "{ // }")
jacob22_ has quit [Quit: Konversation terminated!]
jacob22 has joined #pypy
<vstinner> mattip: i added "pyperformance is not tuned for PyPy yet: use the PyPy benchmarks project instead to measure PyPy performances." note to pyperformance documentation until someone tunes pyperformance for PyPy ;)
hotpot33 has quit [Ping timeout: 256 seconds]
<bbot2> Started: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8172 [ronan: force build, ctypes-stuff]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6992 [ronan: force build, ctypes-stuff]
<cfbolz> vstinner: we've already had a feature request to turn the jit off with an env var
<cfbolz> So maybe we should go and implement that
<vstinner> cfbolz: hehe
<bbot2> Failure: http://buildbot.pypy.org/builders/own-linux-x86-64/builds/8172 [ronan: force build, ctypes-stuff]
otisolsen70_ has joined #pypy
otisolsen70 has quit [Ping timeout: 260 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/6992 [ronan: force build, ctypes-stuff]
oberstet has joined #pypy
kbtr has quit [Ping timeout: 272 seconds]
kbtr has joined #pypy
phlebas has quit [Ping timeout: 244 seconds]
phlebas has joined #pypy
epsilonKNOT_ has joined #pypy
samth has quit [Ping timeout: 272 seconds]
tsaka__ has quit [Quit: Konversation terminated!]
tsaka__ has joined #pypy
epsilonKNOT_ has quit [Quit: ZNC 1.7.5 - https://znc.in]
jeroud has quit [Ping timeout: 272 seconds]
epsilonKNOT has joined #pypy
phlebas has quit [Ping timeout: 264 seconds]
samth has joined #pypy
phlebas has joined #pypy
fryguybob has quit [Quit: Lost terminal]
samth has quit [Ping timeout: 256 seconds]
phlebas has quit [Ping timeout: 256 seconds]
otisolsen70_ has quit [Ping timeout: 240 seconds]
samth has joined #pypy
phlebas has joined #pypy
jeroud has joined #pypy
tsaka__ has quit [Remote host closed the connection]
tsaka__ has joined #pypy
tsaka__ has quit [Remote host closed the connection]
tsaka__ has joined #pypy
Dejan has quit [Quit: Leaving]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
marvin has quit [Remote host closed the connection]
marvin has joined #pypy
otisolsen70_ has joined #pypy
otisolsen70_ has quit [Remote host closed the connection]
tsaka__ has quit [Ping timeout: 264 seconds]
otisolsen70 has joined #pypy
marvin has quit [Remote host closed the connection]
marvin has joined #pypy
lritter has joined #pypy
otisolsen70 has quit [Quit: Leaving]
oberstet has quit [Remote host closed the connection]
Ododo has joined #pypy
<Ododo> Hello. is it possible somehow to compile a 32 bit cffi extension on a 64 bit machine ? ..
<tumbleweed> if you're executing a 32 bit python, and the compiler available is 32bit, I think that's what you'd get
<tumbleweed> easy answer: do it in a 32bit chroot
<Ododo> yeah .. it's looks like something that could be feasable but the easy way is tempting..
<tumbleweed> (or container / whatever)
<Ododo> ok. it's mainly because i was looking for a way to distribute the package and that the basic cloner of the repository could just build it from a 64bit machine without having to create a chroot by himself.
<Ododo> (build a 32bit .so)
<Ododo> but a good readme is also ok
vstinner has left #pypy [#pypy]
<tumbleweed> they'll need a 32bit toolchain and python
<tumbleweed> so, either you have to distribute those
KindTwo has joined #pypy
<tumbleweed> or just point them at an existing distribution
KindOne has quit [Ping timeout: 272 seconds]
KindTwo is now known as KindOne
<Ododo> yep. ok. i see, thanks.
Ododo has quit [Quit: leaving]
tsaka__ has joined #pypy
tsaka__ has quit [Ping timeout: 258 seconds]
asmeurer has joined #pypy
tsaka__ has joined #pypy
inhahe has quit [Read error: Connection reset by peer]
inhahe has joined #pypy