Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-06-08

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

All times shown according to UTC.

Time Nick Message
01:45 FROGGS joined #moarvm
02:44 btyler joined #moarvm
06:24 nwc10 jnthn: not broken. Try harder.
07:24 FROGGS "stout-enhanced"??
07:24 FROGGS *shudder*
07:38 brrt joined #moarvm
08:16 vendethiel joined #moarvm
10:08 vendethiel joined #moarvm
10:14 jnthn o/
10:15 nebuchadnezzar yo
10:30 FROGGS o/
10:34 brrt \o
10:35 timotimo o_
10:36 brrt &lunch; reading http://site.iugaza.edu.ps/hzaq/files/2010/02/Code_generation_using_tree_matching_and_dynamic_programming,.pdf which is interesting
10:57 FROGGS[mobile] joined #moarvm
11:31 dalek MoarVM/inline: 21b669e | jnthn++ | src/spesh/inline.c:
11:31 dalek MoarVM/inline: Simple type-matching case of return -> goto.
11:31 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/21b669e53e
12:04 dalek MoarVM/inline: 16214b3 | jnthn++ | src/spesh/inline.c:
12:04 dalek MoarVM/inline: Handle auto-boxing returns in inline.
12:04 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/16214b3627
12:27 brrt joined #moarvm
12:41 jnthn brrt: How're things going? :)
12:42 brrt hey, well, to be totally honest, i'm kind of stuck on the 'ponder the form of the jit graph' phase
12:43 jnthn ah
12:44 jnthn Well, if pondering isn't producing a way forward, implementing something that could possibly work and evolving it as you gradually need to make more things work might be a better direction.
12:44 brrt thats also a good idea, of course
12:44 FROGGS[mobile] that is what I usually do
12:45 jnthn Code doesn't lie.
12:45 brrt there are obviously quite a few technicalities that i can get working on that don't involve knowing the exact shape
12:45 jnthn Implementing an idea is often the fastest way to figure out if it's a good one or not, in my experience.
12:45 brrt true
12:46 brrt i'm just feeling like i don't know enough yet
12:50 brrt i guess thats my problem with a lot of projects - i try to figure out the hard things first, figuring the 'easy' stuff - i.e. stuff i understand - can come later
12:55 masak +1 on "working code trumps deep up-front thinking"
12:56 jnthn I think I'd just try to get an end-to-end small thing working (like, the add a couple of numbers of hello world one).
12:56 masak I fully endorse deep thinking, and I greatly enjoy it, but the quality deep thinking I get done is when I have some small running piece of code failing some core expectation.
12:56 jnthn Even if part of it is a throwaway, it will probably help get you over the hill, and be informative.
12:57 brrt ok, thats totally true in here, too :-)
12:58 brrt its just, i can already /see/ the naive throwaway code fail ...
12:58 brrt but i'm convinced
12:58 dalek MoarVM/inline: 004f5b0 | jnthn++ | src/spesh/dump.c:
12:58 dalek MoarVM/inline: Dump facts from inlinees also.
12:58 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/004f5b015a
12:58 dalek MoarVM/inline: 57b8bd0 | jnthn++ | src/spesh/candidate.c:
12:58 dalek MoarVM/inline: Ensure spesh log is flushed out to disk.
12:58 dalek MoarVM/inline:
12:58 dalek MoarVM/inline: If we SEGV shortly after writing it, it's very valuable to have the
12:58 dalek MoarVM/inline: full log.
12:58 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/57b8bd0040
13:44 brrt jnthn - its a reasonable assumption that a jit entry point will be given a MVMFrame, no?
13:44 jnthn brrt: Yes, or can always obtain it by being given a tc and doing tc->cur_frame
13:45 brrt hmmm
13:45 brrt why, thats even simpler
13:45 brrt although, perhaps its not
13:47 dalek MoarVM/inline: 7dec344 | jnthn++ | src/spesh/inline.c:
13:47 dalek MoarVM/inline: Merge fact counts table when merging the facts.
13:47 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/7dec34478e
13:47 dalek MoarVM/inline: 6a0aba0 | jnthn++ | src/spesh/inline.c:
13:47 dalek MoarVM/inline: Add usage information to inline graph.
13:47 dalek MoarVM/inline:
13:47 dalek MoarVM/inline: Otherwise, dead code elimination will go swallowing all the things.
13:47 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/6a0aba0dfd
13:52 vendethiel joined #moarvm
13:57 dalek MoarVM/inline: 33f9d0a | jnthn++ | src/spesh/optimize. (2 files):
13:57 dalek MoarVM/inline: Collect arg-related instructions in call info.
13:57 dalek MoarVM/inline:
13:57 dalek MoarVM/inline: This will make the available for the inliner to quickly access and
13:57 dalek MoarVM/inline: tweak.
13:57 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/33f9d0a04c
13:57 dalek MoarVM/inline: e23499f | jnthn++ | src/spesh/inline.c:
13:57 dalek MoarVM/inline: Re-write basic arg passing to set, invoke to goto.
13:57 dalek MoarVM/inline:
13:57 dalek MoarVM/inline: With this, the inline transform for basic cases is now in place; main
13:57 dalek MoarVM/inline: reason for things to not work out now is missing deopt updates.
13:57 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/e23499f581
14:10 zakharyas joined #moarvm
14:40 brrt ok, now i know how to compile a relative address in dynasm
14:42 brrt do we have an offsetof macro?
14:43 brrt .. i don't think we do
14:43 brrt we do have alignof
14:44 brrt offsetof is defined in stddef.h
14:44 brrt think its fair to include that?
14:54 timotimo i think i've used offsetof somewhere before
14:54 jnthn brrt: Seems reasonable.
14:54 timotimo and didn't include something more manually
14:54 timotimo maybe it's "already in there" on gcc? but then the windows build would have exploded
14:55 jnthn Yeah, I thought we mighta had it before...
14:55 brrt not in the current source :-)
14:55 jnthn Don't find a use of it in current source, though
14:55 brrt (ackoriding to ack)
14:55 timotimo oh
14:55 jnthn Anyway, that header and macro exists with MSVC too
14:55 timotimo i must have done that in a branch i later discarded or something
14:55 jnthn For many versions back
14:59 timotimo that must be the patch where i tried to build the specialized accessors for some repr or other
15:00 timotimo i think it was get_int and such, or something similar
15:00 brrt there are only two compilers and operating systems :-p windows and posix
15:05 vendethiel joined #moarvm
15:16 jnthn joined #moarvm
15:23 cognominal__ joined #moarvm
15:37 dalek MoarVM/inline: d4df6a0 | jnthn++ | src/ (5 files):
15:37 dalek MoarVM/inline: Sketch out inlines table.
15:37 dalek MoarVM/inline:
15:37 dalek MoarVM/inline: Will track extents in the bytecode where we have inlined code from
15:37 dalek MoarVM/inline: another frame.
15:37 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/d4df6a0f69
15:52 dalek MoarVM/moar-jit: 7e8418b | (Bart Wiegmans)++ | src/jit/ (3 files):
15:52 dalek MoarVM/moar-jit: Compile jit entry/exit stuff so we don't forget our frame
15:52 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/7e8418b9e7
15:52 dalek MoarVM/moar-jit: ad88672 | (Bart Wiegmans)++ | src/ (3 files):
15:52 dalek MoarVM/moar-jit: Allocate the rbx register for the MVM register base.
15:52 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/ad88672136
15:52 dalek MoarVM/moar-jit: 50bc894 | (Bart Wiegmans)++ | src/ (7 files):
15:52 dalek MoarVM/moar-jit: Prototype emitting a C call. We can't represent addresses / values very well yet, so we don't add arguments.
15:52 dalek MoarVM/moar-jit: review: https://github.com/MoarVM/MoarVM/commit/50bc89475e
15:53 jnthn wow!
15:54 * jnthn goes to read :)
15:54 * brrt appreciates comments and critique
15:55 cognominal joined #moarvm
15:59 jnthn | sub rsp, 16
15:59 jnthn That 16 shows up quite a bit, I might prefer to give it a name :)
15:59 jnthn +    | mov [rsp-8], rdi              // thread context
15:59 jnthn yay, that's a nice way to comment what things are :)
16:00 jnthn (Make it much easier to follow)
16:00 * brrt had the same idea, will change it
16:01 jnthn Only other thing is meta: it's nice if your commit messages followed the usual git commit message formatting rules.
16:01 jnthn (Subject line, empty line, body if there's more to describe)
16:02 jnthn (Where subject line is up to 50 chars)
16:02 brrt ok, will do
16:03 brrt i'd like a better name for MVMJitCCall, though
16:03 brrt MVMJitCFunctionCall MVMJitNativeCall MVMJitCallNative
16:03 brrt MVMJitCallC
16:05 jnthn Well, keeping it relatively short is nice
16:05 jnthn MVMJitCallC works for me.
16:09 brrt more readable than MVMJitCCall too
16:09 brrt :-)
16:16 brrt do you have an opinion wrt to the management of the stack pointer? i.e. change it on entry or change it on function call (as i do now)
16:17 brrt the difference is in how you address stack values, by the way :-)
16:18 jnthn Would changing it on entry/exit not generally be cheaper, as we typically make multiple function calls?
16:19 brrt yes, i think it would
16:19 brrt i'm going to check what gcc does
16:19 masak jnthn++ # now asking others to follow git commit message guidelines
16:20 jnthn It's kinda annoying to have to think of a 50-line description always. But it's kinda worth it for getting nice output from the tools.
16:21 jnthn OK, I really need to eat before I finish up this inline table calc.
16:21 jnthn shop &
16:23 masak I guess it qualifies as constrained writing.
16:23 masak the thing about constrained writing is that yes, it's a bit arbitrary, but it also tends to bring out nice results, mainly because the limitations force a bit of extra thought in a smaller/simpler state space.
16:27 * brrt can't really write without constraints at all
16:29 brrt clang subtracts from rsp on entry and refers to rbp instead
16:29 brrt i guess that works, too
16:32 * brrt finds intel syntax confusing
16:34 brrt &dinne
16:34 brrt dinner
16:59 nebuchadnezzar joined #moarvm
17:02 brrt joined #moarvm
17:16 nwc10 jnthn: *still* not broken. use more 'stout'? Maybe try absinthe?
17:18 vendethiel oooh, JIT work !
17:19 vendethiel brrt++
17:24 colomon joined #moarvm
17:24 woosley joined #moarvm
17:25 synopsebot joined #moarvm
17:36 dalek MoarVM/inline: 1b76d2a | masak++ | src/spesh/inline.c:
17:36 dalek MoarVM/inline: comment nitpick
17:36 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/1b76d2a241
17:38 jnthn so nitpick :P
17:39 jnthn nwc10: Well, the reason you don't see all the breakage is that the inline stuff isn't actually turned on yet...I've got a local change here that does that.
17:41 nwc10 oh. "ho ho ho"?
17:44 * masak .oO( Christmas comes early this year... if you have a local change )
18:29 dalek MoarVM/inline: 7c41d88 | jnthn++ | src/spesh/graph.h:
18:29 dalek MoarVM/inline: Add spesh annotation for inline start/end.
18:29 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/7c41d883d5
18:29 dalek MoarVM/inline: 42fee86 | jnthn++ | src/spesh/dump.c:
18:29 dalek MoarVM/inline: Dumping of new inline start/end annotations.
18:29 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/42fee86473
18:30 dalek MoarVM/inline: 54d3380 | jnthn++ | src/spesh/ (3 files):
18:30 dalek MoarVM/inline: Start building inline extents table.
18:30 dalek MoarVM/inline:
18:30 dalek MoarVM/inline: Copes with inlining things that also had things inlined into them
18:30 dalek MoarVM/inline: already.
18:30 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/54d3380fe9
18:32 brrt joined #moarvm
19:25 vendethiel joined #moarvm
19:38 dalek MoarVM/inline: 61aa4f7 | jnthn++ | src/spesh/ (6 files):
19:38 dalek MoarVM/inline: Correctly form a deopt table for inlined code.
19:38 dalek MoarVM/inline:
19:38 dalek MoarVM/inline: Also detect the inline case in deopt_one and deopt_all; for now it
19:38 dalek MoarVM/inline: just throws.
19:38 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/61aa4f71d6
19:46 zakharyas joined #moarvm
19:59 timotimo ooooh, sounds like we're getting pretty close
19:59 timotimo jnthn++ :)
19:59 timotimo except for a bit of cheerleading i've been super useless this week :S
19:59 jnthn Well, in theory this means we have the various data tables in place to re-create the frames...
20:00 timotimo just have to do it now :)
20:01 jnthn "just" :P
20:02 timotimo yeah, SMOP and stuff
20:20 nwc10 jnthn: *still* not broken
20:22 jnthn Phew :)
20:23 timotimo i thought that's because you have to explicitly turn it on? :)
20:23 jnthn Well, yeah, but collateral damage is also possible.
20:24 jnthn It's entirely possible the changes I'm doing could accidentally break spesh in the non-inline case.
20:24 jnthn If I were to miss something.
20:24 timotimo ah, sure
20:25 btyler joined #moarvm
20:41 dalek MoarVM/inline: a19b0aa | jnthn++ | src/core/frame. (2 files):
20:41 dalek MoarVM/inline: Add a way to create a frame as part of uninlining.
20:41 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/a19b0aab5f
20:42 timotimo uninlining ... outlining?
20:43 timotimo jnthn: apart from multiplication and division into bit shifts, what cool strength reductions are commonly done?
20:44 timotimo turn adding 0 and multiplying 1 into sets? :)
20:48 jnthn Well, yeah... But SR beyond those transforms really involves looking at loops...
20:49 timotimo ah, i suppose that makes sense
20:49 timotimo how hard is common subexpression extraction in spesh?
20:50 timotimo easior or harder than loop invariant hoisting? :P
20:50 timotimo i think both are probably too hard for me at this point (and in the forseeable future :P)
20:58 jnthn timotimo: Given we're already in SSA form, you may find http://en.wikipedia.org/wiki/Global_value_numbering easier to get into
21:19 timotimo jnthn: wow, that article doesn't explain how that thing is done at all
21:21 timotimo "a good algorithm will give this perfect mapping. using that info, the redundant computations can then be removed"
21:21 timotimo well, gee ...
21:22 dalek MoarVM/inline: 46cce5f | jnthn++ | src/spesh/inline. (2 files):
21:22 dalek MoarVM/inline: Record inline result reg/type for use in deopt.
21:22 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/46cce5f0f9
21:22 jnthn timotimo: haha... :)
21:23 jnthn timotimo: Yeah, the article on SSA is just like that too :)
21:23 jnthn timotimo: It may reference some useful papers.
21:23 timotimo i've got some pdfs in front of me now
21:27 timotimo ah, well, that would have been very helpful to point out: these numberings are done by first pretending all nodes of the same type (operand/operator) are congruent and then partitioning noncongruent nodes later on
21:30 timotimo heh. an example that was run on an IBM RS/6000 Model 540
21:31 timotimo "running at 30mhz, with a 64 kb data cache"
21:45 jnthn Old paper is old :)
21:46 jnthn Doesn't mean it's bad, though. The algorithm is still probably as good as it was :)
21:49 dalek MoarVM/inline: b4d3b0b | jnthn++ | src/spesh/deopt.c:
21:49 dalek MoarVM/inline: Initial attempt at one-level uninline.
21:49 dalek MoarVM/inline:
21:49 dalek MoarVM/inline: Structured to do multi-level, but that piece is not implemented just
21:49 dalek MoarVM/inline: yet.
21:49 dalek MoarVM/inline: review: https://github.com/MoarVM/MoarVM/commit/b4d3b0b0b2
21:49 timotimo of course
21:51 jnthn Tricky thing is tricky :)
21:53 jnthn Enough on that for today, I think :)
21:56 timotimo i'll wait with the weekly until i can run some benchmarks with inlining vs without inlining :)
21:57 jnthn Oh, I think I've 2-3 more days (well, evenings...) of work on this before we're at that point...
21:58 jnthn It's gonna need some debugging and I know there's some things left to do that it'll run into pretty rapidly.
22:03 timotimo d'aawc
22:15 jnthn Patience...or patches :P
22:15 jnthn 'night o/
22:19 timotimo patchience

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