Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-02-02

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

All times shown according to UTC.

Time Nick Message
00:15 pyrimidine joined #moarvm
01:13 pyrimidine joined #moarvm
01:26 agentzh joined #moarvm
01:46 geekosaur joined #moarvm
02:11 agentzh joined #moarvm
02:39 pyrimidine 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:31 agentzh joined #moarvm
03:56 pyrimidine joined #moarvm
04:29 agentzh joined #moarvm
04:51 geekosaur joined #moarvm
04:53 njmurphy joined #moarvm
05:00 agentzh joined #moarvm
05:23 agentzh joined #moarvm
06:12 stmuk_ joined #moarvm
06:14 japhb joined #moarvm
06:14 sivoais joined #moarvm
06:35 domidumont joined #moarvm
06:42 domidumont joined #moarvm
07:03 brrt joined #moarvm
07:26 KDr2 joined #moarvm
07:49 domidumont joined #moarvm
08:12 brrt joined #moarvm
08:21 zakharyas joined #moarvm
09:39 pyrimidi_ joined #moarvm
09:57 agentzh joined #moarvm
10:41 samcv any clue how we handle binding the same hash object to multiple keys of another hash object?
10:41 samcv we don't replicate the hash do we?
10:42 jnthn It's binding, so they all point to the same thing
10:42 samcv hmm
10:42 jnthn It's assignment that copies
10:43 samcv so nqp::bindkey shouldn't do any copying
10:43 samcv but %hash{$var} = %hash; might copy the hash?
10:43 jnthn It may depending on what's at %hash{$var}
10:43 samcv nothing is there yet
10:44 samcv i need to bind a single hash to the keys of 65,000 keys of a different hash. quickly
10:44 jnthn Then you'll just assign into a Scalar, so it'll point to the existing %hash
10:44 samcv it's taking so long
10:45 samcv like 9 minutes
10:45 jnthn m: my @keys = ^65000 .map(*.Str); my %h2 = a => 1; my %h; %h{@keys} = %h2 xx *; say now - INIT now
10:45 camelia rakudo-moar 18e6f0: OUTPUT«0.74697460␤»
10:46 samcv hmm i made some changes and now it's much faster
10:46 samcv made it go through one less sub
10:46 jnthn hmm
10:46 samcv maybe that was causing the slowness
10:47 jnthn Maybe...anything special about the sub?
10:47 samcv jnthn, is %h{@keys} faster than doing nqp::bindkey ?
10:47 samcv not really
10:47 jnthn No, though it's likely a good bit faster than writing for @keys { %h{$_} = %h2 }
10:47 samcv the sub just does `for Range.new($first-cp, $second-cp) { apply-hash-to-cp($_, %hash)}
10:48 samcv and just did that same code instead in the slow sub and it seems to have made it much faster
10:48 samcv and by much faster i mean taking 17.731817 seconds instead of like 20 minutes
10:48 jnthn o.O
10:49 jnthn Got it somewhere I can look at?
10:49 jnthn I'm busy with $other-work at the moment, but would be curious to look into why that makes such a huge difference.
10:49 samcv https://github.com/samcv/UCD/blob/master/UCD-gen.p6#L479
10:50 samcv moved this code into the routine i linked in my last irc message https://github.com/samcv/UCD/blob/master/UCD-gen.p6#L537-L539
10:50 samcv \o/ though. now i can get the whole UCD on perl 6
10:51 samcv witnhout taknig hours
10:51 samcv after doing loads of other improvements to the speed, making the other parts of the function over 10x faster as well by nqping it
10:51 samcv O.o i'm using 21% of my memory atm :P
10:51 samcv 16GB
10:52 samcv looks like in the code that turns all the unicode names at once into base 40
13:10 lizmat_ joined #moarvm
13:34 ggoebel joined #moarvm
13:56 ggoebel joined #moarvm
13:59 agentzh joined #moarvm
14:00 lucasb joined #moarvm
14:01 lucasb o/
14:02 brokenchicken \o
14:02 lucasb I noticed this struct named MVMNGFTrieNodeEntry in src/strings/nfg.{c,h}
14:02 brrt good hi, lucasb, brokenchicken, *
14:02 lucasb I guess the intention was to have named it with "NFG" instead of "NGF"
14:02 brrt heh, that looks well possible
14:03 lucasb so, just s/NGF/NFG/g :)
14:03 brrt PR pls :-P
14:03 KDr2 joined #moarvm
14:04 brrt (not that I don't agree that this is a really easy change, it's just that I'm trying to distribute the workload as broad as possible, if only for the secondary effect that more people will have seen/be confident in editinng MoarVM source code)
14:04 lucasb ok, I can change it later today and submit a PR :)
14:05 brrt i eagerly await it :-)
14:18 jnthn Heh, nice catch
14:21 brrt speaking of PRs, have you had the chance to look at the JIT-data-section bit?
14:45 jnthn Not yet; been tied up in some $other-task all yesterday/today
14:45 jnthn Which I just got done with :)
14:57 Geth ¦ MoarVM: lucasbuchala++ created pull request #517: Correct typo in struct name (s/NGF/NFG/)
14:57 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/pull/517
16:07 brrt joined #moarvm
16:10 pyrimidine joined #moarvm
16:26 agentzh joined #moarvm
16:30 brrt lucasb++ looks good to me, will merge
16:31 Geth ¦ MoarVM: 625f70fdc4 | (Lucas Buchala)++ | 3 files
16:31 Geth ¦ MoarVM: Correct typo in struct name
16:31 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/625f70fdc4
16:31 Geth ¦ MoarVM: 66961d88a8 | (Bart Wiegmans)++ | 3 files
16:31 Geth ¦ MoarVM: Merge pull request #517 from lucasbuchala/nfg-typo
16:31 Geth ¦ MoarVM:
16:31 Geth ¦ MoarVM: Correct typo in struct name (s/NGF/NFG/)
16:31 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/66961d88a8
16:58 pyrimidine joined #moarvm
17:13 FROGGS joined #moarvm
17:39 domidumont joined #moarvm
17:40 domidumont joined #moarvm
18:03 domidumont joined #moarvm
18:46 agentzh joined #moarvm
19:05 brokenchicken nqp ops like div_i are in src/core/interp.c ?
19:06 jnthn Their interpretation is
19:06 jnthn Such an op will also be JIT-compiled
19:07 brokenchicken Does MVM_JIT_DISABLE=1 disable that?
19:07 brokenchicken Like there's a bug but I see nothing wrong in src/core/interp.c Where else should I look?
19:10 brokenchicken Oh, I see some stuff in src/jit/emit_x64.dasc
19:10 pyrimidine joined #moarvm
19:10 timotimo yeah, jit disabling disables just that
19:11 brokenchicken oh, so if the bug is still present then it's not in emit_x64.dasc? hmmmm
19:12 timotimo also try disabling spesh, just to be sure
19:13 brokenchicken bug still there
19:18 jnthn Note if you're dealing in big ints, not hative ints, then it's div_I
19:18 jnthn uh, native
19:19 timotimo i assume it also happens with a high-level operator?
19:19 brokenchicken jnthn: well, isbig_I tells me is it big, but it's only like 50 bits. And JVM gives correct result.
19:20 jnthn Oh, if it's a boxed object you're working on it'll use div_I though
19:20 brokenchicken no, I can repro in just nqp
19:20 jnthn Ah
19:20 jnthn Example?
19:21 brokenchicken Not yet :) I wanna try to solve on my own :)
19:21 * [Coke] chuckles at hative ints.
19:22 nwc10 "like 50 bits"? Like 53?
19:23 brokenchicken nwc10: 51.15
19:23 nwc10 oh :-(
19:23 brokenchicken nwc10: why? What happens with 53?
19:23 nwc10 size of mantissa on a 64 bit double
19:24 timotimo hm.
19:24 timotimo i think the is_big logic isn't right
19:24 timotimo it looks at the bigint's "used" stat, and sees if it's bigger than one
19:25 timotimo but libtommath can be configured to have one of many different kinds of storage formats
19:25 timotimo what buffoon wrote that code? oh, it was me! okay!
19:37 brokenchicken oh ok. `int` is 32 bits and that's where the problem comes from
19:38 brokenchicken how can I make it use 64-bits on 64-bit boxes?
19:39 brokenchicken And well, I guess I don't know what I'm doing :) .. It's https://rt.perl.org/Ticket/Display.html?id=130686#ticket-history
19:39 brokenchicken And the problem boils down to:
19:39 brokenchicken m: use nqp; say(nqp::div_i(10000000000000000, 4))
19:39 camelia rakudo-moar f2894d: OUTPUT«468729856␤»
19:39 brokenchicken j: use nqp; say(nqp::div_i(10000000000000000, 4))
19:39 camelia rakudo-jvm fb4f16: OUTPUT«2500000000000000␤»
19:39 brokenchicken And on moarvm div_i stores those values in a `int` that's 32bit so it overflows and has wrong value
19:40 timotimo MVMint64 or MVMuint64
19:40 timotimo huh, why does it do that? that's very wrong :)
19:41 brokenchicken Oh cool! Then I can even fix this :D
19:41 * brokenchicken tries
19:41 timotimo what buffoon wrote that code? oh. it was me... okay ...
19:41 brokenchicken :)
19:41 geekosaur heh
19:42 timotimo well, that was in there since 2014-01-11
19:42 timotimo and nobody complained
19:42 brokenchicken heh
19:42 timotimo so ... am i off the hook? maybe? :S
19:52 brokenchicken https://github.com/MoarVM/MoarVM/pull/518
19:52 moritz timotimo: your current self is off the hook, while we viciously blame your past self :-)
19:52 brokenchicken Fixes the bug and passes rakudo's stresstest
19:52 timotimo :)
19:53 timotimo brokenchicken: can you try what happens if you run that in a big loop and have it jitted?
19:53 timotimo i.e. does the jit use the proper register size? i.e. 64bit for each part of the result?
19:55 brokenchicken cpan@perlbuild2~/CPANPRC/rakudo (nom)$ ./perl6 -e 'use nqp; my $x; for ^1000000 { $x = nqp::div_i(10000000000000000, 4) }; say $x'
19:55 brokenchicken 2500000000000000
19:55 brokenchicken Like that?
19:58 Geth ¦ MoarVM: zoffixznet++ created pull request #518: Fix overflow in div_i op
19:58 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/pull/518
19:59 brokenchicken this also gives the right result at the end:  use nqp; my $x; for ^100000000 { $x = nqp::div_i(10000000000000000, 4) }; say $x
21:10 agentzh joined #moarvm
21:13 pyrimidine joined #moarvm
21:23 zakharyas joined #moarvm
21:32 samcv brokenchicken++
21:34 jnthn Travis didn't even *start* any of the builds.
21:37 domidumont joined #moarvm
21:59 brokenchicken samcv: ?
21:59 samcv hmm?
22:02 geekosaur joined #moarvm
22:08 samcv brokenchicken, ?
22:09 brokenchicken 1632      samcv │ brokenchicken++
22:10 samcv oh
22:10 samcv the PR
22:10 samcv <brokenchicken> this also gives the right result at the end:  use nqp; my $x; for ^100000000 { $x = nqp::div_i(10000000000000000, 4) }; say $x
22:14 MasterDuke joined #moarvm
22:21 pyrimidine joined #moarvm
22:49 pyrimidine joined #moarvm
23:21 pyrimidine joined #moarvm

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