github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
japhb timotimo: In the Spesh Performance Overview section of wakelift.de/2019/02/21/always-wear...scalaring/ , the screenshot shows up to 230% jit ... what does >100% signify? 00:35
timotimo psst! not so loud, or others will notice! 00:36
seriously though, the frontend just displays what comes out of the backend. you have to ask whoever is responsible for that how that happens 00:39
what did you say, that's me as well? well, i'll be ...
tbh i don't know how that happens either. i did see it, though 00:40
japhb I wondered if it was just a bug (sounds like it might be), or if it signified some special case (like "this code got re-jitted multiple times" or somesuch). 00:43
timotimo at one point i thought it could be due to OSR, but i don't think jumping into osr'd code actually counts up entries at all
02:40 Elronnd joined
Elronnd are there any resources on embedding moar? I want to use perl6 as a scripting language, so is there any way to call into moar to simply evaluate a string, rather than providing a filename? 02:44
and, how can I compile a .p6 file into a moarvm file? 02:48
I tried perl6 --target=moar on a test file, but it says "Cannot dump this object; no dump method" 02:54
(and target=mbc) 02:55
oh, I need a --output=. But how can I run the resultant file? When I try to I get a "Unhandled exception: Cannot call method 'cli-options' on a null object" 03:03
mst Elronnd: so I am totally ignorant of this, but the perl5 XS module p3rl.org/Inline::Perl6 apparently boots moarvm right and fucks with it so it can do that 03:16
Elronnd: hopefully somebody with a clue will turn up soon and help you, but that's the one embedding I know about and it definitely works, so maybe you can cargo cult from there until somebody who knows what they're talking about turns up 03:17
Elronnd thanks, I'm looking at that now 03:20
I'm not exactly sure that xs is, though, it looks similar enough to c to read, but there are a couple of thing I'm not quite sure of
most importantly, what an SV is
Found this perldoc.perl.org/perlxs.html but it's not that illuminating 03:22
well, I'm stuck 04:09
managed to get it running, but spits out this error now 0x0.st/z-Kx.txt
(from this code ix.io/1BT1/c) 04:10
Geth MoarVM: ugexe++ created pull request #1058:
Use preadv(2) instead of read(2) via uv_fs_read
04:13
08:08 domidumont joined 08:37 domidumont left 08:38 domidumont joined
nine Elrond: in line 52 it should probably read ret->cu->body.deserialize_frame 09:19
Elronnd: ^^^
10:06 brrt joined 10:50 brrt left 11:40 brrt joined 11:44 brrt left 11:51 brrt joined 12:05 brrt left 12:06 brrt joined
nine Oh, I just noticed that merge_bbs is no longer active. That's probably hurting the expr jit :/ 12:15
timotimo Elronnd: the first problem you're running into is that moar has to be invoked with the path to the perl6 extension ops; check what's in "perl6-m", it's a shell script 12:30
but in general, what perl6 --target=mbc spits out isn't runnable as a stand-alone program, i think? 12:31
nine It isn't
timotimo i imagine the first problem is that the code would have to have code in it to find the ModuleLoader and from that the core setting and all that 12:32
perl6 --target=mbc is at the moment the same thing we use to precompile modules; precomped modules are already big enough without having "make me stand-alone code" stuff in it :( 12:33
of course that doesn't mean there can't be a perl6-make-executable-moar-bytecode-file foo.p6 that does the necessary things
nine IIRC pmurias++ and/or ugexe++ have gotten pretty close to get that working already 12:37
brrt ohai 12:47
oh btw, nine++ for fixing the JIT nativecall bug :-)
nine :) 12:48
brrt does anybody know if there's any response regarding TPFs GSoC application? 12:49
MasterDuke brrt: i believe the 26th is when responses are sent 12:50
brrt I see. Exciting 12:53
13:05 brrt left 13:12 lucasb joined
nine Ok, I've got a fix for merge_bbs that will allow for us to activate it again. Now if I could just push to master... 13:25
13:34 domidumont left 13:36 domidumont joined
MasterDuke timotimo: in the "Optimization" tab, it might be good to explain the difference between "Deopt One" and "Deopt All" 14:23
timotimo: have you thought at all about if/how to support opening multiple profiles? and possibly comparing them? 14:31
timotimo i want to have that in at some point, yeah 14:37
MasterDuke e.g., i frequently create multiple profiles (e.g., stock rakudo, modified rakudo, v1 of whatever i'm profiling, v2 of whatever i'm profiling, etc) and open them all up in the browser and switch between tabs to compare
timotimo fortunately i had enough sense in me to not put that in the original list of deliverables for the grant
MasterDuke heh 14:38
i assume the easiest way to do that right now is start a new moarperf for each one on a different port?
timotimo yeah
though it'd be very easy to just separate them by a path on the server side
putting support for a "base url" into the profiler frontend could be a bit of tedious work, though, or it could be very easy :) 14:39
that'd save a little bit of ram at least :)
MasterDuke should i create an issue in the repo? 14:40
timotimo could be good for tracking it 14:41
MasterDuke github.com/timo/moarperf/issues/1 14:46
15:15 domidumont left
Elronnd nine: no because MVM_interp_run wants an MVMThreadContext*, not an MVMStaticFrame* 17:18
timotimo: perl6 and perl6-m are exactly the same thing on my system 17:19
timotimo yes
if you have --backends=jvm,moar then perl6-j and perl6 will be the same
it uses what's first in the --backends list
Elronnd I was trying to do what inline::perl6 does, which is to use moar to start perl6 to run perl6 code, because that seems more feasible. But that's what's not seeming to work 17:20
timotimo you can look at moar's main.c file to see how an MVMInstance and its initial MVMThreadContext get created 17:21
Elronnd looking there
MasterDuke timotimo: how difficult would it be for moarperf to support old profiles? i.e., those without a 'replaced' field/column?
timotimo it should already support a profile without 'replaced'; are you getting an error? 17:22
MasterDuke timotimo: gist.github.com/MasterDuke17/edf3d...b14bc2329d 17:24
timotimo pushed a fix 17:26
MasterDuke timotimo: also, i just got a big red frowny face in the optimization tab 17:27
timotimo mhm
Elronnd well, I got a perl6 shell copying moar's main.c. But I want to have some way to say p6eval("say 'hello world';");, which I assume (?) can come from using moar to call into perl6 internals functions? 17:28
MasterDuke oh, refreshed and now it's fine 17:29
timotimo Elronnd: evaling code is something more high-level; you'll want to have some code that, for example, listens on a queue or something and reacts to that
Elronnd like, putting it on a different threat? 17:30
timotimo yeah, i'd say so
Elronnd I'm not sure if I want to do that bc then tls might get in the way
timotimo otherwise you can have moar NativeCall into your function as a callback and it'll return to your code 17:31
Elronnd oh, wait, that might actually work a lot better 17:37
because I can send the addresses of my functions from perl6 to c and then call them from there 17:38
hell, can just send over an EVAL
17:40 Kaiepi left
nine Inline::Perl6 uses the route via NativeCall 17:50
Elronnd: I don't understand your answer. I meant that line 52 should read in full: MVM_interp_run(ret->tc, init_frame, ret->cu->body.deserialize_frame); 17:52
Elronnd ohhhhh, I see 17:53
yeah, you're right
I'm struggling to get functions from p6 to c. I have a c library with void (*p6_say_hello)(int); void set_p6_hello(void *hello) { p6_say_hello = hello; }, and then from p6 I said sub set_p6_hello(&fun (int32)) is native("perl6-c") { ... } sub p6_say_hello(int32) is native("perl6-c") { * } sub say_hello(int32 $n) { say "Hiya!! I'ma perl6 ;o ($n)"; }, but when I do set_p6_hello &say_hello and then 17:56
p6_say_hello 7, I get a segfault
seems like that _should_ be fine syntax for passing callbacks according to perl6advent.wordpress.com/2015/12/...-beyond-c/ 17:58
18:01 lucasb left
nine Elronnd: that looks pretty correct. However, that's not the whole program, so I guess the error is in the rest :) 18:10
MasterDuke timotimo: a --profile of `zef info zef` gives wildly wrong numbers in the routines tab. e.g., hash2identity taking 55,340,232,221,127.82ms with only 3 entries 18:14
timotimo yes, zef uses "exit", and that makes the profiler extremely unhappy
MasterDuke anything i could do to get more sane numbers?
timotimo sadly, removing "exit" from zef is an arduous task 18:15
MasterDuke hm, this is where a coverage log could be useful, to see what exits are actually getting hit... 18:17
Elronnd nine: this is all my code sprunge.us/VEfZYv (and 0x0.st/z-bY.txt). Segfaults every time
timotimo MasterDuke: or wrapping "exit" with printing a stack trace :) 18:19
actually, i think you can set &*EXIT to something else?
Elronnd ahhhhhh, I can't call the function pointer
timotimo m: my &*EXIT = -> |c { say "haha, fooled you" }; exit 1
camelia haha, fooled you
Elronnd but I can call it fine from c
MasterDuke MVM_COVERAGE_LOG=c.log p6 -I lib/ bin/zef info zef gives an immediate segv
timotimo well, that sounds bad 18:20
BBIAB
MasterDuke gist.github.com/MasterDuke17/594b6...38c1900b8d
nine Elronnd: ooh...yes, now I see it, too 18:21
Elronnd: this would work: void (*wrapped_p6_say_hello)(int); void p6_say_hello(int n) { wrapped_p6_say_hello(n); } void set_p6_hello(void *hello) { wrapped_p6_say_hello = hello; } 18:22
Elronnd yes, that's how I got it to work 18:23
bit annoying that it needs the indirection but
¯\_(ツ)_/¯
small price to pay
now all I need is a way to dynamically make variables/variable names (since I can't EVAL them in without annoying hacks that just might work)
nine Well, storing pointers to Perl 6 functions in C just to call them from Perl 6 seems like a bit of a useless redirection anyway 18:24
Elronnd yeah true, I'm mainly going to be calling them _from_ c 18:25
18:36 domidumont joined
Elronnd github.com/Elronnd/libport tada! 19:14
nwc10 .tell jnthn ASAN very excited by more-pea - heap-use-after-free when building NQP -- paste.scsys.co.uk/583261 19:44
yoleaux nwc10: I'll pass your message to jnthn.
19:50 Kaiepi joined 20:02 domidumont left 20:58 brrt joined 21:29 Kaiepi left 21:30 brrt left 22:01 brrt joined 22:10 brrt left 22:13 robertle left 23:40 Kaiepi joined