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
tsaka__ has quit [Ping timeout: 260 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/980 [mattip: Forced by command line script, release-pypy3.7-v7.x]
jcea has quit [Ping timeout: 276 seconds]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7651 [mattip: Forced by command line script, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1494 [mattip: Forced by command line script, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6365 [mattip: Forced by command line script, release-pypy2.7-v7.x]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5556 [mattip: Forced by command line script, release-pypy2.7-v7.x]
gef has quit [Ping timeout: 240 seconds]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-64/builds/227 [mattip: Forced by command line script, release-pypy2.7-v7.x]
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7651 [mattip: Forced by command line script, release-pypy2.7-v7.x]
gef has joined #pypy
<bbot2> Success: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6365 [mattip: Forced by command line script, release-pypy2.7-v7.x]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-s390x/builds/1494 [mattip: Forced by command line script, release-pypy2.7-v7.x]
gef has quit [Ping timeout: 252 seconds]
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-macosx-x86-64/builds/5556 [mattip: Forced by command line script, release-pypy2.7-v7.x]
Gustavo6046 has quit [Quit: ZNC 1.8.2 - https://znc.in]
Gustavo6046 has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-win-x86-64/builds/227 [mattip: Forced by command line script, release-pypy2.7-v7.x]
gef has joined #pypy
gef has quit [Ping timeout: 265 seconds]
glyph has quit [Read error: Connection reset by peer]
glyph has joined #pypy
oberstet has joined #pypy
gef has joined #pypy
gef has quit [Ping timeout: 252 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 260 seconds]
todda7 has joined #pypy
todda7 has quit [Remote host closed the connection]
gef has joined #pypy
<mattip> cfbolz: there is a strange failing test on rpython/rlib/test/test_rbigint.py
<mattip> it seems to come from 5154f8a314fb, where you added test_int_divmod_mod_int_result
<mattip> but there is no int_divmod_mod_int_result on rbigint, only test_int_mod_int_result
<cfbolz> mattip: hrm, weird. I'll look
<mattip> err, only int_mod_int_result
<cfbolz> mattip: ah, right
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7652 [mattip: test branch, jit-instance-ptr-eq-improvements]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6366 [mattip: test branch, jit-instance-ptr-eq-improvements]
lritter has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-64/builds/7652 [mattip: test branch, jit-instance-ptr-eq-improvements]
gef has quit [Ping timeout: 240 seconds]
todda7 has joined #pypy
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-x86-32/builds/6366 [mattip: test branch, jit-instance-ptr-eq-improvements]
<bbot2> Started: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/983 [mattip: Forced by command line script, release-pypy2.7-v7.x]
gef has joined #pypy
<cfbolz> waaat, we don't cache the result of space.newtext("some constant") during translation?
<cfbolz> so that means all the code with newtext will really allocate a W_UnicodeObject at runtime?
<cfbolz> we used to have annotator support for this
gef has quit [Ping timeout: 265 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 268 seconds]
isidentical has joined #pypy
todda7 has quit [Remote host closed the connection]
todda7 has joined #pypy
nulano has quit [Quit: ZNC - http://znc.in]
gef has joined #pypy
<mattip> cfbolz: "we used to have annotator support for this" - do you remember what it looked like?
<cfbolz> mattip: it was annotator magic
<mattip> going back to v.7.0.0, before utf-8, I don't see the magic
<cfbolz> let me dig
<mattip> there is a "specialize.memo" decorator
<cfbolz> mattip: yes, that's what we should use nowadays
<cfbolz> but we had special support for "wrap"
<cfbolz> I don't think we should bring that back
<cfbolz> new space method + memo
<cfbolz> is good enough
<mattip> ahh, just saw the issue :)
<mattip> there are 746 matches when grepping pypy for space.newtext(['"]
<cfbolz> yeah, it's work :-(
gef has quit [Ping timeout: 252 seconds]
<cfbolz> mattip: ah, from the issues: is it intentional that the release is named 7.3.6
<cfbolz> ?
<cfbolz> ah, right
gef has joined #pypy
<cfbolz> mattip: I don't think we should change writelines
<mattip> right, only if CPython changes it
<bbot2> Failure: http://buildbot.pypy.org/builders/pypy-c-jit-linux-aarch64/builds/983 [mattip: Forced by command line script, release-pypy2.7-v7.x]
isidentical has quit [Quit: isidentical]
gef has quit [Ping timeout: 260 seconds]
<arigato> cfbolz: don't you think a hack would be OK, to memoize all calls to space.newtext(constant)?
<arigato> the hack can be a bit more general, too, because here are other places where it would make sense
<arigato> basically a variant of "elidable"
<cfbolz> arigato: but an annotation level one
<cfbolz> arigato: something like specialize.memo_or_var
<cfbolz> ?
<arigato> either that, or a helper function that can be implemented in terms of existing annotations (I think)
<arigato> like "if is_constant(x): return memo_f(x); else return f(x)"
oberstet has quit [Quit: Leaving]
<arigato> avoids having to hack various levels of the translation process
<cfbolz> arigato: hm, nice plan
<arigato> not completely sure it works, though, but it would be the idea
<arigato> maybe it needs a flow-space replacement, so that the annotator can see the constant being propagated as 'x'
<arigato> ah, or maybe with an additional @specialize.arg_or_var()
<cfbolz> arigato: yes, was just thinking that
<cfbolz> I can try
<arigato> otherwise, I see the @register_flow_sc() annotator nowadays
<cfbolz> arigato: hm, I am tempted to even write this in newtext directly
<cfbolz> Not have a generic decorator
<arigato> sure
<mjacob> arigato: nevermind my question from a few days ago, it became too off-topic
<mjacob> is it possible in cffi to obtain a pointer (cdata) to some function declared in cdef without writing a function that returns the pointer?
gef has joined #pypy
<arigato> yes, you need to declare it in cdef as a constant function pointer instead of as a normal function
<arigato> e.g. "int (*const f)(int, int);" I think
<arigato> or maybe "const*" I never remember :-)
<arigato> no, the "const" needs to be together with the "f"
<mjacob> arigato: i also can't remember which way, but fortunately i already have the a function pointer typedef at a
<mjacob> at hand in the cdef
<mjacob> why does it need "const"?
<mjacob> without const, it generates nonsense and the result segfaults
<arigato> ah wait
<arigato> this only works in set_source (API) mode, not in ABI mode
<mjacob> yes, i'm using set_source
<arigato> OK
<arigato> then if you don't say "const" here, it will not compile at all, I think
<mjacob> i'll write a minimal example showing that it works ;)
<arigato> because it will try to write a helper function that writes to the variable "f"
<mjacob> arigato: https://bpa.st/UAKA compiles, but it gives compiler warning https://bpa.st/GKJQ
<arigato> ah right, it's done like that
<arigato> yes, the warning is gcc's way of saying "I should give a fatal error on this, but well, you know better, I guess"
gef has quit [Ping timeout: 246 seconds]
<mjacob> arigato: everything works as intended now, thank you!
<arigato> great!
gef has joined #pypy
<cfbolz> arigato: unfortunately it breaks in obscure ways, when things go from constant to not constant during reflowing
<arigato> you need to ensure that the annotation you return is "growing" correctly
<cfbolz> arigato: yes, but "is_annotation_constant" is not doing that
<cfbolz> it returns SomeBool(const=True) and later SomeBool(const=False)
<arigato> where is that?
<cfbolz> in objectmodel.py
<cfbolz> line 360
<arigato> ah, yes
<cfbolz> it should go to SomeBool(), maybe
<cfbolz> and then *rtype* to False?
<arigato> looks strange, it cannot be used like that
<cfbolz> then backendopt can remove the call still
<arigato> unsure who uses that
<cfbolz> arigato: only one place ;-)
<cfbolz> similar construction to what I am trying to write
<arigato> right, but here it works because @specialize.arg_or_var()
<cfbolz> arigato: no, I also have that for newtext:
<cfbolz> I still think is_annotation_constant is implemented wrong. it should go from SomeBool(const=True) to SomeBool()
<arigato> not on the lgt argument
<cfbolz> arigato: I tried both
<arigato> I think with the default value of -1 it can confuse things even more
<cfbolz> or maybe not, I forgot how arg_or_var with more than one argument works
<cfbolz> @specialize.arg_or_var(1, 2) right?
<cfbolz> I tried to apply the decorator twice, which is nonsense, of course
<arigato> probably? but yes, is_annotation_constant() as written is brittle
<cfbolz> given that it's so rarely used, maybe not worth it
<cfbolz> (to fix, I mean)
<cfbolz> right, now I run into other problems, good, progress :-)
gef has quit [Ping timeout: 252 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 240 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 246 seconds]
gef has joined #pypy
<cfbolz> arigato: seems to work! thanks for your help
gef has quit [Ping timeout: 240 seconds]
lritter has quit [Ping timeout: 240 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 260 seconds]
gef has joined #pypy
gef has quit [Ping timeout: 252 seconds]
gef has joined #pypy
forgottenone has joined #pypy
forgottenone has quit [Remote host closed the connection]
gef has quit [Ping timeout: 240 seconds]
gef has joined #pypy