Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2014-04-05

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

All times shown according to UTC.

Time Nick Message
00:03 dalek joined #moarvm
00:16 jnthn sleep &
00:16 tadzik joined #moarvm
00:24 colomon joined #moarvm
01:47 ilbot3 joined #moarvm
01:47 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
07:35 * lizmat checks whether he changes broke parrot
07:36 lizmat *her
07:54 nikolos joined #moarvm
08:15 nevalgen joined #moarvm
09:54 jnthn Turns out it's the dead instruction removal that hoses the trig tests
10:26 jnthn argh
10:26 jnthn atan2_n             w(num64) r(num64) w(num64) :pure
10:26 jnthn Of cource, that third arg should be an r(num64)
10:27 jnthn Slo it was deleting instructions assuming the instruction really did write to its 3rd reg arg.
10:28 jnthn And there I thought we had a really weird SSA construction bug
10:28 jnthn decont r12(2), r13(11)
10:28 jnthn unbox_n r15(1), r12(2)
10:28 jnthn atan2_n r14(2), r14(1), r15(2)
10:28 jnthn Note the r15(2) on the end there. :)
10:29 jnthn So of course the unbox_n and decont were considered dead.
10:32 dalek MoarVM/spesh: b77ca87 | jnthn++ | src/core/ext.c:
10:32 dalek MoarVM/spesh: Avoid accidental "pure" marks on extops.
10:32 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/b77ca87c5b
10:32 dalek MoarVM/spesh: 4096332 | jnthn++ | / (3 files):
10:32 dalek MoarVM/spesh: Correct atan2 op signature.
10:32 dalek MoarVM/spesh:
10:32 dalek MoarVM/spesh: We read, not write, the 3rd register argument.
10:32 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/409633224e
10:56 dalek MoarVM/spesh: 1769ad6 | jnthn++ | src/spesh/facts.c:
10:56 dalek MoarVM/spesh: Fix usage tracking of inc/dec instructions.
10:56 dalek MoarVM/spesh:
10:56 dalek MoarVM/spesh: They are the only ones that read/write, and so need special handling
10:56 dalek MoarVM/spesh: in the usage tracking.
10:56 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/1769ad63a2
10:57 * jnthn just got his lowest "build Rakudo" time :)
10:58 jnthn (as in, Rakudo's "make" phase)
11:03 jnthn OK, spesh is doing good in Rakudo spectest now. Let's try and keep it that way. :)
11:55 ilbot3 joined #moarvm
11:55 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
12:35 ilbot3 joined #moarvm
12:35 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
14:13 dalek MoarVM/spesh: f0d1d72 | jnthn++ | src/ (5 files):
14:13 dalek MoarVM/spesh: Stub in spesh guards for specializing on arg type.
14:13 dalek MoarVM/spesh:
14:13 dalek MoarVM/spesh: None are produced so far; this just prepares the storage of them and
14:13 dalek MoarVM/spesh: adds a first pass at the code for checking them.
14:13 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/f0d1d7211e
14:21 FROGGS morning
14:21 jnthn o/ FROGGS
15:01 zakharyas joined #moarvm
15:10 dalek MoarVM/spesh: 0848295 | jnthn++ | src/spesh/ (3 files):
15:10 dalek MoarVM/spesh: Start adding guards and specializing by arg type.
15:10 dalek MoarVM/spesh:
15:10 dalek MoarVM/spesh: Basically works, but we don't de-spesh yet on mixins, meaning we get
15:10 dalek MoarVM/spesh: some dispatches wrong and break some NQP tests.
15:10 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/0848295903
15:10 dalek MoarVM/spesh: 6e04b28 | jnthn++ | src/spesh/candidate.c:
15:10 dalek MoarVM/spesh: Fix inter-gen issue in spech candidate storage.
15:10 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/6e04b28d36
15:10 dalek MoarVM/spesh: e3c17bc | jnthn++ | / (5 files):
15:10 dalek MoarVM/spesh: Start labeling opts that are de-opt points.
15:10 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/e3c17bcb73
15:13 colomon joined #moarvm
15:13 JimmyZ Does it possible snapshot the optimized Bytecode and serialize it?
15:14 jnthn No.
15:14 jnthn Well, maybe, but it's highly non-trivial.
15:14 jnthn You'd have to re-construct all the safety proofs.
15:14 jnthn And some of them will depend on VM internals.
15:14 JimmyZ Yeah
15:15 jnthn So you'd end up with incompats.
15:15 jnthn So, quite nasty to do.
15:16 JimmyZ Or part of it, such as decont removing, set removing etc
15:22 JimmyZ What is Spesh short for?
15:23 FROGGS specialization
15:23 jnthn The "c" in "specialization" is pronounced like "sh"
15:24 jnthn If it was src/spec/ folks would likely think it was about specification, or ham, or something...
15:24 JimmyZ oh
15:25 jnthn Also it gives it a cute, short, name we can use to talk about it unambiguously.
15:27 JimmyZ I'm not native english speaker, so I'm more like optimize :P
15:39 raiph joined #moarvm
16:07 raiph timotimo (or jnthn): Do you understand the basics of what's being said in the two page "1. Introduction" section, including the diagram, from the 1971 paper at http://cs.au.dk/~hosc/local/HOSC-12-4-pp381-391.pdf? If so, can you help me properly understand if/how it might one day be relevant to NQP and MoarVM?
16:08 raiph (iiuc this stuff is a big part of the appeal of PyPy)
16:09 jnthn "One of the most difficult concepts in translator writing is the distinction between actions
16:09 jnthn done at translate time and those done at run time."
16:09 jnthn And don't I know it... :)
16:10 timotimo :3
16:10 jnthn BEGIN time in Perl 6 makes this especially fun :)
16:10 timotimo the fact that we can do so much in BEGIN time is pretty cool
16:11 timotimo do so much (without things blowing up left and right)
16:15 jnthn In the early days (pre-nom) you mostly just blew up there :)
16:15 jnthn Then we got QAST::WVals :)
16:17 jnthn Bah, e3c17bc was fail
16:19 timotimo how is that?
16:20 timotimo i'll probably see how in the commit you'll push to fix it :)
16:21 * timotimo AFIrc
16:25 jnthn whoa, I think my deopt code mighta just worked...
16:36 dalek MoarVM/spesh: e1b09c0 | jnthn++ | src/core/op (2 files):
16:36 dalek MoarVM/spesh: Fix deoptpoint instruction marks.
16:36 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/e1b09c088d
16:36 dalek MoarVM/spesh: 4942700 | jnthn++ | src/spesh/ (3 files):
16:36 dalek MoarVM/spesh: Start computing de-opt mapping table.
16:36 dalek MoarVM/spesh:
16:36 dalek MoarVM/spesh: Maps return addresses that may show up in specialized code to their
16:36 dalek MoarVM/spesh: original ones in the original code.
16:36 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/49427009f0
16:36 dalek MoarVM/spesh: 496f417 | jnthn++ | src/ (4 files):
16:36 dalek MoarVM/spesh: Store deopt mapping in cand, and cand in frame.
16:36 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/496f41771f
16:37 timotimo ah, the names didn't match
17:32 dalek MoarVM/spesh: eabbfd2 | jnthn++ | src/ (3 files):
17:32 dalek MoarVM/spesh: Update Lexotic to be de-opt safe.
17:32 dalek MoarVM/spesh:
17:32 dalek MoarVM/spesh: The effective handler set may change.
17:32 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/eabbfd24f3
17:32 dalek MoarVM/spesh: 8b2f676 | jnthn++ | / (4 files):
17:32 dalek MoarVM/spesh: Initial implementation of deopt.
17:32 dalek MoarVM/spesh:
17:32 dalek MoarVM/spesh: Triggered by mixins. Fixes the NQP test suite, and gets Rakudo to
17:32 dalek MoarVM/spesh: survive the CORE.setting build with arg-type specialization.
17:32 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/8b2f676d17
17:36 jnthn Ohh.
17:36 jnthn It's not deopts fault
17:36 jnthn It's that istype analysis is broke
17:37 timotimo oops, my fault i guess
17:37 timotimo oh, right
17:37 timotimo i forgot to mention ... it should only ever do istype at specialize-time if the type to be checked against is "simple"
17:37 timotimo right?
17:37 timotimo though i'm not sure how to implement that in C-space
17:37 timotimo in nqp it'd probably be something like $type_to_check.HOW =:= ClassHOW
17:39 jnthn yeah, there's a type_check_with_cache which is clsoe but not quite it
17:41 jnthn Time for stroll/dinner
17:41 jnthn Will have a look at it afterwards
17:42 timotimo thank you
17:43 timotimo i thought type_check_with_cache wasn't a good choice as it would never say "no"
17:43 timotimo it would only say "probably not"
17:59 profdel joined #moarvm
18:54 dalek MoarVM/spesh: f89bcb3 | jnthn++ | src/ (3 files):
18:54 dalek MoarVM/spesh: Correct istype optimization.
18:54 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/f89bcb3101
18:55 jnthn That almost gets it, but not quite
19:01 timotimo anything i can do about it?
19:03 jnthn oh...
19:03 jnthn I think it was setting the result wrongly.
19:03 jnthn oh, no...
19:04 jnthn It was right
19:04 jnthn Hmmm
19:04 timotimo MVM_TYPE_CHECK_NEEDS_ACCEPTS ←  i hadn't realized this exists; neat!
19:05 LLamaRider joined #moarvm
19:05 jnthn oh, the issue may be something other than type check
19:05 jnthn yeah, it is
19:07 FROGGS dev/nqp$ ./nqp-m -e1
19:07 FROGGS 42
19:08 FROGGS \o/ # I can haz embedded moarvm byteode thingies that get run im my executable!
19:08 jnthn :)
19:08 timotimo -e1? does that mean "run the first embedded bytecode" or something?
19:08 jnthn it's same as -e "1"
19:08 timotimo and the result of that is 42? :)
19:09 FROGGS *g*
19:09 jnthn uh... :)
19:09 FROGGS no, I compiled that "say(42)" to .moarvm, and included it as well as the nqp.moarvm
19:09 timotimo ah, ok :)
19:10 timotimo i like that
19:10 timotimo FROGGS++
19:10 FROGGS I need to disable that repl though, and tell it to just run the CUs
19:10 FROGGS timotimo: I guessed :o)
19:10 FROGGS when we link in the -lmoar statically, we would have a one-file thingy
19:11 timotimo i'll be interested to see how big that will turn out
19:23 FROGGS atm it is 2.2meg (nqp + say 42)
19:27 timotimo not bad
19:27 jnthn Turns out it's fine
19:28 jnthn It's just that a file earlier on in the build had been mis-compiled due to now-fixed bugs.
19:28 timotimo ah, what an annoying thing to track down!
19:39 timotimo the next thing i really ought to do in the spesh is to implement if_o and unless_o
19:39 timotimo they seem to be used much more frequently than if_i and unless_i
19:40 jnthn Well, but in contexts where we have the value?
19:40 timotimo only in that context
19:41 timotimo unless there are types where knowing the type of the thing would be enough to decide whether it's truthy or falsy?
19:43 jnthn No, you need the context
19:43 jnthn uh, the vlaue
19:43 timotimo good to know
19:43 jnthn And you can't do it in any case that does a method call
19:43 timotimo should not be terribly hard, then
19:43 timotimo there should be a simple flag i can read out to decide that, yes?
19:43 jnthn Well, the thing to look at is the boolification spec.
19:43 jnthn Oh, actually...there is quite a lot in that area.
19:44 jnthn Because the boolification spec *is* by type
19:44 jnthn And it tells you how to boolify it
19:44 jnthn so if you know the type you can remove a level of indirection potentially
19:44 timotimo oh, that's neat, too
19:45 jnthn I'm going to work my may now through things that lowered bindings do in Rakudo
19:45 jnthn And try to improve things a lot there.
19:45 timotimo \o/
19:46 timotimo wait, "work my may"? does that mean we'll have to wait another month? :(
19:46 jnthn *my way
19:46 jnthn haha...what a typo :)
20:14 dalek MoarVM/spesh: 7767e32 | jnthn++ | src/spesh/optimize.c:
20:14 dalek MoarVM/spesh: Sort ops in order.
20:14 dalek MoarVM/spesh:
20:14 dalek MoarVM/spesh: May improve code-gen.
20:14 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/7767e32077
20:14 dalek MoarVM/spesh: 7b11da1 | jnthn++ | src/6model/serialization.c:
20:14 dalek MoarVM/spesh: Don't lose HLL owner during serialization.
20:14 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/7b11da1051
20:14 dalek MoarVM/spesh: b2dc797 | jnthn++ | src/spesh/optimize.c:
20:15 dalek MoarVM/spesh: Optimize away hllize when possible.
20:15 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/b2dc797cae
20:19 timotimo how expensive is hllize in the normal case where the owner is already correct?
20:22 jnthn Not hugely, I think.
20:22 jnthn But it's still work we needn't do.
20:23 timotimo aye
20:55 flussence joined #moarvm
21:00 dalek MoarVM/spesh: 0700217 | jnthn++ | src/spesh/ (4 files):
21:00 dalek MoarVM/spesh: Specialize by type held within scalar container.
21:00 dalek MoarVM/spesh:
21:00 dalek MoarVM/spesh: Enables us to start eliminating more type-check related instructions
21:00 dalek MoarVM/spesh: in Perl 6 binding.
21:00 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/0700217955
21:02 timotimo does nqp require some fiddling to make use of the same kind of optimization here?
21:03 jnthn It doesn't emit type checks; signature type checks only take effect for multi dispatch
21:05 timotimo ah, yes, now that you mention it i do remember that
21:27 dalek MoarVM/spesh: 30a287a | jnthn++ | src/spesh/optimize.c:
21:27 dalek MoarVM/spesh: Optimize away isconcrete when possible.
21:27 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/30a287aeef
21:27 dalek MoarVM/spesh: 629caee | jnthn++ | src/spesh/optimize.c:
21:27 dalek MoarVM/spesh: Optimize away assertparamcheck when possible.
21:27 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/629caee3e5
21:34 timotimo i'm quite fond of the fact that turning istypes and such into constant values will sometimes remove getting the value (for example the wval for the type itself) from the bytecode completely
21:41 jnthn Aww...somewhere along the line the Rakudo build has broken
21:47 timotimo should i try to build rakudo at a specific revision for you?
22:12 jnthn I...think it may have been a local Rakudo patch doing it :/
22:13 timotimo i'll try to build moarvm/spesh then
22:13 jnthn Or partly to blame
22:14 timotimo are there juicy opportunities in the specializer right now to improve regex/rule performance?
22:15 timotimo /home/timo/perl6/rakudo/../install/bin/nqp-m --target=mbc --output=blib/Perl6/Actions.moarvm --encoding=utf8 \
22:15 timotimo src/Perl6/Actions.nqp
22:15 timotimo Use of undeclared variable '$copy' at line 6366, near " {\n       "
22:15 timotimo oh
22:15 timotimo that's a local patch, too :)
22:16 timotimo hmm
22:16 timotimo Stage parse      : Package 'Scalar' already has parent 'Scalar'
22:16 timotimo at src/gen/m-Metamodel.nqp:663  (blib/Perl6/Metamodel.moarvm::43)
22:16 timotimo that's with all changes stashed
22:18 timotimo oh, huh
22:19 timotimo with MVM_SPESH_DISABLE=yesplease i get Stage parse      : This type cannot unbox to a native integer
22:19 timotimo at src/gen/m-Metamodel.nqp:2673  (blib/Perl6/Metamodel.moarvm:compose:61)
22:22 jnthn b2dc797 seems to have been fine
22:23 jnthn Provided I make clean Rakudo first.
22:23 timotimo i make m-clean too
22:26 jnthn Hmm...0700217 also was after a clean
22:26 timotimo aye, b2dc works here, too
22:27 jnthn Trying 30a287a
22:27 jnthn aha...
22:28 timotimo Stage parse      : Package 'Scalar' already has parent 'Scalar'
22:28 timotimo on 30a287a
22:29 jnthn Yup
22:29 jnthn I think that one must be to blame.
22:29 jnthn But...how on earth...
22:30 jnthn oh...
22:34 jnthn No, I don't see what's up
22:34 timotimo time to dig into the spesh logs :P
22:36 jnthn timotimo: Yeah.
22:36 timotimo it also breaks with MVM_SPESH_DISABLE
22:36 timotimo for you, too?
22:36 timotimo i couldn't get it to output any spesh log file either
22:36 jnthn Oh, I didn't try that, but that'd be a real weird thing
22:36 jnthn I mean, because if I get head
22:36 timotimo it is already weird to me.
22:37 jnthn And then comment out the optimize_isconcrete call
22:37 jnthn Then it's happy again.
22:37 timotimo i bet it's a missing break!
22:37 * timotimo looks
22:37 timotimo nope.
22:37 jnthn No :P
22:38 dalek MoarVM/spesh: 02883cd | jnthn++ | src/spesh/optimize.c:
22:38 dalek MoarVM/spesh: Back out optimize_isconcrete; it breaks something.
22:38 dalek MoarVM/spesh: review: https://github.com/MoarVM/MoarVM/commit/02883cdc81
22:38 jnthn I'm tired, but not *that* tired :)
22:42 * jnthn pours a Russian Imperial Stout
22:46 jnthn spectest ain't bad with that
22:46 timotimo with the stout?
22:48 jnthn no, with 02883cd :P
22:49 timotimo oh
22:49 jnthn timotimo: If you fancy doing something to help spesh do better, getting the NQP regex optimizer able to play nice with the main language optimizer would be good
22:49 jnthn timotimo: Then we can remove the poisoning off all the regexes
22:50 jnthn timotimo: Which in turn means that spesh can compile-time resolve the methods
22:50 timotimo my $*OUTER_OPTIMIZER? :P
22:51 timotimo the action methods in particular, eh?
22:51 jnthn I think you alrady pass some adverbs to the regex optimizer. Maybe there is fine.
22:51 timotimo or does that also include calls to subrules?
22:51 jnthn No, it's already doing OK with the action methods
22:51 timotimo that's good
22:51 jnthn I mean the method calls to subrules, !cursor_start, etc.
22:52 timotimo that does sound helpful
22:55 timotimo why did i do the thing with @!outer
22:56 timotimo ah, a big part of that was moving stubbed out blocks somewhere so the compiler won't get sad during serialization/compilation
22:59 timotimo i wonder if it would be okay to directly call into $!outer_opt.visit_block
23:00 timotimo i wonder if i should visit the children of that block with the regex optimizer, too
23:01 colomon joined #moarvm
23:02 jnthn timotimo: I think it should be safe
23:09 timotimo it doesn't explode at least
23:09 timotimo i'll have to spectest to convince myself it's all right
23:09 jnthn Did you unpoison the opt?
23:10 timotimo oh, i forgot that part :)
23:10 timotimo that would probably make a big difference
23:11 timotimo No contextual found with name '$/'  -  yeah, no :)
23:15 timotimo do i perhaps need to introduce the outermost QRegex to the union algorithm as something barrier-like?
23:15 timotimo without completely poisoning lowering?
23:18 jnthn Hm, not sure
23:18 timotimo this is kind of hard to debug :|
23:19 jnthn yes, I know, I did a bunch of it the other evening ;)
23:19 timotimo oh btw, is there something we can do if we know a dynamic var has been just declared and is now being used? can we get around the dynamic lookup in that case?
23:19 jnthn I think we already code-gen that smarter
23:19 jnthn As in, turn it into a lexical access
23:20 jnthn Enough hacking for today for me :)
23:20 jnthn 'night
23:20 timotimo good night and thanks for all the fish^Wspesh!
23:30 btyler joined #moarvm
23:35 colomon joined #moarvm
23:54 colomon joined #moarvm

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