01:26 FROGGS_ joined 01:32 benabik joined 06:41 FROGGS_ joined 07:07 hoelzro joined 07:10 zakharyas joined 07:16 rurban joined 07:23 brrt joined 09:26 FROGGS joined
timotimo jnthn: should i add code to decrement the usage counters from the facts database to MVM_manipulate_del_ins? 09:50
and the same in reverse for insert_ins? 09:51
i think that'd be necessary to remove the wval lookup for the type we compare to in an istype 09:54
otherwise i can just manually decrement in optimize_istype
hm, will nqp::istype sometimes require the instance to be inspected rather than the type itself being enough? 09:58
i'll probably have to check what exactly the type of the to-check-against thing is and only allow "simple" things to have the specialization to be applied to them
hm, istype_cache_only unfortunately doesn't give different results for "no cache found" vs "this is definitely not of that type" 10:05
dalek arVM/execname: bcc2cf4 | (Tobias Leich)++ | / (10 files):
implement op execname which returns ARGV[0]

This will only get useful when we provide a proper binary for nqp-m and perl6-m
12:21
nwc10 FROGGS: "you" might be wanting to extend the implementation of that with the code from Perl 5 which figures out absolute path on a bunch of OSes 12:50
but that's a nice-to-have
FROGGS nwc10: question is: does moarvm run on these OSes? because I don't wanna implement broken stuff for OSes that I cannot test on 12:59
nwc10 linux, yes 13:00
FreeBSD, last I checked, yes
lizmat maybe just leave a comment to check the Perl 5 source when needed ?
nwc10 Solaris, I think so
OS X, yes
FROGGS okay, I have most of them in virtual boxes...
13:11 LLamaRider joined
nwc10 I think that the "bigger" problem is that as soon as someone tries to package MoarVM for Debian they are going to hit portability problems 13:21
right now, I think that it only runs on "both kinds of architecture"
x86 *and x86_64
it should (at least) run on all little endian.
and hopefully not much work to get big endian too
xiaomiao all two users will appreciate the effort ;) 13:24
xiaomiao hasn't hasn't seen any requests for any perl6-related stuff outside of both x86 flavours 13:25
nwc10 all two users on what?
aha yes.
>2 million Raspberry Pis shipped.
aynway, point is that it likely won't get packaged for Debian if it's less portable than Parrot 13:26
xiaomiao on Gentoo I'm aware of at least one user of rakudo
so I guess there's not much demand yet
nwc10 not yet. No star release yet for a backend with supported concurrency 13:27
and Perl 5 is still faster
and no, we're not going to slow down Perl 5 to help :-)
xiaomiao herp :)
just saying, I've not noticed any actual usage, so portability doesn't even seem to be an urgent problem 13:28
nwc10 yes, agree with where you're coming from
but I think it's kind of a bootstrapping problem
my hunch is that there won't be packages until portability is better
and without packages, there won't be (as) many users
xiaomiao hehe 13:30
well, I've been keeping things up to date on gentoo ... even if I don't have a use for perl6 yet
nwc10 that's useful. thanks for doing that 13:31
xiaomiao I collect weird languages ... j, opendylan, perl6 ... 13:32
in terms of "being good upstream" the perl6 crowd is pretty much a rolemodel, with working tarballs 'n stuff 13:33
13:59 jnap joined
FROGGS nwc10: back to execname: the goal *is* to return an absolut path so I will steal from P5, though, we need a real nqp/perl6 binary first instead of a shell sript 14:04
script*
nwc10 I don't know how to do it on Win32, but I think that something in win32/*.c does 14:05
FROGGS and this binary would it make easier to run things in gdb 14:06
14:41 camelia joined 14:57 btyler joined 15:40 jnap1 joined 16:13 jnap joined
timotimo great 16:57
now i implemented actually turning the istype into a set and it giveo Type check failed in binding; expected 'Int' but got 'Int' 16:58
jnthn You probably want to turn it into a const_i64 16:59
timotimo ah 17:11
that kinda makes sense :)
jnthn timotimo: Just done some sketching of a lex => loc algo.
I *think* I can do it in one trip down the tree.
Collecting info down, lowering/flattening on way up. 17:12
With careful unioning.
timotimo that sounds nice :)
jnthn Well, ideas usually do, but I need to code it to see if it will be nice. 17:13
I think I'll take dinner, and then see what energy I have :)
(Slept badly last night, then taught all day, so may be zombie after dinner.)
timotimo: About your sp_get_arg_o crash: you mighta been missing validation of register type compat. 17:14
timotimo: That is, you can only sp_get_arg_o if the callsite says you're being passed an o
The required args code carefully checks for that. 17:15
i need to look more carefully at what you ended up with to see if that's the issue, but it may be.
Anyway, I haz an appetite so I'm gonna go eat :) 17:16
bbia
b
timotimo i thought i put checking code in there, too? 17:44
but maybe i need to add + req_max to i in there each time, too
that'd make sense
wow, i am dumb 17:46
actually, no, that was correct
well, half of it
dalek arVM/spesh: 92b30f6 | (Timo Paulssen)++ | src/spesh/args.c:
these indices were off-by-req_max.
17:51
arVM/spesh: e2c08e8 | (Timo Paulssen)++ | src/spesh/optimize.c:
staticify istype for a spesh-time-known value or type
nwc10 zombie jnthn needs offal? A particular sort of offal? From long pigs? :-) 18:10
18:18 jnap joined 18:51 rurban_ joined
jnthn Well, the pig I just ate was pretty good... :) 18:54
18:59 btyler joined
timotimo jnthn: what would introducing the fact that we know the literal value of a register to the fact database look like? 19:03
would i have to box an int for that?
jnthn wtf 19:04
no!
timotimo well, it has a slot for a MVMObject *
jnthn You just an a .i64 slot to the union. 19:05
timotimo and a flag to say "it's an i64"?
jnthn No
You don't need it.
timotimo oh, duh
the register is typed
jnthn You already know the types of all the...right :)
And the bytecode was validated
timotimo i'm not a smart man all the time
jnthn Well, my "wtf" was more a "argh no" ;)
timotimo it's all right :) 19:06
jnthn Because if the specializer allocates we're...in trouble.
(Does a GC allocation, that is.)
I was just seeing the bugs already :)
timotimo fair enough :)
jnthn makes branch, opens Optimizer.nqp 19:18
timotimo jnthn: do you think collapsing cascading sets would be worth anything yet? 19:19
as in: you turn some deconts into sets, but could just as well just re-name registers instead
FROGGS hmmmm, looks like I have an nqp-m ELF binary now...
timotimo oooh!
a fakecutable?
FROGGS no, not very faky
timotimo well, i think that's the name for it, though? 19:20
jnthn timotimo: I'd pondered that.
timotimo: I think you can prove it's OK off usage counts but I was worried about BB spanning.
FROGGS what is moarvm's binary?
jnthn timotimo: That is, I couldn't convince myself the naive thing was safe.
timotimo ah, ok 19:22
i thought that's what SSA is for :P
FROGGS timotimo: I took MoarVM's main.c, hardcoded the args we put in the nqp-m.sh, and compiled it to nqp-m ELF
timotimo ah 19:23
that's cute
jnthn timotimo: Yeah. I think it *is* safe, something bothered me.
FROGGS so we can properly get its executable name (and then its absolute path), and it is easier to run using gdb or valgrind
jnthn timotimo: I was probably just tired.
timotimo: 'cus I can't think of it now. 19:24
timotimo oke :)
FROGGS: next step would be to link the .moarvm files it needs into the binary itself :) 19:25
FROGGS timotimo: hmmm
:o)
would be nice to include the modules... but, well, not now :o) 19:26
benabik If you want to rename/remove registers, I _think_ you still need def-use information in SSA. It’s just that the def-use links are very simply.
timotimo mhm
benabik is currently taking a compiler optimization course.
jnthn benabik: Well, there's one def :) 19:27
timotimo: Oh! I remembered it.
timotimo: It was de-opt I was concerned about. 19:28
timotimo oh?
because we deopt right in the middle of code, yes?
jnthn Well, we can know the risk points.
benabik jnthn: Like I said: simple. :-) But uses can be in any block the def dominates, so you still ned to have it. 19:29
jnthn Basically, anything invokey.
benabik: Aye, agree.
timotimo an opt for later, then
benabik tried to implement a simple copy propigation step in a toy compiler, found it was more complex than expected. 19:30
(Not too bad, but that wasn’t the assignment anyway.) 19:31
dalek arVM/spesh: 4f4c34f | (Timo Paulssen)++ | src/spesh/ (2 files):
introduce the known value of istype result to facts database
19:38
timotimo now we just need to use that in "if" :P
do i have to do some kind of check for the "get" op to figure out what the types of the source and destination registers are? 19:44
jnthn Which get op? 19:47
timotimo er, set
jnthn oh
Here's set's definition: 19:48
timotimo i would think i'd have to, unless i can just assign the complete union with =
jnthn set w(`1) r(`1)
timotimo the backtick means "anything"?
jnthn `1 means a generic type arg
timotimo or rather: the same thing twice
jnthn Right.
set is always between two registers of the ame type 19:49
timotimo ah, excellent
jnthn And the validator ensures it.
dalek arVM/spesh: 385649a | (Timo Paulssen)++ | src/spesh/optimize.c:
fix compilation
19:50 japhb_ joined
dalek arVM/spesh: f5dd758 | (Timo Paulssen)++ | src/spesh/optimize.c:
propagate known type/value through set op.
19:50
jnthn timotimo: uh... 19:52
timotimo: I thought I'd done that already...
timotimo oh?
... maybe?
i can check
jnthn oh, I see
timotimo oh
jnthn well, see fact.s 19:53
timotimo yeah, in add_bb_facts
jnthn .c
timotimo i aint reading assem... oh :)
jnthn But yeah, we need to re-prop.
Because we figured out something new during optimize phase.
So it's ok
timotimo yes
but i can use copy_facts :)
oh, it really copies everything forever
should my code stay the same or copy the fact completely? 19:54
jnthn For set I think you can copy the log...or at least, if copy_facts in facts.c does 19:55
timotimo the log? 19:56
jnthn *lot 19:57
timotimo mhm 19:58
i'll change it later
i don't see a lot of output from my iffy-op-optimization attempts yet :\ 20:06
(when compiling nqp and rakudo) 20:07
so far i only do if_i and unless_i, though
jnthn We're not yet going to be in a good place to take advantage yet of the istype thing. 20:08
I'll try and put in at the weekend the stuff to actually specialize on incoming types.
timotimo ah 20:09
yeah, that'd be important :)
jnthn Once we do *that*, Rakudo's bind lowering will then mean we can take advantage of istype elimination for the bind type checks.
timotimo should i try to build constant propagation for more ops? like lt/gt perhaps?
jnthn Only if you can test them.
timotimo test as in make test cases that show if it's correct?
jnthn Yeah
I'd rather we just do the if ones for now 20:10
timotimo fair enough
dalek arVM/spesh: 50bc7a7 | (Timo Paulssen)++ | src/spesh/optimize.c:
if_i and unless_i for known values can be optimized
20:11
jnthn timotimo: I think you should be able to try that one out with an "if 0 { } else { }" in NQP :) 20:13
timotimo i thought so, too 20:14
waiting on the spesh diff output now :)
oh, my test probably didn't succeed because it wasn't using native ints 20:17
and thus it would have used if_o rather than if_i
nqp also uses if_o in this piece of code i made 20:18
timotimo tries sub foo(int $foo) instead
but i think that doesn't actually do anything in nqp?
const_i64 r0(1), liti64(0) 20:20
unless_i r0(1), BB(3)
could it be that const_i* doesn't get fact'd yet?
doesn't seem so, actually 20:21
that would go in facts.c, right?
jnthn right. :) 20:23
You'll be better at this than me soon :)
timotimo++ # diving into spesh
timotimo is an excitement-driven developer 20:24
and you just gave me a pretty exciting toy to play with :)
benabik I’d probably dig into that, but this month is my area exams. Maybe I’ll have some spare time when I’m off at my internship this summer. 20:26
jnthn benabik: Nice :) 20:27
benabik: Good luck with exams!
timotimo i'm turning the literals into facts now, but the iffy optimization doesn't kick in yet. hum. 20:32
haha
missing a break; 20:33
before a default: return :)
dalek arVM/spesh: dd32d69 | (Timo Paulssen)++ | src/spesh/optimize.c:
bah, gimme a break;!
20:34
jnthn :D
dalek arVM/spesh: aafcaed | (Timo Paulssen)++ | src/spesh/facts.h:
more known value type options
arVM/spesh: 47d5c64 | (Timo Paulssen)++ | src/spesh/facts.c:
learn values from const_i* ops
timotimo oh, that segfaults now 20:35
jnthn heh, I was just "argh, analysis, why you think that can be lowered"
And then realized it had found an unreferenced var...
:)
timotimo um, yay? 20:36
dalek arVM/spesh: ca0a244 | (Timo Paulssen)++ | src/spesh/manipulate.c:
BBs with no children could explode.
20:38
jnthn Well, it means it wasn't wrong in that way.
timotimo turned an iffy op into a goto
MVMArray: Can't pop from an empty array
hooray :)
timotimo hunts more and more problems 20:39
(that he himself created in the first place ... oh well)
i had the iffy thing backwards 20:43
given the output i just pasted in #perl6, it seems like there's a predecessor that doesn't get removed :\ 20:45
oh, i have to go through *all* successors and remove the predecessor :)
wait, does that make sense?
dalek arVM/spesh: bb545cd | (Timo Paulssen)++ | src/spesh/optimize.c:
the iffy optimization was exactly backwards
20:46
jnthn timotimo: Well, the stage at the end should do that. 20:48
timotimo: The final "kill dead bbs" one
As it iterates
timotimo oh 20:49
maybe that's missing ATM. i'll have a look soon-ish
but first:
late night tea
20:51 colomon joined
timotimo will i be seeing lex2loc before you go to bed tonight? :) 20:55
jnthn mebbe 21:16
timotimo: Do you know if the regex optimizer calls back into the normal optimizer for blocks it finds? 21:21
jnthn is guessing "no"... 21:24
timotimo i think so 21:28
er no 21:29
the other way around though :P
jnthn I've got something that gets through the build and passes many of the NQP tests 21:37
Something is a bit off as something is busted with string escapes
including interpolation
timotimo oh, that's interesting 21:43
jnthn Oh, I found it.
timotimo does it make a funny anectode? :)
anecdote*
jnthn No, it tells us that we really, really, should fix the optimizer to walk embedded blocks in regexes. 21:44
timotimo ah 21:45
yes, it really should.
i special-cased blocks-in-regexes for my lex2local search thingie
but that's not sane at all.
jnthn But I think I can work around it for now my poisoning the whole block var state stack.
timotimo but the optimizers will have to pass data back and forth
that's what i had implemented early on, yeah
jnthn Well, if you pass the optimizer instnace into the regex one then you'll be fine.
It should just call back into it later.
timotimo "found a regex? oh, i'll just forget about optimizing, then" 21:46
21:47 woolfy1 joined
jnthn ok, now I'm down to 2 failing tests 21:47
timotimo in nqp?
that should be 0, though! :P
jnthn test files
yeah
timotimo mhm
timotimo is playing violent vidya games and can't develop right now 21:48
enough of that for now 22:03
jnthn timotimo: OK, pushed my hacking. 22:09
timotimo cool 22:10
it's still at 2 failing test files?
jnthn No
It passes all NQP tests and builds a Rakudo that passes sanity tests. 22:11
timotimo yay!
i like the sound of that!
jnthn Feel free to spectest it.
23:10 colomon joined 23:59 colomon joined