dalek arVM: 4e9210f | hoelzro++ | VERSION:
Bump VERSION
01:39
hoelzro if anyone's around with upload permissions, I've uploaded the tarball to hoelz.ro/files/MoarVM-2015.06.tar.gz 01:41
sha256sum 8dfe52630a3fcc749b653591f8a4e7fa723cd204cf0f6133b62b70d1b9c5980f
JimmyZ hoelzro: no change log? 04:21
06:41 TEttinger joined 06:51 FROGGS joined 07:04 zakharyas joined 07:55 brrt joined
brrt \o 07:58
nwc10 o/
brrt update on current 'research' into adapting dynasm
calculating all possible values of REX bytes and their proper locations is very difficult, because they interact with operand size overrides (for byte and word register sizes) 07:59
fortunately, that's not necessary 08:00
the correct hack would be to specify alternative sequences, and have dynasm work it out at runtime which alternative to take 08:01
end of update, i guess :-) 08:06
FROGGS :o) 08:09
TEttinger so is there some sort of template that github.com/arnsholt/snake and github.com/tokuhirom/Perl6-Renshu/...r/nqp-lisp are following? 08:37
I'm looking to start my own project along those lines
08:37 Ven joined
JimmyZ TEttinger: NQP itself? 08:41
TEttinger I was wondering, thanks
JimmyZ TEttinger: github.com/perl6/nqp/tree/master/e...es/rubyish 08:42
TEttinger sweet. 08:43
thank you very much!
arnsholt If you want a dead simple Makefile, I've got one in the Snake repo (arnsholt/snake at GitHub) 08:44
Sadly the dependency tracking is a bit broken, so you have to use "make clean all" to rebuild 08:45
But yeah, there's no explicit template for build systems and such, beyond 08:47
*beyond what's implicit in NQP and Rakudo
But those are relatively complicated
timotimo obviously we should totally build a build system just for nqp
it'd be called "nqsb" for "not quite sane builds", perhaps 08:48
arnsholt =D
timotimo or maybe "nqsbt" - not quite sane build tool 08:50
TEttinger arnsholt, I'm afraid dead simple makefile is not always the case on windows :) 08:53
timotimo, which is funny because Scala has sbt as their build tool 08:54
arnsholt Yeah, can't help you there =)
TEttinger arnsholt, no worries, I need to get a bit of learning experience here
timotimo TEttinger: i'm aware :) 08:55
a friend of mine is quite fond of sbt, iirc
oh, and also, our very own and lovely panda will be replaced by nqpm
JimmyZ nqpm? nqp-m? 08:56
timotimo oh
that's a problem
JimmyZ whereis nqpm? :)
TEttinger quite-the-package-manager 09:00
qtpm
woah, did moar 2015.6 release in the last 7 hours? 09:03
timotimo yeah, it seems like hoelzro just did the release in a few minutes while nobody was looking
fastest-seeming release i've ever seen
TEttinger it isn't on the moarvm.com site yet 09:05
timotimo right, jnthn could upload it to that web server
09:06 zakharyas joined
JimmyZ and no changelog update :P 09:27
timotimo that, too 09:29
oh 09:30
we don't have a changelog section for this month at all
timotimo has a quick look 09:31
changelogs i write are usually shorter than jnthn's :\ 09:37
dalek arVM: e8d02ad | timo++ | docs/ChangeLog:
First draft of MoarVM changelog 2015.06
09:40
timotimo does somebody want to flesh it out?
09:44 brrt left 09:55 hoelzro_trying_w joined 09:58 Ven joined
TEttinger oh boy. so GCC is not working for me when I try to build Moar, and I am not sure why. it can't complete the probe to see if it thinks it's GCC 10:49
MSVC gets further, but chokes with a parser stack overflow on unicode.c 10:50
will Clang potentially work?
JimmyZ msvc works here 10:51
arnsholt Clang should work 10:53
But it's odd that it doesn't build on the MS toolchain, as that's what jnthn uses...
jnthn builds with MSVC nearly every day... 10:57
TEttinger I'll ask him later 11:00
JimmyZ, what version? 11:01
I am using 2015 RC
32-bit
nwc10 would be useufl if the probe fails, that it knows how to print out the STDERR
JimmyZ msvc 2012 or 2013, 64bit
nwc10 clearly that's a missing feature
TEttinger I'll try 64
JimmyZ express verstion
*version
TEttinger community here
11:02 brrt joined
brrt dynasm might just be the most evil codebase i know 11:05
github.com/MoarVM/dynasm/blob/mast...x86.h#L274
i submit for evidence ^
timotimo i think you have to explain that to me :\ 11:06
i don't see the evil
is it just the if (...) with a { directly below it that doesn't if the block to the condition? 11:07
TEttinger same error, src\strings\unicode.c(45034): fatal error C1026: parser stack overflow, program too complex
timotimo TEttinger: what versions are involved here?
TEttinger sorry, 2015 RC, 64 bit community 11:08
on windows 7
64
timotimo shouldn't that be totally fine?
TEttinger I'd like a pony
I'd settle for a building NQP :)
JimmyZ or simply use only msi package :) 11:09
TEttinger NEVAR
I need to make source mods to the rubyish example
11:09 brrt left
TEttinger which may or may not require compiling NQP! 11:09
JimmyZ TEttinger: you can run the rubyish by the msi nqp too 11:10
TEttinger yeah, I probably should do that 11:11
I do want to be ABLE to build
JimmyZ or hack the probe to know gcc :P 11:12
FROGGS it does know gcc 11:15
JimmyZ or install a linux on virtualbox? :)
FROGGS and it works with gcc+gmake and cl+nmake on my windows 7 box
though, I used cmd.exe and windows sdk shell
JimmyZ me too 11:16
11:16 brrt joined
brrt has finally found the money line 11:17
also, timotimo, you *don't* find that evil?
timotimo is it only the in-line if with an "anonymous" block directly on the next line? 11:18
i just want to know if i'm looking at the right thing :) 11:19
TEttinger brrt, now that I see it, yeah that's awful. they just forgot about 'else' existing, huh 11:22
brrt well, mike pall is brilliant. just not in the 'readable code' sense
TEttinger sweet, with 2013 64-bit it builds 11:23
brrt timo: yes, that's the one i meant
TEttinger all tests pass too
brrt i have more evidence if you're really interested 11:24
github.com/MoarVM/dynasm/blob/mast...x86.h#L228 <- this one is also very nice 11:26
FROGGS TEttinger: can you please file a MoarVM issue?
timotimo brrt: oh come on, that's just like duff's device! :P 11:27
well, a little bit
dalek arVM/clang-static: a0a9245 | arnsholt++ | src/core/args.c:
Avoid memcpy() into a NULL pointer.
MoarVM/clang-static: c37feb0 | arnsholt++ | src/strings/nfg.c:
MoarVM/clang-static: Set a (previously unused) variable correctly, and use it.
arnsholt *sigh* I keep doing that >.<
11:28 dalek joined
timotimo that's putting in fixes to problems highlighted by clang's static code analyzer? 11:28
that branch*
arnsholt jnthn: I've pushed some commits to the clang-static branch, fixes suggested by running the MoarVM build through the clang static analyzer; is this a line of inquiry worth pursuing further?
timotimo cool
11:29 Ven joined
TEttinger FROGGS, just that it doesn't build on 2015 because of parser stack overflow? 11:30
arnsholt There's 41 more (although 15 of those are dead stores, so not really bugs as such). I've found a couple of false positives, but the NULL-deref warnings have mostly been on point (of the ones I've been able to make sense of)
FROGGS TEttinger: aye 11:34
psch i don't get how to do the getlexstatic_o for Failure in p6typecheckrv /o\
JimmyZ we need submit a bug report to microsoflt :P 11:35
psch: what's the blocker? 11:36
psch gist.github.com/peschwa/f399cf10914f1d287a74 is the latest seemingly-sensible thing i tried, and i have no idea how to reach the return value of getlexstatic_o
i get a "no such method result_reg" with that
i've tried using getlexstatic_o as it's used in QASTOperationsMAST.nqp:1373, but that gives me "Cannot invoke this Object" 11:37
i suspect there's some confusion how exactly QAST and MAST and all those registers work together :s 11:38
hoelzro JimmyZ: thanks for pointing that out; that wasn't in the release guide =/ 11:39
timotimo: thanks for working on the changelog; is that ready to go? 11:40
since no tarballs were uploaded, should I just re-create the 2015.06 tag? or should I create a 2015.06.1? 11:41
JimmyZ psch: you should not use $str_failure.result_reg; 11:44
and nqp::push(@ops, MAST::Op.new( :op('getlexstatic_o'), $str_failure) ); should be nqp::push(@ops, MAST::Op.new( :op('getlexstatic_o'), $failure_o, $str_failure) );
methinks 11:45
and nqp::push(@ops, MAST::Op.new( :op('istype'), $isfailure, $decont, $str_failure.result_reg) ); change to nqp::push(@ops, MAST::Op.new( :op('istype'), $isfailure, $failure_o, $decont) ); 11:46
psch ohh
that makes sense, the getlexstatic_o needs a return reg
hoelzro does anyone have thoughts on the tag/tarball situation? 12:09
JimmyZ hoelzro: you have the right :) 12:10
hoelzro JimmyZ: sorry?
JimmyZ I think it is ok the re-tag, if rakudo/moar didn't upload the tar 12:11
*site
hoelzro ok, thanks! 12:12
jnthn Never overwrite a pushed tag! 12:18
We can ship the tarball without the changelog
And put it in the release guide so we don't forget next time
It's not a huge deal
hoelzro jnthn: alright 12:20
good thing you stopped me =)
jnthn :)
If you want to read a foul-mouthed explanation of why I think Linus wrote one :P
TEttinger the kid with the blanket? :) 12:24
JimmyZ hmm, git-scm.com/docs/git-tag # have something about re-tag
timotimo hoelzro: i'm not sure it can just go in there like that 12:31
hoelzro timotimo: jnthn, JimmyZ, and I just talked about this; jnthn says it's ok to ship sans Changelog 12:32
but I'll be adding it to the release guide as punishment =)
timotimo :)
brrt (flying is horrible :-() 12:37
jnthn brrt: Pretty much... 12:41
brrt the only advantage is that it's fast 12:47
timotimo but at least you're secure from all the terrorists now that flying is so secure! 13:03
jnthn: i'm idly wondering what the state of escape analysis is 13:04
i remember there was the beginning of markup for ops as to how they behave with regards to escaping stuff
JimmyZ I had the branch :P
timotimo but nothing(?) that analyses BB code regarding that
brrt apparantly you are never secure from the terrorist in your pilot's head
timotimo first we'll have self-driving cars, then completely self-flying planes 13:05
JimmyZ timotimo: github.com/MoarVM/MoarVM/blob/alia.../mem.c#L27 13:06
timotimo ah, that 13:07
brrt it'd be better if we just all lived in the same place to begin with
timotimo i was refering to the escape analysis jnthn and masak prototyped on a train or something :)
JimmyZ the blocker for me is that I don't know do store remove, since it is a bit different from luajit ssa 13:09
timotimo hmm, store remove
is that like "no need to set an attribute, just remember it'd be put in an attribute in some register for later when we get it out there again"?
JimmyZ and cse etc
timotimo common subexp extraction? 13:10
JimmyZ yeah
no
wiki.luajit.org/Optimizations#CSE:-...limination
brrt JimmyZ - you can only do that to a very limited degree, yet 13:11
JimmyZ and wiki.luajit.org/Optimizations#FWD:-...Forwarding
jnthn You need to be really careful with store/remove
Because it intersects with threading
Meaning you need global escape analysis 13:12
JimmyZ yeah. which is tricky :(
brrt that's basically a real good example of luajit style clarity
JimmyZ and I really like wiki.luajit.org/Optimizations#SINK:...re-Sinking , which is beyond my ability :( 13:13
I know store/remove is more tricky with threads 13:14
dalek arVM: c29ba9b | hoelzro++ | docs/release_guide.md:
Update release documentation to include changelog update
brrt JimmyZ: my suspicion is that this is possible in fast paths which allocate an object (like a boxed integer), do some operations, and discard that 13:15
suppose i have a section that builds an object, sets some values, reads some values, loses the reference; that's easy enough to eliminate provided you are first able to express the loads and stores as separate operations 13:17
JimmyZ well, I think trace spesh may help it, if I understand it correctly.
brrt i don't think trace spesh will help you do that
but the SSA form will
basically, in moarvm the operations are often too high-level for an analysis like that to be valid 13:18
timotimo JimmyZ: does your branch do anything to running code yet?
brrt e.g. suppose i have a sp_create, sp_p6obind_o followed by a sp_p6ogetvc_o; the last of these may well autovivify an object 13:19
timotimo with an sp_fastcreate, it will only autoviv if the p6obind didn't bind a null 13:20
JimmyZ timotimo: not yet. I only wrote the basic code, but I don't know how to do FWD/DSE with SSA, though FWD and CSE may be easier
than DSE
brrt in that case i can't safely sink the create, bind, and get, unless i know that the object that is bound is nonnull 13:21
timotimo brrt: well, you can emit a branch, or use logging 13:22
JimmyZ en.wikipedia.org/wiki/Global_value_numbering # better than CSE? 13:23
brrt different than CSE :-) 13:24
it is my understanding that CSE should be done at a somewhat higher level, *or* a somewhat lower level, than a spesh graph
timotimo oh, huh 13:25
brrt because the spesh graph isn't going to introduce a lot of possiblities that weren't present in the MAST tree
but that is mho
maybe 'hunch' rather than opinion
timotimo how will turning allocations into stack allocations work btw? will we reserve a piece of space at the end of a frame to store inlined/flattened objects and add those to the frame's gc mark routine and that's it? 13:27
brrt that won't work
timotimo does it have to look more like alloca?
JimmyZ not alloca 13:28
otherwise you may get SEG :)
timotimo what's that?
brrt wait, i'll get back to this 13:29
JimmyZ it is more like local var, methinks
timotimo well, our local vars are still just pointers 13:31
i thought one of the great things about having escape analysis would be being able to get rid of a whole lot of Scalar objects that used to go in the nursery
JimmyZ timotimo: wiki.luajit.org/Allocation-Sinking-...oint-Class explains it
brrt i agree. i think the point of escape analysis and allocation sinking is the same 13:32
anyway, the point is not to do stack allocation, for two reasons
a): that'll never work with GC
b): stack is also just memory 13:33
c): moarvm is stackless (you dummy)
:-P
three reasons
i can't count
JimmyZ the link explains how to turn objects into register
without allocation
brrt right 13:34
it's a strenght reduction
masak jnthn: we really should get back to escape analysis. I'm kind of eager to find time for that again.
timotimo oh, you mean you "spill" an object's attributes into registers
brrt with spilling we typically refer to moving registers to memory :-) 13:35
JimmyZ brrt said allocation-free frame, is the same thing, methinks.
timotimo sorry :)
JimmyZ timotimo: yeah
brrt but yeah
if you make an object, write, then read from that same object, then discard it, then you can skip all that and just keep the calculated values in registers, or local memory as needed 13:38
and in that sense, having tracing helps
because objects are often used to communicate state over routine boundaries 13:39
timotimo i was expecting stack-allocated objects could also be passed to callees, though
brrt who would these callees be?
timotimo but i suppose that would cause the object to be considered escaped
and that would prevent stack-allocating the object in the first place
FROGGS btw, if someone tried to port moarvm to Hurd, (s)he would have to take parts of the aix codepath, and port the pollset stuff to poll 13:44
14:10 JimmyZ_ joined
JimmyZ_ brrt: so tracing is the blocker, if it helpsšŸ˜Š 14:11
14:16 lizmat joined 14:19 brrt joined
brrt respectfully, i disagree 14:19
they are separate optimizations
tracing removes routine boundaries
allocation sinking removes memory traffic / copying 14:20
the latter works better if the former is implemented
but they are conceptually quite different
JimmyZ_ right
brrt also, timo, again we're stackless :-) 14:21
if you'd
'allocate' an object in mvm register space
you'd run into all sorts of problem, because nobody expects a header, object body, etc
and if you'd allocate an object on the 'C' stack, you'd run into all sorts of problems, least of all cleanup 14:23
timotimo well, yeah, but we have MVMFrames 14:47
and they could in theory have flattened STables for objects at their end or something like that
like P6Opaque does
i dunn 14:48
i dunno*
brrt hmm 14:52
15:00 brrt joined
jnthn You could allocate on the end of the ->work area provided the GC had a map of what's there 15:07
timotimo that's what i'd've put the STables in there for 15:11
at least the REPR and REPR_data needs to be there
jnthn Hm, actually yeah, you just need to know the end, since everything knows its size 15:20
timotimo my thought as well 15:23
then you can just compare against the "beginning" of the last+1th element
no need even to keep a dedicated counter variable around
15:24 FROGGS joined
brrt ok, even supposing you did that, what would the benefit be 15:25
jnthn brrt: Object dies when the frame dies, making no work for the GC
brrt if the object dies when the frame dies, it needn't exist at all 15:26
if you can prove the object does not escape, you can simply map the attributes to the frame
i suppose you can argue you allocated the object on the frame, but i'm not sure i agree 15:27
jnthn That's a separate and not always possible optimization.
Not all representations are objects with attributes
brrt moreover, if you do create a real object on the frame, you'd better be really sure it's never ever pushed as a (temporary) gc root 15:28
jnthn It's not a problem.
brrt hmm... i'm not sure i can easily imagine a reason 15:29
jnthn Well, it needn't be a problem.
brrt why not
you'd have to mark them unmovable, at the very least
15:29 Ven joined
jnthn You could easily flag such an object as frame-owned 15:29
brrt yes, well, that would help
jnthn Much like we have to flag gen2 things.
brrt right 15:30
i suppose that would work for dynamically-sized stuff 15:31
like bigints and strings
jnthn bbiab 15:32
brrt that you can't map onto attributes
see you (i'll be having dinner soon enough anyway) 15:33
timotimo oh, you mean we could also instead of mallocing + freeing string body data at that place 15:34
brrt i'm not sure what i mean :-) 15:51
timotimo well, bigints and strings are only "dynamically-sized" in that they have a pointer to a region of memory that can be any size 15:53
brrt yes. however, if you want that data to disappear after leaving the frame, you either have to add a frame cleanup function, or allocate it to the end of the work space 15:55
and that then means you can't have more than one such structure 15:59
brrt afk 16:11
timotimo in theory you can already know in advance what you're going to be allocating "in the work area" 17:34
except if it's in a loop. hmm.
arnsholt timotimo: BTW, running MoarVM through the static analyzer is ridiculously easy. Just `scan-build make` and then `scan-view $file` to check out the log 17:45
timotimo cool 18:03
huh, apparently we try to free functions sometimes? 18:05
i probably better get your branch with fixes before i look into any of the warnings :) 18:06
oh, i think it reached interp.c 18:09
clang isn't very good at that huge switch statement, i believe :)
18:20 kjs_ joined 18:40 kjs_ joined 19:02 brrt joined
jnthn Tomorrow and most days next week are for Perl 6 :) 19:02
And Moar :)
hoelzro \o/ 19:05
19:05 vendethiel joined
nwc10 you're safely back home? 19:05
19:08 vendethiel- joined
jnthn nwc10: For some definition ;) 19:10
I'm at my Sweden home for the last week.
timotimo clang doesn't know ALIGNOF can't return 0
jnthn So, it'll be a week of packing and hacking... :)
nwc10 I was about to ask, the old beer fridge? Or the new one?
brrt why wouldn't alignof be able to return 0 19:21
for chars it would, or am i missing something?
oh, no, i am 19:22
it would return 1
for a char
19:29 kjs_ joined 19:51 brrt joined
brrt i think i'd start to bore you with tales of dynasm the interesting codebase 20:07
jnthn :) 20:08
"May you live in interesting times" :)
brrt right. i was under the impression that this was a curse of sorts :-) 20:09
not sure how i got that
jnthn ;) 20:14
japhb brrt: From the dynasm code links you posted earlier, I'd say that's a sure sign of someone who is "seeing through the code" to the output assembly underneath. His C style feels like someone who really, truly is writing "portable assembly". 20:29
brrt yes, i agree completely 20:30
comments, where they exist, are pretty good though 20:32
also, mind that large parts of luajit are in fact written in assembly 20:33
so it is probably indeed the way the author thinks 20:34
there is an mrm variable that i cannot, for the life of me, figure out what it means 20:38
maybe it's something to do with modrm byte 20:39
wiki.osdev.org/X86-64_Instruction_E..._SIB_bytes
aha...
20:54 kjs_ joined
jnthn Time for some rest 20:59
brrt: Good luck ;)
jnthn back tomorrow
brrt thanks :-) sleep well
timotimo gnite jnthn! 21:01
brrt offtopic: how on earth is a person to buy a decent stereo set these days 21:05
(mine is breaking due to software issues, as near as i can tell)
timotimo a ... stereo set? breaking due to software issues? 21:42
hm. could ALIGNOF(void *) be 0? 21:44
something must make clang think ALIGNOF(void *) is returning 0 21:56
and it's a constant expression
clang's report viewer doesn't handle our MVMROOT macro terribly well %) 22:01
brrt hmmm 22:02
that'd be weird, though
i couldn't see why a void* wouldn't follow the alignment rules of any other pointer type
(and yes. it is weird, but nothing ever happened to hardware, yet playback can often only be restored by a power reset) 22:03
timotimo o_O 22:04
brrt right :-)
but i'm sleeping now
good night
22:09 xiaomiao joined, kjs_ joined
timotimo FWIW, i think arnsholt's branch clang-static can be merged as-is 22:29
22:51 sivoais joined 22:56 kjs_ joined 23:06 moritz joined