Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-06-12

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

All times shown according to UTC.

Time Nick Message
01:20 FROGGS_ joined #moarvm
05:02 bcode joined #moarvm
06:05 bcode joined #moarvm
06:59 zakharyas joined #moarvm
07:00 FROGGS_ joined #moarvm
07:04 nwc10 jnthn: debug build completes, some spectests fail with SEGVs. Running one of them under valgrind, it passed, but valgrind complained about stuff. Didn't investigate that further, because...
07:04 nwc10 ASAN vomits ANSI color codes. Running the same thing with valgrind to get nicer stacktraces finds two problems: http://paste.scsys.co.uk/393371
07:05 dalek joined #moarvm
07:05 nwc10 first is because last_res_type is not initialised in uninline()
07:06 nwc10 second is because inlinee->deopt_addrs == inliner->deopt_addrs and the realloc code in merge_graph() doesn't consider that as a possibility
07:06 nwc10 I don't know exactly what the right fix in either case is
07:06 nwc10 in particular, whether the bug is in the realloc code, or that situation should never happen, so the bug is elsewhere
07:07 nwc10 I aplogise for distracting you from your fun day at work work.
07:11 synopsebot joined #moarvm
07:13 FROGGS_ morning
07:24 dalek MoarVM/moar-jit: e815b77 | (Bart Wiegmans)++ | src/jit/ (3 files):
07:24 dalek MoarVM/moar-jit: Fix jumping to exit.
07:24 dalek MoarVM/moar-jit:
07:24 dalek MoarVM/moar-jit: Apparantly, the addition code is broken because dynasm
07:24 dalek MoarVM/moar-jit: computes the wrong register offset, and nothing I do changes
07:24 dalek MoarVM/moar-jit: that.
07:24 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/e815b77a50
07:36 brrt joined #moarvm
07:56 odc joined #moarvm
07:58 * brrt is out of ideas wrt to the jit compiler bugs
07:58 brrt .... or perhaps not totally out of ideas
07:59 brrt basically, it looks as if there are off-by-one's introduced into the dynasm code at sompe laces
07:59 brrt some places
07:59 brrt and... i don't exactly know why
08:04 jnthn Can you recreate the issue in an isolated example, free of the MoarVM bits?
08:04 nwc10 brrt: also, your branch as checked appears to be unbuildable elsewhere
08:05 nwc10 I'm guessing there's at least one object file missing, and a link line to the dynasm library
08:05 brrt i can't, thats the thing
08:06 brrt nwc10 - i know its an issue i can fix :-)
08:08 brrt oh, you don't need to link to dynasm, thats the beauty
08:09 brrt its all self-contained in a header file
08:09 brrt i'll fix the 'build without jit' case first
08:09 nwc10 brrt: OK. Could you fix it - right now your branch is less useful than it could be, beacuse it's unbuildable.
08:16 dalek MoarVM/inline: aa30bf3 | jnthn++ | src/spesh/deopt.c:
08:16 dalek MoarVM/inline: Fix copy-pasto.
08:16 dalek MoarVM/inline:
08:16 dalek MoarVM/inline: Found by ASAN, reported by nwc10++.
08:16 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/aa30bf3d3e
08:17 nwc10 jnthn: technically *that* one was found by valgrind :-)
08:18 nwc10 as a side effect of trying to find the other one
08:18 moritz "Found by @awesome-tools.pick(), reported by nwc10++"
08:19 nwc10 it's possible to run everything with valgrind, but it's way slower
08:19 nwc10 and as I found out, you can DOS a machine that way
08:19 nwc10 in future, ulimit
08:19 nwc10 RAM, om nom nom nom nom (etc)
08:20 FROGGS I didn't even know that DOS was that memory hungry :o)
08:21 FROGGS I've got disk images of 6.22 here if somebody needs it... *cough* *warez* *cough*
08:22 lizmat joined #moarvm
08:22 jnthn nwc10: I think the other one - will check into it later - could be to do with trying to inline a recursive call, something it's still on my todo list to prevent it trying todo.
08:23 jnthn nwc10: I'm not actually sure how it could happen anyway...
08:23 nwc10 no, me neither, but the assert() catches it
08:23 jnthn nwc10: But it'd explain the same pointers.
08:23 FROGGS m: say ?NQPMu
08:23 camelia rakudo-moar 60aaed: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/FRKGfZlD8S␤Undeclared name:␤    NQPMu used at line 1␤␤»
08:26 woolfy joined #moarvm
08:30 dalek MoarVM/moar-jit: 521b686 | (Bart Wiegmans)++ | src/jit/ (5 files):
08:30 dalek MoarVM/moar-jit: Fix jitless build stub
08:30 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/521b686c52
08:33 brrt nb, this is the build you'll get if you either a): lack lua (and lua bitop) or b): do not pass --enable-jit
08:33 brrt so by default, everyone :-)
08:33 brrt i should look at that again
08:34 jnthn brrt: Is that, you can pass --enable-jit without having Lua and it will work out, 'cus we check in the output of dynasm?
08:34 brrt you ought to be able to, but no
08:34 brrt dumb check i left in
08:35 brrt basically, preprocessing is a makefile rule
08:35 brrt i should either just 'let it crash' if you are editing the dasc file without having lua
08:37 brrt or check it at build-time
08:41 dalek MoarVM/moar-jit: b8f9f55 | (Bart Wiegmans)++ | Configure.pl:
08:41 dalek MoarVM/moar-jit: Remove configure-time check for lua.
08:41 dalek MoarVM/moar-jit:
08:41 dalek MoarVM/moar-jit: Just let it crash if you modify dasc without having
08:41 dalek MoarVM/moar-jit: lua installed.
08:41 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/b8f9f554c8
08:41 brrt your make installation will Do The Right Thing
08:43 brrt hmm
08:43 brrt or not
08:43 brrt depends on whether make will see the .c file as up-to-date
08:51 xiaomiao btw - annoying little buglet: https://bugs.gentoo.org/show_bug.cgi?id=510706
08:52 xiaomiao at some part of the build process the local absolute path is stapled in, but that ends up being very wrong
09:16 zakharyas joined #moarvm
09:21 dalek MoarVM/moar-jit: ff8f477 | (Bart Wiegmans)++ | / (2 files):
09:21 dalek MoarVM/moar-jit: Warn rather than crash on preprocessor failure.
09:21 dalek MoarVM/moar-jit:
09:21 dalek MoarVM/moar-jit: Detect likely failure of the DynASM preprocessor
09:21 dalek MoarVM/moar-jit: during configuration and emit a warning line into
09:21 dalek MoarVM/moar-jit: the Makefile rather than a command that would crash.
09:21 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/ff8f4778e8
09:22 brrt jnthn: this allows you to build with --enable-jit while not having lua installed
09:22 brrt at worst it will warn
09:40 brrt nwc10++ for pointing me to it :-)
10:13 woolfy left #moarvm
10:20 woolfy joined #moarvm
10:20 woolfy left #moarvm
11:40 brrt joined #moarvm
12:28 jnap joined #moarvm
12:35 FROGGS joined #moarvm
12:51 brrt much frustration
12:52 brrt y u no work
12:53 FROGGS brrt: can I test your branch?
12:53 brrt sure
12:54 brrt ehm, instructions are really simple
12:54 FROGGS so I should build it with --enable-jit I guess
12:54 brrt git checkout moar-jit; perl Configure.pl --enable-jit $options; make; make install; ./foo.nqp
12:54 brrt :-)
12:54 brrt ./foo.nqp makes known-compilable frame
12:55 brrt if everything went 'well', it should work (i.e.) not crash but after 14 iterations you should see that the return value is no longer 4
12:56 brrt and you should stop seeing the 'oh hai' fragment as i haven't decided on string lookup just yet
12:56 brrt fwiw, unless strings like that are known to move i /think/ we should look 'm up at compile time
12:56 jnthn If the pointer is to something in gen2, you can always just put the literal pointer right into the machine code.
12:56 brrt but that depends on gc details
12:57 brrt ok, how do i figure that out? :-)
12:57 jnthn If it's not made it to gen2 yet, it can still move
12:57 jnthn Encapsulate it, but you just check the collectable flags
12:57 jnthn There's am MVM_blah_i_forgot_GEN2 or so
12:57 jnthn See near top of 6model.h
12:57 nwc10 which doesn't nest.
12:58 jnthn What doesn't nest?
13:00 nwc10 turn on "direct to gen 2"
13:00 nwc10 call something
13:00 nwc10 turn on "direct to gen 2"
13:00 nwc10 turn off "direct to gen 2"
13:00 nwc10 return
13:00 nwc10 turn off "direct to gen 2"
13:02 jnthn No
13:02 jnthn We're talking about checking if a given collectable is already in gen2
13:02 jnthn Not forcing allocation there.
13:02 nwc10 ah OK, sorry for being a PEBKAC
13:03 jnthn Granted that mechanism doesn't nest, though, which could be considered fragile
13:03 jnthn Even more fragile is that it doesn't have a clue about exceptions, mind...
13:03 nwc10 IIRC there's already one code path which nests (well doesn't)
13:03 nwc10 and oh gosh, exceptions
13:03 nwc10 yes, this is where Perl 5 ends up with a private little stack of things to undo
13:07 FROGGS ./foo.nqp
13:07 FROGGS Unhandled exception: Bytecode stream version too high
13:07 FROGGS /o\
13:13 brrt oh, i see
13:13 brrt you'll need to recompile nqp then :-)
13:13 brrt (yes, that *****. it won't be necessary once i've merged with master)
13:15 jnthn .oO( sucks isn't swearing... )
13:17 brrt well.... i try to keep it family-friendly here :-)
13:20 FROGGS okay, will recompile nqp, hold on
13:22 * brrt holding on
13:22 FROGGS Return value: 4
13:22 FROGGS Loop nr: 14
13:22 FROGGS Return value: 279172874291
13:22 FROGGS \o/
13:22 brrt yes
13:22 brrt you can disassemble the output using objdump
13:23 brrt (if everything went well, you should have a file 'jitcode.bin'
13:23 brrt hangon, i'll give you the exact line
13:23 brrt objdump -D -b binary -m i386:x86-64 -M intel jitcode.bin
13:23 brrt aliased to disasm :-) in my file
13:24 brrt .bashrc file
13:24 FROGGS brrt: I've got something for ya: https://gist.github.com/FROGGS/8b90c0d93baccfee3acc
13:25 jnthn FROGGS++ Valgrind++
13:25 brrt oh..... that is such awesome
13:26 brrt you are so many heroes right now
13:26 FROGGS *g*
13:26 tadzik nice :)
13:26 FROGGS hope you can find the source of all evil now :o)
13:27 brrt i'll have a much better chance now
13:27 timotimo hooray for friendship!
13:27 oetiker joined #moarvm
13:29 tadzik it's magpi
13:29 tadzik magic *
13:32 jnthn .oO( The magpi, a bird that steals 3.14159265359 shiny things )
13:37 * brrt can repeat the issue, not yet fix it
13:47 brrt whut, it works
13:47 jnthn whut whut \o/
13:48 timotimo holy yay!
13:48 jnthn brrt++
13:48 brrt FROGGS++ :-)
13:54 FROGGS \o/
13:54 dalek MoarVM/moar-jit: d59f69b | (Bart Wiegmans)++ | src/jit/ (3 files):
13:54 dalek MoarVM/moar-jit: Initialize global labels prior to dasm setup.
13:54 dalek MoarVM/moar-jit:
13:54 dalek MoarVM/moar-jit: This fixes an issue whereby dasm memory and
13:54 dalek MoarVM/moar-jit: by extension machine code would be corrupted.
13:54 dalek MoarVM/moar-jit: FROGGS++ for finding the root cause.
13:54 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/d59f69b497
13:56 jnthn Now there's just a few more ops to do. ;-)
13:56 brrt this.. makes the addition part of our magic frame work :-)
13:56 jnthn \o/
13:56 brrt and return, etc
13:56 brrt but like you said
13:56 brrt just a few more ops :-D
13:57 brrt 638 - 4 = 634
13:57 jnthn Well, can be strategic :)
13:57 brrt by ops, I'm 0.75% done :-)
13:57 jnthn sp_getarg_* could be good next ones. :)
13:57 brrt yes
13:57 brrt arithmetic ops, too
13:57 jnthn Those are the optimzied ones, but provided you call it with the right types, it's all good.
13:58 jnthn Aye. :)
13:58 brrt (those are easy)
13:58 jnthn Yeah
13:58 FROGGS what does that mean exactly? does the operation that results in the value 4 really ends up as machine code?
13:58 brrt yes
13:58 brrt if all is correct , you'll get a file called 'jitcode.bin' in your pwd?
13:58 brrt that is the code that is called
13:59 FROGGS \o/ \o/ \o/
13:59 FROGGS -rw-r--r--   1 froggs froggs      93 Jun 12 15:23 jit-code.bin
13:59 brrt ok, you can dump that with the line i posted
14:00 brrt objdump -b binary -D -m i386:x86-64 -M intel jit-code.bin
14:00 FROGGS yes, I see.... things there
14:00 FROGGS brrt++ # fast things
14:01 FROGGS here is the dump: https://gist.github.com/FROGGS/00cc9c2b4c1443f4f613
14:01 brrt (the -M intel is for intel syntax, you can drop it for AT&T syntax, which some people prefer)
14:01 brrt i.e. I'd prefer it if I weren't forced to write intel syntax all day :-)
14:01 FROGGS hehe, I can't read any of them :o)
14:02 brrt that's not my most-recent checkout, right?
14:03 FROGGS not, that is the one from the valgrind run
14:03 brrt using valgrind made it correct, too
14:03 brrt funny
14:03 brrt anyway, i can guide you through it if you care?
14:03 FROGGS yes, running stuff in gdb or valgrind sometimes makes things work
14:04 FROGGS the instructions?
14:04 FROGGS I updated: https://gist.github.com/FROGGS/00cc9c2b4c1443f4f613
14:05 brrt I'll comment on your gist, how about that :-)
14:05 FROGGS +1
14:05 FROGGS :o)
14:05 FROGGS awesome!
14:10 timotimo linenoise is kinda stupid with regards to utf8 input and backspace :(
14:10 timotimo > s�ay %h
14:10 timotimo ===SORRY!===
14:10 timotimo Malformed UTF-8 at line 1 col 2
14:10 nwc10 oh. :-(
14:10 nwc10 that's LTA
14:11 timotimo i typo'd an umlaut after s, then backspaced over it and wrote ay %h instead
14:11 jnthn timotimo: It's possible to pass an arg to MoarVM's configure to build yourself one with readline instead.
14:21 timotimo mh
14:46 brrt there you go
14:46 * brrt is off for household chores
14:46 brrt left #moarvm
16:12 lizmat joined #moarvm
16:14 woolfy joined #moarvm
17:08 raiph joined #moarvm
17:10 raiph Did I just see bart get a 1 + 1 or similar to correctly moar-jit ?
17:11 lizmat not sure.. it went by so fast  :-)
17:13 raiph :P
17:14 jnthn raiph: Yes, pretty much
17:20 woolfy left #moarvm
17:33 jnap1 joined #moarvm
17:39 nebuchadnezzar is the moarvm build system specific or does it follow some conventions?
17:43 FROGGS I don't think it follows conventions yet
17:43 cognominal joined #moarvm
17:46 nebuchadnezzar I'm dumping %config to understand what is what ;-)
19:05 _sri joined #moarvm
21:13 lizmat joined #moarvm
22:14 lizmat joined #moarvm
22:31 dalek MoarVM/inline: 34dcc20 | jnthn++ | src/spesh/ (3 files):
22:31 dalek MoarVM/inline: Don't inline recursive things or incomplete spesh.
22:31 dalek MoarVM/inline:
22:31 dalek MoarVM/inline: Includes adding an assert suggested by nwc10++.
22:31 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/34dcc20add
22:32 woolfy joined #moarvm
22:32 jnthn nwc10: 34dcc20 should hopefully fix the other thing ASAN/Valgrind caught.
22:33 jnthn nwc10: Verification of that (and knowing any other failures) would be very welcome :)
22:33 timotimo jnthn: now implementing the method ann for QAST nodes
22:34 jnthn :)
22:34 jnthn brrt: On Windows, the maor-jit branch in Configure says "JIT isn't supported on MSWin32-x64-multi-thread yet."
22:35 timotimo an idea how much that ought to save?
22:36 jnthn timotimo: Not sure off hand but allocating the hash lazily will save a lot of hashes
22:38 dalek MoarVM/moar-jit: f939d2c | jnthn++ | Configure.pl:
22:38 dalek MoarVM/moar-jit: Make JIT probe recognize Win32 x64.
22:38 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/f939d2c128
22:44 lizmat perl5's approach:
22:44 timotimo mhm
22:44 lizmat $ perl -MData::Dumper -E 'my %h; $h{a}=\%h; say Dumper(\%h)'
22:44 lizmat $VAR1 = {
22:44 lizmat 'a' => $VAR1
22:44 lizmat };
22:44 lizmat oops, ww
22:44 jnthn brrt: The moar-jit build fails on MSVC with https://gist.github.com/jnthn/8a67ca154313a9dc6163 - it seems unhappy in a couple of ways.
22:45 jnthn brrt: I'll leave it with you, unless you can't figure it and want me to look deeper at it.
23:01 timotimo jnthn: how performant is the "associative_delegate" trait in nqp?
23:06 timotimo jnthn: what should i do if someone calls .hash on a QAST::Node; should that create the hash?
23:08 jnthn timotimo: associative_delegate is a blessing and a curse
23:08 jnthn timotimo: It makes the access very fast
23:08 jnthn timotimo: But it forces up-front allocation of the hash.
23:08 timotimo aye.
23:08 timotimo i can't get a delegate in place after the annotation has been mixed in, right?
23:09 jnthn Well, I'm not sure allowing <...> to magically work after the first .ann call is good API design.
23:09 jnthn The history of QAST nodes is that they were once basically capture-like things and inherited from NQPCapture.
23:10 jnthn The .list nature for the children still makes sense, but I kinda see the hash nature of it being annotations as being a kind of hangover...
23:10 timotimo ah, of course.
23:18 woolfy left #moarvm
23:34 timotimo so much work ...
23:35 timotimo fortunately i have a talk to prepare, so this counts as valid procrastination :)
23:42 timotimo sadly, now i'm running into a compile-time error that's neither "this type doesn't support associative operations" nor "the LHS of bind must be a n NQP::Var"
23:49 * timotimo has run into a NPE on jvm, null object on moarvm etc ...
23:51 timotimo somehow, in method trait_mod:<is>, the block_ast annotation turns out to be null :\
23:51 timotimo but it seems like i've changed all mentions of block_ast to use the .ann method already
23:53 timotimo turns out i never correctly set these annotations in the firs tplace %)

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