Geth rakudo/nom: d69f3751d5 | (Elizabeth Mattijsen)++ | src/core/Any-iterable-methods.pm
Streamline Any::IterateOneWithoutPhasers.sink-all

  - put return value in signature
  - remove unnecessary $running flag
  - simplify next handling
  - indicate extra scope is for optimization only
Makes for @a { ... } about 1% faster. Normally I wouldn't take this but this is for a *very* common idiom, so feels like somethingw we want anyway.
00:23
lizmat which depleted my tuits for today 00:24
good night, #perl6-dev!
brokenchicken night
Geth nqp: f21c8f1668 | TimToady++ | 2 files
get rid of $*ACTIONS

The current actions class is now passed via the cursor.
07:06
rakudo/nom: 9493ffb90c | TimToady++ | 2 files
get rid of $*ACTIONS

The current actions class is now passed via the cursor.
rakudo/nom: version bump brought these changes: github.com/perl6/nqp/compare/2017....-gf21c8f1
951a441d10 | TimToady++ | tools/build/NQP_REVISION
¦ rakudo/nom: version bump brought these changes: github.com/perl6/nqp/compare/2017....-gf21c8f1 07:07
[Tux] This is Rakudo version 2017.01-131-g951a441d1 built on MoarVM version 2017.01-25-g70d4bd53 07:45
csv-ip5xs 2.748
test 12.182
test-t 4.834
csv-parser 13.224
second run 4.880
TimToady parsing seems a percent or so faster now, I think 08:37
though we mostly got rid of $*ACTIONS because it was the right thing to do 08:38
masak I love it when performance and the right thing to do come together 08:39
Geth roast: ac12ffeb5f | usev6++ | S17-promise/nonblocking-await.t
Fudge some newly added tests for JVM
10:03
samcv how do i stop this error payload: don't change grammar in the setting, please! 10:36
if trying to add an op
lizmat well, that seems to be 6.d then ? 10:37
*6.d material
jnthn: is the "Introducing spesh" part in 6guts.wordpress.com/2014/04/12/opt...-and-moar/ still correct ? 10:38
samcv: what are you trying to do ? 10:39
having been in that situation in the past :-)
samcv gist.github.com/samcv/d633ebd66fb5...2492d7217b to Str.pm
lizmat ok 10:41
you need to add it to the Grammar.nqp
although this *could* be 6.d material: adding methods to classes ok, adding ops wasn't if I recall correctly 10:42
samcv lizmat, which one? 10:43
lizmat src/Perl6/Grammar.nqp
jnthn lizmat: Yes, if incomplete
lizmat: It's out of date in that we now *can* also product machine code at the end
*produce 10:44
lizmat ok :-)
jnthn lizmat: And since then, importantly, it supports inlining and OSR
samcv lizmat, thanks :)
<sym> >> <O(|%structural)> # not sure what this means but just gonna steal the one for cmp and leg 10:45
jnthn lizmat: Can also resolving multi-dispatches at spesh time too
*resolve
Guess you can just put "And many other little opts" :)
lizmat jnthn 10:46
samcv: that's a start
you would also need to add it to src/core/precedence.pm I think
samcv well good sign, it compiled
jnthn <sym> means "match whatever is in :sym<here>", >> means word boundary, <O(...)> specifies precedence, associativity, etc. 10:47
lizmat jnthn: are you ok with adding this to 6.c instead of 6.d.PREVIEW ? 10:48
jnthn Well, according to the doc I did, it'd go in 6.d 10:50
How strictly we want to follow that at the moment is another matter.
`await` clearly needed to be because it's a notable behavior changes 10:51
samcv what are you guys discussing?
there's so many changes, hard to keep up :P 10:52
lizmat jnthn: I'm having trouble finding the doc you did about this 10:54
jnthn samcv: Whether or not unicmp belongs in 6.d.PREVIEW or not :)
samcv ah ok
jnthn lizmat: It got put into the Rakudo repo so we wouldn't have that problem, I tought? :P 10:55
samcv i'm not even sure what the final name for it is gonna be tho
jnthn *thought
samcv: That'd be even more reason to put it behing 6.d.PREVIEW :)
*behind
But for now, I guess, make it work at all :)
samcv though i mean a new op won't be noticed by anybody so idk if we need to hide it 10:59
since it's not gonna be in the docs just yet
samcv wonders if we could hide sorting strings with cmp to use unicmp_s in the preview 11:00
jnthn Yeah, I was wondering about that
I think it might be doable
Or if not, we can fix it to be doable :)
samcv heh 11:01
Geth rakudo: samcv++ created pull request #1009:
Add unicmp op which uses unicmp_s nqp op to do string compare
11:07
samcv jnthn, lizmat thoughts on this pr 11:09
lizmat samcv: what does the 7,0,0 signify ? 11:10
samcv 7 means do primary secondary and tertiary collation
lizmat I wonder whether that should maybe be settable with a dynamic var? 11:11
samcv lizmat, full info here github.com/MoarVM/MoarVM/commit/875867d1
samcv actually might change that 7, but atm the 7 doesn't actually change anything about what MVM does 11:12
lizmat something like $*TOLERANCE 11:13
samcv but i may change it to be 15, meaning primary, secondary tertiary, and 4th level is breaking ties by cp
lizmat perhaps $*COLLATION ?
samcv well
read the whole thing, there's also countrys and languages
let me know when you've read that mvm commit
lizmat read it :-) 11:16
samcv kk
so yeah maybe $*COLLATION 11:17
but yeah about 95% sure that 7 is gonna be changed to a 15. because i think it might be useful to be able to call cmp and get "same" if the collation values was equal 11:18
lizmat could be a Collation object, with settings for primary/ secondary / ternary
and that would then map to 15,0,0 or so for now
samcv yeah
that sounds fine
lizmat jnthn: is that an idea? so we can encapsulate that functionality in a simple unicmp operator, yet are able to change its meaning dynamically ? 11:19
samcv and if we have cmp do unicmp_s i think it should do language inspecific
though there is something to say for always getting the same sorting order even if unicode changes things, though we have synthetics 11:20
jnthn Not sure about dynamically
samcv and those can be sorted differently based on what synthetic codepoint they are assigned to
jnthn Could certainly do adverbs, and a pragma
lizmat jnthn: I was thinking one liners and env variables :-)
jnthn Please not env vars. :P 11:21
And one-liners could easily do it with the adverbs
lizmat ok
clearly I've not gotten rid of the cold yet :-)
samcv haha. 11:22
not good when the same program runs differently on different computers
lizmat goes to clock another few hours in bed
samcv o/
jnthn lizmat: Feel better! o/
samcv wow suprised it made it 3x faster 11:41
i already optimzed a ton of this part of the script but
gist.github.com/3bf513759424aae24a...a616c278ff top took 1.5s, bottom took .5s 11:42
which was already at least 3x faster than doing @dec.».parse-base(16), by using the nqp ops
i have the sub that processes UnicodeData.txt now 2x faster than it was yesterday :) 11:46
brokenchicken \o/
samcv it still takes hours? idk some really long amount of time to do all cp
i have not waited for it to finish
well it's still going on the bisectable server, been at least a couple hours 11:47
brokenchicken The <sym> >> <O(|%structural)> stuff: <sym> is the same string as the :sym<....> on that particular proto regex. The `>>` is the right word boundary, and <O...> stuff is the precedence thingie being set up these settings github.com/rakudo/rakudo/blob/nom/....nqp#L3828 this stuff is briefly mentioned in Day 1 of Rakudo Internals course 11:51
samcv ah ok i will look at that more then, thanks :) 11:52
is there a nqp noop? 12:04
arnsholt Why do you need a noop? 12:06
If you're building a QAST tree, a Stmts with no children is fine 12:07
samcv just to put in placeholders things that want something there. 12:08
m: use nqp; nqp::if(iseq_i(0,0), )
camelia rakudo-moar 951a44: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ iseq_i used at line 1␤␤»
samcv anyway not super important but was curious if we had a noop 12:09
arnsholt Doesn't look like it
There's a debugnoop listed in the docs, but looks like it's only on JVM
But what kind of thing do you have that requires an op? 12:10
samcv it's not really important, i just wondered it, while i was trying to benchmark if statements compared to code without if statements
and wanted to just put noop in there so it would compile
string ne ''; is basically equivalent to nqp::isne_i( nqp::chars($stc), 0); ? at least that's what i'm doing to try and optimize this code 12:11
unless there's a better way to do it
arnsholt Oh, something to pass nqp::if? Did you try just passing in an empty block? 12:13
samcv yea
arnsholt Then I'm all out of ideas. But if it's any consolation, nqp::if(..., nqp::noop()) wouldn't work either =) 12:15
But from --target=ast it looks like if $cond { $consequent } compiles more or less directly to nqp::if anyways 12:16
samcv kk 12:17
yeah i haven't gotten much speedup changing to nqp::if unless all the surrounding code is already nqp 12:18
then i get a speedup
jnthn --target=ast doesn't show that the optimizer (output of --target=optimize to see) often optimizes away QAST::Block too 12:39
samcv i wish i could have macros that would go to nqp ops that wouldn't slow anything down 12:46
macros seem slower than subs i guess. hmm. maybe i'll just make subs 12:47
it seems making this thing i'm doing a sub is about the same speed 12:48
timotimo make: *** [gen/moar/stage1/nqpmo.moarvm] Illegal instruction (core dumped) 12:58
that's fun!
samcv jnthn, is there a way to make for sure something gets inlined? 13:03
is raw and is pure, what effect do those have on that?
timotimo is raw is for what happens to the return value, is pure is for whether it'll be considered for compile-time evaluation
jnthn is pure means it can be constant folded 13:04
Most inlining happens in the VM, and it decides based on code size, heat, and whether there's things in the sub that make it impossible to inline 13:05
MasterDuke_ samcv: re that snippet you posted, `%decomp_spec{$cp}<mapping> = @dec.map( { nqp::atpos(nqp::radix(16, $_, 0, 0), 0) } )` was about twice as fast in my rough test 13:09
samcv faster than the faster test? 13:10
MasterDuke_ yeah. .25s intead of .5s 13:13
samcv nice
MasterDuke_ oh, could also try `%decomp_spec{$cp}<mapping> = @dec.map(-> int $_ { nqp::atpos(nqp::radix(16, $_, 0, 0), 0) } )`, might be faster still
dogbert17_ jnthn: fun fact, the original reporter of github.com/MoarVM/MoarVM/issues/234 saw your changes from yesterday and closed the issue 13:17
timotimo very nice
dogbert17_ timotimo: how's your stomach? 13:18
timotimo it's recovered completely, thank god!
dogbert17_ horay
jnthn \o/ on both :) 13:20
samcv MasterDuke_, it's actually about exactly the same as what i ended up doing
MasterDuke_ the code or the speed?
timotimo so ... how do i get a working moarvm again? o_O 13:21
MasterDuke_ good either way i guess
samcv the speed
MasterDuke_, this is what i'm doing now gist.github.com/samcv/566950400b06...cmp-p6-L30
though i might do what you said just to make it more readable
compared to yours gist.github.com/samcv/566950400b06...cmp-p6-L53
timotimo Program received signal SIGILL, Illegal instruction. 13:22
SHA1_Transform (state=state@entry=0x7fffffffdb20,
is my hardware dying?!
MasterDuke_ samcv: can't `if nqp::eqat(nqp::atpos($dec, 0), '<', 0) {` be simplified to `if nqp::eqat($dec, '<', 0) {`? 13:23
samcv does eqat allow arrays? 13:24
MasterDuke_ samcv: doh, nm, read your code wrong 13:25
timotimo no, it's only for strings
samcv actually yours is like 10% faster than mine. gonna go with yours 13:28
jnthn timotimo: No, it's just ill... 13:29
timotimo i'll give it a reboot and see if that changes things to the better
if not .. well, at least i still have my laptop to switch to
and rebooting is quite fast 13:32
well, that still asplodes ... 13:33
samcv MasterDuke_, also gonna use map in a different place and prolly speed things up
timotimo why do u do dis gcc
just had to rm the sha1 .o and .a files 13:40
travis-ci NQP build failed. Pawel Murias 'Test that 'local' variables are properly initialized.' 13:49
travis-ci.org/perl6/nqp/builds/197113556 github.com/perl6/nqp/compare/501c5...90db6fe491
brokenchicken t/qast/01-qast.t ....................... Failed 1/119 subtests 13:51
dogbert17_ it's getting increasingly difficult to find bugs in MoarVM, argh :) 13:55
travis-ci NQP build failed. Zoffix Znet 'Add rudimentary docs for `locallifetime` 13:56
travis-ci.org/perl6/nqp/builds/197131227 github.com/perl6/nqp/compare/5490d...a05465e84e
timotimo so we build some features instead and voila 13:58
more bugs for you
jnthn dogbert17_: Your collecting info on them is making the quicker for me and others to fix, which works against your hunting. :-P 14:00
*making them
brokenchicken I'm guessing I can't declare a var I plan on returning inside QAST::Op.new( :op('locallifetime'), ? 14:02
brokenchicken tries anyway
timotimo returning out of it should be fine
things ought to be returned through a register, i'd assume
brokenchicken I know nothing about registers :) (yet) 14:03
travis-ci NQP build failed. Zoffix Znet 'Merge pull request #344 from perl6/robust_dentin_dentout 14:04
travis-ci.org/perl6/nqp/builds/197133735 github.com/perl6/nqp/compare/34a05...3f5515689d
NQP build failed. TimToady 'get rid of $*ACTIONS 14:09
travis-ci.org/perl6/nqp/builds/197212396 github.com/perl6/nqp/compare/213f5...1c8f1668f8
[Coke] news.mit.edu/2017/optimizing-code-...grams-0130 14:15
jnthn Will be interesting to read the papers :) 14:19
DrForr Hyperoptimizer?
jnthn :P
DrForr Oo, quantum compiler - simultaneously test all possible code paths. 14:20
brokenchicken What could error mean? There isn't a '{' or '}' for miles in sight.Unable to parse expression in blockoid; couldn't find final '}' at line 7850, near "$past := Q" 14:22
And the code is a bunch of QAST nodes...
DrForr Are you using any #`(..) comments? I've had a few problems with nesting with those. 14:23
brokenchicken nope
timotimo it can mean you broke the parser :) 14:24
brokenchicken heh
jnthn May mean a mis-nested other brace too 14:25
timotimo seriously, though. many changes i've tried in moar in the past have caused the most random errors from parsing code
arnsholt Yeah, that sounds like NQP code. And the error reporting in NQP is in the tradition of most other compilers =) 14:26
(That is, not terribly helpful in most cases)
MasterDuke_ samcv: replacing gist.github.com/samcv/566950400b06...p6-L57-L62 with a ternary, e.g., `%decomp_spec{$cp}<type> = nqp::eqat(nqp::atpos(@dec, 0), '<', 0) ?? nqp::shift(@dec) !! 'Canonical'` would probably also be faster 14:27
brokenchicken *sigh* don't see it
brokenchicken undos until last working version
[Coke] brokenchicken: got a URL or a patch or something? I can stare at code if it helps. 14:28
brokenchicken It's already gone, but thanks :) 14:30
[Coke] WOOT
glad I could... "help"?
brokenchicken heh
timotimo :D 14:31
perlpilot
.oO( ... and the cosmic joker arranges it such that brokenchicken's code still complains about a missing '}' even after backing out his changes )
14:34
Geth rakudo/nom: 97359ae42e | (Zoffix Znet)++ | src/Perl6/Actions.nqp
Fix result variables of S///; perlpilot++ for tips

Currently S/// uses $/ to store the result of its operation, which clobbers the Matches it's supposed to have and causes numerous other issues due to returning a container that's re-used on multiple S/// calls.
Fix by leaving the $/ alone (so it keeps the Match objects) and ... (20 more lines)
15:31
roast: 1ed4d128d2 | (Zoffix Znet)++ | S05-substitution/subst.t
Test S/// does not return $/ and so can be used in .map

RT#130355: rt.perl.org/Ticket/Display.html?id=130355 Rakudo fix: github.com/rakudo/rakudo/commit/97359ae42e
15:33
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130355
roast: b15e0a0d9b | (Zoffix Znet)++ | S03-operators/andthen.t
Unfudge now passing S/// andthen S/// tests

RT#127822: rt.perl.org/Ticket/Display.html?id=127822 Rakudo fix: github.com/rakudo/rakudo/commit/97359ae42e
15:34
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127822
perlpilot brokenchicken: see? I told you, you'd do better :) 15:36
brokenchicken :) 15:37
hm... 16:03
m: 'foo'.match: :g, /o/; say $/
camelia rakudo-moar 97359a: OUTPUT«(「o」 「o」)␤»
brokenchicken m: 'foo'.subst: :g, /o/, 'x'; say $/
camelia rakudo-moar 97359a: OUTPUT«「o」␤»
brokenchicken m: ($ = 'foo').subst-mutate: :g, /o/, 'x'; say $/
camelia rakudo-moar 97359a: OUTPUT«「o」␤»
brokenchicken m: S:g/o/x/ given 'foo'; say $/
camelia rakudo-moar 97359a: OUTPUT«(「o」 「o」)␤»
brokenchicken Seems .subst/.subst-mutate don't set $/ to all the matches when :g is used 16:04
and that was so since before 2015.12 16:05
Geth roast: 4b949eb583 | usev6++ | 2 files
[JVM] Fudge newly failing tests for r-j
16:06
brokenchicken :( 16:11
hm, no idea how to fix it. 16:48
Don't get why its broken either. It seems to just call .match under the hood, fowarding the $/ up the food chain
RaKUDOBUgged: rt.perl.org/Ticket/Display.html?id=130688 16:57
jdv79 this is as good as i can golf this bug so far: gist.github.com/anonymous/d6011770...c70ac4465a 17:44
can anybody repro that or better yet have any ideas?
brokenchicken That has a feel of a concurrency bug. 17:46
jdv79 i know. oddly if you only have one class i can repro it. 17:47
brokenchicken reproed on 4th run on 2017.01-121-gf94cb21
jdv79 also even the for loop has to have a pair or whatever that is in there - 1..1 kills the repro. 17:48
so weird
i guess that's golfed enough to report 17:49
brokenchicken mhm, stick [CONC] at the start of the subject line
jdv79 oops. i meant can't repro with jut one class
that's our best guess?
sure
timotimo the message seems very much like a concurrency bug, yeah
jdv79 thanks 17:50
timotimo how long do i have to run it every time to get it to explode in valgrind before i decide "it's run long enough, this time it's probably fine" 18:02
jdv79 for me it usually kicks in a few seconds or i just restart and it'll hit in a handful 18:03
sometimes it never hits
travis-ci Rakudo build errored. Jonathan Worthington 'Only generate static inline info when native args.
travis-ci.org/rakudo/rakudo/builds/197004056 github.com/rakudo/rakudo/compare/f...b346943910
buggable [travis build above] ✓ All failures are due to timeout (0), missing build log (3), or GitHub connectivity (0).
jdv79 initial state?
timotimo jdv79: the thing is that valgrind makes things between 10x and 100000x slower :) 18:04
jdv79 its #130690
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130690
timotimo so do i run it for 5 minutes? 10 minutes? 1 hour?
jdv79 ew
i run it for no more than 30s and then just ctrl-c and do it again if it hasn't hit 18:05
most of the time
you can repro it without valgrind?
timotimo yeah
i can 18:06
jdv79 huh
timotimo valgrind also serializes threads, so ... 18:09
==24651== More than 1000 different errors detected. I'm not reporting any more. 18:11
==24651== Final error counts will be inaccurate. Go fix your program!
helgrind be like -^
jdv79 haha 18:13
timotimo i'm having a hard time interpreting the firehose that is helgrind
disabling spesh seems to make it harder to repro, can you confirm? 18:14
i've tried like 20 times and didn't get it to crash once 18:17
SPESH_INLINE_DISABLE doesn't seem to prevent repro, on the other hand 18:18
SPESH_OSR_DISABLE also doesn't prevent the crash 18:19
JIT_DISABLE also doesn't prevent it 18:20
but i still can't repro when MVM_SPESH_DISABLE is set 18:21
Geth geth: 5f3744acad | (Zoffix Znet)++ | lib/Geth/Plugin/GitHub.pm6
Use bold instead of italics

italics don't seem to be displaying right in irc clients
18:40
travis-ci Rakudo build canceled. Jonathan Worthington 'Only generate static inline info when native args. 18:57
travis-ci.org/rakudo/rakudo/builds/197004056 github.com/rakudo/rakudo/compare/f...b346943910
buggable [travis build above] ✓ All failures are due to timeout (0), missing build log (3), or GitHub connectivity (0).
Geth rakudo: ronaldxs++ created pull request #1010:
replace s///r in fudgeandrun for compatibility with perl 5.10
19:31
rakudo/nom: ac37a20e9e | (Ronald Schmidt)++ | t/fudgeandrun
replace s///r in fudgeandrun for compatibility with perl 5.10
19:34
rakudo/nom: bc53f6770f | (Zoffix Znet)++ | t/fudgeandrun
Merge pull request #1010 from ronaldxs/new-fancier-fudgeandrun

replace s///r in fudgeandrun for compatibility with perl 5.10
travis-ci Rakudo build canceled. Elizabeth Mattijsen 'Streamline Any::IterateOneWithoutPhasers.sink-all 20:32
travis-ci.org/rakudo/rakudo/builds/197151628 github.com/rakudo/rakudo/compare/b...9f3751d50d 20:33
buggable [travis build above] ☠ Did not recognize some failures. Check results manually.
RabidGravy ah 20:35
with "use 6.d.PREVIEW" if you take the server example from docs.perl6.org/type/IO$COLON$COLON...COLONAsync and add a $conn.close after the write it craps out after the second connection every time 20:37
brokenchicken report it
RabidGravy Unhandled exception in code scheduled on thread 9
Attempt to unlock mutex by thread not holding it
brokenchicken on ticket tracker 20:38
RabidGravy yeah
is there a way to get a backtrace from an exception in a thread? 20:42
brokenchicken If you stick CATCH {} into it
CATCH { default { .gist.say } } 20:43
RabidGravy Hmm not it seems 20:44
timotimo i think the recent await changes also made backtraces for threads better? 20:45
RabidGravy no backtrace
can't seem to catcch 20:46
ah there is no backtrace 20:51
I'll RT it, it'll probably be obvious to someone 20:53
jnthn Hm, that's an interesting one :) 21:02
RabidGravy Quite bizarre 21:03
and I can't make a ticket on rt
what? 21:04
timotimo only via mail
has been that way for what, three months now?
maybe longer
RabidGravy pfft 21:05
it's RT #130692 21:12
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130692
jnthn Thanks 21:22
Will look when less exhausted :)
RabidGravy definitely odd 21:24
jnthn For anyone who found the article linked (I think) here on fork-join in the LLVM IR, cpc2016.infor.uva.es/wp-content/up...per_12.pdf is the actual paper 21:33
Which hopefully is less hand-wavey :)
Argh, wait, it's one page
wsmoses.com/tapir.pdf seems to be the full thing :) 21:34
Geth rakudo/nom: 9f15a4d649 | (Elizabeth Mattijsen)++ | src/core/Any-iterable-methods.pm
Streamline Any::IterateTwoWithoutPhasers.push-all

  - add another case of .slip-all
  - simplify code for handling Slip
  - add scope for magic performance improvement
This make my @b = @a.map: -> \a,\b { } about 15% faster
22:31
rakudo/nom: 7384939eb1 | (Elizabeth Mattijsen)++ | src/core/Any-iterable-methods.pm
Streamline Any::IterateTwoWithoutPhasers.sink-all

  - remove unnecessary flag
  - simplify next handling
Makes for @a -> \a, \b { } about 2% faster. It's not a lot, but for such a common idiom, I guess we'll take it.
22:49
timotimo i got myself a nice toy 23:42
"cyber clean" "the high-tech cleaning compound" 23:43