Camelia, the Perl 6 bug

IRC log for #moarvm, 2013-08-21

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

All times shown according to UTC.

Time Nick Message
00:30 diakopter hrm codepoint 48694944
01:20 dalek MoarVM: aaa8e98 | diakopter++ | src/ (3 files):
01:20 dalek MoarVM: - safer backtracing
01:20 dalek MoarVM:
01:20 dalek MoarVM: - new --crash command line option to segfault instead of exit, to more easily catch in debugger...
01:20 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/aaa8e98067
01:30 FROGGS_ joined #moarvm
02:03 JimmyZ ..\moarvm.exe --crash nqp.moarvm -e "say(420)"
02:03 JimmyZ Illegal option --y(420)
02:03 JimmyZ diakopter: ^^
02:04 diakopter heh
02:06 diakopter weird..
02:06 dalek MoarVM: 66d010a | diakopter++ | src/main.c:
02:06 dalek MoarVM: remove debug
02:06 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/66d010a508
02:06 diakopter I don't get that
02:06 JimmyZ ..\moarvm.exe --crash nqp.moarvm temp.moarvm
02:06 JimmyZ Failed to tell position of filehandle:
02:07 diakopter wat
02:07 JimmyZ I'm sure it's about args
02:07 JimmyZ it's about temp.moarvm
02:11 JimmyZ hmm, ..\moarvm.exe --dump  nqp.moarvm segfault
02:14 diakopter JimmyZ: something must be very different about your setup
02:14 diakopter from mine
02:15 JimmyZ I'm trying rebuild
02:16 FROGGS joined #moarvm
02:21 JimmyZ yes, it's segfault
02:21 JimmyZ MVMuint32 ann_offset = GET_UI32(frame->body.annotations, j*10);   here
02:48 diakopter I don't see why
02:48 diakopter how
02:49 benabik "Illegal option --y(1)"
02:49 benabik Also, no args: "MVMArray: Can't shift from an empty array", with lists of <unknown>s in the backtrace.
02:49 JimmyZ yes
02:50 JimmyZ I saw them
02:51 benabik `../moarvm --crash nqp.moarvm temp.moarvm` does nothing, interestingly enough.
02:51 benabik No segfaults though.  :-D
02:51 JimmyZ ..\moarvm.exe --dump  nqp.moarvm
02:52 JimmyZ will be segfault
02:52 benabik nope.  108k lines of output
02:53 JimmyZ MVMuint32 ann_offset = GET_UI32(frame->body.annotations, j*10);   segfault here
02:58 sorear joined #moarvm
03:07 JimmyZ compile time is apain....
03:13 diakopter JimmyZ: which OS/compiler are you using again
03:13 diakopter I'll try to reproduce
03:13 JimmyZ msvc 2012
03:13 JimmyZ express
03:13 JimmyZ x64
03:14 diakopter oh 2012..
03:14 diakopter i'll try that; jnthn & I use 2010
03:18 JimmyZ hmm, how 'sa' ea '--' ?
03:19 JimmyZ that's why "Illegal option --y(1)"
03:19 JimmyZ s/ea/eq/
03:26 JimmyZ diakopter: nqp::say(nqp::substr('say(42)', 0, 2) eq '--');
03:26 diakopter what about it
03:26 JimmyZ diakopter: run as nqp nqp-moar-cc.nqp test.nqp
03:27 JimmyZ you will got 1
03:27 diakopter wat.
03:27 JimmyZ diakopter: nqp::say('sa', eq '--'); will be 0
04:17 benabik nqp::say("'" ~ nqp::substr('say(1)', 0, 2) ~ "'");  outputs nothing
04:18 diakopter ergh
04:18 benabik Huh.  nqp::say is broken for me?
04:19 diakopter try reverting the last couple commits?
04:21 benabik Tests seem to complete though.  Don't those rely on output?
04:22 diakopter :D
04:22 benabik Hm.  Probably just that it's exiting before running the code for some reason.
04:22 diakopter did you try reverting the last copule commits?
04:23 benabik Yes.
04:29 diakopter hrm
04:31 benabik eh.  I should sleep.
04:47 JimmyZ nqp::say(nqp::substr('say(42)', 0, 2));
04:47 JimmyZ nqp::say('sa' eq '--');
04:47 JimmyZ nqp::say(nqp::substr('say(42)', 0, 2) eq '--');
04:47 JimmyZ outputs : sa, 0, 1
04:51 JimmyZ nqp::say("'" ~ nqp::substr('say(1)', 0, 2) ~ "'"); outputs: 'sa'
06:05 FROGGS joined #moarvm
06:25 not_gerd joined #moarvm
06:25 not_gerd o/
06:25 JimmyZ \o, not_gerd
06:25 not_gerd lots of fail in the test suite :(
06:25 JimmyZ ;)
06:25 not_gerd any reason for using fake_crash() instead of plain old abort()?
06:26 JimmyZ fake_crash?
06:26 JimmyZ I don't know about it
06:28 not_gerd it's what get's called by --crash
06:28 not_gerd it does printf("%s", (char *)(1));
06:28 not_gerd ie causes  the libc to segfault
06:29 not_gerd if the goal is just to cause a core dump, it's cleaner to just call abort()
06:30 JimmyZ oh, I see it
06:31 JimmyZ yesh, libuv use abort heavily in mutex
06:39 diakopter not_gerd: oh.
06:39 dalek MoarVM/abort: f9a931a | (Gerhard R)++ | src/core/exceptions.h:
06:39 dalek MoarVM/abort: Fix prototype of MVM_crash_on_error()
06:39 dalek MoarVM/abort: review: https://github.com/MoarVM/MoarVM/commit/f9a931a06b
06:39 dalek MoarVM/abort: 7388198 | (Gerhard R)++ | src/ (2 files):
06:39 dalek MoarVM/abort: Use abort() instead of custom fake_crash()
06:39 dalek MoarVM/abort: review: https://github.com/MoarVM/MoarVM/commit/7388198d8b
06:40 not_gerd diakopter: feel free to merge ^^
06:40 diakopter how to merge?
06:41 JimmyZ $ git merge abort
06:41 not_gerd (assuming there's no deeper reason behind using a custom fake_crash(), of course)
06:41 diakopter why didn't you commit to master
06:41 diakopter no, I'm a newbie
06:43 diakopter please commit to master
06:43 dalek MoarVM: f9a931a | (Gerhard R)++ | src/core/exceptions.h:
06:43 dalek MoarVM: Fix prototype of MVM_crash_on_error()
06:43 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/f9a931a06b
06:43 dalek MoarVM: 7388198 | (Gerhard R)++ | src/ (2 files):
06:43 dalek MoarVM: Use abort() instead of custom fake_crash()
06:43 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/7388198d8b
06:44 arnsholt diakopter: Just "git merge $branchname" merges $branchname into your current branch
06:44 JimmyZ arnsholt: diakopter is modest
06:44 diakopter no
06:44 diakopter I'm not
06:45 diakopter I'm seriously a newbie
06:45 diakopter but I did mis-ask when I asked how to merge
06:45 diakopter I meant how to merge a pull request that didn't exist yet
06:45 diakopter I didn't realize it was a branch
06:45 arnsholt Oh, right!
06:45 arnsholt Merging a non-existent PR would be hard, yeah =D
06:46 diakopter anyone know which commit made all the fail in the test suites?
06:50 crab2313 joined #moarvm
06:51 FROGGS diakopter: no, but I can bisect it
06:51 dalek MoarVM: 03ef595 | (Gerhard R)++ | src/main.c:
06:51 dalek MoarVM: s/segfault/abort/ and some whitespace fixes
06:51 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/03ef5952f4
06:59 JimmyZ not_gerd: how about to change #ifdef CLOCK_REALTIME to #ifndef __APPLE__
07:00 JimmyZ or #ifdef __APPLE__
07:00 not_gerd JimmyZ: it's better to test for features than architectures
07:01 not_gerd there might be other POSIX systems without clock_gettime()
07:01 JimmyZ oh yes
07:01 not_gerd diakopter: the changes to nqp-cc/src/QASTCompilerMAST.nqp broke the tests
07:01 not_gerd git checkout 211ab0b19f25b8c81685a97540f4b1491eb17504 -- nqp-cc/src/QASTCompilerMAST.nqp
07:02 not_gerd ^^ works
07:02 diakopter which changes
07:03 not_gerd see  git diff 211ab0b19f25b8c81685a97540f4b1491eb17504 -- nqp-cc/src/QASTCompilerMAST.nqp
07:03 FROGGS https://github.com/MoarVM/MoarVM/commit/​211ab0b19f25b8c81685a97540f4b1491eb17504
07:03 diakopter ?
07:03 not_gerd rather https://github.com/MoarVM/MoarVM/commit/​9910a6a9ed8463a96aace9e0fd76597602c14c48
07:03 diakopter that's not a change to an .nqp file
07:03 not_gerd 211ab is the working commit
07:04 FROGGS ahh
07:04 diakopter okay, so calling clargs is what breaks it
07:08 * diakopter tries random crap to fix it
07:16 crab2313 joined #moarvm
07:17 diakopter well the first thing to do is fix the stupid annotations
07:18 not_gerd diakopter: https://github.com/MoarVM/MoarVM/commit/​10153a345799afac0c475acc3aca2accb286d47e
07:18 not_gerd needs to be reverted
07:18 not_gerd MVM_hll_current(tc)->slurpy_array_type apparently isn't wired up yet
07:18 not_gerd (or broken)
07:19 JimmyZ MVM_hll_current(tc)->slurpy_array_type is right
07:19 diakopter ?
07:19 diakopter JimmyZ: what do you mean it's right
07:19 not_gerd JimmyZ: reverting that commit fixes my test failures
07:20 JimmyZ what failures?
07:21 diakopter all of them?
07:21 not_gerd JimmyZ: all qast tests of nqp-cc
07:21 not_gerd wait...
07:21 not_gerd they fail again :(
07:22 * not_gerd makes clean and tests again
07:23 JimmyZ diakopter: I mean it's still tc->instance->boot_types->BOOTArray :-)
07:24 diakopter what is "it" there?
07:24 cognominal joined #moarvm
07:28 not_gerd it's not ->slurpy_array_type - the tests just worked because I still had the version of QASTCompilerMAST.nqp that does not call clargs checked out :(
07:29 diakopter oh
07:29 diakopter okay, so is the problem my change to what clargs does in a later commit?
07:29 diakopter or does checking out that "broken" commit entirely still work
07:31 not_gerd http://xkcd.com/303/
07:31 jnthn moarning
07:31 not_gerd o/
07:31 diakopter jnthn: hi. apparnetly I'm stpiders ther stpidnsf
07:32 diakopter <- furious at self for forgetting about abort
07:33 FROGGS hey, this is a channel where we bless $self :o)
07:33 cognominal joined #moarvm
07:34 diakopter <- livid at self for lots of other things from the past few hours I won't mention
07:34 diakopter <- in a blind rage at self
07:34 TimToady diakopter: you just don't want to look as stupid as the rest of us usually are :)
07:35 diakopter :/
07:35 TimToady s'okay, we all have our off moments
07:35 diakopter not_gerd: if only my code were compiling :P
07:35 diakopter then I'd be fencing
07:35 diakopter or at least playing ping pong
07:36 jnthn Maybe do some ping pong then come back to the code? :)
07:36 diakopter well I don't even know enough to blame you or not :P so I don't know whether to ask you to look at it.. and I don't know how to figure out the next step for figuring out the next step
07:37 jnthn coffee??
07:37 diakopter yeah but
07:38 diakopter supposedly I have to be at work in 8 hours
07:40 diakopter jnthn: well I guess I shoudl ask you to look at it
07:40 * diakopter rickrolls self
07:40 diakopter (again)
07:40 diakopter 3 minutes 34 seconds of awesomeness
07:41 diakopter well the current crash is in apr file close
07:41 diakopter sigh.
07:46 TimToady well, pace yourself; you know what they say: Time is the universe's way of keeping everything from happening all at once.
08:14 _ilbot joined #moarvm
08:14 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
08:15 diakopter the cross compiler doesn't know about it
08:15 JimmyZ nqp -e "nqp::clargs()" does not work either
08:15 * not_gerd guessed it was like that
08:16 diakopter yes, it's a moarvm op, not an nqp op
08:18 jnthn aye, there's not an nqp::op for it
08:20 diakopter jnthn: does nmake test pass for you?
08:20 diakopter (before you git pull)
08:20 jnthn Before I pulled nmake nqptest did at least work for me...
08:21 diakopter yeah but that's not the thing :)
08:21 diakopter that's broken
08:21 jnthn (and I just built latest)
08:21 jnthn (and nqptest seems to work)
08:21 diakopter right, but that's not the thing that's broken
08:21 jnthn hm, some failures in make test...wtf
08:22 diakopter qast has a different expectation about something or other
08:22 diakopter or I broke something
08:22 jnthn oh...
08:22 diakopter 'ts why I was curious how yours did after your last commit
08:23 jnthn wait, I ran make test and make nqptest at the same time and they raced for the temp.moarvm
08:23 diakopter heh
08:23 diakopter well
08:23 jnthn yes, that's better...but the qast ones appear to fail
08:23 not_gerd jnthn: 9910a6a breaks it for me by emitting a call to :moarop('clargs')
08:24 jnthn OK
08:24 not_gerd we already tracked it down that far ;)
08:24 jnthn But...are we passing any args?
08:24 diakopter yeah but I made changes to the clargs stuff after that commit
08:24 diakopter so I still don't know whether it was working find at that commit
08:25 dalek MoarVM: 13dbc8c | diakopter++ | src/core/bytecodedump.c:
08:25 dalek MoarVM: slightly more robust
08:25 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/13dbc8cc54
08:25 diakopter anyway that'll help slightly
08:25 diakopter args, tabs
08:26 jnthn ooh...
08:26 jnthn We always pass foobar foobaz over for all tests it seems
08:27 jnthn As command line args
08:27 diakopter oh yeah :)
08:31 not_gerd 9910a6a9ed8463a96aace9e0fd76597602c14c48 is already broken here
08:32 jnthn Guess that'll teach me to run make test as well as make nqptest :)
08:33 jnthn Looks like it doesn't break what the tests are testing so much as our ability to invoke them, however...
08:34 jnthn Can look later; should $dayjob
08:51 keta joined #moarvm
08:52 keta left #moarvm
08:58 Tene joined #moarvm
10:06 diakopter jnthn: could the annotations be getting the wrong values b/c of boxing?
10:06 jnthn Sounds unlikely
10:07 diakopter well the numbers are wrong, as shown by --dump
10:09 dalek MoarVM: e0ac69a | (Gerhard R)++ | / (2 files):
10:09 dalek MoarVM: Do not rely on APR for byte order detection
10:09 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/e0ac69adab
10:09 not_gerd another tiny bit of APR gone
10:12 diakopter not_gerd++
10:13 jnthn diakopter: You still plotting the libatomic_ops update?
10:17 diakopter eh
10:18 jnthn diakopter: As in, planning to do...
10:18 jnthn So we can finish switching over to it from the APR atomics...
10:19 diakopter well we could switch now I thought
10:19 diakopter just increasing some storage size
10:20 jnthn No, we're missing the CAS variant that returns what it saw.
10:21 diakopter well like I said you can always just read it again :P it's not like there's any more risk of losing a race.. just means you can try less often
10:21 diakopter (but yes, let's get the new lao asapractical)
11:29 JimmyZ hmm, what about apr_getopt_long
11:35 not_gerd btw, should we really remove the GPL portions of libatomic_ops?
11:35 JimmyZ I'd like to add struct { char *shotopt, char *longopt, int default, char *help }
11:35 not_gerd it's enough to just not link against (or even build) libatomic_ops_gpl
11:36 not_gerd if we actually want to remove source files under the GPL, the test files should have been removed as well
11:36 JimmyZ I'd like to remove GPL part...
11:36 JimmyZ I think we doesn't need test actully for 3rd
11:36 not_gerd *libatomic_ops_gpl.a
11:36 JimmyZ as libuv
11:38 JimmyZ We only need test when we're patching it
11:42 JimmyZ I mean we don't need to maintain 3rd test
11:50 JimmyZ not_gerd: how about add struct { char *shotopt, char *longopt, int default, char *help } to replace apr_getopt_long?
11:50 JimmyZ *shortopt
11:53 not_gerd using which code to actually parse the arguments?
11:54 JimmyZ strcmp
11:54 not_gerd ;)
11:55 JimmyZ MVM_opt opts[] = { {"-d", "--dump",0, "Dump moarvm code"}, .... }
11:56 JimmyZ so just need strcmp
11:57 JimmyZ or ,add int has_args in struct, for if an opt has arg or not
11:57 JimmyZ struct { char *shotopt, char *longopt, int has_args, int default, char *help }
12:08 JimmyZ jnthn: ^^
12:10 JimmyZ struct { char *shotopt, char *longopt, int has_args, char *default_arg, int is_default, char *help } :-)
12:10 JimmyZ *short
12:20 benabik joined #moarvm
12:31 JimmyZ *strncmp
12:58 not_gerd bye, #moarvm
12:58 not_gerd left #moarvm
13:02 yoleaux joined #moarvm
14:43 FROGGS joined #moarvm
14:55 jnap joined #moarvm
15:55 crab2313 joined #moarvm
15:56 JimmyZ Good night
15:56 diakopter o/
16:22 cognominal joined #moarvm
17:17 timotimo joined #moarvm
18:14 not_gerd joined #moarvm
18:14 not_gerd o/
18:15 not_gerd so, we can no longer use APR for getopt
18:15 not_gerd should we import another 3rdparty lib or roll our own version?
18:16 not_gerd the latter could turn out to be a pita to get right if we want to support more complex arguments
18:17 not_gerd right now, all we need to check is flags, which is trivial...
18:48 dalek MoarVM: 9acf7bc | (Gerhard R)++ | src/moarvm. (2 files):
18:48 dalek MoarVM: Fix prototypes of MVM_vm_run_file() and MVM_vm_dump_file()
18:48 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9acf7bc846
18:48 dalek MoarVM: 550002b | (Gerhard R)++ | src/main.c:
18:48 dalek MoarVM: No longer use APR for command line arg parsing
18:48 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/550002b471
18:48 not_gerd [x] done
18:51 FROGGS awesome!
18:51 FROGGS not_gerd++
18:51 * FROGGS pulls
18:52 not_gerd hope it still works ;)
18:52 FROGGS still? the segfault from yesterday ways fixed?
18:53 diakopter depends which one you mean
18:53 not_gerd should have clarified: I hope the frontend executable still works
18:53 FROGGS the one we bisected
18:53 not_gerd FROGGS: that's not yet fixed
18:54 FROGGS k
19:08 not_gerd diakopter: should I base our libatomic_ops import on HEAD?
19:08 not_gerd there was a ChangeLog update today, last real commit Aug17
19:10 jnthn I'll look into fixing the other one this evening.
19:40 jnap1 joined #moarvm
20:14 diakopter not_gerd: yeah I think head is fine
20:16 not_gerd I think I ripped out everything we don't want
20:16 not_gerd should I create a private libatomic_ops fork or should that go to MoarVM/
20:16 diakopter just shove it in for now :)
20:16 diakopter jnthn hasn't finished deciding about the external repo integration
20:18 jnthn Oh, I thought he had :P
20:18 diakopter it wasn't communicated to me
20:18 jnthn He's only so decisive :P
20:18 jnthn But srsly, having been being pondering it, I think the best bet is that we keep such things as forks/repos under the MoarVM account on GitHub.
20:19 jnthn I'm hopeful that we'll be able to use the system versions of various dependencies in the future.
20:19 jnthn When they're avaialable, that is.
20:19 jnthn It matters to various packagers.
20:20 diakopter they can't care as much if we modify it extensively
20:20 not_gerd anyway - https://github.com/gerdr/li​batomic_ops/commits/moarvm
20:23 diakopter ok
20:23 diakopter doesn't look too different from what I did
20:24 jnthn diakopter: True :)
20:26 not_gerd I guess configure.ac shouldn't really call LT_INIT(), but my autotools-fu is not that strong
20:26 not_gerd the build workd fine as-is
20:26 not_gerd *works
20:32 donaldh joined #moarvm
20:32 jnthn diakopter: Don't suppose you got anywhere with the weird substr bug?
20:33 diakopter jnthn: i was braindead; should've been asleep; no
20:35 jnthn ok
20:43 dalek MoarVM: 55c9392 | jnthn++ | nqp-cc/ (2 files):
20:43 dalek MoarVM: Fix clargs test; also make testing more flexible.
20:43 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/55c93927a7
20:44 FROGGS here, http://irclog.perlgeek.de/​perl6/2013-08-21#i_7479412
20:44 FROGGS ww
21:00 jnthn ahahahaha... https://github.com/jnthn/nqp-jvm-prep/commi​t/5312f5c33587e6367186189e3e3a90b292282b37
21:00 diakopter heh ok
21:01 jnap joined #moarvm
21:04 FROGGS jnthn: and this patch is missing here?
21:04 jnthn yeah
21:04 jnthn applying now
21:09 dalek MoarVM: 6cdcccb | jnthn++ | nqp-cc/t/qast/qast_ (11 files):
21:09 dalek MoarVM: Unbest make test (threads.t aside).
21:09 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/6cdcccb468
21:11 jnthn Much cleaner again now.
21:11 jnthn nqptest also looking good
21:11 diakopter jnthn++ hard work
21:11 jnthn So, nobody broke too much today :)
21:11 not_gerd jnthn++
21:14 diakopter jnthn: do you have time to investigate the wrong annotation values?
21:23 jnthn diakopter: Time, perhaps. Energy...hmm :)
21:23 * jnthn somehow got quite tired from $dayjob tasks today...
21:23 jnthn oh, I guess I slept badly too...
21:24 FROGGS well, $beer @couch can be awesome too
21:39 jnthn The annotations that --dump spit out look quite hosed
21:39 jnthn annotation: 4A6E3A9C34CAB208344593CF090B214BCD2634AE:0
21:40 diakopter right; they did before I added the guard too
21:41 diakopter I've never seen them look right
21:41 diakopter so it's burgeon territory
21:43 jnthn Well, the code to write them looks OK
21:45 jnthn oh, I think I know what this might be...
21:46 jnthn struct MVMBytecodeAnnotation { MVMuint32 bytecode_offset; MVMuint16 filename_string_heap_index; MVMuint32 line_number;
21:46 jnthn };
21:46 jnthn That probably doesn't work out too well; it will probably shove 16 bytes padding after the 16-bit field so the 32-bit one is aligned.
21:47 jnthn Also, endianness...
21:50 jnthn (working on a fix)
21:51 not_gerd on a related note, is the bytecode guaranteed to be aligned correctly?
21:52 not_gerd otherwise, the GET_I* macros may segfault on architectures that don't support unaligned access
21:53 not_gerd not every architecture is as forgiving as x86
21:54 jnthn not_gerd: No, it's not, and on such architectures we'll need to manipulate the bytecode, just as we already have to on big-endian.
21:55 not_gerd I guess we'll wait to cross that bridge until it becomes an issue ;)
21:56 jnthn aye
21:56 not_gerd as long as there's a plan on how to deal with it, everything's good
21:56 jnthn "First, make a product that people *want* on their platform" :)
22:07 not_gerd jnthn: I also did some thinking on how to get a JIT compiler into Rakudo/MoarVM
22:07 not_gerd see https://gist.github.com/gerdr/68fbfbab5baf55dfd98a for some bikeshedding
22:13 jnthn diakopter: I'm not sure that the op and instr in the backtraces add much value...
22:13 jnthn Are you terribly attached to them?
22:14 dalek MoarVM: 71576da | jnthn++ | src/ (6 files):
22:14 dalek MoarVM: Fix bytecode annotation lookup.
22:14 dalek MoarVM:
22:14 dalek MoarVM: It made bad assumptions about C structure packing and didn't handle
22:14 dalek MoarVM: endianness right. Still doesn't in bytecodedump, though it at least
22:14 dalek MoarVM: looks a lot righter on little endian now.
22:14 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/71576dab77
22:14 dalek MoarVM: 97942bf | jnthn++ | src/core/exceptions.c:
22:14 dalek MoarVM: Don't leak annotation lookup result.
22:14 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/97942bff58
22:15 TimToady not_gerd: when you say "type inference" I think that in addition to multi prediction, it will have a lot of optimization potential for propagating lazy/sink/eager/hyper/race context inward at the same time
22:16 not_gerd TimToady: does this pass a basic sanity check?
22:16 TimToady in particular, lists that don't have to have the lazy apparatus can be batched or done as a whole as P5 does
22:16 TimToady not_gerd: I'm not an expert in the low-level bits of it, but it sounds goodish
22:17 FROGGS joined #moarvm
22:17 TimToady I suspect the current approach will be to just stay within hailing distance rather than targeting a JIT off the bat
22:17 TimToady but it might be good to think about whether anything in the instruction set would preclude that later
22:18 TimToady jnthn++ et al have been doing a pretty good job of keeping the instructions simple, from my (distant) viewpoint
22:18 jnthn Having pondered the JIT stuff, my feeling is that getting the REPR specialization stuff in place probably has a lot of bang for buck.
22:18 jnap joined #moarvm
22:19 TimToady well, that's where the type inference rubber meets the instruction set road
22:19 TimToady assuming we're not in a flying car
22:19 jnthn It's not so much inference as "OK, we observe we get these things"
22:19 not_gerd does Rakudo support multi-dispatch on REPRs?
22:19 TimToady you mean at run time?
22:20 jnthn Not short of where .REPR eq ...
22:20 * TimToady is hoping for a little more compile-time smarts too...
22:20 jnthn TimToady: Well, we're already doing a little of that, too. Though it can also go a lot further.
22:20 jnthn That is, multi inlining at compile time.
22:21 not_gerd well, multi-dispatch on REPR would be more or less a pre-requisite to make my particular idea work
22:21 TimToady I think optimizing away laziness will also be a biggie
22:23 jnthn not_gerd: I suspect that's the wrong factoring.
22:23 not_gerd jnthn: in what way?
22:24 jnthn It's as interesting for single-dispatch or just any frame really.
22:25 not_gerd jnthn: so promote single-dispatch to potentially-multi dispatch
22:25 jnthn I think what we're looking at is below the level of actually manipulating the Rakudo-level multi candidate lists.
22:25 not_gerd any callsite that does not call a sun with complete type information should be made multi-able
22:26 jnthn I don't think MoarVM should actually have that deep knowledge of how Rakudo lays its Routine out. Knowing about the multi cache, however, is fine.
22:27 not_gerd jnthn: triggering dynamic recompilation would happen Rakudo-side
22:27 jnthn That sounds like the kind of coupling I really don't want.
22:28 * not_gerd digs out a video to somewhat related work by oracle labs
22:28 jnthn The reason we have all of the 6model ops as MoarVM ops is so we can push the interesting semantic info down VM-wards.
22:29 not_gerd jnthn: arguments can be made that some stuff wants to happen at a high level
22:29 jnthn Sure, but not JIT repr-specialization, IMO
22:29 not_gerd I believe that's the video I was thinking about: http://medianetwork.oracle.co​m/video/player/1785432528001
22:30 jnthn That's not the vision I had when I designed 6model a few years ago, anyways. :)
22:30 jnthn oh yay, the video to go with the slides! :)
22:31 jnthn not_gerd: I'll certainly watch that, though not tonight. :)
22:31 not_gerd jnthn: where would you image to hook in repr-specialization if not the multi-dispatcher?
22:32 not_gerd I see that as a very convenient point to wire up arbitrary recompilation
22:32 not_gerd after all, reprs are just another type of polymorphism
22:33 jnthn not_gerd: When a bytecode frame gets JIT-compiled, the JITted code would be type+REPR-conditional
22:34 jnthn A lot of code will be monomorphic in both dimensions.
22:35 jnthn for example, consider a submethod BUILD() { $!foo = 42 }
22:35 jnthn There's likely not many types self can be, and possibly only ever a given REPR
22:36 jnthn s/given/single/
22:37 jnthn Then observing that if self starts with a given REPR, it's going to keep it, and given it's probably P6opaque, the $!foo lookup can almost certainly be JIT-compiled into adding an offset to the self pointer.
22:38 jnthn To a limit, a given frame may have several JITted specialized variants.
22:38 TimToady assuming no MI chicanery, of course...
22:38 jnthn Right. :)
22:39 jnthn MI throws you back onto the unoptimized path.
22:40 jnthn My idea was to initially prototype this stuff by specializing to an intermediate form we could JIT from, but then interpreting it to start with.
22:40 jnthn Which should still come out ahead.
22:41 * TimToady is in favor of coming out ahead
22:41 jnthn Building it that way would naturally lead us to separate the analysis/specialization logic from the details of a particular CPU instruction set, which is likely also good design.
22:42 jnthn .oO( It may also mean I can focus on the specialization logic and get away with emitting the machine code... :P )
22:43 jnthn Inlining I guess gets intresting once you start coalescing the guards...
22:43 jnthn um, however you spell it... :)
22:44 TimToady intRESTing?
22:45 jnthn oh, I thought I got coalescing wrong :P
22:50 not_gerd well, I still like my idea because it automatically takes care of guard clauses
22:51 not_gerd assuming sufficietly smart type propagation, the type information will bubble all the way down and call-sites further down the call chain
22:51 not_gerd s/and/to/
22:58 not_gerd I think I'll just post an example of how I image this to work out before going to bed
22:59 not_gerd say foo(x) calls bar(x)
22:59 not_gerd at a particular call site, foo() gets called with x of type int 3 times in a row
22:59 not_gerd if there's no multi for foo(int), we generate one
22:59 not_gerd type inference will show that bar() also necessarily gets called with type int, and we force-compile bar() as well with correct type information
23:00 not_gerd the bar() callsite within that particular foo() becomes static and the guard has been pushed up to the call site of foo()
23:04 not_gerd needs to get some sleep o/
23:04 not_gerd left #moarvm
23:15 BenGoldberg joined #moarvm
23:18 jnthn sleep also &
23:35 FROGGS joined #moarvm
23:40 cognominal joined #moarvm

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