Perl 6 - the future is here, just unevenly distributed

IRC log for #moarvm, 2017-09-02

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:57 Geth ¦ MoarVM: 3e8236593a | (Samantha McVey)++ | src/strings/ops.c
00:57 Geth ¦ MoarVM: Make `eqat` 1.7x-2.5x faster
00:57 Geth ¦ MoarVM:
00:57 Geth ¦ MoarVM: For strings a and b:
00:57 Geth ¦ MoarVM: 1. Both a and b are strands
00:57 Geth ¦ MoarVM: 2. Both a and b are flat
00:57 Geth ¦ MoarVM: 3. One is flat and one is a strand
00:57 Geth ¦ MoarVM:
00:57 Geth ¦ MoarVM: <…commit message has 9 more lines…>
00:57 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/3e8236593a
00:57 Geth ¦ MoarVM: 9b142a0d30 | (Samantha McVey)++ | src/strings/ops.c
00:57 Geth ¦ MoarVM: Fix indentation of switch in substrings_equal_nocheck
00:57 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/9b142a0d30
00:57 Geth ¦ MoarVM: f59ac65d99 | (Samantha McVey)++ | src/core/coerce.c
00:57 Geth ¦ MoarVM: Use PRIi64 macro instead of %lld in MVM_coerce_i_s
00:57 Geth ¦ MoarVM:
00:57 Geth ¦ MoarVM: Use PRIi64 to ensure that we are always using the correct one
00:57 Geth ¦ MoarVM: for platforms regardless of the length of long long int's.
00:57 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/f59ac65d99
01:38 geekosaur joined #moarvm
01:52 ilbot3 joined #moarvm
01:52 Topic for #moarvm is now https://github.com/moarvm/moarvm | IRC logs at  http://irclog.perlgeek.de/moarvm/today
02:00 lizmat joined #moarvm
03:28 travis-ci joined #moarvm
03:28 travis-ci MoarVM build errored. Samantha McVey 'Use PRIi64 macro instead of %lld in MVM_coerce_i_s
03:28 travis-ci https://travis-ci.org/MoarVM/MoarVM/builds/271048975 https://github.com/MoarVM/MoarVM/compare/8644fc6e5f7d...f59ac65d99e9
03:28 travis-ci left #moarvm
03:47 Ven`` joined #moarvm
06:06 Geth ¦ MoarVM: samcv++ created pull request #673: Replace all uses of sprintf with snprintf
06:06 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/pull/673
06:43 Geth ¦ MoarVM: ad5a6464c7 | (Samantha McVey)++ | 4 files
06:43 Geth ¦ MoarVM: Consistently use MVMuint16 for was_multi
06:43 Geth ¦ MoarVM:
06:43 Geth ¦ MoarVM: Avoid compile time warnings this way. This value only appears
06:43 Geth ¦ MoarVM: to hold a boolean value, so this should not change any actual
06:43 Geth ¦ MoarVM: functionality but avoid warnings.
06:43 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/ad5a6464c7
06:57 travis-ci joined #moarvm
06:57 travis-ci MoarVM build passed. Samantha McVey 'Consistently use MVMuint16 for was_multi
06:57 travis-ci https://travis-ci.org/MoarVM/MoarVM/builds/271095096 https://github.com/MoarVM/MoarVM/compare/f59ac65d99e9...ad5a6464c75c
06:57 travis-ci left #moarvm
08:54 leont joined #moarvm
09:25 Ven joined #moarvm
09:46 Skarsnik joined #moarvm
09:46 dogbert2 joined #moarvm
09:46 Skarsnik Hello,is there an existing api to log stuff in a file?
09:48 Skarsnik_ joined #moarvm
09:54 eater joined #moarvm
10:05 Ven joined #moarvm
10:11 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 ^^
10:14 nine Skarsnik_: I just use fprintf(stderr, "...")
10:21 Skarsnik_ I need to compile moar without optimize to not have : (gdb) p (uintptr_t)repr_data->struct_offsets[i]
10:21 Skarsnik_ value has been optimized out
10:21 nine Yes. You really want to compile with --debug --optimize=0
10:25 Skarsnik_ it's annoying this take 1h30 to crash x)
10:25 nine ouch
10:28 Skarsnik_ I try to figure https://rt.perl.org/Ticket/Display.html?id=131003#txn-1486588 with running the code with libefence$
10:34 samcv night all o/
10:35 samcv see you tomorrow
10:38 Skarsnik joined #moarvm
11:25 vendethiel- joined #moarvm
11:32 nine Finally! All tests successful.
11:32 nine The code is a mess, but it works! With pointer and integer arguments JIT compiled
11:32 jnthn nine: Time to write more tests!
11:33 nine I just hope that spesh will really be able to strip out those concreteness checks and deconts
11:38 vendethiel- joined #moarvm
11:39 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:40 jnthn Yeah, the branch should be something spesh can strip out ;)
11:42 nine Then I guess it's about time I find out why spesh is completely ignoring those generated function bodies
11:43 nine Though I don't know how to even approach this
11:49 timotimo ohai jnthn :)
11:49 jnthn o/ timotimo
11:49 jnthn nine: Is it being called with flattened args?
11:50 jnthn The spesh log will tell you something useful, I suspect
11:50 jnthn They'll surely show up in the stats section
11:51 nine Well maybe? It's simple methods like this: method p5_get_type(Pointer) is native($p5helper) returns int32 { ... }
11:51 nine The spesh log doesn't even mention them except as lit arguments to findmeth
11:51 timotimo do they actually properly show up with the names you set?
11:57 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:59 timotimo i seem to recall for whatever reason that
11:59 timotimo the name could disappear
12:21 Voldenet joined #moarvm
12:21 Voldenet joined #moarvm
12:22 Geth ¦ MoarVM/jit_nativecall: bf80c46045 | (Stefan Seifert)++ | 2 files
12:22 Geth ¦ MoarVM/jit_nativecall: JIT compile native calls with int64 arguments
12:22 Geth ¦ MoarVM/jit_nativecall: review: https://github.com/MoarVM/MoarVM/commit/bf80c46045
12:22 Geth ¦ MoarVM: 8ec28a8d5c | (Stefan Seifert)++ | src/core/interp.c
12:22 Geth ¦ MoarVM: Add some explanation of GET_REG and cur_op to interp.c
12:22 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/8ec28a8d5c
12:24 Voldenet joined #moarvm
12:24 Voldenet joined #moarvm
12:52 Skarsnik_ joined #moarvm
12:54 Skarsnik__ joined #moarvm
14:27 Skarsnik_ joined #moarvm
14:39 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:41 timotimo it doesn't even get stats recorded for it?
14:43 nine With 10000 iterations of TakeInt(42) (from t/04-nativecall/02-simple-args.t) I even see a call to send_log
14:44 timotimo right
14:53 nine But...shouldn't MVM_spesh_log_entry be more interesting to me than MVM_spesh_log_invoke_target?
14:53 nine I presume the first is about the calle while the latter is about the callsite?
15:08 nine While the MVMCode object does have a name, the static frame doesn't
15:18 nine How does a static frame get its name? I can't find any code that sets the field
15:22 timotimo nine: with a QAST::Block with a :name field perhaps?
15:26 nine What the? If I add the :name field the test program starts hanging
15:26 timotimo o_O
15:30 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 nine In deserialize_frames in src/core/bytecode.c
15:51 nine 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 nine 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.
15:53 nine Ah! When I remove my debug output from spesh the hang is gone. And even better: I now find the frame in spesh.log!
16:26 timotimo nice
16:34 nine And spesh does indeed get rid of the branch :)
16:34 nine The very ironic part is, that I should now start thinking about JITing the nativecallinvokejit op, so the full sub body can be JITed
16:36 timotimo you mean jit it to more than just callingnthe same c func?
16:38 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:45 timotimo i see, so we currently still interp a piece of speshed code
16:45 timotimo that's still better than it used to be
16:54 squashable6 joined #moarvm
17:11 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:14 nine 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:20 nine 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:22 nine 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:30 AlexDaniel joined #moarvm
17:38 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 timotimo the ultimate goal is to reach the work data at the right position, isn't it?
17:38 timotimo that should be static at the time you're jit-compiling
17:41 timotimo i mean you'll have it available as "WORK"
18:40 dogbert2 hmm, looks like the Malformed UTF-8 problem is still present
18:46 dogbert2 the byte stream looks like this when the error occurs (decimal values):
18:46 dogbert2 ... [95] [95] [95] [194] [171] [95] [95] ...
18:47 dogbert2 it chokes on the [171] which is located at 'abs_byte_pos = 14680064'
18:47 dogbert2 coincidentally 14680064 % (2**20) == 0
18:50 dogbert2 any ideas wrt what might be going on?
18:52 dogbert2 here's the code where things finally asplodes https://github.com/MoarVM/MoarVM/blob/master/src/strings/utf8.c#L499
19:03 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:04 nine Which may actually not be such a bad idea after all.
19:05 timotimo well, yeah, that's how spesh works :P
19:05 timotimo by having all the information available rather late in the process of doing stuff
19:05 nine Compile once to get something that can at least run and then when spesh is through compile again with a bit less indirection
19:06 nine It won't make much difference performance wise, as it will save just 2 pointer dereferences, but every bit helps :)
19:07 nine Yeah, I will try that tomorrow
19:38 [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:44 zakharyas joined #moarvm
19:45 Skarsnik joined #moarvm
20:12 committable6 joined #moarvm
20:32 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
20:33 dogbert2 ah, to early :)
21:16 samcv hi dogbert2
21:16 samcv i was at lunch with my grandparents. how are you
21:16 dogbert2 good morning samcv :)
21:17 samcv morning
21:17 dogbert2 I'm good, still contemplating the Malformed UTF-8 problem
21:17 dogbert2 I found what I think is a decent golf
21:18 dogbert2 create a file with this specific code:    perl6 -e 'print "a" x (2**20 - 1) ~ "«"' > golf
21:18 dogbert2 then run: perl6 -ne '' golf
21:20 dogbert2 samcv: with a little luck you should get the error
22:13 * TimToady smiles wistfully at how small a megabyte has become these days...
22:18 samcv dogbert2, did you see also my bug report about how moar hangs when getting utf8 input with missing end bytes?
22:18 samcv strace just shows it requesting data and getting 0 bytes back for infinity
22:18 samcv https://github.com/MoarVM/MoarVM/issues/663
22:19 TimToady temperatures are getting smaller too: yesterday we had 43.7 but today is only 42.2?
22:20 samcv it's really hot today in the bay area
22:20 samcv also yesterday
22:21 timotimo i decided I won't be long pants for this event... now I'm freezing
22:21 timotimo need*
22:21 timotimo but it's past midnight, so it is fine
22:23 dogbert2 samcv: looks like a nasty bug
22:25 timotimo but I'm glad I got to make some GIFs of my sdl2 experiments
22:26 timotimo don't have one of the side scrolling shooter yet, the one I made between lunch and lightning talks
23:16 Geth ¦ MoarVM: 69e631119e | (Samantha McVey)++ | src/strings/ops.c
23:16 Geth ¦ MoarVM: Use < or <= sign for all conditionals in strings/ops.c
23:16 Geth ¦ MoarVM:
23:16 Geth ¦ MoarVM: For consistency and readability.
23:16 Geth ¦ MoarVM: review: https://github.com/MoarVM/MoarVM/commit/69e631119e

| Channels | #moarvm index | Today | | Search | Google Search | Plain-Text | summary