Zoffix Looking at QAST for &META_ASSIGN optimization, looks like `$a op= $b` becomes `$a = op(op(), $b)` when $a is a :U. I assume that's a mistake and gonna change it to just `$a = $b` 01:07
TimToady m: my $a; $a -= 2; say $a 01:09
camelia -2
Zoffix Ah
Right. 01:10
(my brain)++ # for mentioning this first so I could find the flaw with the plan without writing any code :)
TimToady :D
Zoffix But... how about `$a = op($b)` 01:13
m: dd infix:<->(2)
camelia -2
Zoffix Saves a call 01:14
Zoffix tries
And - QAST::Op(callstatic &infix:<+>) without any kids can prolly be constant folded too 01:16
m: say &infix:<+>.cando(\()).head.is-pure
camelia No such method 'is-pure' for invocant of type 'Sub'
in block <unit> at <tmp> line 1
Zoffix m: say &infix:<+>.is-pure
camelia True
Zoffix well, it is already, in other contexts 01:18
TimToady m: say infix:<%>(1) 01:19
camelia 1
TimToady m: say infix:<%>()
camelia No zero-arg meaning for infix:<%>
in block <unit> at <tmp> line 1
Zoffix m: my $a; $a %= 42
camelia No zero-arg meaning for infix:<%>
in block <unit> at <tmp> line 1
Zoffix OK. Thanks :) 01:20
TimToady we really want to restrict it to an identity element, and reject it if there isn't one
Zoffix Got it.
Geth roast: c42d861a4b | (Zoffix Znet)++ | S03-operators/assign.t
Remove trailing whitespace
01:26
roast: a497e9151a | (Zoffix Znet)++ | S03-operators/assign.t
Cover potential bugs with META_ASSIGN opts

Covers discussed buggy proposals with :U opts:
  irclog.perlgeek.de/perl6-dev/2018-...i_15681388
01:27
rakudo: f41d5e870e | (Zoffix Znet)++ | src/Perl6/Optimizer.nqp
Comment that META_ASSIGN op-doubling on :U's is by design
01:28
rakudo: cad66b72d5 | (Zoffix Znet)++ | 2 files
Fix spurious useless-use warnings in metaop+metaassign op

Fixes RT#131251: rt.perl.org/Ticket/Display.html?id=131251
We check if the meta's op has is_pure annotation and cry if it does, but the use isn't useless if our meta is a metassign.
N.B.: the check for metaassign can probably be moved up to the outer conditional, but IIUC it'd make it too wide without is-from-core check.
03:16
synopsebot RT#131251 [open]: rt.perl.org/Ticket/Display.html?id=131251 Useless use warning triggered on assignment forms of reverse metaops
rakudo: 992b805576 | (Zoffix Znet)++ | src/Perl6/Optimizer.nqp
Fix typo in comment
03:42
roast: 01ce74034b | usev6++ | 2 files
[jvm] Skip newly failing tests
06:37
travis-ci Rakudo build passed. Zoffix Znet 'NO MONKEY BUSINESS!! 🙈🙉🙊 07:55
travis-ci.org/rakudo/rakudo/builds/327876433 github.com/rakudo/rakudo/compare/7...2e50c855ea
[Tux] Rakudo version 2017.12-176-g992b80557 - MoarVM version 2017.12.1-32-g56c03d99c
csv-ip5xs1.144 - 1.144
csv-ip5xs-2013.602 - 13.689
csv-parser12.681 - 12.775
csv-test-xs-200.443 - 0.445
test11.241 - 11.542
test-t2.860 - 2.978
test-t --race1.146 - 1.165
test-t-2052.078 - 53.192
test-t-20 --race17.696 - 17.906
08:49
gfldex i wonder if we should sue intel for messing with our benchmarks :-> 09:56
DrForr Shoot the messenger, it always works for companies :/ 10:04
moritz sue google for discovering spectre and meltdown? that's the more typical corporate strategy :/ 10:05
lizmat Files=1231, Tests=75890, 327 wallclock secs (14.84 usr 5.32 sys + 2260.87 cusr 224.71 csys = 2505.74 CPU) 10:30
jnthn morning o/ 10:35
Geth rakudo/supply-syntax-opts: 38e9eacabd | (Jonathan Worthington)++ | src/core/Supply.pm
More binding, not assignment, in Supply internals

This saves 4 Scalar allocations per iteration of `my $s = supply emit 42; for ^10_000 { react whenever $s { } }`, which saves a GC run.
11:07
rakudo/supply-syntax-opts: 27326e3fb2 | (Jonathan Worthington)++ | src/core/Supply.pm
One more Scalar elimination in Supply guts
11:49
lizmat jnthn: is there any reason not to put that bind inside, like add-actiive-tap($tap := $_) ? 11:50
jnthn Keeping the code simple. Also that shouldn't matter much :) 11:51
YOu'll like the next one 11:54
Geth rakudo/supply-syntax-opts: 3d3a99efbe | (Jonathan Worthington)++ | src/Perl6/World.nqp
Improve first touch of Array/Hash variables

The $!reified and $!todo of List and the $!storage of Map are lazily allocated for variable declarations like `my @a`, `has %!h` and so forth. However, the check to see if these fields were initialized would allocate a Scalar due to the default auto-viv behavior of attributes. By binding a Mu there in the prototype container that is ... (7 more lines)
jnthn That makes every single array and hash variable a little cheaper :) 11:55
lizmat Cool! 11:56
lizmat tests
is there a reason you're doing this in a branch ?
jnthn Makes it slightly easier to do comparison of the set of changes before/after with something more real-world :) 12:00
Plus a bit of isolation
I already nearly put in a commit that would have been a nasty regression; only one spectest caught it
Oh, also one commit in the branch has potential for fallout, though I doubt there will be any 12:01
lizmat grr... I need a link to a Perl 5 / Perl 6 benchmark in which Perl 6 is faster :-) 12:17
jnthn needs lunch :) 12:19
The utf-8 million lines one on my blog is faster nowadays 12:20
tbrowder .tell AlexDaniel rakudo PR #1339 is finally ready for another review. 12:46
yoleaux tbrowder: I'll pass your message to AlexDaniel.
tbrowder jnthn: any more thoughts on speeding up ASCII handling? 12:52
jnthn tbrowder: Not beyond the mail I sent you some days back about it 13:20
(In that, sure, we can speed up the ASCII decoder itself a bit, but the costs are elsewhere) 13:21
Geth rakudo/supply-syntax-opts: d0b2cc10ac | (Jonathan Worthington)++ | src/core/Lock/Async.pm
Use a little more binding in Lock::Async
13:22
rakudo/supply-syntax-opts: f04b1d7bf3 | (Jonathan Worthington)++ | src/core/Supply.pm
Avoid a closure per call to !run-supply-code

Which saves 20,000 of them plus a GC run in `my $s = supply emit 42; for
  ^10_000 { react whenever $s { } }`.
13:25
lizmat jnthn: the one blog post I could find about that, states that Perl 5 is still faster :-( 13:35
Geth rakudo: d7b160c728 | (Zoffix Znet)++ | .gitignore
Use simpler ignore rule for .precomp

The ** thing doesn't seem to work on my current system and just `.precomp` is sufficient to ignore `.precomp` in all the dirs.
13:37
jnthn lizmat: It was at the time the post was written 13:38
Then I did the summer spesh work
lizmat hmmm.. a very hidden mention in news.perlfoundation.org/2017/11/per...abi-4.html 13:40
I'll use that
Geth rakudo/supply-syntax-opts: 7cf3f0b354 | (Jonathan Worthington)++ | src/core/Promise.pm
Use an nqp::list for then-list in Promise

Since every Promise will have one of these, it's a hot path, and it has little impact on readability to use an nqp::list here instead.
14:04
roast: d93d062ef5 | (Zoffix Znet)++ | S06-operator-overloading/prefix.t
Skip-fudge bogus(?) tests

The tests were added[^1] in Dec 2017 and aren't part of 6.c language. These currently exercise RT#132711 / RT#131099 when RT#132713 is fixed and based on comments on RT#131099 these should likely complain about meaningless associativity rather than work.
P.S.: fudger refused to fudge these right, so I fudged manually
  [1] github.com/perl6/roast/commit/8cbb...15f0f05bf6
14:13
synopsebot RT#132711 [open]: rt.perl.org/Ticket/Display.html?id=132711 [LTA] Stupidly using `is assoc` with unary prefix operator has an error message from the deep
synopsebot RT#131099 [new]: rt.perl.org/Ticket/Display.html?id=131099 [LTA] is assoc('list') gives "MVMArray: Can't pop from an empty array"
synopsebot RT#132713 [new]: rt.perl.org/Ticket/Display.html?id=132713 Order of `is assoc` and precedence traits matter, but should it?
masak re rt.perl.org/Public/Bug/Display.html?id=132711 -- associativity *does* make sense for prefix ops. see S03 for the whole scoop 14:16
...but basically, if you have `!$a!`, where prefix:<!> and postfix:<!> have the same precedence, then those two ops *associate* in the sense of having a left or right associativity 14:17
(I happen to know this because 007 has this behavior, which was copied directly from Perl 6)
we basically never run into this, because people generally don't tend to make postfixes bind as tightly as prefixes. (they're usually tighter, modulo the fact that Perl 6 has one termish set of precedences and one list-oppy set.) 14:19
but if you ever made a precedence level with both prefixes and postfixes in it, then associativity would totally make sense in the above way. 14:20
lizmat .ask Zoffix on modules.perl6.org/search/?q=List%3A%3AUtil the Travis icon has a ? , but on modules.perl6.org/dist/List::Util:cpan:ELIZABETH it shows BUILD passing. Is there some magic I need to perform to have the ? disappear
yoleaux lizmat: I'll pass your message to Zoffix.
masak for all intents and purposes, associativity is something that you set on a whole precedence level, not on individual operators. but since precedence levels are not first-class in Perl 6, we set them on ops. having two ops on the same level differ in associativity is pretty nonsensical, though. 14:22
masak pastes this into the ticket 14:23
bleh, I get an empty page when I hit "Reply" or "Comment" in RT 14:24
anyone seen that before?
lizmat has started a github.com/lizmat/P5-modules-to-P6...ting-guide 14:25
comments / PR's welcome
Zoffix Is &sub.prec<assoc>:delete the same as setting it to left-associate? 14:33
yoleaux 14:20Z <lizmat> Zoffix: on modules.perl6.org/search/?q=List%3A%3AUtil the Travis icon has a ? , but on modules.perl6.org/dist/List::Util:cpan:ELIZABETH it shows BUILD passing. Is there some magic I need to perform to have the ? disappear
Zoffix m: sub infix:<z> is equiv(&[**]) { $^a ** $^b }; say 2 z 4 14:35
camelia 16
Zoffix m: sub infix:<z> is equiv(&[**]) { $^a ** $^b }; say 2 z 4 z 5
camelia 1048576
Zoffix m: sub infix:<z> is equiv(&[**]) is assoc<right> { $^a ** $^b }; say 2 z 4 z 5 14:36
camelia 17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987139335765878976881441662249284743063947412437776789342486548527630221960124609411945308295208500576883815068234246288147391311054082723716…
Zoffix m: sub infix:<z> is equiv(&[**]) is assoc<right> { $^a ** $^b }; say 2 ** 4 ** 5
camelia 17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987139335765878976881441662249284743063947412437776789342486548527630221960124609411945308295208500576883815068234246288147391311054082723716…
Zoffix k, then "yes"
Zoffix-- # breaking `is equiv`
Geth rakudo/fix-equiv: 6f5b27ce63 | (Zoffix Znet)++ | src/core/traits.pm
Revert "Delete .prec<assoc> in is equiv() trait"

This reverts commit f9f0883c6cef3695c5150d336f5e6552e1be4a4c.
Per S06 speculations, `is equiv` is supposed to copy assoc.
  [1] design.perl6.org/S06.html
14:42
Zoffix In a branch 'cause some spectests explode due to RT#131099 apparently 14:44
lizmat .tell stmuk is the "iniside" in the "title "Perl 6 Iniside Out" of the syndication of Shitov's blog post intentional or a typo ?
yoleaux lizmat: I'll pass your message to stmuk.
Zoffix (gonna try to fix on weekend)
synopsebot RT#131099 [new]: rt.perl.org/Ticket/Display.html?id=131099 [LTA] is assoc('list') gives "MVMArray: Can't pop from an empty array"
lizmat . 14:59
afk&
Zoffix masak: FWIW, it would be helpful for those comments to be *on the corresponding tickets* 15:02
I noticed them in the log completely by accident when I went to get a URL I needed
masak: added them to rt.perl.org/Ticket/Display.html?id...xn-1523563 the empty page... Hmm. Are you sure you're logged in? 15:06
masak Zoffix: I'm logged in. likely my account is misconfigured in some way. or maybe I'm viewing the page wrong. 15:15
I recognize this failure mode, but I don't remember how to fix it.
Zoffix: thank you for adding the comments.
Geth rakudo/supply-syntax-opts: 40108e1551 | (Jonathan Worthington)++ | 2 files
Optimize more cases of private method calls

This resolves some more private methods at compile time, meaning that they do not need to be looked up and go through dispatch:<!> at run time.
15:26
jnthn Hm, that probably makes $c.Foo::bar() faster as well, fwiw 15:27
By doing a compile-time resolution of Foo
Geth rakudo: 5dd9ed100e | (Zoffix Znet)++ | src/Perl6/Optimizer.nqp
Second-pass optimize &META_ASSIGN opt

Makes `for ^1000_000 {my $a; $a ~= "b"}` 70% faster. In most cases, perf applies only if $a is a :U.
After we code-gen replacement for the op, we end up with `op(nqp::p6definite($foo) ?? op() !! $foo, $bar)`. ... (13 more lines)
15:43
rakudo/supply-syntax-opts: 4b51a426e3 | (Jonathan Worthington)++ | src/core/Lock/Async.pm
Tune Lock::Async code stucture

Smaller private methods allow common-case paths to be inlined. This code structure also needs less closure clones, by moving the dynamic var declarations into the signature of a private. As a further bonus, factoring out a little repetition makes the code slightly shorter. Shaves 4 GC runs off `my $s = supply emit 42; for ^10_000 { react whenever $s { } }` due to the reduced allocations, and gives a speedup.
15:58
rakudo/supply-syntax-opts: a9f6d69592 | (Jonathan Worthington)++ | src/core/Lock/Async.pm
Factor out a LEAVE block in Lock::Async

This is not only less and simpler code, but it also means a few less closure clones too.
16:20
|Tux| Rakudo version 2017.12-178-g5dd9ed100 - MoarVM version 2017.12.1-32-g56c03d99c
csv-ip5xs1.080 - 1.083
csv-ip5xs-2012.534 - 12.839
csv-parser12.078 - 12.178
csv-test-xs-200.450 - 0.460
test11.246 - 11.381
test-t2.758 - 2.782
test-t --race1.131 - 1.231
test-t-2050.440 - 51.065
test-t-20 --race16.725 - 17.173
16:32
jnthn Goodness, LEAVE is a pig 17:28
(Performance wise) 17:29
Geth rakudo/supply-syntax-opts: 27d5a2cb34 | (Jonathan Worthington)++ | src/core/Supply.pm
Refactor supply/react code running

Rather than blocks that poke into the SupplyState object, just put the logic inside of methods inside of SupplyState. This saves making 3 closures for every single message a Supply processes. Further, a bunch of accessor calls give way to attribute accesses, and further improvements are possible as a result of the code being in a righter place.
rakudo/supply-syntax-opts: db3953a24a | (Jonathan Worthington)++ | src/core/Promise.pm
Save a couple of Scalar allocations per Promise
jnthn Well, next week 17:31
TimToady wonders if the hot path could be inlined at the end of a routine, with a helper invokable that can goto it 17:32
jnthn At the moment it loops through the phasers, checking if there are any on the undo or leave queue, then looping over the post queue and so on 17:33
Probably there's something along those lines that we can do 17:34
Certainly, at the closing } of the routine we should know all of the LEAVE phasers and their friends 17:35
TimToady might be worth a code duplication even
jnthn Yeah 17:36
Thing is, LEAVE is the only way to get some things correct.
(Because of resumable exceptions)
timotimo indeed
jnthn So it's used heavily in concurrency guts for unlocking 17:37
TimToady well, invariants are important to enforce 17:38
jnthn Anyway, it's certainly a juicy optimization target :) 17:39
timotimo we need a --fast flag for rakudo that just throws out all checks for invariants :P 17:50
TimToady then we'll make that the default, and make people use a --slow flag when the security flaws emerge :P 17:57
jnthn Worked for speculative execution :P
TimToady indeed
TimToady still worries about dos attacks on nfg... 17:58
but yeah, we need to get things into widespread use before we slow them down again :) 17:59
jnthn :)
ooh, it's about an hour after when I was going to go home... 18:00
TimToady is already home...
jnthn -Ofun I guess :)
jnthn bbl
TimToady hopes you're not in trouble domestically
jnthn No, it's not *that* late :) 18:01
&
Geth rakudo/faster-literal-postconstraint: fefb86ba70 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Preliminary faster literal postconstraint codegen

Makes `sub foo(42) {}; for ^5000_000 {foo 42}` 8.8x faster, but currently blows up with subsets.
Stash the work for a later time.
18:14
AlexDaniel releasable6: next 18:41
yoleaux 12:46Z <tbrowder> AlexDaniel: rakudo PR #1339 is finally ready for another review.
releasable6 AlexDaniel, Next release in 8 days and ≈0 hours. No blockers. Unknown changelog format
tbrowder i just changed Pod.nqp after a good build and apparently got a malformed utf8 char during finger fumble leaving vi. the build msgs are in gist gist.github.com/tbrowder/fcfbe37f7...d295c3e397 19:26
i have tried various *nix toolos to find the bad char (os, strings, diffuse) but nothing so far. the output from "od -c" was then run through "strings" and i inserted that output it as a comment in the last good Pod.nqp file which compiled successfully! unless i get some good ideas, i will painfully had enter my changes and keep my fingers crossed. note this has happened before and the recovery technique was 19:32
somewhat the same. i have searched for a good solution for the general problem but have found nothing definitive. maybe Zoffix can build a good utf8 scrubber tool!
corrections: *nix tools (od, strings, diffuse)... 19:33
Geth rakudo: 65d4876d88 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Make constraint checks Num/Int/Str literals 1.1x-10x faster

Str is 1.1x / Int is 7.7x / Num is 10x
When code-genning ParamTypeCheck for Num/Int/Str literals in sigs (e.g. `-> 42 {}`), don't go through .ACCEPTS call and instead gen pure-nqp-op concreteness and equality check
  (nqp::iseq_I needs an explicit decont too; tho others don't)
20:00
Zoffix ZOFFLOP: hung stresstest (looks like hung on t/spec/S17-promise/nonblocking-await.t) 20:01
timotimo i like that commit, Zoffix :) 20:07
Zoffix yeah... -> $ where 42 {} can likely be made the same 20:11
Zoffix &
Geth rakudo: 90495b1d9c | (Elizabeth Mattijsen)++ | src/Perl6/Actions.nqp
Not sure why CREATE was used, shortcut to nqp::create
20:30
rakudo: 79600d6978 | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Warn on xor with sunk args due to bad precedence

Phixes github.com/rakudo/rakudo/issues/1389
20:38
roast: dd59c28457 | (Zoffix Znet)++ | S03-operators/short-circuit.t
Test xor with sunk args due to bad precedence warns

Closes github.com/rakudo/rakudo/issues/1389
20:39
rakudo: 0415bb5f74 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/BOOTSTRAP.nqp
Micro-opt exit_handler

Since many things can go wrong very quickly here, we tread with baby steps.
21:24
rakudo: b5b6e23b02 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/BOOTSTRAP.nqp
Micro-optimize exit_handler, part #2

  - don't get the KEEPs and UNDOs unless we need them
  - use nqp::eqaddr instead of =:=
21:35
rakudo: 421504bd47 | (Elizabeth Mattijsen)++ | src/Perl6/Metamodel/BOOTSTRAP.nqp
Micro-optimize exit_handler, part #3

  - don't store code object, we only need it once
  - create a fast path for a single LEAVE block
22:04
lizmat hopes that's what jnthn had in mind ^^^
benchmarks shows this only gains about 1% on blocks with a single LEAVE phaser 22:35
:-(
gfldex every % counts 22:36
lizmat jnthn: is exit_handler called on all exit of scopes? or is it only called if there are phasers ? 22:55
jnthn In NQP, =:= compiles directly into nqp::eqaddr, iirc :) 22:58
lizmat: It's only called on blcks with leave phasers (or their friends)
lizmat ah, ok, will revert that then for readability 22:59
jnthn I think we need to do something a bit more drastic than micro-opt that code, alas
lizmat jnthn: ok, that implies that *if* we get there, we don't need to check for existence of the %phasers, right ?
jnthn Hm, good point :)
Yeah, that we should be able to assume
lizmat running spectest now that should give us 7% improvement on the single LEAVE case 23:00
jnthn Cool
I did have a patch that got quite a nice improvement, but it broke spectest
I didn't have time to find out why before heading home
lizmat well, I'm focusing on getting to the single LEAVE case asap 23:01
jnthn Should help 23:02
Next week I'll probably first work on getting the supply whenever { } case (when there is precisely one whenever block) compiled differently
Well, precisely one and it's the final statement 23:03
In that case, we can make some assumptions
summerofcode.withgoogle.com/ # time to think about this 23:08
lizmat jnthn: Lexical with name '$fh' does not exist in this frame <--- does that ring a bell ? 23:31
jnthn Yes, I got that very error today when trying to optimize exit handlers! :) 23:32
lizmat guess I'm tickling it now as well :-( 23:33
jnthn Yeah, I didn't have any good guesses what was up 23:35
lizmat only seems to appear in conjunction with "will leave" 23:36
jnthn Oh....
lizmat it loses the variable on which the "will leave" is based
jnthn Take a look inside of the impl of the will trait
I think it has a nqp::ctxcaller chain
And maybe we need a level less now 23:37
lizmat checks
jnthn (Yes, it's fragile AF)
lizmat aha!
yup 23:38
hmmm... guess I need to make an extra scope, because the number of scopes is now different for the single LEAVE and LEAVE + others 23:39
jnthn I've worse news for you 23:40
lizmat noooo :-)
jnthn NQP flattens scopes quite aggressively
So you can't just count them in the source
:)
lizmat just adding a scope won't work either, right? because it'll get optimized away, jnthn? 23:43
jnthn Pretty much 23:51
timotimo at least the number of layers isn't susceptible to spesh being on or off 23:53
jnthn True :) 23:54
lizmat work so far: gist.github.com/lizmat/ce7b04adff5...4051a3045b 23:56
calling it a day now :-) 23:57
fwiw, I used this as benchmark: for ^100000 { LEAVE Nil } 23:58
jnthn lizmat++
tbrowder jnthn: i tracked down the problem and it wasn’t a malformed utf-8, the culprit was use of an undeclared variable—should that be an LTA msg for nqp? 23:59
timotimo this is the 7% improvement you saw?
lizmat well, the odd thing is that this last version loses all performance benefits :-(
timotimo tbrowder: that sounds bizzarre, can you stash the code before and after the undeclared variable problem for us to see?