github.com/moarvm/moarvm | IRC logs at colabti.org/irclogger/irclogger_logs/moarvm
Set by AlexDaniel on 12 June 2018.
jnthn .tell jnthn When you re-work deopt tomorrow, rather than having to rewrite the whole stack and worry about frame expansions all the way down, you can instead fiddle the frame kind to be a "please deopt me" one, and then the only place deopt has to mess with is the frame on the stack top, which makes your job seriously less awful 00:02
tellable6 jnthn, I'll pass that message to your doctor
jnthn Better cache locality and avoids having to force all the frame to the heap too. 00:04
'night
jnthn morning o/ 10:00
lizmat 7 seconds late! :-) 10:03
jnthn :P 10:04
lizmat but yeah, one of those days where you realize you have to replace a bottom piece of your carefully constructed tower
nwc10 \o 10:09
jnthn Looks like last night me read an OSR paper and got an idea (oddly, not one that appears in the paper) about how to make the deopt changes far less painful 10:10
nwc10 "Doctor, doctor, it hurts when I do this" "well, don't do that then" ?
but yes, your summary last night seems very elegant 10:11
jnthn lunch, bbiab 11:03
jnthn Mmm, gulaš 12:19
nine Sounds nice. I think I'm gonna grab some lunch as well :) 12:34
jnthn Why does it segv? Ohh...this looks bad... :) 12:41
(gdb) p tc->stack_current_region->alloc
$7 = 0x7ffff5797080 ""
(gdb) p tc->stack_current_region->alloc_limit
$8 = 0x7ffff5796010 "
MasterDuke i'm still not sure why gist.github.com/MasterDuke17/c505c...53c47f048c segvs in MVM_jit_emit_primitive 12:50
timotimo have we double-checked what each register is mapped to? 12:52
at the point of segv, what does "x/i $rip" say? 12:54
or is it %rip?
jnthn
.oO( rest in peace? )
13:00
Geth MoarVM/new-disp: b0ce9e9446 | (Jonathan Worthington)++ | 6 files
Make all frames have a call stack record

Even those that get heap promoted now leave one behind. For now, this doesn't achieve anything particularly new, aside from cleaning up some aspects of call stack region management. However, it also paves the way for putting disptchers and flattening data on the call stack (and having them automatically get dropped when we return from the things that they ... (6 more lines)
13:20
MasterDuke timotimo: => 0x7ffff79c2c29 <MVM_jit_emit_primitive+22008>: mov (%rax),%rdx 13:26
jnthn heh, with spesh disabled it manages to even build Rakudo 13:27
I'm a bit spooked 'cus I'm sure continuations should be really broken, but it's probably just about robust enough to survive
nine MasterDuke: I'm still confused. Is it actually the MVM_jit_emit_primitive function that's segfaulting, or code generated by the JIT? 13:28
MasterDuke gist updated with a gdb backtrace 13:29
nine So it's the compiler that's failing 13:30
MasterDuke: just try removing lines from the assembly until it doesn't break anymore 13:31
Then you know what it's tripping over
MasterDuke heh
dies at `| lea ARG2, MVMDISPINLINECACHE:TMP2->entries[slot];` 13:33
i.e., up until that line is fine
jnthn Amazingly, Rakudo does - spesh disabled - build and pass much of spectest, even before I fix up continuations... 13:34
nine jnthn: how much are continuations actually used? 13:35
jnthn gather/take, await
And the failures I see are largely in list-y and thread-y things
For such a deep change I feared more fallout at this point. 13:36
Granted it probably can get out of sync and get away with it at present.
Yeah, almost all explosions are in concurrency tests 13:37
OK, now for the continuations...
nine MasterDuke: come to think of it, that line doesn't make that much sense anyway 13:39
timotimo MasterDuke: try "info registers" 13:40
nine MasterDuke: what you're doing there is effectively mov ARG2, TMP2 + offsetof(entries) + slot * 8, i.e. TMP2 + a constant
timotimo nine: it's AT&T syntax i think
MasterDuke: `set disassembly-flavor intel`
nine Yeah, set disassembly-flavor intel
MasterDuke i got farther with `| mov TMP3, MVMDISPINLINECACHE:TMP2->entries; | lea ARG2, [TMP3 + slot];`, but still a segv later
but the segv is in nowhereland 13:41
gist updated 13:42
nine Oh, btw. this thing will blow up on Windows, because there ARG1 == TMP1, so you're overwriting ARG1 after setting it
MasterDuke "arg", that problem again. well, easy fix 13:43
nine I'd probably just use ARG* even for temporaries, to make it clear 13:44
jnthn heh, pro tip: GC mark the call stack... :) 14:04
Geth MoarVM/new-disp: 5819f5a00f | (Jonathan Worthington)++ | 4 files
GC mark the callstack, plus assert it's in sync

The assertion revealed the forgotten marking. Now, the assertion only fails in the continuations tests in NQP, which is what it was expected to detect.
14:08
Geth MoarVM/new-disp: 5235e4d503 | (Jonathan Worthington)++ | 2 files
Fix a naming inconsistency
15:00
MoarVM/new-disp: b54a047112 | (Jonathan Worthington)++ | 3 files
Refactor marking of frames living on call stack

They're now handled as part of the call stack walking, so we don't have to traverse it in two places. This will also ease continuation handling.
MasterDuke nice, nqp and rakudo now both build, with lego jit bails from sp_getlexstatic_o gone. not sure what the testing situation is though, were they clean at any point? 17:12
looks like the same tests fail with that non-jitted 17:15
Geth MoarVM: MasterDuke17++ created pull request #1286:
Lego JIT implementation of sp_getlexstatic_o
17:22
MasterDuke not quite sure what a template for ^^^ would look like 17:26
Geth MoarVM/new-disp: baa27a97c1 | (Jonathan Worthington)++ | 12 files
Mostly move continuations to new callstack model

This is required for dispatchers because we shall also needs to save their state when taking a continuation. The new approach is to always have continuations allocate stack frames within a fresh region (so a reset is a region base). This means that we can avoid looking through every frame, and just look through the (much smaller number of) regions ... (23 more lines)
17:50
jnthn Rakudo manages to get through its build with this. Tests are explosive, though with one of the known todo panics. :) 17:54
Home time.
o/ 17:55
(Oh, and also: only with spesh disabled, 'cus I didn't update deopt yet.)
nwc10 \o 19:05
beer!
MasterDuke this morning i just bottled the stout i'm brewing 19:08
nwc10 ooooh 19:18
dogbert17 I get test failures in t/spec/S32-io/io-cathandle.t 22:01
get native descriptor requires an object with REPR MVMOSHandle (got Scalar with REPR P6opaque) 22:02
lizmat github.com/rakudo/rakudo/commit/f33ce01c11 22:04
dogbert17 ^^
github.com/rakudo/rakudo/commit/61046d7695 probably caused it 22:05