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
Kipras_ has quit [Read error: Connection reset by peer]
Kipras_ has joined #pypy
kandinsk1 has joined #pypy
kandinski has quit [Remote host closed the connection]
Kipras_ has quit [Read error: Connection reset by peer]
Punisha has joined #pypy
kandinsk1 is now known as kandinski
Punisha has left #pypy [#pypy]
antocuni has quit [Ping timeout: 268 seconds]
Khayman has joined #pypy
TheAdversary has quit [Disconnected by services]
Hasimir has quit [Ping timeout: 246 seconds]
Khayman is now known as Hasimir
TheAdversary has joined #pypy
igitoor has quit [Ping timeout: 252 seconds]
igitoor has joined #pypy
igitoor has quit [Changing host]
igitoor has joined #pypy
awkwardpenguin has quit [Ping timeout: 252 seconds]
awkwardpenguin has joined #pypy
jcea has quit [Quit: jcea]
awkwardpenguin has quit [Ping timeout: 252 seconds]
awkwardpenguin has joined #pypy
_whitelogger has joined #pypy
awkwardpenguin has quit [Ping timeout: 245 seconds]
awkwardpenguin has joined #pypy
awkwardpenguin has quit [Ping timeout: 250 seconds]
awkwardpenguin has joined #pypy
Punisha has joined #pypy
Punisha has left #pypy [#pypy]
awkwardpenguin has quit [Ping timeout: 246 seconds]
awkwardpenguin has joined #pypy
awkwardpenguin has quit [Ping timeout: 252 seconds]
awkwardpenguin has joined #pypy
awkwardpenguin has quit [Ping timeout: 268 seconds]
tayfun26 has joined #pypy
tayfun26 has quit [Client Quit]
Punisha has joined #pypy
awkwardpenguin has joined #pypy
awkwardpenguin has quit [Ping timeout: 252 seconds]
awkwardpenguin has joined #pypy
awkwardpenguin has quit [Remote host closed the connection]
witrandev has joined #pypy
arigato has joined #pypy
arigato has quit [Quit: Leaving]
realitix has joined #pypy
_whitelogger has joined #pypy
mitsuhiko_ has left #pypy [#pypy]
dddddd has joined #pypy
<kenaan> arigo cffi/cffi f2522654c2b5 /cffi/cparser.py: #389 Warn when using string literals in the cdef() source
Punisha has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcea has joined #pypy
Zaab1t has joined #pypy
realitix has quit [Quit: realitix]
realitix has joined #pypy
realitix has quit [Client Quit]
realitix has joined #pypy
marky1991_2 has joined #pypy
marky1991_2 has quit [Read error: Connection reset by peer]
marky1991_2 has joined #pypy
marky1991_2 has quit [Remote host closed the connection]
marky1991_2 has joined #pypy
witrandev has quit [Ping timeout: 256 seconds]
marky1991_2 has quit [Quit: Saliendo]
marky1991 has joined #pypy
adamholmberg has joined #pypy
antocuni has joined #pypy
Rhy0lite has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
TheAdversary has quit [Ping timeout: 260 seconds]
Hasimir has quit [Ping timeout: 252 seconds]
Hasimir has joined #pypy
TheAdversary has joined #pypy
inad922 has joined #pypy
<_aegis_> if I have a global like DEBUG = False will pypy optimize out branches that depend on it?
<_aegis_> if not is there a good way to put debug statements in performance critical code without a bunch of branching?
<Alex_Gaynor> it'll be 1 or 2 instructions, but broadly yes
<Alex_Gaynor> it's a memory load and a well predicted branch; probably not meaningful impact on throughput
<antocuni> Alex_Gaynor: don't module dicts emit out of line guards?
<cfbolz> Yes, I think they do
<Alex_Gaynor> Mmm, this code has changed a lot since I looked at it
<antocuni> so an "if DEBUG:" should be optimized away entirely, I think
<cfbolz> Unless you change the value at runtime
Zaab1t has quit [Ping timeout: 260 seconds]
lritter has joined #pypy
awkwardpenguin has joined #pypy
Sonderblade has joined #pypy
Punisha has joined #pypy
<Sonderblade> how come some python code gives completely different results when run in python vs pypy?
<Sonderblade> is it expected?
<Alex_Gaynor> Not generally, no. There's a handful of compatibility differences, but for normal code, it's a bug https://pypy.org/compat.html
inad922 has quit [Ping timeout: 245 seconds]
<Sonderblade> can there be some caching stuff so that python and pypy interfere with each other?
<Sonderblade> it's pypy 3.5.3 vs python 3.7.0
inad922 has joined #pypy
<toaderas> Hello everyone
lxnt has joined #pypy
<toaderas> Are there any statistics of the performance improvement gains of pypy as further development takes place ?
<mattip> Sonderblade: there should be no cross-caching. PyPy and CPython should be using unique lib and site-packages paths
<mattip> toaderas: we have speed.pypy.org, but we haven;t updated it in a while
<lxnt> Hello. Was anyone translating pypy3 under mingw/msys? After patching this and that to make all the platcheks run I get
<lxnt> [translation:ERROR] OpErrFmtNoArgs: [<W_TypeObject 'OverflowError' at 0x4a46b30>
<lxnt> unsigned int')])]
<lxnt> : W_BaseExceptionUserWeakrefable([W_UnicodeObject(u'int too large to convert to
<lxnt> what does that even mean?
<lxnt> (that's pypy2-6.0.0 translating pypy3-6.0.0, gcc is 7.3.0)
<lxnt> (all 32-bit of course)
realitix has quit [Quit: realitix]
<Sonderblade> mattip: then i must indeed have run into a bug
<simpson> Sonderblade: Do you have a reproducible test case that you can share?
<Sonderblade> kind of.. but the problem disappears when you try to isolate it
<mattip> lxnt: no, not really.
<mattip> lxnt: that error should also indicate where the error occurred, it means we need to wrap a value with widen(value)
<mattip> I think, but would need to see it
<lxnt> mattip: thank you. here's the backtrace: https://pastebin.com/UFCD8mby Can I do anything more?
<lxnt> mattip: there were also warnings from platcheck84 : https://pastebin.com/VYeCsz9w for various HKEY_whatever constants. Can this be related?
<mattip> when you get the debugging prompt, you should be able to `up` to a trace with a `graph` in local varaibles, that is the function being translated
<mattip> the platcheck test may be relevant, I don't see any warnings when compiling with MSVC http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-32/builds/4159/steps/translate/logs/stdio
<lxnt> mattip: hmm. doing up ; p 'graph' in locals() doesn't show anything but False over all the stack.
awkwardpenguin has quit [Remote host closed the connection]
<lxnt> I'll look into getting rid of the warnings, maybe something would change
<lxnt> btw, are those platchecks actually being run, or just compiled? because ideally I'd like to cross-translate pypy on linux using mxe
<ronan> mattip, lxnt: the failure happens before translation, so there is no graph
<ronan> lxnt: if you inspect 'self', it should tell you which function it's running
<ronan> lxnt: it's failing while initialising some builtin module, it raises an app-level exception while running some app-level code
<ronan> there's probably a way to see the app-level traceback, but I don't remember how to do it
<lxnt> ronan: well, in which frame? in the bottommost it's <pypy.interpreter.pyopcode.SApplicationException object at 0x059c20f0>
nunatak has joined #pypy
<ronan> sorry, one level up, I think
<lxnt> ronan: and, a built-in module of pypy2 or some module that's in pypy3-src?
awkwardpenguin has joined #pypy
<ronan> an app-level builtin, so pypy3
<ronan> lxnt: you need the PyFrame object
<Sonderblade> i found the bug!
<lxnt> okay, that's <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object _find_and_load,
<lxnt> file "<frozen importlib._bootstrap>", line 967> at line 970
<mattip> hehe, famous last words. "the" bug, as if there is only one
<Sonderblade> without the assert, h gets set to 1, with the assert it gets set to 19
<ronan> lxnt: what's self.locals_cells_stack_w?
* Sonderblade waits for someone to say that the code triggers ub anyway :)
<mattip> Sonderblade: what happens when you run with `--jit off` ?
<Sonderblade> then it works
<lxnt> (Pdb+) p self.locals_cell_stack_w
<lxnt> locals_cell_stack_w'",)
<lxnt> *** AttributeError: AttributeError("'StdObjSpaceFrame' object has no attribute '
<ronan> lxnt: sorry, self.locals_cells_stack_w
<Sonderblade> perhaps that is why my isolated test case didn't fail? then the code is only run once so it's never jitted
<lxnt> (Pdb+) p self.locals_cells_stack_w
<lxnt> e, None]
<lxnt> [W_UnicodeObject(u'_collections'), <Function _gcd_import>, None, None, None, Non
forgottenone has joined #pypy
<lxnt> mattip: with -O2 it's the same error
<ronan> lxnt: so I guess it's failing while importing _collections_abc
<lxnt> mattip or I don't understand what do you mean by --jit off
<lxnt> ronan: well, what do I do about it? fix warnings/retry?
<ronan> lxnt: the exception is probably raised from pypy.objspace.std.longobject.W_LongObject.tofloat()
<ronan> lxnt: in pypy/objspace/std/longobject.py, try putting 'raise RuntimeError' at line 104, just after 'except OverflowError:'
<ronan> and rerun
<toaderas> I had a conversation relatively recently with a few of the main project volunteers about pypy and real time applications and the improvement allowance for that. Has anything changed in regards to that ?
antocuni has quit [Ping timeout: 252 seconds]
awkwardpenguin has quit []
nunatak has quit [Quit: Leaving]
adamholmberg has quit [Remote host closed the connection]
<Sonderblade> perhaps pypy can transpile python to c?
adamholmberg has joined #pypy
<ronan> toaderas: it's the same, I guess
<ronan> antocuni is working on a branch to allow better control of the GC by the user, though
<lxnt> ronan: no luck. I've put more try ... except: raise something -s into the methods and still nothing changed
<ronan> lxnt: you get the exact same traceback?
<lxnt> ronan: can't really be sure, let me diff them
<lxnt> but the same exception
<mattip> Sonderblade: can you post a complete reproducer, including a `__main__`?
<ronan> lxnt: huh, I'm pretty sure that that place is the only one that can possibly raise this exception with this specific message
<Sonderblade> mattip: maybe. if you can tell me how to force the jit to run
<lxnt> ronan: exactly the same modulo exception object address
adamholmberg has quit [Ping timeout: 244 seconds]
<lxnt> ronan: well, idk. if it can possibly depend on what platcheck84 builds then ... but does it?
<mattip> Sonderblade: I mean can you pastebin the way you are calling evaluate(board, w = defaultWeights) ?
<lxnt> ronan: wait a sec, maybe it's me after all
<Sonderblade> mattip: to protect the guilty parties i can't :) it's not my code
adamholmberg has joined #pypy
forgottenone has quit [Quit: Konversation terminated!]
<lxnt> ronan: no, definitely it's something else. I even put prints there and nothing in the output as if this W_LongObject methods aren't even called
<ronan> lxnt: ah, I'm an idiot, it's in uint_w(), line 138
waldhar_ has joined #pypy
jcea has quit [Ping timeout: 276 seconds]
waldhar has quit [Ping timeout: 260 seconds]
jcea has joined #pypy
<lxnt> ronan: yes, that did it
<simpson> Sonderblade: The JIT will run on loops that are run several thousand times, in general.
<lxnt> ronan: (Pdb+) p self.num
<lxnt> <rbigint digits=[1, 2147483647, 3], sign=1, size=3, len=3, 18446744071562067969>
<ronan> lxnt: what's the traceback
<ronan> ?
<Sonderblade> simpson: can't you get it to jit the whole program at once instead?
<lxnt> it got cut off on the top, is that critical?
<simpson> Sonderblade: Not really; the JIT can only trace code that is actually running.
<ronan> lxnt: no, I only care about the end
Sonderblade has quit [Read error: Connection reset by peer]
Sonderblade has joined #pypy
Punisha has left #pypy [#pypy]
<toaderas> ronan: you were one of the conversation participants ? I don't remember
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
beerbaron23 has joined #pypy
<ronan> toaderas: I don't think I was in the conversation, though I vaguely remember seeing it
<ronan> lxnt: so it's something about HKEYs, I guess the warnings were actually meaningful
<mattip> Sonderblade: does len(board) change during the execution of the function?
<lxnt> ronan: okay, thanks much
<Sonderblade> mattip: no. look at the paste
inad922 has quit [Ping timeout: 272 seconds]
<mattip> Sonderblade: well, evalboard should be a copy of board, but maybe they share some internal structure
<mattip> since you use copy.copy and not a deep copy
<mattip> and then you do `del evalboard[h]` which for all I know could modify board somehow
<mattip> but that *is* a bit farfetched, I admit
<mattip> I don't think the JIT should be moving the evaluation of `height = len(board) -1` around
<Sonderblade> i dont see how del evalboard[h] could change the size of some other list?
<mattip> yeah, me either truthfully, just grasping at straws
asmeurer__ has joined #pypy
adamholmberg has quit [Remote host closed the connection]
marky1991 has quit [Ping timeout: 252 seconds]
adamholmberg has joined #pypy
<toaderas> ronan: is there a participant around ? :P
inad922 has joined #pypy
asmeurer__ has quit [Quit: asmeurer__]
inad922 has quit [Ping timeout: 276 seconds]
marky1991 has joined #pypy
<cfbolz> Sonderblade: I agree with mattip, I think we would need a more complete program that we can run ourselves to fix this. Looks like a (serious?) bug, fwiw
<Sonderblade> cfbolz: if you tell me how to force the jit to run always, i could try and make a test case. otherwise it is hard to isolate the problem
<cfbolz> Sonderblade: you can't, that's not how the jit works, sorry
<Sonderblade> must be hard to make deterministic test cases for the jit if you can't force it to trigger
Sonderblade has quit [Read error: Connection reset by peer]
<cfbolz> Amazing
<simpson> Some people would rather have buggy code than work with others. CLV.
beerbaron23 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<cfbolz> found the code anyway
jamesaxl has joined #pypy
jamesaxl has quit [Quit: WeeChat 2.2]
beerbaron23 has joined #pypy
Rhy0lite has quit [Quit: Leaving]
adamholmberg has quit [Remote host closed the connection]
adamholmberg has joined #pypy
adamholmberg has quit [Ping timeout: 245 seconds]
asmeurer__ has joined #pypy
<mattip> looking into using gholke wheels on pypy, he is shipping numpy-1.15.2+mkl-pp360-pp360-win32.whl
<mattip> the pp comes from pypy, the 3 is from python3, and the 60 is sys.pypy_version_info.major, sys.pypy_version_info.minor
<mattip> this means any release we do, or even nightlies, cannot work with this wheel since we increment our minor version
<mattip> I think I would like to move to only incrementing micro for now, until we make a breaking API change
<lxnt> mattip: fyi mingw32 builds are broken so much it isn't even funny. I finally got it to start the actual translation, but to get it into any commitable shape would require forking off a new plaform
<lxnt> mattip: here's where i'm at currently: https://pastebin.com/5tdmkbAM
<mattip> nope, the API changed. Py_ZeroStruct has become Py_FalseStruct, a c-extension module from 6.0 will no longer load on nightly.
<mattip> maybe other changes too
<mattip> lxnt: looking
<mattip> lxnt: a new translation/c/platform may make sense, there is not alot in common between msvc and gcc
<mattip> lxnt: fwiw that exception looks like something you added? What hg branch are you working off?
<lxnt> mattip: yes. that's a hell's blend of both. btw i'm sorry the the FloatWFailed
<lxnt> is that I added this, yes.
<lxnt> sec, i'll find it in the source
<mattip> pull requests are welcome
<mattip> or a blog post about how to reproduce it
<mattip> download this bit, build/install these external libraries using this package manager, ...
<mattip> our windows port could use some love
<lxnt> ./pypy/objspace/std/longobject.py def float_w()
<lxnt> sorry, the line numbers are all wrong
<lxnt> sure I'll document all this.
<mattip> right, that is what got me thinking you might be working off a strange hg commit
<lxnt> yeah. I'll get the real exc in amin
Kipras_ has joined #pypy
<lxnt> mattip: now this is unexpected: https://pastebin.com/zHXxHsdB
<lxnt> mattip: oh, no, it's again my sloppy hands..
asmeurer__ has quit [Quit: asmeurer__]
<kenaan> mattip release-pypy3.5-6.x ac3e7351541c /rpython/rlib/: add, test LoadLibraryW, LoadLibraryEx{A, W}
<kenaan> mattip release-pypy3.5-6.x 2dda0ffebf61 /: Use LoadLibraryEx in loading extension modules, like CPython's _PyImport_FindSharedFuncptr
<kenaan> mattip release-pypy3.5-6.x f59b3a27e35f /: fix win32 translation, also remove some MSVC compiler warnings
<kenaan> mattip release-pypy3.5-6.x dfef27e92951 /pypy/module/cpyext/api.py: move include before declaration
<lxnt> mattip: so far so good, it finished the mandelbrot and croaked on line 15 of whatever the second was supposed to be.
<mattip> memory error?
<lxnt> mattip: no, undefined reference to `_imp___get_timezone`
<lxnt> et al
<lxnt> looks like from modules/interp_time.py but damned if I know which lib it's missing
<lxnt> mingw's libmsvcrt* and libucrt* match but how do I get them linked and where?
<mattip> I think you might want to disable all that. You should try running the tests since that is much faster
<lxnt> mattip: sorry? how do I do that?
<mattip> python2 pytest.py pypy/module/time
<mattip> there is a bit of mixup bwteen _CYGWIN and _WIN
<mattip> it seems some of the "if _WIN" should become "if _WIN and not _CYGWIN"
<lxnt> mattip: hm. most of what I added is basically #ifdef MS_WINDOWS or _WIN to be equivalent to __MINGW32__
<lxnt> because mingw32 is gcc but not posix
<lxnt> except for pthreads
<lxnt> it's all crazy
<mattip> hahaha, simple
<lxnt> ah
<lxnt> all I need is to build win32 exe with pypy embedded on a linux box
<mattip> describes our test driven dev process
<mattip> so you can try out
<mattip> python2 rpython/translator/c
<mattip> to make sure the compiler all works with makefiles and library discovery
* mattip off, zzz
<lxnt> well, it doesn't. it sees sys.platform==win32 and decides it's msvc or something.
<lxnt> i'm offf to sleep too.
bbot2 has joined #pypy
Kipras_ has quit [Read error: Connection reset by peer]
antocuni has joined #pypy
<simpson> Hm. I want to print a nice timestamp. Is datetime not allowed in RPython?