01:48 ilbot3 joined 03:05 mtj_ joined 03:08 mtj_ joined 06:19 FROGGS joined 06:34 rurban_ joined 08:30 zakharyas joined
timotimo do we have some sort of solution in reachabel distance for this, jnthn? 10:07
jnthn Which "this2? 10:08
(working on gather/take in GLR so may be a distracted...) 10:09
timotimo ah ... the lexref thing that could be the reason infix:«<» doesn't get inlined 10:14
for my int $i; while $i < nqp::elems($!foo) { ... }
the first for isn't a perl6 for
jnthn I'd expect Perl6::Optimizer to inline that one 10:16
Because nqp::elems should get marked as producing a native int
timotimo oh, not spesh, of course 10:18
jnthn gather/take assigned into an array ==> was 0.539364099502563s, now 0.839381376902262s 10:28
for loop over gather/take ==> was 3.69287792841593s, now 0.42135747273763s
You win some, you lose some :)
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 =)
jnthn So I suspect the first one will come out better very soon too :)
moritz sounds like a very good result for not-yet-highly-optimized thing
jnthn Didn't make either handle Slip yet...
Yeah, I again looked at the profile and we've code-gen issues
Maybe one of them the same one timotimo++ may be looking into right now :) 10:31
timotimo haven't looked at that one yet 10:46
it's just i'm wasting some time on youtube right now :S 10:57
i've looked at analyze_args_for_ct_call before and it was big and not terribly obvious 10:58
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"? 10:59
jnthn lexicalref does mean "the lexical is in scope" 11:02
The only thing you need to be careful about is to make sure that you aren't looking at an "is rw" arg
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?
jnthn I'm assuming we're passing it to a function?
timotimo right, &infix:<<> 11:04
jnthn In general we have to assume the function might be "is rw"
timotimo you mean the arguments?
jnthn Well, parameter
timotimo right
jnthn But we conservatively emit code to pass a reference
timotimo so only if it's not "is rw" can we use the lexical itself rather than a reference to it
jnthn Right
timotimo this is something the optimizer would have to do, because it's the thing that'll figure out stuff about the candidates? 11:05
jnthn Right 11:07
We expect we can inline most natively typed operators statically
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
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
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?
jnthn Isn't .returns set to the native you get a reference to on a lexicalref? 11:12
But I'd expect to do the scope switch, yes 11:13
timotimo good question; wouldn't that mean the code already DTRT?
jnthn Maybe...but it apparently doesn't
timotimo i mean, a lexicalref returns an object from the VM standpoint
jnthn OK, next up lunch, then making gather know about Slip
timotimo great! :)
looking forward to it
jnthn I did the "avoid the continuation when we want N values" thing.
Now I've got: 11:14
gather/take assigned into an array ==> was 0.536030769348145s, now 0.221679290135702s
for loop over gather/take ==> was 3.64187502861023s, now 0.515029430389404s
Hope we don't lose too much to handling Slip
Anyways, lunch & 11:15
timotimo i like those values :) 11:19
even if we come out 1:1 on the one thing after slipping, we'll have more clarity and saner semantics
oh, seems like lunch happens here, too! 11:26
i see the piece of code that sets the "returns" to what "find_lexical_container_type" returns 12:29
jnthn # expected: 'brown ale' 13:28
# got: 'stout'
...some test result failures seem an improvement ;P
nwc10 :-)
jnthn Once I figured out how to factor the Slip handler for gather it came out quite nice 13:34
nwc10 ie Czech lager? :-) 13:35
jnthn Heh, none of that yet today :)
timotimo "kein bier vor vier!" 13:36
jnthn A lot of water though, given it's kinda warm 13:37
timotimo if you don't get enough water, you don't think as good 13:38
by which i mean, you get less optimistic. obviously.
jnthn Darn it, the tests I keep adding pass 13:43
But I missed something important
nwc10 but you expected them to fail?
jnthn I understand why they don't now...
Yeah, I thought they'd hit something I missed
This is why to work fail first with tests... :) 13:44
13:52 harrow joined
jnthn writed a hairy enough test and got success :) 14:03
gather/take assigned into an array ==> was 0.525030056635539s, now 0.224679549535116s 14:06
for loop over gather/take ==> was 3.6518755753835s, now 0.570699373881022s
So, just about no degradation for full Slip handling
leedo whoa, jnthn++ (sounds too awesome to stay silent :) 14:09
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?
more jit BAILs?
jit all the Bailey's
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
But only 60% JIT rate
And that's factoring in frames, not where time was spent 14:18
oh, ouch
push-exactly doesn't get JIT-compiled
timotimo that'd be bad
jnthn Specialized via OSR
All the push calls it does are inlined, which is great 14:19
But yeah, I'd love to know why push-exactly doesn't JIT
That's basically the hottest loop 14:20
timotimo the jit log would tell quite easily
jnthn Yeah
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:
$i < nqp::elems($!reified)
Ending up doing the late-bound mutli-dispatch
Which it then also refuses to inline
timotimo it doesn't even inline the proto?! 14:22
jnthn (in spesh)
Well, that one is two compile-time-known ints
So it should statically inline
timotimo yeah, P6:O isn't smart enough about that apparently 14:23
jnthn *nod*
timotimo hasn't looked at it too much yet; distractions all around
jnthn np
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
Knowing there's more in the tank beyond that is a nice position to be in :) 14:25
timotimo yes, very 14:26
14:56 itz joined
timotimo mhhh, sun's nice outside 15:00
japhb jnthn++ # Color me quite impressed so far :-) 15:20
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:37
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?"
timotimo what exactly? :) 15:39
hoelzro timotimo: that the sun is nice outside =)
timotimo ah
it's nicer to have the sun outside than to have it in your house directly
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
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
*batch
jnthn TimToady: That's push-at-least
TimToady okay
jnthn TimToady: Which defaults to push-exactly
push-at-least is the "you're free to work ahead if you know you won't be held guilty for it"
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:42
For the push-y forms, pass the final destination down as far as we can 15:43
*we pass
Which gets rid of intermediate buffers
A List or Array in the chain always implies an intermediate buffer 15:44
TimToady okay, carry on :)
jnthn But only in the sense of "their $!reified"
japhb timotimo: having the sun directly in one's house reminds me of Trance Gemini from Andromeda
jnthn TimToady: Once you backlog, see my ponderings on lazy :) 15:46
timotimo i don't recall much about Andromeda
only that it was quite cheesy, but i appreciated it for that
jnthn needs a keyboard break, and perhaps dinner :)
japhb OMG SO CHEESY, definitely
But I think that Kevin Sorbo has some sort of Cheese Field around him. 15:47
timotimo wasn't he also the actor for Hercules? 15:48
japhb Yup. 15:49
ISTR he said his favorite part about Hercules ending was being allowed to cut his hair 15:50
timotimo tee hee
[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. 15:59
timotimo i only occasionally watched an episode here or there on TV, so i didn't really have the right order :| 16:07
japhb [Coke]: Right there with you. 16:11
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
Either that, or someone on the bus is streaming video, in which case *rageface* 16:14
16:33 FROGGS joined 18:30 TEttinger joined
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: github.com/MoarVM/MoarVM/blob/mast...tion.c#L90 18:43
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125738
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
is there some magic happening in MVM_ASSIGN_REF?
jnthn It's the object body that's zeroed, not the object header
MVM_gc_allocate_zeroed isn't returning completely zeroed memory, it's returning a header followed by the requested amount of zeroed memory 18:45
hoelzro ah ha 18:46
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
The requested size includes the header...
Objects and STables both have MVMCollectable inlined at the start of them 18:49
6model.h is where this lot is defined, fwiw
hoelzro ah, I was confusing MVM_gc_allocate and MVM_gc_allocate_nursery
jnthn Ah
Yeah, MVM_gc_allocate selects nursery or gen2 18:50
hoelzro I see
line 90 now makes a lot more sense =)
jnthn :)
20:37 colomon joined
timotimo hoelzro: was it you who was fighting DESTROY recently? 21:12
hoelzro timotimo: yup
hoelzro .oO( now I am become Death, the DESTROYer of worlds )
timotimo :S 21:13
all i care for is how the VM goes up
how it comes down is not my department
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
the whole thing is quite eerie
hoelzro interesting, I may have to check that out 21:15
I'm hoping to finish my skimming of the GC code tonight after work 21:16
that should make me better equipped to diagnose the problem
for the problem I found, the finalizing queue is one shorter in the erroneous code, because the unreachable object thinks it's reachable
timotimo oh, crap; something like reincarnation going on? 21:17
or maybe it's being declared dead, but then reached from another thread's GC?
hoelzro hmm, I'm not sure
jnthn We're *meant* to mark all the objects (and their graphs) if they're in the finalizer queue.
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
jnthn: finalizer or finalizing? AFAICT there are two queues, right?
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 %)
TEttinger github.com/SquidPony/SquidLib/blob....java#L637
hoelzro I have a feeling it's a commonly cited quote among programmers =)
TEttinger oh yeah 21:21
hoelzro timotimo: hahaha what
timotimo well, musical screaming
hoelzro ah, "musical" ;)
timotimo hehehe :D
hoelzro that oppenheimer quote is also in " 21:22
"They Should Have Warned Us Years Ago" by For Astronauts and Satellities, FWIW
it works well with the chiptuney sound
timotimo that'll certainly have a very different feel from the Minsk track
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
TEttinger heh
timotimo all i know is that near the beginning the person talks about "the last day, or the latter day"
jnthn hoelzro: I think finalizing is just a normal array though, nothing special
timotimo which is where i've drawn that conclusion from
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"?
jnthn hoelzro: But I mighta done it wrong somehow...
hoelzro on the subject of quotes in music, I rather like the Herman Hess quote in Frames' In Via intro track
jnthn: I read through finalize.c last night, it looks to be in order
but that's with a large personal blindspot on how the GC really works =/ 21:25
TEttinger: I haven't
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
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
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"?
TEttinger that sounds awesome
timotimo a skit from the SMBC Theater folks
TEttinger plato's allegory of the cave... with dragons
timotimo i'm not sure nobody has turned it into a fully fleshed-out game yet ;) 21:28
jnthn hoelzro: It's meant to be re-incarnation safe, anyways 21:33
hoelzro: But with the James Bond rule.
hoelzro submethod DESTROY { say "Do expect me to talk?" } 21:34
21:39 colomon joined
jnthn hoelzro: It's fine for it to talk :) 21:48
hoelzro jnthn: is that what you meant by the James Bond rule, then? =)
jnthn You Only Live Twice 21:49
(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.)
hoelzro jnthn: oh, I thought it was "No, Mr. Bond. I expect you to die." =P 21:50
your reference (no pun intended) makes a lot more sense though =)