Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-07-17

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

All times shown according to UTC.

Time Nick Message
01:57 MasterDuke there's nothing in the log with the name of the non-jitted function, so how do i know which bail is associated with it?
01:58 timotimo is it speshed at all?
01:59 MasterDuke nope
01:59 timotimo well, there's your answer
02:00 timotimo can't jit what isn't speshed
02:00 timotimo one of the drawbacks of the current system, it's "all or nothing"
02:00 timotimo in this case it's nothing
02:00 MasterDuke https://github.com/rakudo/rakudo/blob/nom/src/core/Match.pm#L197
02:02 timotimo it's currently quite difficult to figure out why spesh isn't doing something at all
02:02 timotimo maybe the spesh log of the frames that call into INTERPOLATE have a little something to tell us
02:05 MasterDuke INTERPOLATE shows up in the spesh log, but i know how to read it even less than the jit log
02:07 MasterDuke the code i'm running is: `my @l = "f.json".IO.lines; my $s = "name"; my @m = @l.grep(/ $s /); say +@m`
02:07 MasterDuke playing around with https://rt.perl.org/Ticket/Display.html?id=127064
02:11 timotimo hmpf. it has an interned callsite and it uses fastinvoke to call into INTERPOLATE
02:12 timotimo however the INTERPOLATE method itself doesn't show up at all
02:15 timotimo i really should go to bed now though
02:15 MasterDuke lots of param_sn and throwpayloadlex in the BAILs
02:17 timotimo yeah
02:17 timotimo those are only interesting if the frames they bail out from take a significant amount of time
02:19 timotimo ttyl!
02:20 MasterDuke later...
04:16 lizmat joined #moarvm
05:53 statisfiable6 joined #moarvm
06:09 brrt joined #moarvm
06:21 brrt good * #moarvm
06:24 brrt i know why param_?? and friends aren't JITted
06:24 brrt but why isn't throwpayloadlex
06:39 domidumont joined #moarvm
06:44 domidumont joined #moarvm
06:46 lizmat joined #moarvm
06:58 domidumont joined #moarvm
07:14 brrt joined #moarvm
07:29 zakharyas joined #moarvm
07:46 lizmat joined #moarvm
07:55 brrt good * lizmat
08:10 samcv good * brrt
08:10 brrt good * samcv
08:45 jnthn morning o/
08:45 jnthn brrt: On throwpayloadlex, probably simply that nobody got to doing it yet
08:46 brrt i seem to recall timotimo did something with that and it burned
08:46 nwc10 good *, *
08:49 brrt ohai nwc10
08:50 jnthn .oO( probably that nobody got to doing it right yet :P )
08:52 samcv was gonna get back to work on concatenation
08:52 * jnthn planning to get back to work on spesh-worker
08:53 lizmat brrt: good *, wasn't actually here, but just the victim of a flaky wifi
08:53 jnthn Though allowing myself to be at least for a little time distracted by https://rt.perl.org/Ticket/Display.html?id=131755
08:55 brrt (either that or it exposed some broken assumption)
08:55 brrt damn flaky wifis'
08:55 * brrt is looking forward to TPC
08:56 samcv same
08:57 brrt i'm wondering if i can make a Makefile rule that will make
08:57 zakharyas joined #moarvm
08:57 brrt foo.expr be automatically picked up as a dependency for foo.o
08:57 brrt but only for foo.o
08:57 brrt and only if foo.expr really exists
08:58 samcv jnthn, so what is perl6's thing with opening something as '-' i heard it was special? and didn't actually open a file named '-'?
08:58 samcv is this true?
08:58 jnthn samcv: Apparently it opens stdin or stdout...
08:59 jnthn I think it's on the chopping block, though
08:59 samcv sadface
08:59 samcv i don't think anybody uses it. at all
08:59 nwc10 it's the classic Unix command line tool way of expressing STDIN or STDOUT
08:59 samcv yeah i know that... still tho
08:59 nwc10 ah OK. I didn't know that you know that. Now I know that you know :-)
08:59 robertle joined #moarvm
08:59 nwc10 and I agree - not really sure if anyone is still using it
08:59 samcv yeah i totally *get* it i just hate it
09:00 * jnthn wonders if it's one of those "we did it in Perl 6 'cus Perl 5 does it" things
09:00 brrt why hate it?
09:00 samcv because i name all my files '-'
09:00 brrt i mean, it'd be wrong on certain places in the stack
09:00 brrt well, there's a classic unix trick for that too
09:00 brrt foo — '-'
09:00 brrt or
09:00 samcv b-but this is perl 6!
09:01 brrt i like my classic unix hacks :-P
09:01 samcv but yeah i know the - - thing too
09:01 samcv and cd -- -
09:01 samcv in scripts i usually use cd -- whenever i remember
09:02 jnthn I can't manage to get the example from the RT to work ever
09:02 jnthn valgrind just says we're passing -1 to the read syscall
09:02 lizmat joined #moarvm
09:02 samcv i need to go through and delete all my old branches
09:03 samcv as they all won't fit on the screen with git branch for some time now
09:05 jnthn ah, if I stick a say $*IN.native-descriptor into the script just before the read from $*IN then it works
09:06 jnthn Odd
09:10 jnthn aha, the close call is coming from a DESTROY method
09:10 jnthn ahhh
09:11 jnthn So the script makes the original $*IN unreachable
09:11 jnthn Which means that it gets GC'd
09:11 jnthn And the DESTROY method closes the file handle
09:11 jnthn The timing of that is GC-sensitive, thus the timing oddities we see make sense
09:12 jnthn But handles that use stdout/stderr/stdin are special in that they re-use the same underlying VM handle
09:13 jnthn And the DESTROY is closing it
09:13 * jnthn will note this on the ticket
09:20 jnthn There we go; analysis of the issue noted :)
09:50 geekosaur I would say it is good if the argv-files thing handles -, but it should be special cased for that.
09:50 geekosaur that is, '-' is not a filename, it is part of command line processing
09:51 brrt that is true
09:51 geekosaur perl 5 didn't do it that way, but perl 5 also thought filenames like 'foo|' were great
09:51 geekosaur and I think (hope!) we ditched that too
10:02 samcv great as in it made a pipe?
10:02 samcv was that sarcasm?
10:02 samcv i've never tried to use odd filenames and just did the best practices ways of opening files with mulitple arguments
10:03 brrt well, it's one of those pretty-cool-in-a-tight-spot perl5 script handy things
10:03 brrt but then
10:03 geekosaur if you use a name like that as a filename on the command line, it runs the command as a pipe and reads its output
10:03 samcv oh command line
10:03 brrt it's not compatible with perl-as-a-web-language thing
10:06 geekosaur (these days shells can handle both of those for you, but on systems without /dev/stdin or /dev/fd/* the shell's implementation may be even hackier than perl 5's way of handling it. see bash source for an example.)
10:06 mst http://imgur.com/cKQrf
10:07 geekosaur in fact shells are even more evil than that; zsh came up with /dev/tcp/hostname:port some years back and bash adopted it later...
10:15 geekosaur (I've always been afraid to ask how they deal with Solaris.)
11:02 lizmat joined #moarvm
11:03 Geth_ ¦ MoarVM/spesh-worker: f93757621e | (Jonathan Worthington)++ | src/spesh/dump.c
11:03 Geth_ ¦ MoarVM/spesh-worker: Factor out dumping a spesh stats type tuple.
11:03 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/f93757621e
11:03 Geth_ ¦ MoarVM/spesh-worker: 4e1b6ce67c | (Jonathan Worthington)++ | 3 files
11:03 Geth_ ¦ MoarVM/spesh-worker: Implement observed type specialization planning.
11:03 Geth_ ¦ MoarVM/spesh-worker:
11:03 Geth_ ¦ MoarVM/spesh-worker: This is where the an observed type tuple gains a large enough share of
11:03 Geth_ ¦ MoarVM/spesh-worker: the hits or OSR hits in order to win a specialization. This will no
11:04 Geth_ ¦ MoarVM/spesh-worker: doubt receive further tweaks, but seems to produce fairly sensible
11:04 Geth_ ¦ MoarVM/spesh-worker: initial results.
11:04 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/4e1b6ce67c
11:05 jnthn Lunch time; bbiab
11:19 lizmat joined #moarvm
12:04 jnthn Pondering over lunch a bit, I think I'll put off doing the fancier type planning and move on to getting the actual specialization work moved over to the worker
12:05 samcv nice
12:06 jnthn That gets me to a potentially mergeable result sooner
12:25 samcv oh nice i can just do git branch --merged master and delete all those sweet
12:27 Geth_ ¦ MoarVM/spesh-worker: 080d6b7cb6 | (Jonathan Worthington)++ | 3 files
12:27 Geth_ ¦ MoarVM/spesh-worker: Track maximum simulated stack depth stats seen at.
12:27 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/080d6b7cb6
12:35 Geth_ ¦ MoarVM/spesh-worker: 797421020a | (Jonathan Worthington)++ | 3 files
12:35 Geth_ ¦ MoarVM/spesh-worker: Include maximum applicable stack depth in plan.
12:35 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/797421020a
12:42 zakharyas joined #moarvm
12:45 Geth_ ¦ MoarVM/spesh-worker: 8480011343 | (Jonathan Worthington)++ | src/spesh/plan.c
12:45 Geth_ ¦ MoarVM/spesh-worker: Sort plan by stack depth descending.
12:45 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/8480011343
12:55 jnthn grmbl, got a small number of explodey spectests
12:58 domidumont joined #moarvm
13:02 Geth_ ¦ MoarVM/spesh-worker: 409d06aa41 | (Jonathan Worthington)++ | src/core/frame.c
13:02 Geth_ ¦ MoarVM/spesh-worker: Don't passa a real NULL into a LEAVE block.
13:02 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/409d06aa41
13:04 * jnthn wonders que passa with his typing...
13:09 samcv hehe
13:09 brrt haha
13:10 brrt (though i must ask. why not qsort?)
13:10 samcv no pasa
13:10 samcv *passa
13:13 jnthn brrt: That is a quicksort?
13:14 brrt it looks at first blush surprisingly like a quicksort
13:15 brrt yes, you pick a pivot and swap over it
13:15 brrt and then recurse
13:15 brrt (you have a variant on that that is 'pick top n', implemented in nearly the same way)
13:16 brrt oh, hang on
13:16 brrt i mean to say
13:16 brrt why not use qsort(3), the C stdlib function
13:17 jnthn Maybe 'cus I didn't know it exists? :)
13:18 jnthn hm, MSVC even seems to have it
13:18 jnthn For once
13:19 brrt :-) there's even, i think, on bsd-like platforms, a standard heapsort, and a standard mergesort
13:20 brrt but those are nonstandard
13:20 nwc10 it wouldn't be very conformant C89 without it
13:20 brrt (nonstandard stdlib function)
13:20 jnthn nwc10: Heh, that was gonna be my next question, is it c89 or c99
13:20 mst brrt: on the nearest debian box it appears to be in -lbsd
13:21 brrt that is pushing it a bit though
13:22 brrt anyway, the 'normal' reason not to use stdlib qsort is that it incurs a function invocation for every comparison, and that is costly
13:22 brrt so i thought that would be it :-)
13:22 jnthn Grr, still got a few spectests that SEGV under spectest with by branch
13:23 jnthn They're fine without it
13:23 * jnthn tries GC torture
13:23 Zoffix What standard does MoarVM follow C89 or C99 or newer?
13:23 nwc10 if you want torture I can lend you some image handling libraries
13:23 jnthn C89 for the sake of MSVC
13:23 Zoffix yikes
13:25 mst doesn't MSVC have, like, *most* of C99 at this point?
13:26 jnthn mst: It's certainly got bits of it, and we're probably using parts that it does have.
13:26 jnthn The main annoyance is that it doesn't allow declarations anywhere except the top of a block
13:26 mst ow
13:27 mst so no 'for (int i = 0; ...)' ?
13:27 jnthn Right
13:27 mst eww
13:28 Zoffix dammit RoarVM already exists: https://github.com/smarr/RoarVM
13:28 Zoffix so much for MoarVM written in Rust :}
13:28 jnthn heh, never heard of that
13:29 jnthn If there's a MoarVM successor it'll probably be called LessVM and written in Perl 6 :P
13:29 Zoffix heh
13:30 * Zoffix might try making it in Rust as a learning project of both MoarVM and Rust
13:30 jnthn (No, I've certainly no plans. :) More likely is MoarVM will gradually evolve to become smaller.)
13:31 jnthn Writing a VM is a fun learning project :)
13:33 jnthn oh hurrah, I got an explosion
13:33 timotimo cool guys don't look at explosions
13:34 jnthn Apparently somehow a callframe ends up containing a pointer to something from a past fromspace.
13:35 timotimo is it a callframe that the spesh worker somehow owns but doesn't properly mark?
13:35 jnthn No, doubt it
13:35 jnthn Probably more likely a thinko in the interpreter
13:36 jnthn Just found a likely candidate
13:37 nwc10 The aim is to converge on something the size of http://x.com/ ?
13:37 nwc10 (might take a while)
13:38 Zoffix Why did Elon register it?
13:39 nwc10 IIRC technically he didn't
13:39 nwc10 oh wait, it was his startup
13:39 nwc10 paypal was what merged
13:40 Zoffix oh
13:49 jnthn huh, it looks like it's always a frame that gets marked and its ->caller is an outdated pointer o.O
13:51 jnthn Hm, and MVM_SPESH_DISABLE doesn't make it go away
14:01 Geth_ ¦ MoarVM/spesh-worker: 8f066c33a4 | (Jonathan Worthington)++ | src/core/interp.c
14:01 Geth_ ¦ MoarVM/spesh-worker: Make sure code won't be outdated if spesh log sent
14:01 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/8f066c33a4
14:02 jnthn That fix is needed, but not it seems the bug that I'm hitting.
14:02 brrt (making moarvm smaller)++
14:07 jnthn Most odd. In both cases I look at so far it's the same caller/callee where the caller has an outdated caller point
14:17 Geth_ ¦ MoarVM/spesh-worker: ad158f0792 | (Jonathan Worthington)++ | src/core/frame.c
14:17 Geth_ ¦ MoarVM/spesh-worker: Correct a typo.
14:17 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/ad158f0792
14:22 dogbert17 joined #moarvm
14:27 jnthn Can't figure it out easily from the debugger, and know it works without my spesh-worker changes, so currently bisecting, fwiw
14:46 jnthn Apparently, ddca0e5f99021 is to blame
14:47 brrt joined #moarvm
14:47 timotimo but there's hardly any code in there?!
14:48 jnthn That...doesn't make much sense :S
14:48 * jnthn rebuilds Rakudo just in case
14:50 timotimo doesn't one of the extops use staticframes?
14:51 timotimo it grabs the outer, but it doesn't set anything
14:51 jnthn yeah, will see
14:52 evanm joined #moarvm
14:53 domidumont1 joined #moarvm
14:53 * jnthn goes back one more commit from the one bisect found to try that
14:53 AlexDaniel joined #moarvm
14:57 evanm Hi, I have a question about MoarVM's internal string representation
14:57 timotimo go ahead
14:57 evanm It looks like there's a repetition structure so that "abcde" and "abcde" x 10000 use the same amount of memory
14:58 jnthn What the heck, the one bisect found apparently really is it?!
14:58 evanm But when I match the latter against a regex, it seems to get expanded into a flat representation first -- is that correct?
14:58 jnthn evanm: Yes.
14:59 jnthn Strand-y strings get flattened out so they are cheaply indexable, for the sake of regex performance.
14:59 jnthn The request to do that is implemented in, iirc, !cusror_init in the Cursor role in NQP
15:00 timotimo grep for "indexingoptimized"
15:03 evanm Ok, thanks, I'll take a look. Are regexes capable of matching strand-y string directly?
15:04 timotimo yep, they are
15:04 jnthn I don't think there's any reason why at MoarVM level why it'd not work (just run slowly); it's not exposed as an option at Perl 6 level. The standy thing is really just an optimization, not part of the language.
15:04 evanm I'm just thinking ("abcde" x 10000) ~ "foo" ~~ "foo" takes longer than it should
15:05 brrt joined #moarvm
15:05 evanm Err you know what I mean
15:05 jnthn Does that even use regex?
15:08 evanm time perl6 -e '("abcde" x 100_000_000) ~ "foo" ~~ /foo/'
15:08 evanm 3.25 real         2.13 user         1.09 sys
15:08 evanm time perl6 -e '("abcde" x 1_000) ~ "foo" ~~ /foo/'
15:08 evanm 0.18 real         0.14 user         0.02 sys
15:09 evanm But I guess that might be asking for another layer of optimization
15:09 brrt jnthn, that moves the sequence number by 4 bytes, might that upset the JIT?
15:09 jnthn I think that's one of those cases where we'd maybe like the regex compilation to be smart enough to realize that the thing in question isn't really a regex
15:09 brrt i mean, it only would when the compile isn't clean
15:10 jnthn brrt: Shouldn't, but I'm running with MVM_SPESH_DISABLE and getting the crash anyway
15:10 brrt okay, then i'm flabbergasted
15:10 brrt :-)
15:10 jnthn It gets better
15:10 jnthn It's the addition to the struct that causes it. o.O
15:10 brrt oh, that's good
15:10 jnthn If I remove all the code that uses the addition we're good
15:10 jnthn uh
15:10 jnthn we're still not good
15:11 brrt hmmkay, why now?
15:11 jnthn So a patch that just adds an extra entry to an MVMFrame is sufficient o.O
15:11 jnthn That's bizzare
15:11 jnthn I was gonna guess it's alignment, but it's added in the middle
15:12 brrt hmmm
15:12 jnthn The thing ends with an 8-byte pointer
15:12 brrt anything in rakudo that uses that structure directly?
15:12 brrt .oO( let's all sponsor jnthn to kill the extops )
15:14 brrt i almost convinced someone to use perl6 today!
15:14 brrt by analogy: perl6 is to go what perl5 is to C (or C++)
15:14 timotimo huh
15:15 timotimo .contains("foo") is actually a whole lot slower than ~~ /"foo"/
15:15 jnthn I wonder if this is a result of MVMFrame passing a certain size
15:15 timotimo using indexingoptimized before contains is still slower than just regexing
15:16 timotimo is something accidentally writing over the boundary of a struct value and it used to write into padding space so it did no harm?
15:16 brrt does valgrind know? or asan?
15:16 timotimo i don't think it would
15:17 jnthn It's at 288 bytes after the change fwiw
15:18 jnthn #define MVM_FSA_BINS       96
15:18 jnthn m: say 96 << 3
15:18 camelia rakudo-moar 2f5a6c: OUTPUT: «===SORRY!=== Error while compiling <tmp>␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~<␤at <tmp>:1␤------> say 96 <<⏏ 3␤»
15:18 jnthn m: say 96 +< 3
15:18 camelia rakudo-moar 2f5a6c: OUTPUT: «768␤»
15:18 brrt … if i hadn't forgotten to download virtualbox, i would've had a fully functional dev vm by now
15:19 jnthn valgrind...seems to be hiding the problem entirely?!
15:19 jnthn grr
15:19 brrt (yolo)
15:20 jnthn Disabling the FSA makes no difference
15:22 jnthn m: say 288.base(2)
15:22 camelia rakudo-moar 2f5a6c: OUTPUT: «100100000␤»
15:25 Zoffix brrt: "almost" convinced? Why didn't they want it in the end?
15:27 brrt a dayjob that wouldn't allow it
15:28 Zoffix timotimo: looks like it depends on whether "foo" is at the start or at the end. When it's at the start, .contains takes .2s; when it's at the end, it takes 11s; and regex takes ~3s in both cases
15:28 Zoffix say ("foo" ~ "abcde" x 100_000_000).contains: "foo" vs say ("abcde" x 100_000_000 ~ "foo").contains: "foo" I mean
15:28 evalable6 Zoffix, Full output: https://gist.github.com/e26bd3ba790cc8808d669af6d136ba53
15:28 evalable6 Zoffix, rakudo-moar 2f5a6cd9a: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/weXibWRGHc␤Two ter…»
15:28 jnthn Yup, and delte the field and it works just fine
15:28 jnthn *delete
15:28 Zoffix evalable6: shoo
15:28 evalable6 Zoffix, rakudo-moar 2f5a6cd9a: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/KRqexuaO4N␤Undeclared routine:␤    shoo used at line 1␤»
15:32 jnthn It's possible that the frame size difference just impacts whether the past fromspace check catches it, I guess
15:39 jnthn The spectests that would fail don't without that field added, though
15:39 jnthn Which kinda holes that theory
15:39 jnthn :S
15:40 * jnthn puts this aside for a bit
15:40 jnthn Maybe I'll think of something
15:48 domidumont joined #moarvm
15:57 Geth_ ¦ MoarVM/spesh-worker: 2d6a1b7797 | (Jonathan Worthington)++ | 2 files
15:57 Geth_ ¦ MoarVM/spesh-worker: Eliminate calls into the specializer.
15:57 Geth_ ¦ MoarVM/spesh-worker:
15:57 Geth_ ¦ MoarVM/spesh-worker: These will be replaced with the specializations being performed and
15:57 Geth_ ¦ MoarVM/spesh-worker: installed on the worker thread. For the moment, this disables all of
15:57 Geth_ ¦ MoarVM/spesh-worker: the specialization.
15:57 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/2d6a1b7797
15:57 Geth_ ¦ MoarVM/spesh-worker: 3f805ef359 | (Jonathan Worthington)++ | 3 files
15:57 Geth_ ¦ MoarVM/spesh-worker: Toss out now-unrequired call counting bits.
15:58 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/3f805ef359
16:01 zakharyas joined #moarvm
16:10 Geth_ ¦ MoarVM/spesh-worker: 4909bab4fd | (Jonathan Worthington)++ | src/spesh/dump.c
16:10 Geth_ ¦ MoarVM/spesh-worker: Remove dump of soon-to-be-removed spesh log slots.
16:10 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/4909bab4fd
16:10 Geth_ ¦ MoarVM/spesh-worker: 5504a0d23c | (Jonathan Worthington)++ | 3 files
16:10 Geth_ ¦ MoarVM/spesh-worker: Remove spesh logging insertion code.
16:10 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/5504a0d23c
16:15 Geth_ ¦ MoarVM/spesh-worker: 7b655eec86 | (Jonathan Worthington)++ | src/spesh/candidate.c
16:15 Geth_ ¦ MoarVM/spesh-worker: Remove spesh log mentions from candidate setup.
16:15 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/7b655eec86
16:15 Geth_ ¦ MoarVM/spesh-worker: a7528401ca | (Jonathan Worthington)++ | src/spesh/osr.c
16:15 Geth_ ¦ MoarVM/spesh-worker: Remove mentions of spesh logging from OSR.
16:15 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/a7528401ca
16:16 Geth_ ¦ MoarVM/spesh-worker: 32f9f58423 | (Jonathan Worthington)++ | src/core/interp.c
16:16 Geth_ ¦ MoarVM/spesh-worker: Gut two spesh ops that will be going away.
16:16 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/32f9f58423
16:17 Geth_ ¦ MoarVM/spesh-worker: c201e7a93a | (Jonathan Worthington)++ | src/core/frame.h
16:17 Geth_ ¦ MoarVM/spesh-worker: Remove now-unused spesh_log_slots from MVMFrame.
16:17 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/c201e7a93a
16:27 Geth_ ¦ MoarVM/spesh-worker: bed4731dc7 | (Jonathan Worthington)++ | 5 files
16:27 Geth_ ¦ MoarVM/spesh-worker: Remove last mentions of spesh_log_idx.
16:27 Geth_ ¦ MoarVM/spesh-worker:
16:27 Geth_ ¦ MoarVM/spesh-worker: Which is a nice simplification and removes checks on various GC
16:27 Geth_ ¦ MoarVM/spesh-worker: marking and invocation paths.
16:27 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/bed4731dc7
16:27 Geth_ ¦ MoarVM/spesh-worker: 25273e4ed4 | (Jonathan Worthington)++ | src/spesh/dump.c
16:27 Geth_ ¦ MoarVM/spesh-worker: Toss another log slots mention from the dumper.
16:27 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/25273e4ed4
16:27 Geth_ ¦ MoarVM/spesh-worker: 792ac61f30 | (Jonathan Worthington)++ | 2 files
16:27 Geth_ ¦ MoarVM/spesh-worker: Eliminate log slots from candidate data structure.
16:27 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/792ac61f30
16:38 Geth_ ¦ MoarVM/spesh-worker: 6b80e45847 | (Jonathan Worthington)++ | 2 files
16:38 Geth_ ¦ MoarVM/spesh-worker: Remove facts/optimize use of spesh logs.
16:38 Geth_ ¦ MoarVM/spesh-worker:
16:38 Geth_ ¦ MoarVM/spesh-worker: This will be replaced with obtaining data using the new spesh logging
16:38 Geth_ ¦ MoarVM/spesh-worker: scheme.
16:38 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/6b80e45847
16:38 Geth_ ¦ MoarVM/spesh-worker: b1b5377617 | (Jonathan Worthington)++ | 2 files
16:38 Geth_ ¦ MoarVM/spesh-worker: Remove some of the last spesh logging mentions.
16:38 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/b1b5377617
16:38 Geth_ ¦ MoarVM/spesh-worker: 2226b9799c | (Jonathan Worthington)++ | 8 files
16:39 Geth_ ¦ MoarVM/spesh-worker: Remove sp_log op.
16:39 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/2226b9799c
16:44 domidumont joined #moarvm
16:45 Geth_ ¦ MoarVM/spesh-worker: 4629ad79fe | (Jonathan Worthington)++ | 7 files
16:45 Geth_ ¦ MoarVM/spesh-worker: Remove the OSR finalize op.
16:45 Geth_ ¦ MoarVM/spesh-worker:
16:45 Geth_ ¦ MoarVM/spesh-worker: We'll need the osrpoint op to poll for a ready replacement under the
16:45 Geth_ ¦ MoarVM/spesh-worker: new scheme, so this op becomes redundant.
16:45 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/4629ad79fe
16:48 robertle joined #moarvm
16:53 Geth_ ¦ MoarVM/spesh-worker: 9e8b9f804a | (Jonathan Worthington)++ | src/core/frame.h
16:53 Geth_ ¦ MoarVM/spesh-worker: Remove now-unused osr_counter field from MVMFrame.
16:53 Geth_ ¦ MoarVM/spesh-worker: review: https://github.com/MoarVM/MoarVM/commit/9e8b9f804a
16:56 jnthn Alrighty, I think I'll leave it there for today
16:57 jnthn Tomorrow I'll work at getting spesh working again on this branch, this time on the worker thread. Once I get the basic case working again, I'll look into getting OSR back in shape also
17:03 zakharyas joined #moarvm
17:20 ilmari[m] joined #moarvm
17:32 lizmat joined #moarvm
19:09 evanm joined #moarvm
20:02 lizmat joined #moarvm
21:34 samcv whoops i accidently deleted my master branch
21:35 samcv fixd now :)
22:03 lizmat joined #moarvm
22:07 MasterDuke joined #moarvm
22:31 jnthn samcv: haha, because --merged outputs the branch you're standing on too? :)
22:31 samcv yes :)
22:33 jnthn No prizes for guessing how I suspected this ;)
22:41 jnthn rest time; more spesh hackery tomorrow :)
22:57 samcv so today i'm going to try and get my concat patch reading for merge
22:57 samcv just running benchmarks and such. interestingly as i'd made other changes to reduce when re_nfg is triggered my old tests which showed a bigger improvement are now no longer as good :P
22:57 samcv so i'm having to manufacture some more that better trigger things hah
22:59 samcv ahhh i see why. damn optimizations not performing the concatenation every time :p
23:00 samcv mostly want to ensure that short concats are not any slower
23:00 samcv as i *know* long ones will be immensely faster
23:03 samcv ok.... this is weird
23:03 samcv how...
23:03 samcv ok i do this perl6 -e 'my $boy = "\c[BOY]"; for ^1000 { $ = "aa$boy" ~ "\c[ZWJ]" }' everything is fine
23:04 samcv i run it 10000 times instead. and i get a throw. because somehow it creates the replacement substring but it ends up with 0 codepoints
23:04 samcv wtf.
23:04 samcv howwwwwwwwww
23:04 timotimo use rr to figure it out! ;)
23:05 samcv rr?
23:06 samcv i never even thought that'd ever get triggered. but i threw in a throw adhoc just because
23:06 timotimo yeah, it records your program execution and lets you replay as often as you like and also debug forwards and backwards, including watchpoints
23:06 samcv since if it's 0 for a or for c then it removes those strands
23:06 samcv as that moans the codepoinst from a or c were totally consumed
23:07 samcv so "\c[BOY]" ~ "\c[ZWJ]" would consume the first and second strings
23:07 samcv and remove those strands and not have it an offset or whatever
23:07 samcv but how does that happen for a string i created
23:07 samcv ah
23:07 samcv and why only when i run it enough times
23:08 samcv that is the string i create with MVM_unicode_codepoints_c_array_to_nfg_string
23:08 samcv so it should never be 0 codepoints
23:08 dogbert17 m: for (109..199) -> $num { my ($non-rep, $rep) = (1/$num).base-repeating(10); }
23:08 camelia rakudo-moar 91be8b: ( no output )
23:09 dogbert17 timotimo: this snippet fails when doing a profile, any idea why?
23:10 samcv ok so at least it's not triggering when i throw in a throw when it's created
23:10 samcv so somehow. uh
23:10 samcv something.... else. why
23:11 timotimo dogbert17: no clue
23:11 timotimo cannot call method "defined" on a null object?
23:11 timotimo 'tis a bug i've tried to find before in another program
23:12 samcv so uh
23:12 samcv the string  must be getting gc'd
23:12 samcv since it's not throwing when the string is created
23:12 samcv help
23:12 samcv something terrible must be happening
23:12 samcv but then i check and it's 0 in length like later on in the function
23:12 samcv but only when running it 10,000 times but not 1000 times
23:13 samcv timotimo, also how does MVMROOT work. the argument you supply to it. does it have to be the correct pointer already
23:13 samcv also. i have an issue because only *sometimes* will it ever hold a string. most cases it won't
23:14 * samcv doesn't completely know how MVMROOT works
23:14 dogbert17 timotimo: it's strange, the profiler is 'changing' how the program works
23:15 samcv sounds like physics
23:15 samcv just stop watching it
23:15 samcv ;p
23:15 samcv dogbert17, i've had things change how it works regarding GC at least. like running something in GDB i'd get no problem but not in GDB things would go wrong
23:18 dogbert17 I just figured out that with MVM_SPESH_DISABLE=1 the problem vanishes
23:18 timotimo well, yeah, the profiler works by putting a bunch of ops into the code to do some measurements
23:18 timotimo like "the code just allocated a Str"
23:19 timotimo or "this routine was just entered in its speshed variant"
23:19 dogbert17 spesh seems tricky
23:19 samcv someone help me understand MVMROOT :|
23:20 timotimo samcv: it registers a location in memory as a) containing a pointer to an object that needs to be kept alive, and b) containing a pointer that needs to be kept up to date when things move
23:20 samcv ok and the closure
23:20 timotimo this is done with a stack of pointers that gets pushed to at the beginning of mvmroot and popped at the end
23:20 timotimo it's not actually a closure
23:20 samcv tell me about the closure and how inside and outside
23:20 samcv it's a macro
23:21 timotimo yup
23:21 samcv i know that
23:21 samcv i just meant between the { }
23:21 timotimo the { } are only there to appease the syntax gods
23:21 samcv oh
23:21 samcv so it happens before the code in it
23:21 timotimo you can't put ; in between () of a macro i don't think
23:21 samcv and the end of the } doesn't change any state?
23:21 timotimo the end pops the pointer off the temporary roots stack
23:22 samcv oh ok
23:22 timotimo other than that it doesn't do anything
23:22 samcv so it does change things
23:22 timotimo yeah, after that the pointer you rooted will no longer be kept updated when things move and objects you used to point to may be thrown away in a GC run
23:22 samcv so i must supply the actual pointer to the object to MVMROOT(tc, pointerhere, { } ); i.e. it can't be uninetialized?
23:22 samcv (spelling)
23:22 samcv trying to type badly
23:23 timotimo i think if you don't null the pointer the GC will get upset
23:23 samcv lame
23:23 samcv oh
23:23 samcv wait.
23:23 samcv i mean what if it's null when you supply it to MVMROOT
23:23 timotimo upset as in "dereference a random memory location that might not even be valid"
23:23 timotimo that should be fine
23:23 samcv ah
23:23 geekosaur you'd be telling gc to move around a block of memory at 0
23:23 samcv so then what happens inside the MVMROOT if i don't even give it a real memory address
23:24 geekosaur and keep you updated on any such moves
23:24 timotimo hm? can you clarify that?
23:24 samcv so how do i MVMROOT a variable that's only sometimes pointing to an actual MVM object
23:24 timotimo have it point at null, or have it point at VMNull
23:24 timotimo btw, you wouldn't have an MVMROOT around the code that initializes the variable in question
23:24 samcv ok
23:25 timotimo i.e. i'd consider  MVMROOT(tc, thing, { thing = MVM_gc_allocate(tc, blah) });  to be wrong
23:25 samcv thanks
23:25 samcv that's what i thought too
23:26 samcv it'd be good if we null'd all our pointers
23:26 samcv on declaration
23:26 samcv especially ones that ever get passed to MVM ROOT
23:26 samcv but all sounds good
23:27 samcv ah actually this will be much easier than it was previously. as i've moved around code
23:27 samcv \o/
23:27 timotimo you don't have to use mvmroot btw
23:27 timotimo you can manually push and pop the temp roots
23:27 samcv oh.
23:28 timotimo you just need to (MVMCollectable **)&the_variable
23:28 * samcv looks at code
23:28 samcv ok perfect
23:28 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/07/17/2017-29-zoffix-released/
23:30 samcv lizmat, you can also add that i greatly reduced the chances of strings needing renormalization on concatenation. and it now only triggers if the resulting string would be different, instead of in cases where it's possible it could become changed.
23:31 lizmat is that already in nom ?
23:31 samcv yes
23:31 samcv i'm working on even more improvements as well though :)
23:31 lizmat "if the resulting string would be different"  ??
23:32 lizmat isn't that the point of concatenation ?
23:32 samcv the resulting sections i mean
23:32 geekosaur I think it's the normalization not the concatenatiojn
23:32 samcv before it would renormalize both string a and string b
23:32 samcv yes geekosaur
23:32 geekosaur "only normalize if it's known to actually need it"
23:33 samcv something like that yeah. before we would renormalize if there was a chance of it needing renormalization (i.e. the normalized result would be different than naively concating them together)
23:33 samcv and now it only triggers if the result *is actually* going to be different than the current (normalization)
23:36 lizmat "Samantha McVey worked on string concatenation, making sure that no (potentially expensive) normalization of strings is done, unless it is actually necessary."
23:36 samcv yes
23:36 samcv that is perfect
23:36 lizmat thank you  :-)   and thank YOU!  :-)
23:36 samcv uh you can say that it reduced renormalization of random unicode by over 3x
23:36 samcv possibly more depending on the language
23:37 samcv at least in my testing on three different scripts. Korean Tibetan and Arabic
23:37 samcv i suspect it's actuall very much higher than that over 10x but at least 3x :P
23:38 lizmat I think most of the reader would be interested in knowing it would make appending a newline 3x faster  :-)
23:38 samcv heh.
23:38 samcv but it doesn't :P
23:38 lizmat :-(
23:38 samcv i don't think. i mean
23:38 samcv it's probably faster
23:38 samcv a little bit at least. but don't say it as i haven't tested
23:39 lizmat ok, well I don't think mentioning Korean, Tibetan or Arabic will help a lot either, so I'm letting it be perfect as it is  :-)
23:39 samcv ok :)
23:40 samcv what you wrote is true. and the user can apply to whatever they *actually* use
23:40 samcv because it was getting triggered in many needless circumstances and i can't possibly know all of them heh
23:41 samcv concatenation of emoji is faster? hah
23:41 samcv but as you wrote is perfect hah
23:41 lizmat ok
23:42 lizmat on that note, I bid you all a good night!
23:42 samcv lizmat, that fix got in for release. also night!
23:42 samcv sleep well

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