Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-01-24

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

All times shown according to UTC.

Time Nick Message
01:16 pyrimidine joined #moarvm
02:12 diakopter joined #moarvm
02:24 pyrimidine joined #moarvm
02:40 MasterDuke joined #moarvm
02:48 ilbot3 joined #moarvm
02:48 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
03:26 pyrimidine joined #moarvm
03:36 geekosaur joined #moarvm
03:49 samcv there's a nqp test harness?
03:57 japhb samcv: Yes, pmurias wrote most of it to ensure his nqp-js work was on the right track.
03:57 samcv nice
03:57 japhb Oh, actually, that would be nqp test *suite*.  I haven't actually checked what the NQP 'prove' or equivalent is written in.
04:04 samcv weird still finds everything perfectly, but i cannot run perl 6 or compile nqp, and there's a hang on the spectest
04:05 samcv let me push it to my repo
04:15 samcv https://github.com/MoarVM/MoarVM/compare/master...samcv:rg?expand=1
04:21 diakopter samcv: do you have a guard that "h_pos + 1" is valid
04:22 diakopter I mean, I dunno how that could cause a hang
04:22 diakopter but stil
04:25 samcv let me add a print and make sure thatn isn't happening
04:26 samcv yeah it seems to be pretty rare, but I think that's the issue
04:26 samcv at least i saw it shortly before the hang
04:26 * diakopter crosses fingers
04:27 * diakopter fondly remembers writing "brute force for now. horrible, yes. halp."
04:28 samcv uh nope
04:29 samcv fixed it and now not getting any printout there, but it's hanging
04:29 diakopter well, it's not valid to skip along += ngraphs
04:29 samcv I changed the while loop to while (h_pos < hgraphs - 1)
04:30 diakopter change it to increment only 1
04:30 diakopter why would it be okay to += ngraphs
04:31 samcv still hang diakopter
04:31 diakopter oh, because it's ==2, yeah, I suppose
04:31 samcv yep
04:31 MasterDuke samcv: did you check out my boyer-moore branch at all?
04:31 yoleaux2 23 Jan 2017 10:31Z <lizmat> MasterDuke: seems like a logical continuation of the other Nd work you've done  :-)
04:32 samcv i tad
04:32 MasterDuke it worked fine for me (no problems), but it wasn't faster
04:32 MasterDuke and i don't know why
04:33 MasterDuke diakopter: if you wrote that original code maybe you could take a look at what i tried?
04:33 MasterDuke https://github.com/MasterDuke17/MoarVM/tree/boyer_moore_for_index
04:33 samcv MasterDuke, can you link me it again?
04:33 samcv i'll look a little closer
04:33 diakopter samcv: could you confirm that it's looping in your while loop?
04:33 diakopter MasterDuke: is yours working?
04:34 samcv yeah gonna add some prints
04:34 diakopter samcv: (or is it looping as the result of some bad result of that function)
04:34 MasterDuke if i remember correctly, it works in that it gives the same results as the original code, it just isn't any faster
04:35 MasterDuke sure there's some overhead from building the tables, but i would have expected to see some difference at some combination of needle/haystack size
04:35 diakopter well, how many times is that MVM_string_index called
04:37 samcv yeah it seems to be stuck
04:37 samcv loopy h_pos 1 hgraphs 10
04:37 samcv loopy h_pos 3 hgraphs 10
04:37 samcv both those lines just printed on loop
04:37 MasterDuke diakopter: was that question to me?
04:38 samcv so it's looping twice and then.. starting over? or someplace is calling it again and a again?
04:38 samcv should add in a print for when it exits the loop
04:38 diakopter MasterDuke: sure :)
04:38 diakopter anyone
04:39 MasterDuke diakopter: just once per nqp::index call right? but i think i tried doing many in a loop and the total time was no faster
04:39 diakopter just curious for the motive of optimization (or, how much one could theoretically speed it up)
04:39 MasterDuke but i believe also used for literal regexes
04:39 MasterDuke e.g., /foobar/
04:39 samcv no, it's exiting the loop
04:39 diakopter well I meant in a long-running program such as p6 setting compilation, how many times is it called
04:39 samcv a huge no
04:40 diakopter samcv: ok, so it's returning a wrong result
04:40 MasterDuke i've profiled the compile of rakudo, but moarvm ops don't show up in a profile at that level
04:40 diakopter yeah you'd have to use something fancy :D
04:41 MasterDuke i thought i once perf recorded a rakudo compile, but i'm not sure if i gisted the results
04:41 samcv ok yea'h it is
04:41 samcv 10 in the haystack it fails somehow. will fix that
04:41 samcv curious what part of the code just uh. rechecking forever
04:41 samcv if it can't find something
04:42 diakopter samcv: yes I'm curious about that too
04:44 MasterDuke diakopter: https://gist.github.com/MasterDuke17/4b9dc25bbc9b45fc5ade7fac0b2556cd
04:46 MasterDuke also running a new one now
04:47 diakopter 0.16%     0.07%  moar     libmoar.so            [.] MVM_string_index
04:48 diakopter so the max you could speed up that run, by optimizing that function infinitely, is only that fraction
04:48 diakopter thereabouts
04:49 samcv yeah that's what i thought, i can't change the while loop to while (h_pos < hgraphs - 1)
04:49 MasterDuke of the rakudo compile yeah, but other workloads should be helped more
04:49 samcv gonna set it back then run prove and check the logs see which it hangs
04:49 samcv SUCC 1 h_pos -2134653648 hgraphs -2122111808
04:49 samcv XD
04:50 samcv succ means success
04:50 diakopter heh.
04:50 samcv well. at least it passed one of the checks. i numbered them
04:50 diakopter that's a very long string
04:50 diakopter do you have that much negative memory?
04:51 samcv well it's alternating uhm
04:51 samcv between two things, one where it succeeds and one which fails
04:51 samcv alternating
04:51 samcv the failing one is the odd numbers
04:52 samcv maybe it's just a print error idfk
04:52 samcv or maybe it's the same one and only failing in part of the print's
04:53 samcv oh i forgot to put anything after the fprintf (variables)
04:55 samcv wtf it looks like the values get corrupted?
04:56 samcv loopy h_pos 1 hgraphs 10
04:56 samcv loopy h_pos 3 hgraphs 10
04:56 samcv SUCC 1 h_pos 530666800 hgraphs 543208640
04:56 samcv exiting loop succ 1.1 h_pos 3 hgraphs 10
04:56 samcv fprintf(stderr, "SUCC 1 h_pos %i hgraphs %i\n", h_pos, hgraphs); # corruption
04:56 samcv then below itc
04:56 samcv fprintf(stderr, "exiting loop succ 1.1 h_pos %i hgraphs %i\n", h_pos, hgraphs)
04:56 samcv and prints the correct values
04:57 MasterDuke joined #moarvm
04:57 diakopter MasterDuke: true, so then profile those other workloads.. :)
04:57 samcv time to try making them all
04:57 samcv %li
04:58 diakopter lol at "idfk"
04:58 MasterDuke for the heck of it i'll perf record a spectest run, see what that looks like
04:59 diakopter well that'll be a TON of invocations
04:59 diakopter process executions
05:02 MasterDuke if anyone is interested, here's a perf report of building rakudo with target=parse. https://gist.github.com/MasterDuke17/aff44a22a3a22d3ce0bf476d1d0ba537
05:24 samcv ok diakopter it does fine on all the things i've tested it with
05:24 samcv but it's still hanging
05:26 diakopter samcv: push the changes?
05:32 samcv diakopter, pushed
05:34 diakopter "h_pos + 1 < hgraphs - 1"
05:34 diakopter I think you meant <=
05:36 samcv that's what it says?
05:36 samcv line 245? or elsewhere?
05:36 diakopter yes, 245, I think you meant to write <= instead of <
05:37 samcv yeah that seems so then
05:37 diakopter I think the check needs to be "h_pos + 1 <= hgraphs - 1" or "h_pos + 1 < hgraphs"
05:38 diakopter I still can't conceive of why that would make something hang though XD
05:38 samcv yeah
05:38 samcv in the test it ust goes over the same string segment again and again
05:39 samcv some 10 long string
05:39 samcv i tested all positions of abcdefg.. for hgraphs 10
05:39 samcv but yeah shouldn't hang
05:39 samcv should give me some message like, confused at ...
05:42 diakopter so did that fix it
05:43 samcv i really doubt it
05:43 MasterDuke fyi, just doing an nqp::index() in a loop gives ~40% time in MVM_string_substrings_equal_nocheck and ~10% time in MVM_string_index
05:43 samcv yeah no
05:44 samcv hangggg
05:44 MasterDuke which isn't all that surprising
05:44 samcv it tests the same string again and again
05:45 MasterDuke anyway, i'm off to sleep, later all...
05:45 samcv kk
05:47 diakopter try removing the return -1 line
05:47 diakopter to let it fall back to the other thing
05:48 diakopter sleep&
05:48 samcv k night
05:56 samcv i guess i could attempt to print out the needle and the haystack as their unicode cp's...
05:56 samcv unless there's an easy way to dump a string?
06:31 pyrimidi_ joined #moarvm
07:13 domidumont joined #moarvm
07:20 domidumont joined #moarvm
08:23 zakharyas joined #moarvm
09:45 timotimo the easiest thing is to just encode it to utf8, print that, and free the string again
09:52 brrt joined #moarvm
10:04 domidumont joined #moarvm
10:43 brrt joined #moarvm
13:02 pyrimidine joined #moarvm
13:08 pyrimidine joined #moarvm
13:39 pyrimidine joined #moarvm
14:06 pyrimidine joined #moarvm
14:22 ggoebel joined #moarvm
14:57 pyrimidine joined #moarvm
15:14 pyrimidine joined #moarvm
15:32 dalek joined #moarvm
15:34 synopsebot6 joined #moarvm
15:52 brrt joined #moarvm
15:54 brrt ohai #moarvm
15:55 timotimo greetings brrt
15:55 brrt \o timotimo
15:55 brrt how are things
15:56 timotimo they're okay
15:56 timotimo yesterday i tried some simple stretches and yoga poses some random artist on twitter recommended if you regularly suffer from back pain
15:56 timotimo i don't really have back pain often, but i thought i'd give it a go anyway
15:56 timotimo now i have muscle soreness all over my back and shoulders %)
15:57 timotimo i'm looking forward to getting a little involved with the "easier" parts of the jit soon-ish :3
15:57 timotimo i'd like to hear how you are today, too. i'm going to be AFK for ~half an hour first, though
15:58 brrt ehm, i'm kind of busy, as usual
15:58 brrt unfortunately, i might add :-P
15:59 brrt i figured out that i need to add a 'barrier stack
15:59 brrt or rather
15:59 brrt barrier queue to the JIT
15:59 * jnthn has completed his very busy part of the week and looks forward to digging into Moar/Perl 6 stuff again tomorrow. :)
15:59 brokenchicken \o/
15:59 brrt i.e. a list of all those instructions that cause a flush of (a subset of) registers
15:59 * brrt envies jnthn
16:08 ggoebel joined #moarvm
16:27 brrt joined #moarvm
16:36 brrt so, know how i've been talking about solving the 3-operand to two-operand conversion process
16:37 brrt that also needs to be done for the indirect ops
16:37 brrt to give you an example: suppose I have something intended as:
16:37 brrt rcx = rdx + [rcx + 5];
16:38 brrt well, i can't very well overwrite rcx with rdx if i expect that to work
16:39 timotimo good point
16:39 timotimo i hadn't considered indirect addressing :S
16:40 brrt utlimately, the limitation is that linear scan operates on live ranges, not on tiles, and so it can't enforce per-tile constraints very well
16:41 timotimo let's add another pass! :)
16:41 brrt hmmm
16:41 brrt yes, but
16:42 brrt where
16:42 brrt before, or after linear scan
16:42 timotimo .o( why not both? )
16:42 timotimo wasn't actually a serious suggestion
16:42 brrt i know :-)
16:42 brrt the 'lets' add another pass' probably has some truth to it, but i'm not sure how
16:44 brrt so, to recap
16:44 brrt this is only relevant to binary ops
16:45 brrt this is only relevant when the output register would overwrite the *second* input register
16:46 brrt or actually, 'a secondary', because there may be more than one
17:23 domidumont joined #moarvm
18:20 domidumont joined #moarvm
18:38 domidumont joined #moarvm
18:50 FROGGS joined #moarvm
19:38 domidumont joined #moarvm
20:25 zakharyas joined #moarvm
20:26 pyrimidine joined #moarvm
21:28 pyrimidine joined #moarvm
23:12 MasterDuke is there a fast way to know/find out in moar if a string is all ascii chars?
23:15 timotimo only whatever i do in ops.c or the encoding .c files i think?
23:18 MasterDuke ops.c is ~10k lines, what should i search for?

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