Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-07-10

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
01:33 diakopte1 joined #moarvm
01:40 FROGGS_ joined #moarvm
01:48 dalek MoarVM: 1d89654 | (Geoffrey Broadwell)++ | src/spesh/optimize.c:
01:48 dalek MoarVM: Fix 'elimiante' typo in several places
01:48 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/1d89654fe0
03:28 dalek joined #moarvm
03:36 dalek joined #moarvm
04:16 masak joined #moarvm
06:19 brrt joined #moarvm
06:19 brrt \o moar
06:49 nwc10 probably not relevant, and I've only read the Abstract, but cool :-)   https://www.cs.princeton.edu/~appel/papers/memerr.pdf
06:49 nwc10 "Using Memory Errors to Attack a Virtual Machine"
06:59 brrt joined #moarvm
07:01 brrt paper-size, we can do that
07:11 brrt (dissapointing match, yesterday, btw)
07:12 teodozjan joined #moarvm
07:21 * moritz only saw the first half, and wasn't really overwhelmed
07:23 brrt there was no reason to be overwhelmed indeed
07:31 nwc10 jnthn: Rakudo sanity tests pass for me with origin/set-removal but spectests fail. But ASAN is happy
07:31 nwc10 it's fail fails, not ASAN barfs
07:57 sergot o/
07:58 brrt \o
08:12 brrt left #moarvm
08:36 nwc10 jnthn: we have normality, etc. valgrind and ASAN suggest it's "your problem" (ie not undefined behaviour. Hence a logic bug)
08:36 teodozjan joined #moarvm
09:12 rurban joined #moarvm
09:40 jnthn nwc10: Weird sanity passes...
09:40 nwc10 yes, but then again weird that that other stuff diverged yesterday
09:40 jnthn yes.
09:41 nwc10 fire up a Linux VM and see if you can locally replicate sanity?
09:41 jnthn yeah
09:41 jnthn But after gorging on Perl 6 hacking all day yesterday I should do a few $dayjob things today before that :)
09:44 brrt joined #moarvm
09:45 nwc10 like "eat lunch"? :-)
09:46 brrt ok, i have a script that counts opcodes that JIT currently bails on
09:47 brrt slight issue - it is a bit self-referential, because written in perl6
09:48 jnthn haha
09:48 nwc10 dogfood++
09:48 timotimo i didn't have a big problem with that when i built spesh-diff, but i had to turn on spesh dumping with an env var anyway ...
09:50 brrt takedispatcher seems to be an extop?
09:50 jnthn no
09:50 jnthn core
09:51 jnthn And easy.
09:51 brrt ok, i like them that way
09:51 jnthn Read a value from a field in tc, put it in a register, NULL the tc field.
09:58 dalek MoarVM/moar-jit: e2e9564 | (Bart Wiegmans)++ | / (4 files):
09:58 dalek MoarVM/moar-jit: Add script to measure opcodes the JIT bails on
09:58 dalek MoarVM/moar-jit:
09:58 dalek MoarVM/moar-jit: Because it is written in perl6, it mostly measures the
09:58 dalek MoarVM/moar-jit: ops that are used by the script itself, as well as possibly
09:58 dalek MoarVM/moar-jit: the rakudo compiler.
09:58 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/e2e9564d37
09:58 brrt oh, that really seems easy :-)
10:04 ggoebel111118 joined #moarvm
10:11 nebuchadnezzar joined #moarvm
10:21 dalek MoarVM/moar-jit: 539b1f5 | (Bart Wiegmans)++ | src/jit/ (4 files):
10:21 dalek MoarVM/moar-jit: Add takedispatcher / setdispatcher
10:21 dalek MoarVM/moar-jit:
10:21 dalek MoarVM/moar-jit: These were very common bail points.
10:21 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/539b1f5633
10:21 dalek MoarVM/moar-jit: ab1b19b | (Bart Wiegmans)++ | src/jit/ (4 files):
10:21 dalek MoarVM/moar-jit: Add getcode op
10:21 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/ab1b19b1db
10:21 brrt btw, it doesn't always work very well, reading the jit log as we're going along
10:22 jnthn Could you not read another JIT log in? :)
10:22 brrt maybe open the jit log appending
10:22 brrt possibly
10:26 timotimo brrt: can has an example output? :3
10:26 brrt sure
10:28 brrt https://gist.github.com/bdw/4b0836d1fe0ce557bfeb is what it ought to look like
10:30 timotimo these top ops don't seem that hard
10:30 timotimo also, isnull, unless_o, not_i ... :)
10:30 jnthn sp_fastcreate should at lesat be easy.
10:30 jnthn yeah, isnull and not_i too
10:31 jnthn if_o and unless_o are more involved...
10:31 timotimo oh, right
10:31 jnthn For the same reason decont is
10:31 timotimo boolification specs
10:31 jnthn All of these might invoke.
10:31 timotimo we wanted to spesh those into different sp_ ops based on how they boolify
10:31 jnthn Well, not even sp_ ops
10:31 timotimo but it'll require allocating new register names out of thin air
10:31 jnthn Often there's already ops
10:32 timotimo oh
10:32 jnthn Like isconcrete :)
10:32 jnthn Now our frames can grow in size during spesh, allocating new registers is less of a problem.
10:33 jnthn Just didn't implement it yet.
10:33 timotimo ah, SMOP then.
10:36 brrt for some reason i only get a very small list
10:36 brrt with my last update
10:40 timotimo jnthn: is there anything to be won from making frames shrink during spesh?
10:40 timotimo or is that kind of exactly what jit will end up doing?
10:41 brrt frames shrink?
10:42 * brrt no comprehend
10:43 timotimo IIRC, each register is an offset to the "stack"
10:44 timotimo so the highest register in use inside a frame tells us how big the chunk of memory is that'll get used for executing that frame
10:44 timotimo now if we eliminate a bunch of registers in the middle during spesh, the frame might stay the same size, but have lots of unused slots in the middle
10:45 brrt i don't think you're elimininating registers just yet
10:45 brrt eliminating
10:45 cognominal joined #moarvm
10:46 brrt but i may be wrong
10:46 jnthn Well, we might in some cases delete instructions such that some registers go unused
10:46 brrt and anyway, the jit will be plenty happy wit just working with the registers spesh delivers, so there won't be a jit-specific register elimination (at least not yet)
10:46 jnthn If the thing contains deopt points, though, then we can't just go shrinking the frame easily...
10:51 timotimo ah
10:51 timotimo most interesting things likely will contain deopt points :S
10:51 jnthn Right.
10:55 brrt y dis no work
10:55 jnthn ur doin it rong
10:55 brrt but what?
10:56 jnthn does the code take a penalty anywhere? :P
10:56 nwc10 valgrind?
10:56 * jnthn wonders what exactly isn't working :)
10:57 brrt the perl6 count-jit-bail-ops tool isn't working as it should, i.e. it only shows a small set of ops
10:58 timotimo hm.
10:58 timotimo print "MATCHED" and "NOMATCH" in front of all $line s?
10:59 brrt goot point
10:59 timotimo to check if the regex is correct and the input looks the way it ought to?
10:59 timotimo also, make extra sure you're not reading the file the vm is writing at that moment
10:59 timotimo :P
11:00 brrt that is actually precisely what is happening, however that doesn't actually seem to be a problem
11:02 brrt my regex is just wrong
11:04 brrt but, my regex isn't wrong
11:04 brrt :-(
11:33 jnap joined #moarvm
12:57 [Coke] ... I thought e2e9564 said "the JIT balls". *sigh*
12:59 jnthn haha
13:14 teodozjan joined #moarvm
13:25 brrt joined #moarvm
13:27 zakharyas joined #moarvm
13:34 JimmyZ joined #moarvm
13:39 dalek MoarVM/moar-jit: 790b02f | (Bart Wiegmans)++ | tools/count-jit-bail-ops.p6:
13:39 dalek MoarVM/moar-jit: Have jit bail ops counter take arguments
13:39 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/790b02f706
13:40 jnthn No, not "jit ball ops"... :P
13:50 btyler joined #moarvm
14:10 carlin joined #moarvm
15:10 brrt joined #moarvm
15:17 FROGGS joined #moarvm
15:29 FROGGS m: say "»m\c[COMBINING DIAERESIS]«"
15:29 camelia rakudo-moar 4cad54: OUTPUT«»m̈«␤»
16:07 btyler_ joined #moarvm
16:42 brrt joined #moarvm
16:52 dalek MoarVM/moar-jit: e6e73cb | (Bart Wiegmans)++ | src/jit/ (4 files):
16:52 dalek MoarVM/moar-jit: Add support for sp_fastcreate
16:52 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/e6e73cbf33
16:57 jnthn ...and is_null sneaked in there too
16:57 jnthn *isnull
17:01 dalek MoarVM/moar-jit: 6c305d3 | (Bart Wiegmans)++ | / (2 files):
17:01 dalek MoarVM/moar-jit: Ignore bytecode dump files in git
17:01 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/6c305d3b13
17:10 brrt yes, is null did, but that is supposed to be another commit?
17:10 brrt oh, no, wasn't
17:16 brrt oops!
17:16 brrt decont is big, by the way
17:16 brrt as in, occurs often
17:23 jnthn Yes :)
17:23 jnthn spesh kills many but not all of them.
17:23 jnthn It can also invoke.
17:24 jnthn (in special cases)
17:24 * jnthn suggests working out a plan for the invoke-maybe ops like decont, smart stringify, smart numify, etc.
17:24 jnthn And solve the problem the same way for all of them.
17:25 jnthn I think they are all void functions.
17:25 jnthn So we can actually return a "did it invoke" indicator.
17:31 zakharyas joined #moarvm
17:32 dalek MoarVM/moar-jit: e7982c9 | (Bart Wiegmans)++ | src/jit/ (4 files):
17:32 dalek MoarVM/moar-jit: Add decont
17:32 dalek MoarVM/moar-jit:
17:32 dalek MoarVM/moar-jit: This doesn't actually compile yet.
17:32 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/e7982c9d8c
17:32 brrt oh.... decont can invoke
17:33 brrt yes, good point
17:33 brrt hmm
17:33 brrt undo my last commit then
17:33 jnthn I'd say there are, aside from Just Implementing Ops, 3 bigger pieces left to consider
17:33 jnthn 1) Ops that might invoke
17:34 jnthn 2) OSR
17:34 jnthn 3) extops
17:34 dalek MoarVM/moar-jit: 83d5cc4 | (Bart Wiegmans)++ | src/jit/graph.c:
17:34 dalek MoarVM/moar-jit: Remove decont again as it might invoke
17:34 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/83d5cc4023
17:34 brrt extops are - afaik - function calls, right?
17:34 jnthn Right
17:34 brrt ok, then they ought to be simple
17:34 jnthn Though some might not play well with not being in the interpreter.
17:34 jnthn But we can mark those out.
17:34 brrt hmmm
17:35 brrt the ops that might invoke bit is a biggy
17:35 jnthn Yes
17:35 brrt i'm not sure about the complexity of OSR
17:35 jnthn It's not too bad.
17:35 brrt i suppose that if you know (in spesh term) in what basic block you're starting, it should be doable
17:35 jnthn Yes, there's an annotation
17:36 brrt oh? good
17:36 jnthn MVM_SPESH_ANN_DEOPT_OSR
17:36 jnthn I don't expect getting the OSR thing to work with the JIT to be more than a days work for you :)
17:36 * brrt hopes not
17:37 jnthn But yeah, the may-invoke ops is where I'd look next.
17:37 brrt safe bet is - always return to the interpreter just in case
17:38 brrt or, compare cur_op pointer with the jit bytecode
17:38 jnthn They're common enough that'll suck performance wise...plus the PC will be in the wrong place...
17:38 brrt why is that?
17:38 jnthn Well, I'd use the fact they're all void to actually make them return a "did it invoke"
17:38 brrt are may-invoke ops also at the end of a bb?
17:38 brrt (probably not)
17:38 jnthn No
17:38 jnthn 99.9% of decont ops do not invoke.
17:38 brrt how about an inner interpreter runloop? :-p
17:38 jnthn No, that's evil
17:39 brrt you have no idea about evil
17:39 brrt you know what'd be evil?
17:39 brrt jumping to the labels provided by cgoto
17:39 jnthn Just have the function indicate if it invoked, check the return value, and if it did fall out of the JIT...
17:39 jnthn :P
17:39 jnthn That's awesome :P
17:39 jnthn Though only on compilers that support it :)
17:39 brrt true
17:40 jnthn Also, we'd be in the wrong frame? :)
17:40 brrt yeah
17:40 jnthn As in, C stack frame
17:40 * brrt wonders if that can't be hacked either
17:40 jnthn I don't see why not :) But it feels like a scary optimization :)
17:40 brrt pretty scary
17:41 jnthn For now I'd keep it simple.
17:41 brrt but yes, indicate if it invoked seems good
17:41 brrt note that this follows from '*tc->interp_cur_op == tc->cur_frame->spesh_cand->jitcode->bytecode'
17:42 jnthn Yeah. I dunno if you can use the current C function call jit graph node but make a return type that is something like DidItInvoke and then emit the check-and-fall-out if that's the return type.
17:42 brrt i could add that, yes
17:42 jnthn Well, just thinking if you do it that way you can handle the various invoke-ishes in a common way :)
17:43 * brrt nods
17:43 jnthn Anyway, I'd put those fairly high on the todo list.
17:44 jnthn If next week we land OSR and extops things start looking rather exciting. :)
17:44 brrt yes. they're common enough, too
17:44 brrt timotimo++ also gave me the great advice 'please document how you do stuff', so i think i'll get to that too
17:45 jnthn As in, we'll be able to have perl6-bench things with native ints JIT-compiled :)
17:45 jnthn Yes, that's also a good idea :)
17:47 brrt ok, i'll put it on my list
17:48 brrt the jit-jit call is also something i'd still like to get at
17:52 [Coke] is any of the jit stuff back in trunk yet? huh ?huh? huH? huH? ;)
17:53 jnthn [Coke]: No, but moar-jit is being kept sync'd up with trunk quite often :)
17:53 jnthn So there's not some epic merge to come.
17:53 brrt fortunately
17:54 [Coke] brrt++ brrt++ brrt++ brrt++
17:55 brrt :-)
17:56 brrt i'm going to do some bicycle fixing now :-) see you tomoorow probably
17:57 brrt left #moarvm
17:58 jnthn o/
17:59 FROGGS[mobile] joined #moarvm
18:05 ingy joined #moarvm
18:56 teodozjan joined #moarvm
19:05 zakharyas joined #moarvm
19:57 zakharyas joined #moarvm
21:34 FROGGS joined #moarvm
22:20 dalek MoarVM/moar-jit: c44ab71 | jnthn++ | src/jit/graph.c:
22:20 dalek MoarVM/moar-jit: Put declaration first, to fix MSVC build.
22:20 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/c44ab71b09
22:23 dalek MoarVM/moar-jit: 062641d | jnthn++ | src/jit/graph.c:
22:23 dalek MoarVM/moar-jit: Fix a == that shoulda been =.
22:23 dalek MoarVM/moar-jit:
22:23 dalek MoarVM/moar-jit: Was found by an MSVC warning.
22:23 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/062641d8eb
22:33 masak joined #moarvm
22:33 moritz joined #moarvm
22:33 daxim joined #moarvm
22:34 jnap joined #moarvm
22:36 flussence joined #moarvm
22:36 japhb joined #moarvm
22:36 camelia joined #moarvm
22:36 cxreg joined #moarvm
22:36 harrow joined #moarvm
22:36 tokuhirom joined #moarvm
22:36 timotimo joined #moarvm
22:36 ashleydev joined #moarvm
22:38 BinGOs joined #moarvm
22:43 dalek MoarVM/moar-jit: 59d4385 | jnthn++ | src/jit/emit_ (3 files):
22:43 dalek MoarVM/moar-jit: Move declarations above code, to keep MSVC happy.
22:43 dalek MoarVM/moar-jit:
22:43 dalek MoarVM/moar-jit: With this and other patches, moar-jit is back to building on MSVC.
22:43 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/59d4385ce2
23:01 jnthn brrt: CORE.setting JIT bail reasons, fwiw: https://gist.github.com/jnthn/45b302ebda86a25769ef
23:02 jnthn (yes, this means the JIT runs well enough on Windows to build CORE.setting...also good to know :))
23:05 jnthn 'night

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary