Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2015-08-05

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

All times shown according to UTC.

Time Nick Message
01:48 ilbot3 joined #moarvm
01:48 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
03:05 mtj_ joined #moarvm
03:08 mtj_ joined #moarvm
06:19 FROGGS joined #moarvm
06:34 rurban_ joined #moarvm
08:30 zakharyas joined #moarvm
10:07 timotimo do we have some sort of solution in reachabel distance for this, jnthn?
10:08 jnthn Which "this2?
10:09 jnthn (working on gather/take in GLR so may be a distracted...)
10:14 timotimo ah ... the lexref thing that could be the reason infix:«<» doesn't get inlined
10:14 timotimo for my int $i; while $i < nqp::elems($!foo) { ... }
10:14 timotimo the first for isn't a perl6 for
10:16 jnthn I'd expect Perl6::Optimizer to inline that one
10:16 jnthn Because nqp::elems should get marked as producing a native int
10:18 timotimo oh, not spesh, of course
10:28 jnthn gather/take assigned into an array ==> was 0.539364099502563s, now 0.839381376902262s
10:28 jnthn for loop over gather/take ==> was 3.69287792841593s, now 0.42135747273763s
10:28 jnthn You win some, you lose some :)
10:29 jnthn But the first one is before I implement fast-pathing things when we know we need all the values
10:29 arnsholt That feels like an acceptable trade-off to me =)
10:29 jnthn So I suspect the first one will come out better very soon too :)
10:29 moritz sounds like a very good result for not-yet-highly-optimized thing
10:29 jnthn Didn't make either handle Slip yet...
10:29 jnthn Yeah, I again looked at the profile and we've code-gen issues
10:31 jnthn Maybe one of them the same one timotimo++ may be looking into right now :)
10:46 timotimo haven't looked at that one yet
10:57 timotimo it's just i'm wasting some time on youtube right now :S
10:58 timotimo i've looked at analyze_args_for_ct_call before and it was big and not terribly obvious
10:59 timotimo do we have anything in there that can go from "this is a lexicalref" to "i've got the lexical in scope, i could use it instead"?
11:02 jnthn lexicalref does mean "the lexical is in scope"
11:02 jnthn The only thing you need to be careful about is to make sure that you aren't looking at an "is rw" arg
11:03 jnthn lexicalref means "look up the lexical and take a reference", while lexical means "look up the reference"
11:03 timotimo hm, what exactly is causing the code to emit a lexicalref for my int $i in this case?
11:03 jnthn I'm assuming we're passing it to a function?
11:04 timotimo right, &infix:<<>
11:04 jnthn In general we have to assume the function might be "is rw"
11:04 timotimo you mean the arguments?
11:04 jnthn Well, parameter
11:04 timotimo right
11:04 jnthn But we conservatively emit code to pass a reference
11:04 timotimo so only if it's not "is rw" can we use the lexical itself rather than a reference to it
11:04 jnthn Right
11:05 timotimo this is something the optimizer would have to do, because it's the thing that'll figure out stuff about the candidates?
11:07 jnthn Right
11:07 jnthn We expect we can inline most natively typed operators statically
11:09 timotimo so i understand correctly that lexicalref ought to be treated like other allomorphic things?
11:09 jnthn I think it should be treated more as a known native
11:11 timotimo oh, right, if we have a QAST::Var with scope lexicalref, that means the var could be resolved with scope lexical just as well
11:11 timotimo would i just rely on the later parts of the compilation to properly handle "we pass in a lexicalref to this native int argument"? or would the optimizer switch the .scope and .returns around itself?
11:12 jnthn Isn't .returns set to the native you get a reference to on a lexicalref?
11:13 jnthn But I'd expect to do the scope switch, yes
11:13 timotimo good question; wouldn't that mean the code already DTRT?
11:13 jnthn Maybe...but it apparently doesn't
11:13 timotimo i mean, a lexicalref returns an object from the VM standpoint
11:13 jnthn OK, next up lunch, then making gather know about Slip
11:13 timotimo great! :)
11:13 timotimo looking forward to it
11:13 jnthn I did the "avoid the continuation when we want N values" thing.
11:14 jnthn Now I've got:
11:14 jnthn gather/take assigned into an array ==> was 0.536030769348145s, now 0.221679290135702s
11:14 jnthn for loop over gather/take ==> was 3.64187502861023s, now 0.515029430389404s
11:14 jnthn Hope we don't lose too much to handling Slip
11:15 jnthn Anyways, lunch &
11:19 timotimo i like those values :)
11:19 timotimo even if we come out 1:1 on the one thing after slipping, we'll have more clarity and saner semantics
11:26 timotimo oh, seems like lunch happens here, too!
12:29 timotimo i see the piece of code that sets the "returns" to what "find_lexical_container_type" returns
13:28 jnthn # expected: 'brown ale'
13:28 jnthn #      got: 'stout'
13:28 jnthn ...some test result failures seem an improvement ;P
13:28 nwc10 :-)
13:34 jnthn Once I figured out how to factor the Slip handler for gather it came out quite nice
13:35 nwc10 ie Czech lager? :-)
13:35 jnthn Heh, none of that yet today :)
13:36 timotimo "kein bier vor vier!"
13:37 jnthn A lot of water though, given it's kinda warm
13:38 timotimo if you don't get enough water, you don't think as good
13:38 timotimo by which i mean, you get less optimistic. obviously.
13:43 jnthn Darn it, the tests I keep adding pass
13:43 jnthn But I missed something important
13:43 nwc10 but you expected them to fail?
13:43 jnthn I understand why they don't now...
13:43 jnthn Yeah, I thought they'd hit something I missed
13:44 jnthn This is why to work fail first with tests... :)
13:52 harrow joined #moarvm
14:03 * jnthn writed a hairy enough test and got success :)
14:06 jnthn gather/take assigned into an array ==> was 0.525030056635539s, now 0.224679549535116s
14:06 jnthn for loop over gather/take ==> was 3.6518755753835s, now 0.570699373881022s
14:06 jnthn So, just about no degradation for full Slip handling
14:09 leedo whoa, jnthn++ (sounds too awesome to stay silent :)
14:16 jnthn timotimo: I don't see an effect from the inline stuff BUT it is possible that we have won something and then promptly lost it 'cus we inlined something that didn't JIT...
14:16 timotimo ... oh?
14:16 timotimo more jit BAILs?
14:16 timotimo jit all the Bailey's
14:17 jnthn In total, 304124 call frames were entered and exited by the profiled code. Inlining eliminated the need to create 199587 call frames (that's 39.62%).
14:17 jnthn But only 60% JIT rate
14:18 jnthn And that's factoring in frames, not where time was spent
14:18 jnthn oh, ouch
14:18 jnthn push-exactly doesn't get JIT-compiled
14:18 timotimo that'd be bad
14:18 jnthn Specialized via OSR
14:19 jnthn All the push calls it does are inlined, which is great
14:19 jnthn But yeah, I'd love to know why push-exactly doesn't JIT
14:20 jnthn That's basically the hottest loop
14:20 timotimo the jit log would tell quite easily
14:20 jnthn Yeah
14:21 timotimo i may add a line "these previous lines came from frame named foo" at the end, because every time you find a bail, you'll have to reverse search for the start marker to figure out where it comes from
14:21 jnthn Also we suffer from:
14:21 jnthn $i < nqp::elems($!reified)
14:21 jnthn Ending up doing the late-bound mutli-dispatch
14:21 jnthn Which it then also refuses to inline
14:22 timotimo it doesn't even inline the proto?!
14:22 jnthn (in spesh)
14:22 jnthn Well, that one is two compile-time-known ints
14:22 jnthn So it should statically inline
14:23 timotimo yeah, P6:O isn't smart enough about that apparently
14:23 jnthn *nod*
14:23 * timotimo hasn't looked at it too much yet; distractions all around
14:23 jnthn np
14:24 timotimo like a deck chair in the garden, where the sun is shining
14:24 jnthn I mean, we're already going to be winning on benchmarks against pre-GLR quite well if the micro results scale up
14:25 jnthn Knowing there's more in the tank beyond that is a nice position to be in :)
14:26 timotimo yes, very
14:56 itz joined #moarvm
15:00 timotimo mhhh, sun's nice outside
15:20 japhb jnthn++  # Color me quite impressed so far  :-)
15:37 TimToady jnthn: a possible slip optimization would be to notice in the negotiations that the eventual destination of the slip could be targeted directly rather than by creating/destroying a Slip
15:38 jnthn TimToady: Trouble is, the slip tends to be created inside something that's a black box to the iterator
15:38 hoelzro timotimo: I was thinking the same thing on my walk to work 30 minutes ago, and when you read what you wrote, I thought "how does *he* know?"
15:39 timotimo what exactly? :)
15:39 hoelzro timotimo: that the sun is nice outside =)
15:39 timotimo ah
15:39 timotimo it's nicer to have the sun outside than to have it in your house directly
15:40 hoelzro hahah, true
15:40 jnthn TimToady: I already have plans for making the "we have a slip of 2 things and the consumer needs 2 things" case cheaper though
15:41 TimToady what about "I don't care how much you give me, just give me what you think is a reasonably sized btch"?
15:41 TimToady *batch
15:41 jnthn TimToady: That's push-at-least
15:41 TimToady okay
15:41 jnthn TimToady: Which defaults to push-exactly
15:41 jnthn push-at-least is the "you're free to work ahead if you know you won't be held guilty for it"
15:42 jnthn The at-least bit being because we always have an idea of the minimum amount of things we need ('cus otherwise we'd not be speaking to an iterator)
15:43 jnthn For the push-y forms, pass the final destination down as far as we can
15:43 jnthn *we pass
15:43 jnthn Which gets rid of intermediate buffers
15:44 jnthn A List or Array in the chain always implies an intermediate buffer
15:44 TimToady okay, carry on :)
15:44 jnthn But only in the sense of "their $!reified"
15:44 japhb timotimo: having the sun directly in one's house reminds me of Trance Gemini from Andromeda
15:46 jnthn TimToady: Once you backlog, see my ponderings on lazy :)
15:46 timotimo i don't recall much about Andromeda
15:46 timotimo only that it was quite cheesy, but i appreciated it for that
15:46 * jnthn needs a keyboard break, and perhaps dinner :)
15:46 japhb OMG SO CHEESY, definitely
15:47 japhb But I think that Kevin Sorbo has some sort of Cheese Field around him.
15:48 timotimo wasn't he also the actor for Hercules?
15:49 japhb Yup.
15:50 japhb ISTR he said his favorite part about Hercules ending was being allowed to cut his hair
15:50 timotimo tee hee
15:59 [Coke] Andromeda - I watched every (&*# episode of that series. I was not happy with where things went or ended up, but I still watched the whole thing.
16:07 timotimo i only occasionally watched an episode here or there on TV, so i didn't really have the right order :|
16:11 japhb [Coke]: Right there with you.
16:13 japhb timotimo: It could be *really* confusng if you didn't watch it in order.
16:13 * japhb growls at the crappy cell reception we keep hitting
16:14 japhb Either that, or someone on the bus is streaming video, in which case *rageface*
16:33 FROGGS joined #moarvm
18:30 TEttinger joined #moarvm
18:43 hoelzro I was studying the GC source earlier today (to try to see if I could fix RT #125738), and I came across this line: https://github.com/MoarVM/MoarVM/blob/master/src/gc/allocation.c#L90
18:43 synbot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=125738
18:44 hoelzro how can obj->header.flags & MVM_CF_SECOND_GEN ever be truthy if the object was just allocated a block of 0'd out memory?
18:44 hoelzro is there some magic happening in MVM_ASSIGN_REF?
18:44 jnthn It's the object body that's zeroed, not the object header
18:45 jnthn MVM_gc_allocate_zeroed isn't returning completely zeroed memory, it's returning a header followed by the requested amount of zeroed memory
18:46 hoelzro ah ha
18:48 hoelzro where is that header population happening in MVM_gc_allocate_nursery? it looks to me like each block of memory just comes up against the previous one
18:48 jnthn oh, wait
18:48 jnthn The requested size includes the header...
18:49 jnthn Objects and STables both have MVMCollectable inlined at the start of them
18:49 jnthn 6model.h is where this lot is defined, fwiw
18:49 hoelzro ah, I was confusing MVM_gc_allocate and MVM_gc_allocate_nursery
18:49 jnthn Ah
18:50 jnthn Yeah, MVM_gc_allocate selects nursery or gen2
18:50 hoelzro I see
18:50 hoelzro line 90 now makes a lot more sense =)
18:50 jnthn :)
20:37 colomon joined #moarvm
21:12 timotimo hoelzro: was it you who was fighting DESTROY recently?
21:12 hoelzro timotimo: yup
21:12 * hoelzro .oO( now I am become Death, the DESTROYer of worlds )
21:13 timotimo :S
21:13 timotimo all i care for is how the VM goes up
21:13 timotimo how it comes down is not my department
21:14 timotimo there's a song by Minsk that has the oppenheimer quote in it with one copy on each ear delayed by what feels like 3 seconds
21:14 timotimo the whole thing is quite eerie
21:15 hoelzro interesting, I may have to check that out
21:16 hoelzro I'm hoping to finish my skimming of the GC code tonight after work
21:16 hoelzro that should make me better equipped to diagnose the problem
21:16 hoelzro for the problem I found, the finalizing queue is one shorter in the erroneous code, because the unreachable object thinks it's reachable
21:17 timotimo oh, crap; something like reincarnation going on?
21:17 timotimo or maybe it's being declared dead, but then reached from another thread's GC?
21:17 hoelzro hmm, I'm not sure
21:17 jnthn We're *meant* to mark all the objects (and their graphs) if they're in the finalizer queue.
21:18 hoelzro all I know is it only appears when a CPointer is created via a C function that takes a block, and the result of that is assigned to a scalar before the function returns
21:18 hoelzro jnthn: finalizer or finalizing? AFAICT there are two queues, right?
21:20 TEttinger hoelzro: no way, I have that bhagavad gita/oppenheimer quote in a java lib I wrote.  it's the name of a Goto label. Java doesn't have Goto.
21:20 timotimo hoelzro: another song i like that has a lengthy piece of quotation in it is Angel Eyes' "Political Capital AKA Eleven States Worth of Christians Fed To The Lions", which features some speech by some latter day saints preacher or something ... followed by a few minutes of screaming %)
21:20 TEttinger https://github.com/SquidPony/SquidLib/blob/master/src/main/java/squidpony/squidai/DijkstraMap.java#L637
21:20 hoelzro I have a feeling it's a commonly cited quote among programmers =)
21:21 TEttinger oh yeah
21:21 hoelzro timotimo: hahaha what
21:21 timotimo well, musical screaming
21:21 hoelzro ah, "musical" ;)
21:21 timotimo hehehe :D
21:22 hoelzro that oppenheimer quote is also in "
21:22 hoelzro "They Should Have Warned Us Years Ago" by For Astronauts and Satellities, FWIW
21:22 hoelzro it works well with the chiptuney sound
21:22 timotimo that'll certainly have a very different feel from the Minsk track
21:23 TEttinger timotimo: do LDS churches/temples even have preachers? I'm not sure the term, but I would expect evangelical protestant pastors would make for better musical accompaniment, all the LDS people/mormons I know are rather quiet and laid-back
21:23 timotimo TEttinger: i have pretty much no clue
21:23 TEttinger heh
21:23 timotimo all i know is that near  the beginning the person talks about "the last day, or the latter day"
21:23 jnthn hoelzro: I think finalizing is just a normal array though, nothing special
21:23 timotimo which is where i've drawn that conclusion from
21:24 jnthn hoelzro: The finalizer algo is meant to be the standard one everyone does
21:24 TEttinger ever heard of the tabletop RPG "dogs in the vineyard"?
21:24 jnthn hoelzro: But I mighta done it wrong somehow...
21:24 hoelzro on the subject of quotes in music, I rather like the Herman Hess quote in Frames' In Via intro track
21:24 hoelzro jnthn: I read through finalize.c last night, it looks to be in order
21:25 hoelzro but that's with a large personal blindspot on how the GC really works =/
21:25 hoelzro TEttinger: I haven't
21:25 TEttinger very popular in the indie RPG circuit a while ago, set in what would become present-day Utah back when it was wild west frontier and the LDS church was being chased out of their original areas into Utah, mostly
21:26 TEttinger sorta a wild west thing where each of the characters has some different crisis of faith or of character they need to deal with as they are presented with lawlessness on the frontier and need to survive
21:26 hoelzro interesting
21:27 TEttinger it was a really strange time, higher ups in the church needed armed guards to stop assassination attempts
21:27 timotimo do you know of "Existential Crisis and Dragons"?
21:27 TEttinger that sounds awesome
21:27 timotimo a skit from the SMBC Theater folks
21:27 TEttinger plato's allegory of the cave... with dragons
21:28 timotimo i'm not sure nobody has turned it into a fully fleshed-out game yet ;)
21:33 jnthn hoelzro: It's meant to be re-incarnation safe, anyways
21:33 jnthn hoelzro: But with the James Bond rule.
21:34 hoelzro submethod DESTROY { say "Do expect me to talk?" }
21:39 colomon joined #moarvm
21:48 jnthn hoelzro: It's fine for it to talk :)
21:48 hoelzro jnthn: is that what you meant by the James Bond rule, then? =)
21:49 jnthn You Only Live Twice
21:49 jnthn (As in, you don't ever get your DESTROY run more than once if you manage to re-incarnate yourself in it. The next time you just get collected.)
21:50 hoelzro jnthn: oh, I thought it was "No, Mr. Bond. I expect you to die." =P
21:50 hoelzro your reference (no pun intended) makes a lot more sense though =)

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