github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
timotimo .tell brrt and 1e0/$x.Num makes it go from ~8.25s to ~6.6s 00:01
yoleaux timotimo: I'll pass your message to brrt.
timotimo .tell brrt have you considered removing the hundreds of blank spaces at the end of lines from the .nqp version for much faster compilation? :D :D 00:08
yoleaux timotimo: I'll pass your message to brrt.
timotimo AlexDaniel: do we write a changelog based on changes since 2018.06 or the theoretical release date of 2018.07? 00:12
AlexDaniel since 2018.06 00:13
timotimo jeez, i've done barely anything in moar's code in that time 00:16
also: moar's code, haha, say that out loud
-- --- .- .-. ...- --
lizmat beep beep beep beeeeep bbeeeeep beeeeep beep beep beep 00:17
sleep&
timotimo this is not going to matter in the slightest, but: 02:20
QASTNode's "name" method (from QAST::Op) somehow manages to use getspeshslot on the same spesh slot for both the argument's value and the one it compares with, i.e. NO_VALUE, but it has a PHI in between that somehow eats its Known Value, and so even though the value parameter wasn't passed, the code to set the name is still in the result 02:22
that PHI is actually in the middle of the block 02:24
timotimo perhaps for tomorrow: bool_I exprjit template that handles the smallbigint case in-line, and perhaps a lego jit version, too 02:42
mhh, get_bigint_body goes through get_boxed_ref, that's not quite so awesome for performance, so that could really be worth something 02:43
will need an sp_bool_I for ensuring the type is known
hm, the exprjit is kicked out by an sp_guardconc right in front of the bool_I; looking at Rakudo/Iterator:2330, "push-all" 02:44
brrt timotimo: it is, but note that the 'version that runs on both perls' is exactly how a naive perl programmer would write it 07:45
yoleaux 18 Aug 2018 23:59Z <timotimo> brrt: adding up consecutive reciprocals, isn't that a very, very bad case for rationals? making $x num doesn't help because it'll still first do rational for 1/$x and then turn it into Num; using $x += 1/$_.Num is loads faster
00:01Z <timotimo> brrt: and 1e0/$x.Num makes it go from ~8.25s to ~6.6s
00:08Z <timotimo> brrt: have you considered removing the hundreds of blank spaces at the end of lines from the .nqp version for much faster compilation? :D :D
nwc10 good *, brrt 07:46
brrt ohai nwc10
how was TPC
nwc10 It was In Glasgow :-) 07:47
Good
Nearly every talk I went to was good. (Which was better (for me) than previous years 07:48
Watch the video of the interview with Gloria (once its up) if you didn't see it live - I liked that "keynote" best
brrt I'll do that
holy **** 07:49
gist.github.com/bdw/42819001c1a083...procal-nqp - if I change the $i from int to num
my runtime goes down to 0.289s 07:50
if i do the same in C, runtime drops to 0.219s
nwc10 "WTF?"
Hope the video for this talk is up soon: act.perlconference.org/tpc-2018-gla.../talk/7428
brrt m: say 0.289/0.219
camelia 1.319635
brrt 30% within C. WTF
nwc10 (No bot to say "Building Privacy In" by "John Lightsey (‎J.D.)") 07:51
brrt not yet, but if it needs to do anything fast, build it in NQP 07:52
nwc10 venue was great (apart from having flat seating, just like last year) - food at venue was better than some places in the evening, staff also as good or better than good restaurant staff
brrt (btw, 2.48s for same, without JIT) 07:53
nwc10 next year is Riga (like 2011)
brrt I heard. I forgot which of the baltic countries that is
nwc10 Latvia 07:54
at the moment I think that your "reciprocal.pl6" is no different from "reciprocal.pl" - did you forget to put an ` int` back in the line with the `my` ? 07:56
brrt let me check for a second 08:08
yeah, that's not right 08:12
i miscopy-pasted 08:13
but, adding 'my num $x' slows it from 31s to 45s 08:14
so
brrt anyway, looking at the assembly, i'm guessing that this benchmark spends most of it's time in 'div' 08:23
mst brrt: "warning: benchmark may be a junior web developer" 08:52
samcv good * 09:07
hey mst, brrt
brrt ohai samcv 09:25
mst: i'm not sure I follow :-) 09:26
mst spends most of its time in <div>
brrt haha 09:29
nwc10 :-)
I completely missed that connection.
brrt yeah, me too 09:30
stmuk I still have that awful black drink from riga 2011 :) 09:32
nwc10 I think that the sysadmins have a bottle in their office as a result of a PgConf
nwc10 yoleaux: .tell jnthn MVM_SPESH_NODELAY=1 breaks Rakudo setting -- paste.scsys.co.uk/581482 -- problem probably about a week old 09:42
Stage parse : Error while compiling, type X::Bind::NativeType
name: $!name
at line 19587, near " name),\n "
timotimo nwc10: is that with postrelease-opts or master moarvm? 11:26
jnthn is curious about exactly what timotimo asked, though either way I ain't planning on touching master this side of the release. :) 11:43
timotimo i'm confused by that line. did you mean "why" rather than "what"? 11:48
jnthn timotimo: No, I meant what. As in, "I have exactly the same question" :) 11:49
timotimo oooh
i think my brain may have flipped "exactly what" and "what exactly" around 11:50
jnthn Yes, an sp_bool_I would be good, btw
timotimo huh, is there a good reason why bytecode positions in the "latest statistics" view aren't sorted? 12:01
i kind of assumed we stored them sorted for better lookup in the stats storage and such, but perhaps that's just not how it's implemented 12:05
nwc10 master
timotimo so, i have this SDL2 example "particles". it has an update sub that loops through the indices for positions (in a native num array with x and y values stored pairwise) and lifetimes (a native num array with just one entry per particle) and either moves them along their trajectory or, if their lifetime has reached 0, respawns them at the origin with random trajectory and lifetime 12:12
it suffers noticably from spesh logging ending too soon, where in the regular mode it barely has any of the invocations logged at all (many postcircumfix:<[ ]> invocations) 12:13
i suppose in the future we'll want to keep some logging instructions in the speshed frames and re-spesh when new information becomes available 12:14
jnthn Does it trigger deopt? 12:15
Or just hit a certain specialization, or?
timotimo it just makes a single specialization, which is a certain specialization - the update sub doesn't have any arguments :)- 12:16
jnthn I started writing up the "make `$_` not be dynamic" thing, but as I was explaining why PEA can't help much I realized that maybe it could
timotimo oh, it does have a single argument, but actually the interesting part being speshed is the inner loop
github.com/timo/SDL2_raw-p6/blob/m...les.p6#L43 12:17
it's not exactly the same code locally, i think, but it's very close
removing the "if (rand < df) {" condition makes it better because then it'll not skip as many runs at the start of the program
also, why did i put so many parenthesis for ifs there? :D 12:18
jnthn In that if we were to allocate registers for each lexical, and just flush it at the point that it escapes, then if it never escapes we'd be good
timotimo sounds good at first glance 12:19
jnthn That still only handles the cases where we fully inline or at least where we only rarely taken a code path that isn't inlined, though
*take
timotimo that also deals nicely with situations like "infix:</> can invoke the division by zero error, but in regular code it barely ever will"
jnthn The moment we actually make an invocation which makes a new callframe, we have to consider it as escaping 12:20
timotimo right
jnthn Whereas were it not dynamic it'd be subject to local analysis and the static optimizer could do the usual lexical -> local lowering trick
timotimo *nod* 12:21
i'll spend a bit of time on the sofa with the cat :3 12:22
nwc10 jnthn: master (the setting failure) 12:57
jnthn github.com/perl6/6.d-prep/issues/10 # from last night's discussion 13:07
jnthn nwc10: OK, will look when I get chance (though it'll probably be quite a bug hunt :/) 13:15
timotimo rakudo compilation dies even earlier for me, though 15:04
with NODELAY
/home/timo/perl6/install/bin/nqp-m --module-path=blib --target=mbc --output=blib/Perl6/Metamodel.moarvm --encoding=utf8 \
gen/moar/Metamodel.nqp
Incompatible MROs in P6opaque rebless for types QAST::Var and QAST::IVal+{QAST::SpecialArg}
jnthn timotimo: Does it happen on postrelease-opts too? 15:09
There's one fix in there that's not in master 15:10
timotimo ah, let's see 15:12
timotimo yes, exact same message 15:13
jnthn Ah well, at least things didn't get worse :) 15:15
timotimo it's the colon pairs, man. i tell ya! 15:19
(because it crashes in the colonpair method in NQP.nqp 15:20
jnthn
.oO( pain in the colon... )
15:23
timotimo huh 15:40
it got past that error
wow, a segfault even 15:41
i don't think i'm in the mindspace to get anything done with this 15:52
timotimo hm. perhaps i just forgot the Configure.pl step, but my moar --version didn't correspond to the postrelease-opts branch. perhaps i gave incorrect information 15:55
timotimo OK, i get an error during stage parse, but not a segfault 15:57
Stage parse : Error while compiling, type X::Attribute::Undeclared package-name: <anon|25> package-kind: class what: attribute symbol: $!iter at line 6867, near ",\n " 15:58
Error while compiling, type X::Bind::NativeType name: $!name at line 19586, near " name),\n " 15:59
timotimo now stage parse segfaults without NODELAY o_O 16:04
er
stage optimize
actually, i'll try rebooting my machine 16:05
it's not feeling very good at the moment
timotimo i mean, most likely it's just google-chrome was hogging all resources because of some misbehaving site or plugin or whatever 16:11
but updates have been piling up anyway, so a reboot would be fine anyway
timotimo it still segfaults in stage optimize, weird. 16:29
MasterDuke timotimo: i started adding support for subtraction and multiplication to github.com/rakudo/rakudo/pull/2228, but it got a bit more complicated 17:03
and then i realized that multiplication doesn't even work like addition and subtraction do, after trying mod, because i thought that might be useful 17:04
m: .say for (^4) + 2
camelia 2
3
4
5
MasterDuke m: .say for (^4) - 2 17:05
camelia -2
-1
0
1
MasterDuke m: .say for (^4) * 2
camelia 0
1
2
3
4
5
6
7
MasterDuke changing topics, MVM_SPESH_NODELAY=1 doesn't cause any problems during the rakudo compile for me 17:07
timotimo m: .say for (2..4) * 2 17:48
camelia 4
5
6
7
8
timotimo MasterDuke: i'm not actually sure where the arithmetic is even implemented in your pull request
MasterDuke timotimo: i re-use get_bound 17:50
`timotimo: huh, that looks like an inconsistency (re `.say for (2..4) * 2` vs `.say for (^4) * 2`) 17:51
timotimo why?
that's just ((2*2)..(4*2))
just like ^5 + 1 is (0+1)..(4+1) 17:52
MasterDuke yeah, but it doesn't do that for (^4)
timotimo m: .say for (^4) * 2
camelia 0
1
2
3
4
5
6
7
timotimo that's (0*2)..^(4*2)
or do you think it should interpret the ^ before doing the calculation? 17:53
MasterDuke no, i guess i was thinking of it wrong
think it makes sense to add the other math operations? i was able to do addition by re-using get_bound as-is, but the others will require modifying it and optimize_for_range a bit 17:58
timotimo addition and subtraction are likely the most widely used 17:59
MasterDuke heh, you can do subtraction with my branch, as long as you express it as addition 18:02
e.g., `.say for (^4) + -2` does get the optimization 18:03
timotimo heh. 18:05
MasterDuke oh...wait... 18:06
uh, now i get `===SORRY!=== Unknown QAST node type NQPMu` 18:07
i hate that error, so unhelpful 18:08
timotimo it'd be cool to have kind of a trace to the node itself, like perhaps by having an exception handler on every level that prints out the current node's information and rethrows to the next levell 18:16
timotimo spesh_inline_disable was enough to get core setting to build 18:28
at least that
timotimo huh, interesting 18:31
MoarVM oops: Spesh: instruction box_i missing from define-use chain
i'm not sure why the check is even turned on %)
brrt \o 18:44
timotimo the profiler no longer working is probably just because it doesn't use the usage chain API yet 18:57
jnthn aha 19:08
$ MVM_SPESH_NODELAY=1 MVM_SPESH_BLOCKING=1 ./nqp-m t/nqp/065-how.t
Incompatible MROs in P6opaque rebless for types QAST::SVal and QAST::IVal+{QAST::SpecialArg}
That's a rather smaller case than the setting :)
timotimo oh, nice 19:09
yeah, anything exploding in nqp code is so much better than in perl6 code
jnthn Initial signs are that it's *not* a deopt bug. 19:19
Dammit, 29C is *not* the temperature for this :/
jnthn goes to buy ice cream
timotimo ice cream sounds lovely
brrt i don't know if this is related to anything anyone would ever see, but I do think we need to fix MVM_jitcode_copy 19:54
and.... i'm kind of hesitant to do it because of release process stuff
(do it now, I mean)
masak can always do it in a branch 19:55
jnthn brrt: Could it have introduced SEGVs? 'cus master seems to have gained some... 20:09
brrt it could have, because we may be trying to free() some pages allocated by mmap, or unmap memory allocated by malloc 20:16
i'm not terribly sure since it would rely on cleanup of jit compiled frames, and that is rare in practice
hmm, i'll clean it up regardless
jnthn OK 20:22
brrt not sure why our bots don't work, but here's a PR: github.com/MoarVM/MoarVM/pull/944 20:37
jnthn I've figured out that NQP test fail 23:54
The immediate cause is because I broke propagation of merged log guards by dropping the flag
However, the reason I did that is because it assumes that the immediate writer is the PHI where the merge happened 23:55
This is not the case.
At least, not always.
So anyway, we need to fix that properly.
I'm not doing that at 2am :)
But at least I know what to fix now
jnthn Probably we should just carry around a list of log guards in the facts that we depend on 23:57
And then just use all those log guards