00:50
tsaka__ has quit [Ping timeout: 260 seconds]
01:55
jcea has quit [Ping timeout: 276 seconds]
03:14
gef has quit [Ping timeout: 240 seconds]
03:49
gef has joined #pypy
04:37
gef has quit [Ping timeout: 252 seconds]
05:32
Gustavo6046 has joined #pypy
06:33
gef has joined #pypy
08:05
gef has quit [Ping timeout: 265 seconds]
08:56
glyph has quit [Read error: Connection reset by peer]
08:58
glyph has joined #pypy
09:01
oberstet has joined #pypy
09:18
gef has joined #pypy
09:24
gef has quit [Ping timeout: 252 seconds]
09:27
gef has joined #pypy
09:40
gef has quit [Ping timeout: 260 seconds]
09:57
todda7 has joined #pypy
10:11
todda7 has quit [Remote host closed the connection]
10:11
gef has joined #pypy
10:14
<
mattip >
cfbolz: there is a strange failing test on rpython/rlib/test/test_rbigint.py
10:15
<
mattip >
it seems to come from 5154f8a314fb, where you added test_int_divmod_mod_int_result
10:15
<
mattip >
but there is no int_divmod_mod_int_result on rbigint, only test_int_mod_int_result
10:16
<
cfbolz >
mattip: hrm, weird. I'll look
10:17
<
mattip >
err, only int_mod_int_result
10:18
<
cfbolz >
mattip: ah, right
11:01
lritter has joined #pypy
11:24
gef has quit [Ping timeout: 240 seconds]
11:40
todda7 has joined #pypy
11:53
gef has joined #pypy
12:17
<
cfbolz >
waaat, we don't cache the result of space.newtext("some constant") during translation?
12:17
<
cfbolz >
so that means all the code with newtext will really allocate a W_UnicodeObject at runtime?
12:17
<
cfbolz >
we used to have annotator support for this
12:31
gef has quit [Ping timeout: 265 seconds]
12:32
gef has joined #pypy
12:45
gef has quit [Ping timeout: 268 seconds]
12:47
isidentical has joined #pypy
12:50
todda7 has quit [Remote host closed the connection]
12:52
todda7 has joined #pypy
13:19
gef has joined #pypy
13:58
<
mattip >
cfbolz: "we used to have annotator support for this" - do you remember what it looked like?
13:58
<
cfbolz >
mattip: it was annotator magic
13:58
<
mattip >
going back to v.7.0.0, before utf-8, I don't see the magic
13:59
<
cfbolz >
let me dig
14:00
<
mattip >
there is a "specialize.memo" decorator
14:00
<
cfbolz >
mattip: yes, that's what we should use nowadays
14:00
<
cfbolz >
but we had special support for "wrap"
14:01
<
cfbolz >
I don't think we should bring that back
14:01
<
cfbolz >
new space method + memo
14:01
<
cfbolz >
is good enough
14:04
<
mattip >
ahh, just saw the issue :)
14:06
<
mattip >
there are 746 matches when grepping pypy for space.newtext(['"]
14:06
<
cfbolz >
yeah, it's work :-(
14:08
gef has quit [Ping timeout: 252 seconds]
14:12
<
cfbolz >
mattip: ah, from the issues: is it intentional that the release is named 7.3.6
14:38
gef has joined #pypy
14:55
<
cfbolz >
mattip: I don't think we should change writelines
14:55
<
mattip >
right, only if CPython changes it
15:31
isidentical has quit [Quit: isidentical]
15:39
gef has quit [Ping timeout: 260 seconds]
15:42
<
arigato >
cfbolz: don't you think a hack would be OK, to memoize all calls to space.newtext(constant)?
15:43
<
arigato >
the hack can be a bit more general, too, because here are other places where it would make sense
15:43
<
arigato >
basically a variant of "elidable"
16:13
<
cfbolz >
arigato: but an annotation level one
16:14
<
cfbolz >
arigato: something like specialize.memo_or_var
16:18
<
arigato >
either that, or a helper function that can be implemented in terms of existing annotations (I think)
16:18
<
arigato >
like "if is_constant(x): return memo_f(x); else return f(x)"
16:19
oberstet has quit [Quit: Leaving]
16:19
<
arigato >
avoids having to hack various levels of the translation process
16:20
<
cfbolz >
arigato: hm, nice plan
16:20
<
arigato >
not completely sure it works, though, but it would be the idea
16:21
<
arigato >
maybe it needs a flow-space replacement, so that the annotator can see the constant being propagated as 'x'
16:23
<
arigato >
ah, or maybe with an additional @specialize.arg_or_var()
16:23
<
cfbolz >
arigato: yes, was just thinking that
16:24
<
arigato >
otherwise, I see the @register_flow_sc() annotator nowadays
16:35
<
cfbolz >
arigato: hm, I am tempted to even write this in newtext directly
16:35
<
cfbolz >
Not have a generic decorator
16:36
<
mjacob >
arigato: nevermind my question from a few days ago, it became too off-topic
16:36
<
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?
16:39
gef has joined #pypy
16:39
<
arigato >
yes, you need to declare it in cdef as a constant function pointer instead of as a normal function
16:39
<
arigato >
e.g. "int (*const f)(int, int);" I think
16:40
<
arigato >
or maybe "const*" I never remember :-)
16:40
<
arigato >
no, the "const" needs to be together with the "f"
16:49
<
mjacob >
arigato: i also can't remember which way, but fortunately i already have the a function pointer typedef at a
16:49
<
mjacob >
at hand in the cdef
16:49
<
mjacob >
why does it need "const"?
16:49
<
mjacob >
without const, it generates nonsense and the result segfaults
16:50
<
arigato >
this only works in set_source (API) mode, not in ABI mode
16:50
<
mjacob >
yes, i'm using set_source
16:50
<
arigato >
then if you don't say "const" here, it will not compile at all, I think
16:51
<
mjacob >
i'll write a minimal example showing that it works ;)
16:51
<
arigato >
because it will try to write a helper function that writes to the variable "f"
16:56
<
arigato >
ah right, it's done like that
16:56
<
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"
17:23
gef has quit [Ping timeout: 246 seconds]
17:26
<
mjacob >
arigato: everything works as intended now, thank you!
17:56
gef has joined #pypy
18:21
<
cfbolz >
arigato: unfortunately it breaks in obscure ways, when things go from constant to not constant during reflowing
18:23
<
arigato >
you need to ensure that the annotation you return is "growing" correctly
18:23
<
cfbolz >
arigato: yes, but "is_annotation_constant" is not doing that
18:23
<
cfbolz >
it returns SomeBool(const=True) and later SomeBool(const=False)
18:24
<
arigato >
where is that?
18:24
<
cfbolz >
in objectmodel.py
18:24
<
cfbolz >
it should go to SomeBool(), maybe
18:24
<
cfbolz >
and then
*rtype* to False?
18:24
<
arigato >
looks strange, it cannot be used like that
18:25
<
cfbolz >
then backendopt can remove the call still
18:25
<
arigato >
unsure who uses that
18:25
<
cfbolz >
arigato: only one place ;-)
18:25
<
cfbolz >
similar construction to what I am trying to write
18:26
<
arigato >
right, but here it works because @specialize.arg_or_var()
18:26
<
cfbolz >
arigato: no, I also have that for newtext:
18:27
<
cfbolz >
I still think is_annotation_constant is implemented wrong. it should go from SomeBool(const=True) to SomeBool()
18:27
<
arigato >
not on the lgt argument
18:27
<
cfbolz >
arigato: I tried both
18:28
<
arigato >
I think with the default value of -1 it can confuse things even more
18:28
<
cfbolz >
or maybe not, I forgot how arg_or_var with more than one argument works
18:29
<
cfbolz >
@specialize.arg_or_var(1, 2) right?
18:29
<
cfbolz >
I tried to apply the decorator twice, which is nonsense, of course
18:29
<
arigato >
probably? but yes, is_annotation_constant() as written is brittle
18:30
<
cfbolz >
given that it's so rarely used, maybe not worth it
18:30
<
cfbolz >
(to fix, I mean)
18:31
<
cfbolz >
right, now I run into other problems, good, progress :-)
18:32
gef has quit [Ping timeout: 252 seconds]
18:58
gef has joined #pypy
19:07
gef has quit [Ping timeout: 240 seconds]
19:18
gef has joined #pypy
19:25
gef has quit [Ping timeout: 246 seconds]
19:39
gef has joined #pypy
19:45
<
cfbolz >
arigato: seems to work! thanks for your help
19:46
gef has quit [Ping timeout: 240 seconds]
19:47
lritter has quit [Ping timeout: 240 seconds]
19:48
gef has joined #pypy
20:05
gef has quit [Ping timeout: 260 seconds]
20:13
gef has joined #pypy
21:28
gef has quit [Ping timeout: 252 seconds]
22:07
gef has joined #pypy
22:07
forgottenone has joined #pypy
22:09
forgottenone has quit [Remote host closed the connection]
22:14
gef has quit [Ping timeout: 240 seconds]
22:50
gef has joined #pypy