github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
00:15 lizmat left 01:29 ZzZombo left 02:34 ZzZombo joined, p6bannerbot sets mode: +v ZzZombo 03:24 MasterDuke left 05:16 fake_space_whale left 05:36 domidumont joined 05:37 p6bannerbot sets mode: +v domidumont 06:43 domidumont left 06:44 patrickb joined, p6bannerbot sets mode: +v patrickb 06:56 brrt joined 06:57 p6bannerbot sets mode: +v brrt
brrt \o 06:59
07:01 domidumont joined 07:02 p6bannerbot sets mode: +v domidumont 07:32 brrt left 08:04 brrt joined, p6bannerbot sets mode: +v brrt
jnthn morning o/ 08:44
nwc10 correct! 08:45
good *, jnthn
\p
oops
\o
brrt o/ 08:47
08:58 lizmat joined, p6bannerbot sets mode: +v lizmat
brrt wonders about tweaking prepargs into sp_prepargs_nativecall for easier nativecall handling in the JIT 09:00
09:08 brrt left
masak good correct morning \o 09:16
09:24 robertle joined, p6bannerbot sets mode: +v robertle
jnthn masak: Did you see that the ea work managed to do its first actually useful-to-real-Perl 6 opt? :) 09:38
lizmat jnthn: link ? 09:41
jnthn lizmat: Only the commit log right now: github.com/MoarVM/MoarVM/commits/pea 09:43
See final paragraph of the first commit message of the latest commit 09:44
s/first//
lizmat 6% off wow :-) 09:45
nwc10 "6", that's a nice number 09:48
some folks seem to get a bit twitchy with certain other nearby integers 09:49
10:08 patrickb left 10:13 ZzZombo left 10:24 brrt joined 10:25 p6bannerbot sets mode: +v brrt
nine brrt: I wonder what the nativecall JIT stuff is gonna look like once you're through with it :) 10:28
brrt I can show you a WIP
nine jnthn: that's fantastic news :) 10:29
brrt gist.github.com/bdw/189cfec71ec130...72b0682f5e
jnthn++ indeed 10:30
I need to work out how to do the map backwards to the source register for rw arguments 10:31
masak jnthn: I didn't, but that's great news! 10:32
jnthn: man, I'm swamped with work this week, otherwise I'd've jumped in and helped somehow
really really really stoked by the ea 10:33
nwc10 doubleplusjnthn 10:34
tadzik mmm, ea 10:36
jnthn It's interesting but...tricky :) 10:42
masak well, the "partial" bit does indeed change the landscape a bit
and to Perl 6's advantage, it feels like
jnthn Yeah. Though there's nothing partial about what's there so far (except being structured so that we can do that) 10:43
masak nodnod
brrt What is the 'partial' bit of interest here? 10:59
jnthn brrt: Can apply optimizations like scalar replacement up to the point an escape happens, and so materialize it only on paths where required (and during deopt) 11:01
masak it feels to me it rhymes better with things like JIT and, yes, deopt
11:24 ZzZombo joined, p6bannerbot sets mode: +v ZzZombo
brrt oh, cool 11:37
11:39 patrickb joined, p6bannerbot sets mode: +v patrickb 11:44 lizmat left 12:08 emerson left 12:15 emerson joined, p6bannerbot sets mode: +v emerson 12:45 brrt left
jnthn Hmm 13:47
Thread 1 "moar" received signal SIGILL, Illegal instruction.
Interesting :)
Happens in my pea branch during core setting compilation... 13:48
nwc10 does valgrind have an opinion? 13:49
(such as "get a beer, this is going to take a while..." ?)
jnthn Hm, and it didn't actually perform an optimization...
Well, maybe I should sync my branch with master first just in case...
Geth MoarVM/pea: 12 commits pushed by (Jonathan Worthington)++, (Carl Masak)++
review: github.com/MoarVM/MoarVM/compare/5...5f931d08ab
13:51
jnthn There's a rebase, alas it doesn't help
13:51 lizmat joined, p6bannerbot sets mode: +v lizmat
jnthn Even more fun, it explodes that way even if I have the EA commented out 13:52
Very odd 13:54
Well, 5238516fb0 is good, so it's in one of the more recent commits in that branch 13:56
It's 5db6cec it seems. 13:59
But that doesn't work directly because it trips over something merge_bbs does to the graph 14:00
So a later commit in that branch had communt out the merge_bbs opt
If I do that, it's this commit which ends up with the expr JIT spitting out an illegal instruction 14:01
And it wasn't the added call to eliminate dead BBs, meaning it must be the fix to the successors handling when rewriting a throwcat into a goto 14:07
That's pretty bizzare
nine jnthn: is the base64 encoded return value of nqp::serialize meant for anything other than testing? I.e. may I just change it to return a binary buffer? 14:14
jnthn nine: I think just testing
nine: On MoarVM at least; I don't know totally about other backends 14:15
huh....the frame that it bissects to the specialization of doesn't even have any control flow ops 14:19
ohhh...it's the commenting out of merge_bbs 14:21
That makes more sense
So my hypothesis is that when we merge some BBs, the expr JIT doesn't reach an instruction it otherwise would
And it's producing invalid machine code
If it does reach it 14:22
nine Now I know why I went with the base64 encoded string before. Creating a buf8 type in MoarVM's C code will be....a bit involved 14:27
jnthn nine: The typical pattern is to just pass one in
Aha! 14:28
So it turns out if one comments out merge_bbs in *master* then the EXPR JIT spits out code that SEGVs.
Paging dr brrt... :)
nine jnthn: ah, ok. Since I've got to change nqp::serialize anyway, I may as well do that 14:31
14:34 brrt joined 14:35 p6bannerbot sets mode: +v brrt
brrt \o 14:35
jnthn o/
Current suspect is reprname
brrt hmmmm
let me check the expr code for that 14:36
jnthn If I comment it out then no problem
Downstream of it in that BB is const_s, eq_s, and if_i
I find those unlikely to be wrong :)
Since they're so common we'd presumably know about it :)
brrt yeah, i'd think so as well 14:37
jnthn (macro: ^repr_id (,obj) (^getf (^repr ,obj) MVMREPROps ID)) 14:38
Is then used here:
(template: reprname
(^getf
(load (idx (^get_instance_field repr_list) (^repr_id $1) ptr_sz) ptr_sz)
MVMReprRegistry name))
Is that ptr_sz inside of idx the size of the index or the size of the value to read? 14:39
'cus the index is a 32-bit int
brrt oh... that is the size of the item 14:40
it is the scale
jnthn OK, think that's OK then 14:41
brrt yeah
hmmm
jnthn Why do we have idx and load, ooc? 14:42
idx calculates the offset in memory?
Basically, arg1 + arg2 * size?
brrt correct
jnthn OK, then that doesn't look like the issue. Hm.
Ah, and looked at the getf macro and see it knows about size 14:43
Color me confused. :) 14:44
brrt yeah, me too
that macro looks very innocent actually 14:45
jnthn Removing the eq_s template doesn't help
So I think it's very likely reprname
To repro, just comment out the call to merge_bbs in optimize.c
brrt ok 14:57
jnthn (in master, don;t even need my branch) 14:58
*don't
brrt where does it blow up? 15:00
yay, can repro 15:02
ok, we'll figure it out
jnthn brrt++ 15:05
m: say 1.772 / 1.886
camelia 0.939555
jnthn In `my $s = "foobar"; my $res; for ^10_000_000 { $res = $s.uc.chars }; say $res` I can now eliminate the Str object that .uc wraps its result up in 15:07
15:11 fake_space_whale joined, p6bannerbot sets mode: +v fake_space_whale
timotimo it's not something to do with jumplists, for example? 15:22
15:25 brrt left
Geth MoarVM/pea: e65ce5976f | (Jonathan Worthington)++ | src/spesh/pea.c
Make it easier to grep out the EA opts
15:27
MoarVM/pea: 15ab517fee | (Jonathan Worthington)++ | src/spesh/pea.c
Handle non-merge case of PHI

Sometimes we end up with a PHI that only actually has one soure to merge. In this case, we can track allocations through it.
These show up when a call is inlined, since the return value is always put through a PHI (as part of handling multiple returns consistently). Thus this means we can now handle some simple cases of eliminating an allocation that is made in one routine and immediately got rid of in another.
15:34 domidumont left 15:44 patrickb left 15:46 zakharyas joined, p6bannerbot sets mode: +v zakharyas
Geth MoarVM/pea: dc36f75615 | (Jonathan Worthington)++ | src/spesh/optimize.c
Move PEA phase ahead of other post-inline opts

So that we might get more `set` instructions eliminated
15:51
jnthn heh, with that, the following: 15:53
sub foo() {
my $c := nqp::create(C);
nqp::bindattr($c, C, '$!a', 42);
nqp::getattr($c, C, '$!a');
}
Turns into just the boxing of the 42
No set instructions at all
15:54 fake_space_whale left
lizmat wow 15:58
16:24 AlexDaniel left, AlexDaniel joined, asimov.freenode.net sets mode: +v AlexDaniel, p6bannerbot sets mode: +v AlexDaniel 16:26 lizmat left 16:30 lizmat joined, p6bannerbot sets mode: +v lizmat 16:34 AlexDaniel` left, AlexDaniel` joined, moon.freenode.net sets mode: +v AlexDaniel`, p6bannerbot sets mode: +v AlexDaniel` 16:43 zakharyas left 18:08 nwc10 joined 18:09 p6bannerbot sets mode: +v nwc10 18:16 patrickb joined, zakharyas joined 18:17 p6bannerbot sets mode: +v patrickb, p6bannerbot sets mode: +v zakharyas 18:55 zakharyas left 19:19 brrt joined, p6bannerbot sets mode: +v brrt
brrt \o 19:20
jnthn: any idea what numbers you got for the bisect? 19:21
timotimo o/
brrt ohai timotimo
19:21 zakharyas joined
nine Stage mast : 16.172 19:22
19:22 p6bannerbot sets mode: +v zakharyas
jnthn brrt: Sadly, it's on the terminal on my work machine, but I know 1000 was too high and 800 was OK... 19:22
yoleaux 19:20Z <lizmat> jnthn: I'm thinking of adding a IterationBuffer.List and Array method, which would basically do a nqp::p6bindattrinvres(nqp::create(List),List,'$!reified',$buf)
19:20Z <lizmat> jnthn: s/$buf/self/ , and replace a lot of those calls throughout the setting: for clearer code and possibly smaller candidates
nine By getting rid of the decode_base64. The scary thing is that it worked on the first try ;)
yoleaux 19:21Z <lizmat> jnthn: do you think that's a good idea ?
lizmat my parse / mast: 52.798 / 11.729
nine Yep, just ~ 5 seconds to find 19:23
jnthn nine: I'm always freaked out when that happens. I put in some simple PHI handling to EA today to try and get it to handle some more cases and that also worked first time :)
Then I tried some changes in Perl6::Optimizer to start more aggressive lowering and those blew right up... :) 19:24
nine Until I saw the number, I was convinced that I was running some unmodified code accidentally :)
19:24 AlexDaniel left
jnthn :) 19:24
nine Btw. that's with copying each byte individually: for(i = 0; i < output_size; i++) { MVMRegister r; r.i8 = output[i]; REPR(result)->pos_funcs.bind_pos(tc, STABLE(result), result, OBJECT_BODY(result), i, r, MVM_reg_int64); } 19:25
19:25 AlexDaniel joined
brrt i'll let jit-bisect take a look 19:25
I need to overhaul that some day
nine Is there any faster way to set the whole buffer at once?
jnthn lizmat: Hmm...they're a tad odd in that the List takes ownership...for Array do we know the buffer is already all containers?
nine Without violating all of 6model that is
lizmat ok, maybe just for List
19:25 p6bannerbot sets mode: +v AlexDaniel
brrt now that the jit log and the spesh log have been merged, makes no sense to keep a separate jit sequence nr and spesh sequence nr 19:25
jnthn nine: I was somewhat thinking of putting something new on the REPR API to help with such things... 19:26
lizmat that happens a *lot* in the setting since iterationbuffers don't automatically upgrade to List, as apposed to nqp::list
jnthn Yeah, it's worth factoring out. I mean, the most conservative way is a Rakudo::Internals.wrap-list or so
nine jnthn: ok, I'll make sure that this new REPR API thing will be useful for the write* ops, too 19:27
jnthn nine: Yeah, would be good... :) 19:28
walk, bbiab
19:28 zakharyas left
nine Alas, calling REPR(result)->pos_funcs.bind_pos a gazillion times hardly slows down anything at all....cause it's C 19:36
19:36 AlexDaniel left, AlexDaniel joined 19:37 p6bannerbot sets mode: +v AlexDaniel 19:47 robertle_ joined, p6bannerbot sets mode: +v robertle_
jnthn nine: Yes, the thinking is that we can then specialize and potentially eliminate the call overhead in the JIT too... 19:56
nine And there are more than 2.5 million such calls 20:04
brrt hmm, i can't figure it out so quick either 20:05
20:07 patrickb left
jnthn brrt: Did you figure out if it's reprname or not? :) 20:07
20:10 brrt left
lizmat jnthn: nice tweet, but no link to commaide.com ? and no mention of new release there ? 20:20
jnthn lizmat: d'oh, I forgot the link :) 20:21
lizmat: Log in to the subscriber area for release notes :)
lizmat jnthn: no release notes for casual visitors that may want to buy Comma IDE ? 20:22
20:22 brrt joined 20:23 p6bannerbot sets mode: +v brrt
jnthn lizmat: Hmm, they felt a bit nitty-gritty for marketing purposes. :) Though will update the site soon with a bunch of animated demonstrations of features :) 20:23
lizmat that would be nice for a link in the P6W :-)
brrt ooh, has there been a weekly yet? 20:26
lizmat p6weekly.wordpress.com/2018/10/08/...ed-the-js/ 20:29
brrt hmm, stepping through the code, what I'd expect to be a MVMString really rather not to be
alright, that doesn't compile to what I'd expect it to compile into at all... 20:32
20:42 robertle_ left
timotimo that sounded promising 21:25
i wonder what happened
brrt I'm looking at the wrong frame like a dumbass 21:31
timotimo ^- me at every art exhibition 21:38
"that's not the art, that's the restaurant menu"
"that's not the art, you're just looking at a mirror" 21:39
"that's not the art, that's a novelty paper shredder machine"
21:39 brrt left
[Coke] .tell brrt my TPF address is tpf-grants-secretary at perl-foundation.org. 21:48
yoleaux [Coke]: I'll pass your message to brrt.
21:59 avar left, avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar 22:00 p6bannerbot sets mode: +v avar 22:23 ggoebel left 22:50 ggoebel joined 22:51 p6bannerbot sets mode: +v ggoebel 23:53 avar left