🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | log inspection situation still under development | For MoarVM see #moarvm
Set by lizmat on 22 May 2021.
00:07 reportable6 left 00:10 reportable6 joined 00:42 [Coke]_ joined 00:43 [Coke] left 01:11 [Coke]_ is now known as [Coke] 02:00 melezhik joined
melezhik I am thinking about resuming r3tool for rakudo commits testing - sparrowhub.io:2222/report/576 02:01
Let me know if this something that could be useful
CI can runs closed issues tests against rakudo commits 02:02
These are just black box tests in sparrow style
github.com/melezhik/r3tool 02:03
So a regression could be spotted on per GitHub issues basis
02:14 melezhik left, melezhik joined 02:18 melezhik left 02:26 frost joined 02:37 Xliff joined 03:37 statisfiable6 left, notable6 left, bloatable6 left, bisectable6 left, shareable6 left, quotable6 left, releasable6 left, nativecallable6 left, unicodable6 left, linkable6 left, sourceable6 left, greppable6 left, committable6 left, tellable6 left, coverable6 left, evalable6 left, benchable6 left, reportable6 left, bisectable6 joined, linkable6 joined, notable6 joined 03:38 coverable6 joined, releasable6 joined, unicodable6 joined, statisfiable6 joined, tellable6 joined, shareable6 joined, bloatable6 joined, evalable6 joined 03:39 quotable6 joined, committable6 joined, greppable6 joined, reportable6 joined, benchable6 joined 03:40 nativecallable6 joined, sourceable6 joined 06:08 reportable6 left 06:09 reportable6 joined 08:01 lizmat joined 09:26 Geth joined, RakuIRCLogger left
Geth rakudo: 41e07ab958 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/CoercionHOW.nqp
Micro-opt on CoercionHOW.typecheck

In NQP, =:= alreay returns 1 if condition matches
09:28
09:33 Geth left, Geth joined 09:37 Geth left, Geth joined
Geth rakudo: eceea95cd6 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/CoercionHOW.nqp
Make coercion more easily inlineable

If the type is already correct, then the method is really small and can be inlined. However, this does not appear to have any effect on runtime, as apparently some other optimization is already preventing
  .coerce from being called in the case of already having the correct
type.
Apparently the .coerce method is only called with already correct types during compilation. In any case, the small size allows it to be inlined pretty quickly, so in practice this does not add any method call overhead.
10:04
10:07 [Tux] left
SmokeMachine something seems wrong: 10:37
m: class :: does Sequence does Positional { has Lock $.l .= new; method iterator { die "called iterator" } }.new
camelia (signal SEGV)
SmokeMachine m: class :: does Sequence does Positional { has Lock $.l; method iterator { die "called iterator" } }.new
camelia ( no output )
SmokeMachine m: class :: does Sequence does Positional { has Lock $.l .= new }.new
camelia MoarVM panic: Memory allocation failed; could not allocate 131072 bytes
SmokeMachine bisectable6: class :: does Sequence does Positional { has Lock $.l; method iterator { die "called iterator" } }.new 10:38
bisectable6 SmokeMachine, Will bisect the whole range automagically because no endpoints were provided, hang tight
SmokeMachine, Output on all releases: gist.github.com/fad0d611bba9621abd...355a0d003d
SmokeMachine, Bisecting by exit code (old=2017.09 new=2017.10). Old exit code: 1
SmokeMachine, bisect log: gist.github.com/ba34a5629511f97360...819b4c07ed
SmokeMachine, (2017-10-12) github.com/rakudo/rakudo/commit/cc...b8252c910f
SmokeMachine, Output on all releases and bisected commits: gist.github.com/d713dad5a141159f62...c3c743df49 10:39
lizmat that looks like a false positive
SmokeMachine this is what is breaking Red on 2022.06
(I'm using Lock there as an example... that could be anything... and that's not even being used...) 10:40
m: class Bla {}; class :: does Sequence does Positional { has Bla $.l; method iterator { die "called iterator" } }.new
camelia ( no output )
SmokeMachine (sorry, it seems it isn't anything... but on Red that's breaking with Red::AST::Chained and with Lock...) 10:41
m: class Bla {}; class :: does Sequence does Positional { has Bla $.l .= new; method iterator { die "called iterator" } }.new # I forgot the `.= new` 10:42
camelia (signal SEGV)
SmokeMachine it seems to be anything...
On Red, if there is an Attribute with `.= new` on Red::ResultSeq, for some reason when instantiating it, it calls `cache` that calls `iterator` that dies because it's not prepared to run yet... 10:47
lizmat: sorry, what do you mean by false positive? the bisectable6 answer? 10:48
bisectable6: old=2022.04 new=2022.06 class :: does Sequence does Positional { has Lock $.l .= new; method iterator { die "called iterator" } }.new 10:49
bisectable6 SmokeMachine, Bisecting by exit signal (old=2022.04 new=2022.06). Old exit signal: 0 (None)
SmokeMachine, bisect log: gist.github.com/d1085f40370f3ff057...d06d5ddcbd
SmokeMachine, (2022-04-26) github.com/rakudo/rakudo/commit/83...90929d9597
lizmat yea, the second bisectable answer is more like it 10:50
SmokeMachine lizmat: that code should work, right? 10:53
lizmat yeah, think so 10:54
anyway, just confirmed that reverting that commit does indeed fix the segfault 10:55
nine Maybe there was a reason for making that check strict after all. 10:56
lizmat perhaps... looking into it deeper at 10:59
atm
SmokeMachine will that be possible to make a new release fixing it? Red is not working on 2022.06 because of that... :( 11:00
nine The segfault and memory allocation error would point at an infinite recursion
11:01 [Tux] joined
lizmat yeah, if you remove the iterator method from the class in the example, it just hangs 11:01
SmokeMachine yes
nine We could simply revert the offending commit and do a point release 11:02
lizmat ok, lemme see if that is spectest clean now 11:03
meh... we would need to revert one spectest as well 11:10
anyway, I've established that that code is being called for the nameless class twice 11:12
and actually does not appear to get called for the failing test 11:13
before reverting, I'd like to do a little more research
another thing that it needs to have, is a "method iterator" 11:14
if it does not exist, it goes into an infiniloop eating all memory 11:16
however, the method is not getting called ?
SmokeMachine on Red (Red::ResultSeq) that has a cache and a iterator methods, cache gets called and it calls iterator... 11:19
m: class :: does Sequence does Positional { has Lock $.l .= new; method cache { die "called cache" } }.new # just testing
camelia MoarVM panic: Memory allocation failed; could not allocate 131072 bytes
SmokeMachine the line 87 is the Attribute definition with `.= new: ...` usercontent.irccloud-cdn.com/file/.../image.png 11:21
lizmat m: class A does Sequence does Positional { has Int $.l .= new; method iterator { } }.new # further golf 11:27
camelia (signal SEGV)
lizmat m: class A does Sequence { } # shouldn't that complain about not having implemented an "iterator" method ? 11:30
camelia ( no output )
12:01 linkable6 left, evalable6 left 12:02 evalable6 joined 12:03 linkable6 joined 12:06 reportable6 left 12:09 reportable6 joined
Geth rakudo: dd7f3eb976 | (Elizabeth Mattijsen)++ | src/core.c/Sequence.pm6
Make PostionalBindFailover.iterator die

Apparently, the checks for unimplemented methods do not work for roles that are created this early in the setting. So instead of having a compile time error, settle for a similar run-time error if the method does not get implemented.
12:22
lizmat I think this is only part of this puzzle 12:29
m: class A does Positional does Sequence { has Int $.l .= new }.new
camelia MoarVM panic: Memory allocation failed; could not allocate 131072 bytes
lizmat right... after the last commit, this fails with: Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover 12:30
SmokeMachine m: class A does Iterable {}.new 12:33
camelia ( no output )
SmokeMachine shouldn't `iterator` be required by Iterable?
lizmat yeah, I think the underlying issue in all of this, is that the method implemented check does not appear to work on roles in Core 12:34
m: class A does Positional does Sequence { has Int $.l .= new }.new 12:36
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat so, it's called on A, *BUT* only if it has an attribute that is by default initialized with a .new
SmokeMachine m: role B { method iterator {...} }; say class A does B {}.new.iterator
camelia Rakudo::Iterator::ReifiedListIterator.new
lizmat m: say 42.iterator 12:37
camelia Rakudo::Iterator::ReifiedListIterator.new
lizmat same thing
that's just from a scalar being a reified 1 elem list
SmokeMachine so, it will never fail because it's always implemented...
lizmat s/being/acting like
s/being/acting like 12:38
hmmm... that should be a compile time error ? 12:39
m: role B { method iterator {...} }; say class A does B {}
camelia (A)
lizmat m: role B { method iderator {...} }; say class A does B {} 12:40
camelia ===SORRY!=== Error while compiling <tmp>
Method 'iderator' must be implemented by A because it is required by roles: B.
at <tmp>:1
lizmat feels to me the check for implemented methods is a bit wonky
it should check whether the method is actually implemented by A, not that it is implemented at all 12:41
SmokeMachine m: class A does Positional does Sequence { has Int $.l .= is-prime }.new # It seems it's not only for `.= new`
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat and *that* may be the underlying issue
hmmm... not just initialization, but initialization with .= 12:42
SmokeMachine role R1 { method required { ... } }; role R2 does R1 { method required {} }; class C does R2 {} # lizmat: would your suggestion works for this case? 12:43
lizmat m: class A does Positional does Sequence { has Int $.l = $!l.is-prime }.new $ actually .= not required 12:44
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> uence { has Int $.l = $!l.is-prime }.new⏏ $ actually .= not required
expecting any of:
infix
infix stopper
statem…
lizmat m: class A does Positional does Sequence { has Int $.l = $!l.is-prime }.new # actually .= not required
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat m: role R1 { method required { ... } }; role R2 does R1 { method required {} }; class C does R2 {} 12:45
camelia ( no output )
lizmat m: role R1 { method required { ... } }; role R2 does R1 { }; class C does R2 {}
camelia ===SORRY!=== Error while compiling <tmp>
Method 'required' must be implemented by C because it is required by roles: R2.
at <tmp>:1
SmokeMachine : class A does Positional does Sequence { has Int $.l = 42.is-prime }.new # It seems to be by calling any method... 12:46
m: class A does Positional does Sequence { has Int $.l = 42.is-prime }.new # It seems to be by calling any method...
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
SmokeMachine m: class A does Positional does Sequence { has Int $.l = "bla".contains: "l" }.new 12:47
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat it looks like .cache is being called from the generated BUILDALL of the class
SmokeMachine m: class A does Positional does Sequence { has Int $.l = 1 + 1 }.new # Any execution 12:48
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat m: class A does Positional does Sequence { has Int $.l = $!l.is-prime }; use BUILDPLAN A
camelia class A BUILDPLAN:
0: nqp::getattr(obj,A,'$!l') = :$l if possible
1: nqp::getattr(obj,A,'$!l') = execute-code() if not set
2: vivify nqp::getattr(obj,A,'$!list') if part of a mixin
lizmat the plot thickens
SmokeMachine I did't know about `use BUILDPLAN`... 12:49
lizmat yeah... it's really just for cases like this :-)
so I bet the "execute-code" bit has an issue somehow 12:50
simpler case:
class A does Positional does Sequence { has Int $.l = 42 }; use BUILDPLAN A
evalable6 class A BUILDPLAN:
0: nqp::getattr(obj,A,'$!l') = :$l if possible
1: nqp::getattr(obj,A,'$!l') = 42 if not set
2: vivify nqp::getattr(obj,A,'$!list') if part of a mixin
lizmat prepares mentally for diving into the buildplan code builder again 12:51
SmokeMachine is nqp::getattr(obj,A,'$!list') calling cache (sorry... just gessing) 12:55
?
lizmat nope, it isn't directly, looking at the generated ASTs 12:56
QAST actually
hmmm... where does p6assign live 12:57
aha.. hmm.. so the Sequence role basically injects .cache for just about anything 13:13
m: dd 42.cache
camelia (42,)
lizmat right
13:14 frost left
lizmat m: dd 42.^find_method("cache") 13:14
camelia Method cache = method cache ($: *%_) { #`(Method|3550451296752) ... }
lizmat m: dd 42.^find_method("cache").file 13:15
camelia "SETTING::src/core.c/Any.pm6"
lizmat so it gets the default .cache method, which just turns it into a list
m: dd class A does Sequence { }.^find_method("cache").file 13:16
camelia "SETTING::src/core.c/Sequence.pm6"
lizmat so, when it does Sequence, it gets the PositionalBindFailover one
which calls .iterator
m: dd class A does Sequence does Positional { }.^find_method("cache").file 13:17
camelia "SETTING::src/core.c/Sequence.pm6"
lizmat ok, I'm starting to think we should revert the commit and todo the associated test for now 13:20
also: in Sequence.pm6: nqp::p6configposbindfailover(Positional, PositionalBindFailover); 13:34
Geth rakudo/revert-83ea64749896: 6bdac8909e | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp
Revert relaxation of positional bind failover binding

It basically makes it impossible to create a class that does both Sequence as well as Positional, and this in turn broke Red.
13:39
rakudo: lizmat++ created pull request #4947:
Revert relaxation of positional bind failover binding
13:41
roast/revert-83ea64749896: dbb03d62fe | (Elizabeth Mattijsen)++ | S06-signature/passing-arrays.t
Mark test as todo

To be merged if github.com/rakudo/rakudo/pull/4947 is merged
13:42
roast: lizmat++ created pull request #809:
Mark test as todo
lizmat SmokeMachine: ^^ 13:43
SmokeMachine lizmat: thank you (sorry, I got busy on $DAYJOB...). So should that become a point release? 13:45
lizmat good question... 13:50
I have one other report of breakage in 2022.06 to look into 13:51
vrurg That's why modules need more tests in hope Blin would catch any breakage... 14:17
lizmat m: class A does Positional does Sequence { has $.a = 42.Int; method iterator { } }.new # current golf 14:22
camelia (signal SEGV)
lizmat I think the thunk of "42.Int" is somehow calling A.cache and then goes into never never land 14:23
m: class A does Positional does Sequence { has $.a = 42.Int; method iterator { } }.new(:42l)
camelia (signal SEGV)
lizmat hm
m: class A does Positional does Sequence { has $.a = 42.Int; method iterator { } }.new(:42a)
camelia ( no output )
lizmat right
as to *why* it would call A.cache, I have no idea 14:24
m: class A does Positional does Sequence { has $.a = 42.Int }.new
camelia Method 'iterator' must be implemented by A because it is required by roles: PositionalBindFailover
in method at <tmp> line 1
in block <unit> at <tmp> line 1
lizmat the --ll-exception trace of that one is also pretty interesting 14:25
nine That raises an interesting question: why did Blin not catch that problem with Red? 14:29
SmokeMachine That’s a very good question… 14:30
AlexDaniel could be that Red is very flappy or didn't pass tests on the old version 🤔 14:32
lizmat github.com/rakudo/rakudo/issues/4948 14:34
SmokeMachine m: class A does Positional does Sequence { has $.a = 1+1; method iterator { } }.new
camelia (signal SEGV)
lizmat the initialization of the attribute must be a 400 in the BUILDPLAN
m: class A does Positional does Sequence { has int $.a = 1+1; method iterator { } }.new
camelia (signal SEGV)
lizmat or a 401,402,403,410 I guess 14:35
SmokeMachine AlexDaniel: I hope not
14:59 carlmasak joined, carlmasak left 15:20 ChanServ sets mode: +o lizmat
lizmat 🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Logs available at irclogs.raku.org/raku-dev/live.html | For MoarVM see #moarvm
15:21 ChanServ sets mode: -o lizmat
SmokeMachine where can I see old blin logs to see if Red hadn't pass the last times? 15:49
AlexDaniel SmokeMachine: you don't even need old logs, whoever ran Blin should have the new logs on the old revision 15:53
[Tux] Rakudo v2022.06-6-gdd7f3eb97 (v6.d) on MoarVM 2022.06-1-ged7e1a51b
csv-ip5xs0.780 - 0.793
csv-ip5xs-205.221 - 5.403
csv-parser3.542 - 3.633
csv-test-xs-200.413 - 0.419
test6.386 - 6.512
test-t1.437 - 1.470
test-t --race0.835 - 0.856
test-t-2019.925 - 20.713
test-t-20 --race6.439 - 6.774
16:01
16:06 Xliff left 16:28 discord-raku-bot left 16:29 discord-raku-bot joined
Geth rakudo/rakuast: 11 commits pushed by (Stefan Seifert)++
review: github.com/rakudo/rakudo/compare/c...266a04f9df
17:11
rakudo/rakuast: 4cd038636c | (Stefan Seifert)++ | src/Raku/ast/code.rakumod
Support proto methods
17:22
lizmat m: dd QuantHash.does(Associative) 17:29
camelia Bool::True
lizmat all is good, it appears, however somehow QuantHash gets punned
Geth roast: efe1f6b710 | (Elizabeth Mattijsen)++ | S02-types/keyhash.t
Make sure all methods stubbed by role are implemented
17:36
lizmat m: role A { method list { ... } }; dd A.^pun 17:44
camelia A
lizmat m: role A { method dist { ... } }; dd A.^pun 17:45
camelia Method 'dist' must be implemented by A because it is required by roles: A.
in block <unit> at <tmp> line 1
lizmat I feel the first should also fail, fwiw
18:08 reportable6 left, reportable6 joined, melezhik joined 18:14 melezhik left
nine Why should it? The punned class is a subclass of Any which brings in the required list method. 18:16
So github.com/rakudo/rakudo/commit/dd7f3eb976 should be reverted as well. It breaks that pattern. 18:18
m: class A { method iterator() { } }; class B is A does Sequence { }; B.iterator # the error is wrong 18:19
camelia Method 'iterator' must be implemented by B because it is required by roles: PositionalBindFailover
in block <unit> at <tmp> line 1
18:39 Util joined 19:05 melezhik joined 19:06 melezhik left 19:11 melezhik joined
melezhik nine: SmokeMachine people could use sparkyci to test modules against further releases. I think it's easy to add that support to sparkyci 🤔 19:13
19:14 melezhik left, melezhik joined 19:18 melezhik left 19:35 Geth left 19:36 melezhik joined 19:41 melezhik left 20:49 Geth joined
Geth rakudo/lizmat-stubs-check: 6ed67d09ff | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/ClassHOW.nqp
Consuming class must provide implementation of stubs

This commit changes the way the check for stubbed methods is performed on classes that consume roles. Before, if the class could provide a method for the stub, **even if it was from an inherited class**, it would be accepted. This behaviour makes:
... (50 more lines)
20:51
rakudo: lizmat++ created pull request #4950:
Consuming class must provide implementation of stubs
20:57 Geth left, Geth joined
Geth rakudo/lizmat-stubs-check: 8310ae23c5 | (Elizabeth Mattijsen)++ | src/core.c/Sequence.pm6
Revert "Make PostionalBindFailover.iterator die"

This reverts commit dd7f3eb976efeaee92d2678af642893cb1e51c60 because it is no longer needed if the consuming class *must* provide an implementation.
20:57
21:01 Geth left, Geth joined