Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-11-24

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

All times shown according to UTC.

Time Nick Message
03:10 dalek MoarVM: cfd7fd6 | jimmy++ | src/jit/emit_x64.dasc:
03:10 dalek MoarVM: jit cmp_i
03:10 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/cfd7fd677f
03:11 jimmy_ joined #moarvm
03:12 JimmyZ ^^ I don't know how to test it. nqp::cmp_i doesn't help me :(
03:36 dalek MoarVM: e5379eb | jimmy++ | src/jit/graph.c:
03:36 dalek MoarVM: forgot to add cmp_i to jgb_consume_ins
03:36 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/e5379ebbf2
07:21 FROGGS joined #moarvm
07:51 dalek MoarVM: 4ee566d | jimmy++ | src/jit/graph.c:
07:51 dalek MoarVM: jit isnanorinf
07:51 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/4ee566d80b
08:34 dalek MoarVM: 20b7d1c | jimmy++ | src/jit/ (2 files):
08:34 dalek MoarVM: jit cmp_n
08:34 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/20b7d1ca08
08:35 jnthn If you don't know how to test stuff, putting it in master is probably not the best idea, is it?
09:37 JimmyZ you're right, but seems I didn't break roast, I doubt nothing get jited at all
09:37 * JimmyZ waits for timotimo++ :)
10:07 zakharyas joined #moarvm
10:29 dalek MoarVM: dbc4776 | jimmy++ | src/jit/emit_x64.dasc:
10:29 dalek MoarVM: small fix
10:29 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/dbc4776d53
13:02 brrt joined #moarvm
13:02 brrt \o
13:04 brrt i had two ideas while cycling today :-)
13:04 brrt one is to try and debug our seemingly mac os x-only issues on opendarwin
13:04 brrt however, opendarwin has died, and puredarwin (its successor) isn't really very active either
13:05 brrt so i'll have to see about that
13:05 brrt the other was about WHICH
13:05 brrt iirc, jnthn fixed WHICH instability by pre-allocating a gen2 spot for gen1 objects if they ever call WHICH
13:06 brrt but there's another, simpler and (i think) cheaper to way fix it
13:07 brrt which is to use allocate a number to each nursery round, and use the combination of (nursery_round << 32 | nursery_offset) as the basis for WHICH
13:07 brrt hmm... only one problem there, that's not going to fly well for stuff that is allocated directly into gen2
13:41 lizmat fwiw, jnthn is commuting atm
13:42 brrt i see
13:42 brrt any progress on the os-x based issues yet?
14:04 lizmat no, not yet
14:08 jnthn brrt: The trouble is, objects that make it into gen2 would then need an entry in some table saying where they used to be in the nursery
14:10 brrt that's easy, just prefix it to the object header
14:10 brrt i.e. instead of copying it directly, first copy it's 'WHICH' number, and then the objec theader
14:10 brrt eh object structure
14:10 brrt not just the header
14:11 brrt :-)
14:11 brrt \o jnthn by the way :-)
14:11 Util joined #moarvm
14:12 timotimo thank you, jimmyz for implementing these ops in the jit :)
14:12 jnthn The whole point of this design was to not have to make objects bigger.
14:13 timotimo oh no, the object doesn't get bigger! it just takes up more space than you'd think! :P
14:13 timotimo also, code that scans the gen2, like the collector or my gdb plugin, would need to intuit if the first 64 bits are a number or part of the object header ...
14:14 jnthn Right. And you'd have to conditionally add it on to get the size bin to allocate in...
14:14 jnthn And then what if nobody does .WHICH until the ting is in gen2?
14:14 jnthn So many ways for things to go wrong.
14:16 timotimo jimmyz, in my experience a nqp build and a rakudo build will exercise things like _i ops well enough
14:17 timotimo and a spectest run will exercise _n ops well, usually
14:17 timotimo i think the nqp test suite will also exercise _n stuff a fair bit
14:17 timotimo can always gather jit logs to see if the ops ended up in compiled output
14:18 brrt right timotimo :-)
14:18 jnthn Another good way is to write a loop that uses the op you want to exercise LOADS of times :)
14:18 brrt true jnthn
14:18 jnthn That'll get it jitted :)
14:18 * brrt is reviewing the jit additions
14:18 brrt i thought we had cmp_i yet?
14:18 timotimo hehe
14:19 timotimo we had cmp_I
14:19 brrt ah i see :-)
14:20 JimmyZ joined #moarvm
14:20 brrt hmmm
14:20 JimmyZ timotimo: I don't think any test triggered the cmp_i :(
14:20 JimmyZ I mean the jitted cmp_i
14:21 timotimo hm, OK
14:21 timotimo i'm going to have a look
14:21 JimmyZ and cmp_n
14:21 brrt hmmm
14:21 JimmyZ and maybe isnanorinf
14:21 brrt i don't think jitted cmp_i is right as it is written
14:22 brrt please confirm this for me: cmp_i does:
14:23 brrt setg al; movzx rax, al; setl al; movzr r8, al; sub rax, tmp3;
14:23 brrt al is part of rax
14:23 brrt tmp3 = r8
14:24 JimmyZ so I can use rcx ?
14:26 brrt hmmm
14:26 brrt yes, for example
14:26 brrt better yet
14:26 brrt r8b
14:26 brrt known as 'TMP3b' iirc in renamed-registers
14:27 JimmyZ brrt: BTW I does `ojbdump interp.o` and see something like seta %sil, does dynasm support sil ?
14:27 brrt sil is rsi lower byte
14:27 brrt i think so, yes
14:27 brrt http://corsix.github.io/dynasm-doc/instructions.html
14:27 JimmyZ sometimes I want to just copy the asm code from objdump interp.o to the jit code
14:28 brrt please be careful with that
14:28 kjs_ joined #moarvm
14:28 brrt :-)
14:28 JimmyZ and with a bit modification
14:28 brrt but it's a good basis to start from, i think
14:30 [Coke] moar sees a slight improvement on OS X today.
14:30 [Coke] JIT failing now 75 tests, non-jit only 8
14:30 JimmyZ ok, free to patch it or I will patch it tomorrow :)
14:31 timotimo in what way is cmp_i currently wrong?
14:31 [Coke] (ah, the jit #'s are fluctuating. was at 14 jit failures saturday…)
14:31 jnthn [Coke]: Sadly, I htink that's just the heisenbug being less heisen...
14:31 jnthn Or less bug
14:31 jnthn :)
14:31 brrt :-) i'll fix it
14:31 jnthn I got access to OSX and reproduced the bug, anyways.
14:31 JimmyZ Oh, don't say my wrong code makes OSX happy
14:31 brrt JimmyZ++ for working on JIT :-)
14:31 brrt not all that wrong, just not right yet
14:32 JimmyZ and how about cmp_n?
14:33 * JimmyZ hasn't writting asm code for 10 years...
14:33 JimmyZ *written
14:35 [Coke] jnthn: true, could just be noise. Please let me know if there's more I can do to help track this down. (aside from, you know, tracking it down and fixing it. :)
14:35 jnthn [Coke]: Well, you could teach my TDD in Java class tomorrow if you like... :P
14:39 [Coke] That's fine, just need someone to cover my coldfusion dayjob here.
14:39 jnthn So dependencies... :)
14:39 [Coke] but there's no coffee until they fix the water, so that's robably the hardest ask. :)
14:40 jnthn No coffee at work? That's probably illegal in Sweden... :P
14:49 brrt i haven't looked at cmp_n and tbh i don't know the whole sse stuff that well
14:49 timotimo using sse means our code is extra fast!!
14:49 timotimo that's all i know.
14:49 brrt ... :-)
14:49 brrt why not run it on CUDA :-P
14:50 timotimo can we outsorce it into amazon's elastic cloud?
14:52 JimmyZ Didn't you write eq_n and etc? P
14:52 brrt eq_n is much simpler iirc
14:53 brrt perhaps not much simpler
14:53 brrt but simple in comparison
14:54 JimmyZ I compared gt_n in emit_x64.dasc and cmp_n in interp.o, and think cmp_n is simple too
14:57 jnthn .oO( "in comparison" :D )
14:57 brrt :-)
14:57 brrt i wonder how to emit a cmp_i instruction
14:59 JimmyZ ;)
15:03 [Coke] jnthn: I am making due with diet soda with extra caffiene.
15:05 timotimo over the recent months i've seen more and more articles about diet soda being worse than non-diet soda
15:05 brrt hang on, /me has fix.
15:05 timotimo allegedly the artificial sweetness signalizes "sugar's coming!" to the body, but no sugar is in fact coming in
15:05 timotimo OSLT
15:05 * brrt finds that nonsense
15:05 brrt your brain is not that stupid
15:06 brrt as in, your brain actually senses the actual availability of glucose
15:06 timotimo ah? interesting :)
15:06 brrt and controls its production via the autonomic neural pathways in the liver
15:06 brrt yes. long story. i did my bachelors thesis about it
15:07 timotimo that's excellent!
15:08 brrt :-)
15:08 jnthn .oO( Beer is way simpler, doesn't come in diet variety at all... )
15:08 timotimo it comes in a "root" variety, though
15:09 brrt https://gist.github.com/bdw/aa900db7e31128cd98a3
15:09 timotimo seems like a strange idea to use cmp_i and then compare > 0 %)
15:10 brrt see if i care :-P
15:10 timotimo :)
15:11 brrt but yeah, you could do something like: my int $j := nqp::cmp_i($x, 50); - that would give you a somewhat easier readout
15:11 kjs_ joined #moarvm
15:11 brrt anyway, which of the patches do you like better
15:11 brrt subtract bytes and sign extends
15:11 brrt or
15:11 brrt zero extend bytes and subtract
15:11 brrt the former is one fewer operation :-)
15:13 brrt anyway, i can push the patch :-)
15:13 brrt (the earlier, that is)
15:13 dalek MoarVM: 23c16b4 | (Bart Wiegmans)++ | src/jit/emit_x64.dasc:
15:13 dalek MoarVM: Fix cmp_i
15:13 dalek MoarVM:
15:13 dalek MoarVM: rax and al share registers. I think it is better to explicitly
15:13 dalek MoarVM: use the 'renamed registers' so that it is clear when they conflict
15:13 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/23c16b433e
15:19 brrt left #moarvm
15:19 brrt joined #moarvm
15:19 timotimo brrt: which operatios are cheaper on processors? :P
15:20 brrt i have no idea
15:21 brrt my suspicion is that sign extending is more expensive than zero extending, and that there is no difference between 64 bit and 8 bit subtract
15:21 brrt so that the first version might pay off
15:23 JimmyZ timotimo: Oh I know sub/add are cheaper than inc/dec, so it's good to change them
15:24 timotimo wait what?
15:24 JimmyZ brrt: Will you commit the gist one? which is cheaper?
15:24 JimmyZ :P
15:25 brrt no idea
15:25 brrt the thing is clear enough though
15:27 JimmyZ timotimo: https://github.com/openresty/sregex/commit/f77a72893526c3adce644574dab754ca5e3b099a
15:27 timotimo whaaaaaat
15:27 brrt thats lame
15:28 brrt but that may be workload dependent
15:28 jnthn wtf
15:29 jnthn Mebbe inc is spec'd in some interesting way that makes it harder to do fast.
15:29 timotimo yeah, it must have some semantic difference
15:29 timotimo like overflowing vs not overflowing
15:29 timotimo setting exception flags or not
15:29 timotimo no clue
15:30 JimmyZ I'm sure he won't only test it one time ;)
15:30 timotimo yeah, it's very surprising
15:31 timotimo if there's no significant difference between inc and add $foo, 1, inc would be implemented the exact same  way as add $foo, 1 :)
15:33 JimmyZ +1
15:35 brrt could be an edge case in the microcode interpreter?
15:36 timotimo wait
15:36 timotimo we're changing our interpreter to become a machine code compiler
15:36 timotimo just so that that machine code gets interpreted again?
15:36 timotimo :P
15:37 JimmyZ by different interpreters :P
15:38 brrt yes
15:39 brrt turtles all the way down, until you get to electrons :-)
15:58 JimmyZ hmm, looks like we have inc_u/dec_u but no sub_u and add_u?
15:59 brrt does that differ much?
16:01 JimmyZ I don't think we uses inc_u/dec_u in nqp and rakudo
16:01 JimmyZ jnthn: ^^
16:02 timotimo brrt: would you like to explain how to build invokewithcapture in the jit? or do it yourself?
16:02 brrt oh, yes, i can do both, but it has it's complexities
16:03 timotimo ok, then you implement it :P
16:06 brrt wow man :-)
16:06 timotimo :P
16:07 brrt basically, see MVM_jit_emit_invoke in src/jit/emit_x64.dasc?
16:07 jnthn JimmyZ: *yet*
16:07 JimmyZ and  will?
16:07 brrt well, that most of that all is nunecissary
16:08 brrt unnecissary
16:08 brrt unnecessary
16:08 brrt *brains*
16:08 jnthn JimmyZ: Yeah, except so
16:08 JimmyZ ok :)
16:09 JimmyZ 00:10 here , good night all
16:09 jnthn 'night, JimmyZ
16:11 brrt sleep well JimmyZ
16:12 brrt in fact, invokewithcapture looks sufficiently unlike other invokes that it might be best not to share code generation between them at all
16:12 brrt and rather treat it like a primitive
17:00 pmichaud joined #moarvm
17:03 dalek MoarVM: da0ec71 | (Timo Paulssen)++ | src/profiler/ (2 files):
17:03 dalek MoarVM: with less naive log_allocated, annotate many more ops
17:03 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/da0ec7188e
17:03 timotimo jnthn: would be glad if you could review my choices of ops to annotate
17:10 jnthn Looks sane
17:43 timotimo jnthn: how much worth do you see in splicing BBs together if there's a bunch of BBs in a row that only have no extra successors/predecessors among them?
17:44 timotimo i'm suspecting not having to look too closely at BB boundaries and PHIs would benefit some of the more "simple minded" optimizations
17:46 timotimo .o( and i'm still wondering how best to "normalize" register versions, so that a write to r5(2) followed by a read from r5(7) could be identified as "working with the same register" ... )
17:53 hoelzro an MVMObject's contents (ex. the slots of a P6opaque) are stored after the STable, yes?
17:57 hoelzro ah, I see: MVMP6opaqueBody
17:59 timotimo the STable is always in the header of any object
18:11 kjs_ joined #moarvm
18:30 kjs_ joined #moarvm
18:38 FROGGS joined #moarvm
19:25 dalek MoarVM: 71a7dd0 | TimToady++ | src/6model/reprs/NFA.c:
19:25 dalek MoarVM: guard special cases with a single test
19:25 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/71a7dd079b
19:25 dalek MoarVM: 89a13e2 | TimToady++ | src/6model/reprs/NFA. (2 files):
19:25 dalek MoarVM: calculate longlit offset at last litchar
19:26 dalek joined #moarvm
19:52 vendethiel joined #moarvm
20:05 * FROGGS .oO( The Last Litchar - Summer 2015 In Your Cinema )
20:12 timotimo http://gamerhorizon.com/wp-content/uploads/2013/03/The_Witcher_3_Wild_Hunt_Logo_Black_EN.jpg The Litchar 3 - Wild Parse
20:21 FROGGS :D
21:05 kjs_ joined #moarvm
21:16 brrt joined #moarvm
21:28 kjs_ joined #moarvm
22:40 kjs_ joined #moarvm
23:06 tadzik joined #moarvm
23:06 pmichaud joined #moarvm
23:06 Util joined #moarvm
23:06 dalek joined #moarvm
23:08 synopsebot joined #moarvm
23:11 [Coke] joined #moarvm
23:46 timo joined #moarvm
23:58 dalek MoarVM: ef3d00c | (Bart Wiegmans)++ | src/ (4 files):
23:58 dalek MoarVM: JIT invokewithcapture
23:58 dalek MoarVM:
23:58 dalek MoarVM: This is JITted as a primitive since important parts
23:58 dalek MoarVM: of its logic are not shared with other invoke ops.
23:58 dalek MoarVM: review: https://github.com/MoarVM/MoarVM/commit/ef3d00ca0a

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