Geth MoarVM: 3e8236593a | (Samantha McVey)++ | src/strings/ops.c
Make `eqat` 1.7x-2.5x faster

For strings a and b: 1. Both a and b are strands 2. Both a and b are flat 3. One is flat and one is a strand
... (9 more lines)
00:57
MoarVM: 9b142a0d30 | (Samantha McVey)++ | src/strings/ops.c
Fix indentation of switch in substrings_equal_nocheck
MoarVM: f59ac65d99 | (Samantha McVey)++ | src/core/coerce.c
Use PRIi64 macro instead of %lld in MVM_coerce_i_s

Use PRIi64 to ensure that we are always using the correct one for platforms regardless of the length of long long int's.
01:38 geekosaur joined 01:52 ilbot3 joined 02:00 lizmat joined 03:28 travis-ci joined
travis-ci MoarVM build errored. Samantha McVey 'Use PRIi64 macro instead of %lld in MVM_coerce_i_s 03:28
travis-ci.org/MoarVM/MoarVM/builds/271048975 github.com/MoarVM/MoarVM/compare/8...9ac65d99e9
03:28 travis-ci left 03:47 Ven`` joined
Geth MoarVM: samcv++ created pull request #673:
Replace all uses of sprintf with snprintf
06:06
MoarVM: ad5a6464c7 | (Samantha McVey)++ | 4 files
Consistently use MVMuint16 for was_multi

Avoid compile time warnings this way. This value only appears to hold a boolean value, so this should not change any actual functionality but avoid warnings.
06:43
06:57 travis-ci joined
travis-ci MoarVM build passed. Samantha McVey 'Consistently use MVMuint16 for was_multi 06:57
travis-ci.org/MoarVM/MoarVM/builds/271095096 github.com/MoarVM/MoarVM/compare/f...5a6464c75c
06:57 travis-ci left 08:54 leont joined 09:25 Ven joined 09:46 Skarsnik joined, dogbert2 joined
Skarsnik Hello,is there an existing api to log stuff in a file? 09:46
09:48 Skarsnik_ joined 09:54 eater joined 10:05 Ven joined
samcv Skarsnik_, log what is a file specifically? 10:11
Skarsnik_ I want to write every nativecall call in a file to have a trace ^^
nine Skarsnik_: I just use fprintf(stderr, "...") 10:14
Skarsnik_ I need to compile moar without optimize to not have : (gdb) p (uintptr_t)repr_data->struct_offsets[i] 10:21
value has been optimized out
nine Yes. You really want to compile with --debug --optimize=0
Skarsnik_ it's annoying this take 1h30 to crash x) 10:25
nine ouch
Skarsnik_ I try to figure rt.perl.org/Ticket/Display.html?id...xn-1486588 with running the code with libefence$ 10:28
samcv night all o/ 10:34
see you tomorrow 10:35
10:38 Skarsnik joined 11:25 vendethiel- joined
nine Finally! All tests successful. 11:32
The code is a mess, but it works! With pointer and integer arguments JIT compiled
jnthn nine: Time to write more tests!
nine I just hope that spesh will really be able to strip out those concreteness checks and deconts 11:33
11:38 vendethiel- joined
nine For an integer argument, for example, we now generate> nqp::if(nqp::isconcrete($lowered_param), nqp::bind($lowered, nqp::decont_i($lowered_param)), nqp::bind($lowered, 0)) 11:39
jnthn Yeah, the branch should be something spesh can strip out ;) 11:40
nine Then I guess it's about time I find out why spesh is completely ignoring those generated function bodies 11:42
Though I don't know how to even approach this 11:43
timotimo ohai jnthn :) 11:49
jnthn o/ timotimo
nine: Is it being called with flattened args?
The spesh log will tell you something useful, I suspect 11:50
They'll surely show up in the stats section
nine Well maybe? It's simple methods like this: method p5_get_type(Pointer) is native($p5helper) returns int32 { ... } 11:51
The spesh log doesn't even mention them except as lit arguments to findmeth
timotimo do they actually properly show up with the names you set?
nine I replace &p5_get_type's $!do with the newly generated code block and set the code block's name with nqp::setcodename. So I guess it should show up under that name? 11:57
timotimo i seem to recall for whatever reason that 11:59
the name could disappear
12:21 Voldenet joined
Geth MoarVM/jit_nativecall: bf80c46045 | (Stefan Seifert)++ | 2 files
JIT compile native calls with int64 arguments
12:22
MoarVM: 8ec28a8d5c | (Stefan Seifert)++ | src/core/interp.c
Add some explanation of GET_REG and cur_op to interp.c
12:24 Voldenet joined 12:52 Skarsnik_ joined 12:54 Skarsnik__ joined 14:27 Skarsnik_ joined
nine Ok, this could be my entry point: I see that MVM_spesh_log_invoke_target is called for those native subs and that the code object still has a name. But it never occurs in the spesh log. 14:39
timotimo it doesn't even get stats recorded for it? 14:41
nine With 10000 iterations of TakeInt(42) (from t/04-nativecall/02-simple-args.t) I even see a call to send_log 14:43
timotimo right 14:44
nine But...shouldn't MVM_spesh_log_entry be more interesting to me than MVM_spesh_log_invoke_target? 14:53
I presume the first is about the calle while the latter is about the callsite?
While the MVMCode object does have a name, the static frame doesn't 15:08
How does a static frame get its name? I can't find any code that sets the field 15:18
timotimo nine: with a QAST::Block with a :name field perhaps? 15:22
nine What the? If I add the :name field the test program starts hanging 15:26
timotimo o_O
nine The one place in MoarVM that I could find where a static frame's name is written to is MVM_ASSIGN_REF(tc, &(static_frame->common.header), static_frame_body->name, get_heap_string(tc, cu, rs, pos, 20)); 15:30
In deserialize_frames in src/core/bytecode.c
Hypothesis: that's really the only place a static frame's name is set because that's also the one place where those objects are created. The compiler creates MAST_Frame objects and serializes them into bytecode and only on deserialization are the MVMStaticFrame objects created which are used at runtime. 15:51
That turns the question into "how do MAST frames get their name?" And that sounds suspiciously like timotimo++ is really on the right track. If only that strange hang wasn't there.
Ah! When I remove my debug output from spesh the hang is gone. And even better: I now find the frame in spesh.log! 15:53
timotimo nice 16:26
nine And spesh does indeed get rid of the branch :) 16:34
The very ironic part is, that I should now start thinking about JITing the nativecallinvokejit op, so the full sub body can be JITed
timotimo you mean jit it to more than just callingnthe same c func? 16:36
nine Right now it's several NQP ops for unmarshalling the function arguments + the nativecallinvokejit op for actually calling the C function. That's several NQP ops that are not JITed. 16:38
timotimo i see, so we currently still interp a piece of speshed code 16:45
that's still better than it used to be
16:54 squashable6 joined
nine This...is not going to be easy as of course without a runloop tc->interp_cur_op does not point at the right point in the bytestream and the JITed code won't find the locals to read from 17:11
So I guess, I'll have to emit code that sets interp_cur_op to a pointer to ins->operands[0].reg.orig and restores it afterwards 17:14
Which would be easy if interp_cur_op would contain the register index. But it contains a pointer to a variable holding the register index. And where would I get the space for that variable from? 17:20
I could just malloc it when building the JIT graph and never free it. It's just 2 bytes for every JITed native function. 17:22
17:30 AlexDaniel joined
timotimo what exactly are you using the cur_op for? you're jumping off of it to find the operands of some ops or something? 17:38
the ultimate goal is to reach the work data at the right position, isn't it?
that should be static at the time you're jit-compiling
i mean you'll have it available as "WORK" 17:41
dogbert2 hmm, looks like the Malformed UTF-8 problem is still present 18:40
the byte stream looks like this when the error occurs (decimal values): 18:46
... [95] [95] [95] [194] [171] [95] [95] ...
it chokes on the [171] which is located at 'abs_byte_pos = 14680064' 18:47
coincidentally 14680064 % (2**20) == 0
any ideas wrt what might be going on? 18:50
here's the code where things finally asplodes github.com/MoarVM/MoarVM/blob/mast...tf8.c#L499 18:52
nine timotimo: well, yes, that's the irony. I only need cur_op because I compile the code when the nativecallbuild op is run, not when spesh tries to JIT. But now I'd actually have all the information readily available if I were to compile that code again. 19:03
Which may actually not be such a bad idea after all. 19:04
timotimo well, yeah, that's how spesh works :P 19:05
by having all the information available rather late in the process of doing stuff
nine Compile once to get something that can at least run and then when spesh is through compile again with a bit less indirection
It won't make much difference performance wise, as it will save just 2 pointer dereferences, but every bit helps :) 19:06
Yeah, I will try that tomorrow 19:07
[Coke] dogbert2: I know my sample of malformed utf8 fails more quickly on the mac; perhaps if I could get that same bit of info we'd see a different coincidence that might hep track it down. 19:38
19:44 zakharyas joined 19:45 Skarsnik joined 20:12 committable6 joined
dogbert2 .seen samcv 20:32
yoleaux I saw samcv 15:34Z in #perl6: <samcv> anyway i'm gonna go back to sleep for a bit. see you all in a few hours
dogbert2 ah, to early :) 20:33
samcv hi dogbert2 21:16
i was at lunch with my grandparents. how are you
dogbert2 good morning samcv :)
samcv morning 21:17
dogbert2 I'm good, still contemplating the Malformed UTF-8 problem
I found what I think is a decent golf
create a file with this specific code: perl6 -e 'print "a" x (2**20 - 1) ~ "«"' > golf 21:18
then run: perl6 -ne '' golf
samcv: with a little luck you should get the error 21:20
TimToady smiles wistfully at how small a megabyte has become these days... 22:13
samcv dogbert2, did you see also my bug report about how moar hangs when getting utf8 input with missing end bytes? 22:18
strace just shows it requesting data and getting 0 bytes back for infinity
github.com/MoarVM/MoarVM/issues/663
TimToady temperatures are getting smaller too: yesterday we had 43.7 but today is only 42.2? 22:19
samcv it's really hot today in the bay area 22:20
also yesterday
timotimo i decided I won't be long pants for this event... now I'm freezing 22:21
need*
but it's past midnight, so it is fine
dogbert2 samcv: looks like a nasty bug 22:23
timotimo but I'm glad I got to make some GIFs of my sdl2 experiments 22:25
don't have one of the side scrolling shooter yet, the one I made between lunch and lightning talks 22:26
Geth MoarVM: 69e631119e | (Samantha McVey)++ | src/strings/ops.c
Use < or <= sign for all conditionals in strings/ops.c

For consistency and readability.
23:16