arigato 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 | mac OS and Fedora are not Windows
kipras has quit [Read error: Connection reset by peer]
awygle has quit [Quit: No Ping reply in 180 seconds.]
awygle has joined #pypy
jcea has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
_whitelogger has joined #pypy
jcea has quit [Remote host closed the connection]
jcea has joined #pypy
jcea has quit [Quit: jcea]
auscompgeek has quit [Quit: restarting server]
fling has joined #pypy
fryguybob has quit [Ping timeout: 244 seconds]
<arigato> krono: so, trying to get the pinning crash now.
<arigato> rpython/bin/rpython -O2 targettestpinning.py
<krono> morning
<arigato> gives me a targettestpinning-c
<arigato> which runs without crash for me
<arigato> (and hi!)
<krono> :)
<krono> funny
<krono> my machine rebooted and I had the sources in /tmp so let me redoit really quick
<krono> may I ask what your environment is?
<arigato> linux
<krono> grml
<krono> it doesnt crash now..
<arigato> I'm getting flag = '\x04' or flag = '\x05', but never '\x06'
<krono> I also never got 6..
<arigato> I'm getting flag = '\x06' if I set PYPY_GC_MAX_PINNED to 0
<arigato> but still no crash
<krono> With max_pinnend =0 I never got a crash, tho
<krono> only _without_
<arigato> OK
<krono> thats somehow embarrasing
<arigato> well, it occurs. I'm as embarrassed at you are
<arigato> it can be that you ran things slightly differently yesterday, or else just some internal randomness
<krono> Im going back to the state where RSDL was in and see what happens
<krono> my RSqueakvm still has this behavior
<arigato> makes sense
<arigato> if you reproduce it with RSDL I can try to run it too
<krono> note that I use release-pypy2.7-v7.1.1 tag as my base pypy
<krono> (but I verified the existence of the problem day-before-yesterday with default too)
<krono> yes
<krono> arigato: can you try an --lldebug0 build?
<arigato> yes, let me try
<arigato> ah, crash
<arigato> good
<krono> o_O
<krono> so its the lldebug thing
<arigato> it's an assertion that is triggered by --lldebug0, but I think the assertion makes sense. in non-debug mode it would instead do potential nonsense
<arigato> so it actually makes no sense that we get flag = \x05 here
<arigato> because they are all prebuilt string objects
<arigato> for some reason, "0" is allocated dynamically
<arigato> that might be a very bad reason, like "it's a char!" and then it's transformed into a string dynamically
<arigato> it's unpinning a different object than the one it pinned
<arigato> aaaaaa
<arigato> "it's a char, let's make a string" occurs twice
<arigato> one copy is pinned, and the other is unpinned
antocuni has joined #pypy
speeder39_ has joined #pypy
<arigato> I don't see how to fix the existing API rffi.get_nonmovingbuffer()
<arigato> I fear it needs changing
<krono> (sorry, had to read something)
<krono> that sounds not too good.
<krono> I think I'll do with max_pinned = 0 for now.
<krono> Thanks for loking into it :)
<arigato> NP
themsay has joined #pypy
<arigato> cfbolz: do you have an opinion? I'm thinking about renaming rffi.get_nonmovingbuffer() into rffi.get_nonmovingbuffer_ll() and make it take an llstr as argument
<arigato> then we can be more or less sure to pass the same llstr to the next rffi.free_nonmovingbuffer_ll()
* cfbolz reading
<arigato> these functions are used a few times left and right including in pypy/module/*, but mostly they are used by rffi.llexternal(), which can be fixed internally
<cfbolz> Right, I see how the bug occurs
<cfbolz> arigato: if we change the API, can we somehow have a more high level new one that the existing non llexternal users can migrate to? A with statement?
<arigato> we already have, actually
<arigato> they can say "with scoped_nonmovingbuffer(data)"
<arigato> this API would remain
<cfbolz> Great
<arigato> or "with scoped_view_charp" for the case where they want a null-terminated "char *"
<cfbolz> Then the dangerous API should just go away indeed
<arigato> well I fear it's still used a few times directly, because not all code can easily match a with statement
<cfbolz> arigato: OK, but those places should llstr then?
<arigato> yes
<cfbolz> Ok
<arigato> they are already hacking around by using get_nonmovingbuffer() directly
<arigato> I'm sure they could be rewritten without it, but possibly at a performance loss
<cfbolz> arigato: can you have the old function stay around and raise an exception with an explanation what to use instead?
xcm has quit [Remote host closed the connection]
<arigato> yes
<arigato> good idea
xcm has joined #pypy
<cfbolz> Cool
<cfbolz> (maybe with @not_rpython to make sure the exception doesn't accidentally translate)
<arigato> ...yes, @not_rpython is a better idea than writing an XXX inside the function
<cfbolz> arigato: :-)
<cfbolz> Or ... which has now become valid Syntax
<arigato> yay!
<cfbolz> arigato: a bit of a different topic, would you be up for reviewing my completely overengineered improved json parser next week or so?
<arigato> :-)
<arigato> yes
<wleslie> SysExcInfoRestorer is a much more descriptive name than EXCEPT_HANDLER. thanks pypy3 team.
<cfbolz> arigato: cool, will ping you at some point
<cfbolz> (unfortunately v8's newest version has a much better new one too, so we are losing against them again, but I am going to ignore that for now)
<cfbolz> wleslie: \o/
<krono> thank you for tackling this :)
xcm is now known as Guest36942
Guest36942 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
xcm has joined #pypy
<mjacob> the mailing list archive seems to be out of date: https://mail.python.org/pipermail/pypy-dev/2019-July/thread.html
<cfbolz> mjacob: how so?
<mjacob> i've sent to pypy-dev yesterday, but i don't see my mail in the archives
<mjacob> so after a reload, the archive is up to date
<mjacob> weird
speeder39_ has quit [Quit: Connection closed for inactivity]
glyph has quit [Ping timeout: 248 seconds]
bendlas has quit [Ping timeout: 250 seconds]
edd[m] has quit [Ping timeout: 265 seconds]
hbx6 has quit [Ping timeout: 264 seconds]
glyph has joined #pypy
<krono> so for rffi. If I have a function that returns rffi.CCHARP, I can use rff.charp2str to get a python level string. What do I use for the ones returning a CONST_CCHARP?
<arigato> uh, good question. we have mostly ignored the "const" in C
<arigato> I guess you should just declare the function as returning a CCHARP
<arigato> or do rffi.cast()
<krono> ok. It originally said CCHARP but that results in annoying Red Paint on my terminal during the C compile step ;)
<krono> I leave it as is :)
<arigato> right :-) yes, you can return CONST_CCHARP and add a rffi.cast then
<arigato> (I think the cast doesn't cause a C warning?)
<krono> I haven't tried. However, this is all bikeshedding from what I actually have to do, so I better leave it as is :D
<arigato> right. yes, I think we're getting Red Paint about that in a pypy translation
antocuni has quit [Ping timeout: 268 seconds]
<krono> :)
xcm has quit [Remote host closed the connection]
dddddd has joined #pypy
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
bendlas has joined #pypy
<kenaan> arigo default 19e211d4c76b /: Change the API of rffi.get_nonmovingbuffer(), now renamed to rffi.get_nonmovingbuffer_ll(), because it is not safe:...
<kenaan> arigo default 3576fb517a7b /rpython/memory/gc/env.py: Broken line, get_L2cache_linux2_cpuinfo_s390x() was never called. Comment it out entirely instead of fixing the ca...
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<fijal> who owns pypy docker stuff?
<fijal> like this
<arigato> krono: 19e211d4c76b should fix the problem
<krono> arigato: cool!
<krono> arigato: looks good to me :)
<cfbolz> fijal: I am not sure, but maybe https://twitter.com/tianon
<arigato> krono: thanks for pulling us to get together to the root of the problem :-)
<krono> no problem! I sure don't like workarounds :D
<krono> (viz. Red Paint)
<fijal> cfbolz: he asked me who, so not him
<krono> I'm constantly amazed at which speed y'all are able to tackle such problems
<fijal> cfbolz: so for what is worth, it's not like perf tools work out of the box
edd[m] has joined #pypy
<fijal> ah maybe libunwind outright does not work on arm64?
<arigato> fijal: that sentence might benefit from a few context information---yes, like the fact that you're on arm64
<arigato> I'd assume that libunwind does not work reliably *anywhere*, until proven otherwise
hbx6 has joined #pypy
<fijal> "reliably" != "at all"
<fijal> but yeah, I get your message
<fijal> arigato: I'm trying to understand why visualization tools produce no output
<kenaan> fijal extradoc 0dd699c2378b /blog/draft/2019-07-arm64.rst: add a draft
<fijal> anyone feels like reviewing ^^^^
dddddd has quit [Remote host closed the connection]
dddddd has joined #pypy
<cfbolz> arigato: i have it from a fairly reliable source that unwind will fail on any platform if you push it hard enough
<arigato> yes that's my point.
Rhy0lite has joined #pypy
<arigato> fijal's is that it doesn't work at all on arm64, but my point is that it shouldn't be used anywhere anyway
<cfbolz> arigato: for profiling it's still OK, I think
<kenaan> arigo extradoc 95f7083ab191 /blog/draft/2019-07-arm64.rst: Tweaks
<arigato> fijal: ^^^
antocuni has joined #pypy
<fijal> I think "At all", even when using perf
<fijal> arigato: should we quickly do threadlocals?
<fijal> I *think* it's the only one left
<fijal> there is also singlefloats I guess
<tos9> argh frigging mercurial. I did some copyediting, and then pulled the Tweaks commit, and then fixed the merges, and then hg now threw that merge resolution away somehow
<kenaan> Julian Berman extradoc e49a4b5cc87d /blog/draft/2019-07-arm64.rst: Copy-edit.
<tos9> ok ^
<tos9> hopefully that didn't change the meaning of anything there though I had a hard time guessing what you meant by "old crappy code" :)
<tos9> also I think all those warnings are a bit distracting... maybe it's more "impressive" sounding while still being scientifically honest if they go to the bottom after the key results are presented?
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<fijal> tos9: which warnings? that the benchmark setup is shit?
marky1991 has joined #pypy
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
<kenaan> rlamy py3.6 7560947dd35d /: hg merge default
<kenaan> fijal default 6885d94b89cf /rpython/jit/backend/aarch64/: threadlocalref get
<krono> I have an elidable method, that is truly elidied in 2 rpython-vms, but in the third, a call_r is generated instead:
<krono> +9566: p590 = call_r(ConstClass(CompoundShape.get_transformation), p572, 0, ConstPtr(ptr589), descr=<Callr 8 rir EF=4>)
<krono> how can I approach debugging this?
<fijal> krono: it cannot be elided with p572 being a pointer
<fijal> er, being a variable
<fijal> so what you need is to make it constant, either by promotion or other means
<krono> fijal: thank, that helps
<kenaan> Raemi extradoc 925d7c1b0666 /blog/draft/: trying to make the blog post a bit more appealing :)
<Remi_M> @fijal: I hope you don't mind the changes. I think that the pictures are a bit more appealing than the table :)
<fijal> yeah sure, thanks a lot!
<krono> err, what's an getinteriorfield_gc_r ? is that new?
<fijal> it's a read from an array of structs (inlined)
<fijal> no, it's not new
<fijal> you would see it for dicts for example
<krono> that's interesting, never had that up until now
<arigato> fijal: sorry, back now. Did you finish threadlocals?
<fijal> arigato: I think so, waiting for the tests
<arigato> cool
<fijal> then will kick a translation
Remi_M has quit [Quit: See you!]
<fijal> arigato: is there anything else of value in those oopspec calls?
<fijal> for ARM the rest is 32bit only
<krono> fijal: sorry to bother you with the stuff above, but the p572 is read from a field that is in _immutable_fields_ , so I thought it would be constant already
<fijal> krono: copy paste the read operation please
<fijal> krono: no no no, it does not bother me at all happy to be of service :-)
<arigato> fijal: I think there is little else
marky1991 has quit [Ping timeout: 246 seconds]
<fijal> krono: right so the problem is that it's a read from a constant dict
<fijal> but we don't know that
<fijal> so what we do in such situation is to put it behind elidable: @jit.elidable def read_map(self, key): return self.map[key]
<fijal> or something like that
<krono> yea, sounds reasonable...
<krono> let me thinkg for a minute
<krono> (so the difference to the _other_ two vms where that is not present is that here the holder of p572 has _attrs_ (== _immutable_fields_ ) and in the others, no _attrs_)
<krono> but I'll try withan elidabe getter, be back in 10 minutes
<krono> fijal: just quick before I translate, can the edliable getter also set? a bit like setdefault?
<arigato> yes, "elidable" means that when the same function is called twice with same arguments, then the result must be the same
<krono> thought so, just wanted to be sure.
<krono> thanks. *transalting now*
<arigato> to be precise, when you call an elidable function, the JIT collapses several calls into one, and the one remaining call could occur earlier than it should really occur according to the rpython program flow
<arigato> be careful when you initialize stuff on an instance and then immediately pass that instance (as a constant) to an elidable call, because the elidable call can occur earlier
<fijal> but *also* can be removed completely on constants
<fijal> so you can set things up, but you have to be careful that there are no observable side effects
<arigato> right, but that's a special case where the call occurs only once during JITing
<fijal> arigato: tests seem to pass, if that stuff is tested at all
<arigato> cool
sknebel has quit [Ping timeout: 245 seconds]
<krono> waaaay better, thanks :)
<kenaan> rlamy apptest-file 531d4c2e2b9e /: hg merge default
marky1991 has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
<tos9> fijal: yeah the benchmark shit warnings
<tos9> It looks like Raemi did an even better job at cleaning up the wording though :) so now think it's a lot better
marky1991 has quit [Read error: Connection reset by peer]
marky1991 has joined #pypy
<fijal> we should probably disable stack protector
<fijal> default is -fstack-protector-strong, I think
<fijal> arigato: but it does not seem to be working
<fijal> +536: p38 = call_r(ConstClass(_ll_1_threadlocalref_get__Ptr_GcStruct_objectLlT_Signed), 64, descr=<Callr 8 i EF=1 OS=5>)
<fijal> that should not be the case right?
<fijal> uh, is the USE__THREAD=False not disabling that somehow?
<arigato> I have no clue how this call can remain
<arigato> _prepare_op_call() looks like it should kill it, it has got the right EF=1 OS=5
<arigato> wrong version of pypy-c?
* fijal looks
<fijal> 6885d94b89cf
<fijal> looks right to me?
<arigato> yes
<fijal> 🤷‍♂️
<fijal> gdb time?
sknebel_ has joined #pypy
<arigato> guess so
<arigato> aaaaaaaah no wait
<arigato> we see this line in the log, that's actually expected
<arigato> it doesn't mean it was implemented as a call in assembler
<arigato> we probably did self.assembler.threadlocalref_get(), which emitted non-calls, but from the point of view of the resop, it's still the call shown above
<arigato> you can't be sure without looking at the actual assembler :-)
<fijal> ugh wait
<fijal> right
<fijal> so I wonder why there is no speedup
<kenaan> rlamy py3tests 5ec00f642d67 /: hg merge py3.6
sknebel_ is now known as sknebel
<arigato> look at a benchmark for which you can confirm that the ll_1_threadlocalref_get occurs in a tight loop
<fijal> ok got some speedups
<arigato> ok
<fijal> right so done I guess?
<arigato> yes :-)
<fijal> the twisted benchamrks don't change, but thats; not unexpected
<fijal> would be cool to find out why the difference is so big
<arigato> yes
<arigato> singlefloat support is nice for code that handles C floats somewhere, but not otherwise
<fijal> should we push the blog out? I don't think it changes anything on those numbers
<fijal> (didn't change any of the ones I tried)
<arigato> nice graphs :-)
<kenaan> rlamy py3tests c3e614c36972 /: dummy merge with apptest-file
Rhy0lite has quit [Quit: Leaving]
antocuni has quit [Ping timeout: 272 seconds]
marky1991 has quit [Remote host closed the connection]
marky1991 has joined #pypy
themsay has quit [Ping timeout: 246 seconds]
themsay has joined #pypy
kipras has joined #pypy
themsay has quit [Read error: Connection reset by peer]
themsay has joined #pypy
themsay has quit [Ping timeout: 248 seconds]
themsay has joined #pypy
themsay has quit [Read error: Connection reset by peer]
themsay has joined #pypy
antocuni has joined #pypy
jcea has joined #pypy
marky1991 has quit [Ping timeout: 268 seconds]
themsay has quit [Ping timeout: 245 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
antocuni has quit [Ping timeout: 245 seconds]
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy
xcm has quit [Remote host closed the connection]
xcm has joined #pypy