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