Geth ¦ problem-solving: FCO assigned to jnthn Issue Making a signature accept a list of Pairs github.com/Raku/problem-solving/issues/177 00:06
00:16 vrurg_ joined 00:17 vrurg left 00:36 softmoth joined
AlexDaniel m: say 0x11FFFF.uniname 00:58
camelia <unassigned>
AlexDaniel m: say 0x11FFFF.chr.uniname 00:59
camelia chr codepoint 1179647 (0x11FFFF) is out of bounds
in block <unit> at <tmp> line 1
AlexDaniel 6c: say 0x11FFFF.chr.uniname
committable6 AlexDaniel, gist.github.com/9629f58aeb068e1bee...1f5c5194e4 01:00
AlexDaniel huh
bisect: say 0x11FFFF.chr.uniname
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.12 new=b0a720c). Old exit code: 0
AlexDaniel, bisect log: gist.github.com/38bf8dbb1b23c1d2ac...f397f72925
AlexDaniel, (2020-03-26) github.com/rakudo/rakudo/commit/aa...86c95183a9
AlexDaniel Geth: ver github.com/rakudo/rakudo/commit/aa...86c95183a9 01:01
Geth AlexDaniel, version bump brought in these changes: github.com/perl6/nqp/compare/2020....g17ac1871f
AlexDaniel Geth: ver github.com/Raku/nqp/commit/17ac187...a34f4992cf
Geth AlexDaniel, version bump brought in these changes: github.com/MoarVM/MoarVM/compare/2...g15e94eecb
01:03 sena_kun joined 01:05 Altai-man_ left
Geth nqp: bdd300fbda | Coke++ | docs/ops.markdown
Fix doc headings

  * typos
  * track auto-generated headers to use moar/jvm/js
01:10
nqp: 71c501a0d1 | Coke++ | tools/check-links
Add tool to check the headings in ops markdown
01:14
01:49 softmoth left 03:02 Altai-man_ joined 03:05 sena_kun left 04:50 evalable6 left, linkable6 left 04:51 evalable6 joined 04:53 linkable6 joined 05:03 sena_kun joined 05:05 Altai-man_ left 06:02 ufobat_ left, reportable6 left 06:05 reportable6 joined 06:48 lichtkind joined
guifa2 m: role A[::T] { has T $!a; method a { $!a = 1} }; class B { }; (B.new does A[uint8]).a; 06:59
camelia Cannot assign to an immutable value
in method a at <tmp> line 1
in block <unit> at <tmp> line 1
guifa2 but
m: role A[::T] { has uint8 $!a; method a { $!a = 1} }; class B { }; (B.new does A[uint8]).a;
camelia ( no output )
guifa2 Seems to be something odd going on with the type capture with native types. 07:00
07:03 ilogger2 joined
moritz yes, it cannot work 07:06
normal assignment assumes a container on the LHS
native types don't come with containers, so the compiler recognizes that the assignment must be handled differently
but since it finds $!a to be typed T, it doesn't do the specialization 07:07
and by the time you supply the uint8 argument, it's too late, because the assignment is already compiled
guifa2 moritz: hmmm.... and so self.a = 1 does work because that's handled later or something? 07:14
(using is rw trait) 07:21
moritz it doesn't work because self.a = 1 is compiled into an ordinary assignment, not into an assignment into a natively typed thingy 07:24
guifa2 meh. method call isn't as elegant but it works 07:28
but moritz++ for letting me know it's not gonna be possible so I don't keep trying :-)
09:03 sena_kun joined 09:07 Ven_de_Thiel joined 10:11 squashable6 joined 10:18 lichtkind_ joined 10:24 Ven_de_Thiel left
timotimo hm, we do have just one op for all nums, and one for all ints 11:00
so if there were a way to declare that it has to be a native int or num of some kind, that could allow us to build the right code 11:01
11:02 Altai-man_ joined 11:05 sena_kun left 12:51 lichtkind_ left 13:03 sena_kun joined 13:05 Altai-man_ left 13:32 Xliff joined
Xliff \o 13:32
Good morning
How would this command like look: sub MAIN (@a) { } 13:33
OK, that's just positionals.
But what about...
How would this command like look: sub MAIN (:@args) { } 13:34
I don't see this references in docs.
timotimo refuses to go on Zoom 14:17
lizmat as well 14:24
timotimo so not going to give a presentation
ha!
i have the perfect excuse
lizmat well... I've brought my apprehension to the attention of the organizers
and it appears that Zoom would be the only solution that would make it possible to support the number of expected live attendees 14:25
timotimo it's probably not easy enough to set up a jitsi or bigbluebutton instance that has the exact right amount of power for the amount of visitors
hey liz 14:27
m: my int @a = ^100_000; my int @b = ^100_000; my int @c = ^100_000; my int @d = ^100_000; my $now = now; for ^10 { my int @result = @a >>*<< @b >>*<< @c >>+<< @d; Nil }; say now - $now; 14:28
camelia 5.1342842
timotimo ^- what if this took 0.06 seconds instead?
lizmat that would be magnificent
what needs to be done for that ?
timotimo even if it were essentially an extra implementation of hyperops? 14:29
i'm writing analysis and code-gen inside Perl6/Optimizer.nqp
it'll only work for all-native stuff at the moment, i.e. storing into a native array and taking data from native arrays 14:30
and only for operators that i specifically implement myself right there 14:31
though i suppose building code-gen that goes through .pull-one on iterator objects obtained from the arguments could work and could give a good performance increase 14:32
kind of like how we sometimes turn loops over iterables into while-loops that call .pull-one 14:33
lizmat so, is there something I should / could do ?
timotimo i'd be happy for motivation and rubber ducking 14:34
lizmat it would be very cool if we had something like that :-)
timotimo cool
jnthn timotimo: Is this to the left of using CPU vector ops, or just making them into tight loops? 14:35
*the level of
timotimo only tight loops, but more importantly building just a single tight loop instead of one per operator 14:36
aka loop fusing
since i'm only handling rather simple cases, it'd not be a gigantic step to build vector ops from them 14:37
only got to figure out how to signal it through to the jit
[Coke] (refuse to go on zoom) Using it for $dayjob here for about 30% of my calls. 14:40
timotimo oh, the code i'm generating isn't actually anywhere near optimal 14:41
it does int→num, op, num→int over and over, and getlexes the target array once per element, too
14:44 lichtkind joined
lizmat timotimo: looking at the profile of your example, it already looks remarkably optimized already, with lots even OSR'd 14:46
timotimo how deep does inlining go? how much does it allocate? 14:47
[Coke] nqp: ok(1,"hi"); 14:48
camelia ok 1 - hi
[Coke] ^^ we don't have subtests or anything there, correct?
lizmat 4M Int and 4M IntPosRef
timotimo [Coke]:possibly not, no
lizmat: if you were to write some unit tests for hyper stuff that makes sure my implementation doesn't make silly mistakes that'd be fantabular 14:49
for example, wrong sizes of arrays being mixed isn't implemented yet
lizmat I seem to recall I did that when I created the Hyper class ?
maybe not
hmmm
timotimo: will do tonight 14:50
timotimo it's quite possible that my impl will find exciting new ways to be incorrect 14:51
lizmat :-) indeed... afk for a few hours& 14:55
15:02 Altai-man_ joined 15:05 sena_kun left 15:10 MasterDuke joined 15:26 Xliff left
timotimo jnthn: gist.github.com/timo/26153c88afbd7...7ffe03ac78 - check how tight this code is! but sadly the atpos instructions aren't being devirtualized. i wonder what's going wrong there 15:27
looks like the PHIs from the loops are making it unhappy 15:39
not sure what exactly frame handlers 0, 1, and 2 are all about 15:40
handlers for redo, next, and break? 15:41
ah, yes, i was looking for this, a "nohandler" argument for the "while" op 15:44
didn't do anything for the atpos_i instructions though 15:50
!! 15:55
it was the exprjit
it just doesn't implement devirt
but also: the type is unknown at that position
nine timotimo: but it seems like the type is only unknown because it doesn't make it through the PHI 15:59
timotimo yes
nine I wonder why there is a PHI there in the first place. r7 e.g. doesn't get written to in the loop 16:01
timotimo the issue is you have to figure out that the inside of the loop doesn't change anything about incoming facts
otherwise you're merging facts from before the loop with facts at the end of the loop where you know nothing
so you end up not knowing anything at the start of the loop and not finding anything out about the things during the loop 16:02
thus preventing yourself from knowing anything at the start of the loop
and yes, i'm not sure why the not-written-to things aren't phi-less 16:03
oh, i think it comes from the BB 0 that has 1, 2, and 3 as its successors 16:04
1 and 3 only, not 1, 2, 3
1, 2, 3 are the dominance children, but that doesn't mean terribly much? 16:05
AlexDaniel gah, github is down
timotimo and that's where the rₙ(0) come from in the middle of the loop 16:06
nine But, but, why is 0 a predecessor of 3? There's no way to get from there into the middle of the loop 16:07
timotimo wellllll~
there's a reason for us to attach things as successors to BB 0
i think it's for when control flow can be wacky, like with exceptions perhaps? 16:08
it's been a while
oh, could it be because we OSR it?
nine They're connected even in the Before 16:09
If it's the first block, it's a special case; successors are the real successor, all catch exception handlers, and all OSR points. 16:10
src/spesh/graph.c:548 16:11
jnthn Catch handlers get anchored to BB 0 also, iirc, which handles the fact that any op that throws could enter them.
(It's conservative to do this, of course.) 16:12
Control exceptions I believe are modeled much mre explicitly.
timotimo huh, but BB 3 doesn't have any FH any more
ah, yes, "and all osr points" 16:13
nine Yeah, commit 0fe5cd606c changed it from "all exception handlers" to "all catch exception handlers"
timotimo since we essentially jump from the BB 0 to the osrpoint when we actually do the OSR
nine At the osrpoint we switch from the Before to the After version of the code. Shouldn't the facts we have at that point still be valid and thus carry over from e.g. r7(3) to r7(0)? 16:17
timotimo you can try implementing that and seeing what breaks :) 16:18
MVM_SPESH_OSR_DISABLE=1 doesn't prevent the BB0→BB3 edge from existing
nine Nah, because that only disables the actual osr, not the insertion of osrpoints or anything 16:20
timotimo right. but it could :) 16:21
trying that now
where have all the PHI gone 16:23
only r1 has a PHI node at the start of BB2 left 16:24
and consequently it devirtualizes all the atpos_i ops
nine Well, the facts at the osrpoint are only valid when we actually do osr. They aren't when we enter the optimized function the normal way later on. But...that may not be a deal breaker, as it looks like we're not using the (0) versions of registers in non-osr cases anyway. We start out by nulling registers, thus moving directly to version (1) 16:33
timotimo that'd have to be even-more-specialer-cased 16:34
[Coke] is still surprised to find some ops map almost directly to a moar function, and others are 100 lines of nqp code. 16:35
nine Meh...we do use the (0) versions occasionally.
16:41 chansen_ joined 16:42 tbrowder joined 16:43 MasterDuke left 17:03 sena_kun joined 17:05 Altai-man_ left
timotimo i got the thing Even Faster™ 17:28
guifa2 timotimo++ 17:29
timotimo by making atpos_i and bindpos_i for 64bit integer VMArrays double-devirtualizable to a custom smaller version of the bind_pos and at_pos reprops for VMArray 17:32
0.85s with my double-devirts, 1.23s with no devirts at all (by turning exprjit back on) 17:35
guifa2 Is there an easy way to reinterpret a blob16 as a blob8 (e.g. double the length)? 17:48
timotimo nativecast can do it for CArray, with blob you can use .read-uint8 in a loop i suppose? though it could be that all the read and write buffer ops only work with 8bit integer VMArrays 17:52
18:16 pmurias joined
timotimo do we ever want to ban using negative indices in nqp::atpos and nqp::bindpos? 18:21
it's not great from a performance standpoint :) 18:25
18:33 pmurias left 19:02 Altai-man_ joined
lizmat timotimo: it would cause breakage in nqp and in grammars, and in some places in the core, afaik 19:05
timotimo dang
19:05 sena_kun left
lizmat but those could be dealt with, iteratively I guess 19:05
just make it reports stacktraces of where it happens, and we can adapt the code 19:06
timotimo we could turn atpos(_*) into a desugar that can take a named parameter that disables code-gen for a little piece of nqp code that does the calculation
lizmat I guess it's a matter of premature opts
timotimo or that would probably work too
true, if we're not able to prove value domains for variables and such, we won't be able to do much about that anyway 19:07
lizmat perhaps an nqp::atpos version that would work from the end ?
that would also make it clearer in the code 19:08
nqp::atposend_i
otherwise we would need to get nqp::elems everywhere all of the time
timotimo aye
19:11 guifa2 joined
timotimo Use of uninitialized value $str in substitution (s///) at /home/timo/perl6/rakudo/3rdparty/nqp-configure/lib/NQP/Config.pm line 1420. 19:14
^- did i do something wrong?
lizmat is not seeing any code ? 19:16
m: s///
camelia 5===SORRY!5=== Error while compiling <tmp>
Null regex not allowed
at <tmp>:1
------> 3s/7⏏5//
timotimo $str =~ s{\\}{\\\\}sg; 19:17
it's in the function c_escape_string 19:18
lizmat ah, P5 ? 19:23
timotimo yeah, it's part of nqp-configure 19:24
can i get a stack trace from a warning in there somehow?
anyway, i'm now running a stresstest with the "make int64 array atpos/bindpos faster when jitted" patch 19:25
19:28 MasterDuke joined
nine I wonder how often we actually index an array from the end in nqp 19:29
MasterDuke i didn't even know it was possible
lizmat yeah, one of the little dirty tricks one can play 19:31
a leftover from Perl 19:32
Geth rakudo: 730c5a16d2 | (Elizabeth Mattijsen)++ | src/core.c/Hyper.pm6
Remove to unnecessary return statements

We're still ever so slightly faster if we don't need to throw a control exception to return.
19:50
roast: 0a56b31fd4 | (Elizabeth Mattijsen)++ | S32-temporal/Date.t
Add tests for Date.first/last-date-in-month
19:58
rakudo: ef7dd189ab | (Elizabeth Mattijsen)++ | src/core.c/Hyper.pm6
Revert "Remove to unnecessary return statements"

This reverts commit 730c5a16d256f894e09432c26b5f2efe4408358b.
20:30
lizmat by popular demand 20:31
nine It's a grand total of 2 places that use negative indexes with atpos in NQP. Plus one that was really hard to find, because it's generated by QASTRegexCompilerMAST 20:33
lizmat the core settings uses it in a few places 20:35
Geth nqp/no_more_negative_array_indexing: d7c597f2aa | (Stefan Seifert)++ | 14 files
No longer use negative indexes for nqp::atpos on arrays.

This could simplify things for the VM and help speed things up
20:41
lizmat nine++ 20:43
but I'd really like to see an nqp:: op for indexing from end 20:44
*also
or should we make that a Raku nqp op ?
20:46 MasterDuke left 21:03 sena_kun joined 21:05 Altai-man_ left
lizmat github.com/rakudo/rakudo/issues/2484 # me wonders if jnthn has any ideas about that oe 21:08
*one
21:15 MasterDuke joined 21:17 cognominal joined
jnthn lizmat: Would need to see the DAG it's building, I think 22:04
lizmat how can I do that? 22:05
jnthn If you poke inside of Routine there's some data structure there that has the search groups
I forget the details...it's been a while 22:06
Also, gotta be afk for a bit now
[Coke] we should not make any more Raku nqp ops, IIRC. 22:11
I thought we were trying to get rid of that and push it all down into core nqp.
Geth rakudo: 48688df2ab | (Elizabeth Mattijsen)++ | src/core.c/Cool.pm6
Simplify iterator of Cool values

Use the R:I.OneValue iterator. This does not affect Map and List as these have their own iterator.
22:12
rakudo: ec50b9618e | (Elizabeth Mattijsen)++ | src/core.c/Rakudo/Iterator.pm6
Make R:I.OneValue a PredictiveIterator

As we always know how many values it will produce :-)
lizmat [Coke]: a core op would do for me :-)
timotimo my keyboard died but i've got a replacement 22:27
it's not as comfortable, but better than nothing 22:28
Geth nqp: ad8e170c6e | Coke++ | docs/ops.markdown
Document hllbool
22:30
nqp: c12e67e1c9 | Coke++ | docs/ops.markdown
fix heading link
22:32
nqp: 3e461378c5 | Coke++ | docs/ops.markdown
oops, fix sense of boolean
22:34
[Coke] timotimo: do you need a special KB still?
(I may be misremembering)
timotimo i was using an ergonomic one 22:35
it wasn't the best
just a microsoft ergonomic 4000 or something like that 22:37
not an ergodox or anything else fancy
though i'm kind of eye-ing azeron.eu, but they don't yet have something to make it afull keyboard via chording, and no port of qmk has been finished for it yet 22:38
they had refurbished units for cheaper recently, but it looks like they're all gone already
and those units take at least a month to arrive anyway 22:40
if someone wants to make me a gift :) :) 22:43
22:56 lichtkind left
jnthn [Coke]: Adding more Raku ops written in C is certainly not what we want, but further desugars and the like (which are just an abstraction over existing ops) is alright 23:01
23:02 Altai-man_ joined 23:05 sena_kun left
timotimo lizmat: how would you feel about nqp::atpos($index, :fromend)? 23:12
[Coke] jnthn: makes sense 23:14
timotimo i rebased my local branch on latest raku master and the s/// error went away 23:22
ooh i love the new qast dump thing 23:25
t/spec/S17-procasync/kill.t is unhappy on my end? first it said i planned 7 but ran 8 tests, now it's failing one sometimes 23:34
guifa2 The regex backmod token is / ':'? ['!' | '?' | <!before ':'>/ but I can't seem to figure out the purpose of the <!before ':'> part. The only way to reach that part is if there is no backmod at all, in which case wouldn't it be simplier to write /':'? <[!?]>?/ ? 23:57