|
github.com/moarvm/moarvm | IRC logs at irclog.perlgeek.de/moarvm/today Set by moderator on 8 October 2013. |
|||
| JimmyZ | --output=src/stage1/QAST.moarvm src/stage1/gen/QAST.nqp | 01:09 | |
| Routine declaration requires a signature at line 4103, near "(MAST::Nod" | |||
| Looks like Missing another MVMROOT | |||
|
01:22
benabik joined
01:25
FROGGS_ joined
01:34
BenGoldberg joined
|
|||
| dalek | arVM: 1a08cce | jimmy++ | src/core/interp.c: re-order codes to avoids a MVMROOT, and some cleanups |
01:34 | |
| arVM: c7fef60 | jimmy++ | src/6model/reprs/P6opaque.c: re-order part of code to avoid MVMROOTs |
01:57 | ||
|
02:06
colomon joined
|
|||
| dalek | arVM: ce75f6d | jimmy++ | src/core/interp.c: Add a Missing MVMROOT |
02:07 | |
| JimmyZ | nvm, I was still in moarboot | 02:13 | |
| switch to master still same error | 02:16 | ||
| .tell I got another backstrace: gist.github.com/zhuomingliang/6957379 | 02:22 | ||
| yoleaux | JimmyZ: I'll pass your message to I. | ||
| JimmyZ | .tell jnth I got another backstrace: gist.github.com/zhuomingliang/6957379 | 02:23 | |
| yoleaux | JimmyZ: I'll pass your message to jnth. | ||
| JimmyZ | .tell jnthn I got another backstrace: gist.github.com/zhuomingliang/6957379 | ||
| yoleaux | JimmyZ: I'll pass your message to jnthn. | ||
|
03:16
colomon joined
|
|||
| BenGoldberg | nqp-m: say(nqp::index("this", "h", 1,2,3,4,5,6)); | 04:20 | |
| camelia | nqp-moarvm: OUTPUTĀ«Bytecode validation error at offset 22, instruction 4:ā¤register operand index 50 out of range 0..9ā¤Ā» | ||
| [Coke] | why does nqp-moar have "index_s" that takes 3 args? java called it "indexfrom". | 04:29 | |
| moritz | hi all. What are the steps for implementing an op in moarvm? | 06:16 | |
| I want to do bool_I | |||
| I looked at add_I as an example, and found that it is mapped to the MAST op add_I; but where is *that* defined? | 06:23 | ||
| JimmyZ | moritz: src/core/oplist | 06:46 | |
| moritz: add op to oplist, then run tools/update_ops.p6, then add it to src/core/interp.c | 06:47 | ||
|
07:09
BenGoldberg joined
|
|||
| moritz | JimmyZ: and where are the ops actually defined? | 07:16 | |
| where's the implementation? | |||
| JimmyZ | src/core/oplist | 07:23 | |
| the implementation is in src/core/interp.c | |||
| moritz | thanks | 07:27 | |
| is it normal to get "use of uninitialized value of type Any in string context in any !cursor_init" from update_ops.p6? | 07:35 | ||
| \\o/ success | 07:45 | ||
| (it compiles) | 07:46 | ||
| JimmyZ: is it usual to separate the manual and the generated changes into two commits? | 07:47 | ||
|
07:56
Ben_Goldberg joined
|
|||
| JimmyZ | moritz: nope | 07:56 | |
| FROGGS | morning | 08:15 | |
| moritz: yes, I get the warnings too since a while | 08:17 | ||
| moritz | note to self: always pull *before* running update_ops.p6 | 08:27 | |
| unless you are eager to resolve conflicts in generated files | |||
| FROGGS | "always pull" is a good rule, err, always :o) | 08:28 | |
| moritz | well, when working on rakudo, I seldomly get any conflicts when my working copy is a few days old | 08:31 | |
| and when I do, they are usually trivial to resolve | |||
| FROGGS | true, because there are too many different places to hack on :o) | ||
| but for moarvm there are files you touch almost every time | 08:32 | ||
| one is interp.c | |||
| hmmm, isbig_I wants to be implemented too, I think I pick this one | |||
| dalek | arVM: 02a7a3f | moritz++ | / (9 files): implement nqp::bool_I opcode |
08:33 | |
| moritz | my first moarvm commit that actually implemented a new feature (and not just in Configure) | ||
| FROGGS | humm, isbig_I seems to be there already, maybe it just needs mapping | 08:35 | |
| moritz | isbig_I is what I used as my model, becuse it also receives a bigint arg and returns a bool (or rather int) | 08:41 | |
| FROGGS | moritz: both do not seem to be mapped | 08:45 | |
| this would happen in nqp/src/vm/moar/QAST/QASTOperationsMAST.nqp around line 1500 | 08:48 | ||
| moritz: btw, we should copy this t/nqp/60-bigint.t to nqp too | 08:49 | ||
|
08:51
odc joined
|
|||
| FROGGS | ahh | 08:59 | |
| now I know why my nqp does not build anymore | 09:00 | ||
| moritz: when you add an op in the middle of the list, you need to create a new stage0 for nqp using the nqp-cc | |||
| I take the chance to update sprintf | 09:10 | ||
| diakopter | moritz: yes needs mapped innqp | 09:18 | |
| moritz | uhm, which one? | 09:19 | |
| bool_I worked in the test I added | |||
| so I can't imagine it needs extra mapping | |||
| maybe isbig_I does | 09:21 | ||
| FROGGS: so how do I create a new stage0? | 09:28 | ||
|
09:28
wsri joined
|
|||
| FROGGS | moritz: I did it already | 09:28 | |
| nwc10 | is it documented how? | 09:29 | |
| FROGGS | dont think so | ||
| you got to MoarVM/nqp-cc | |||
| configure it, make, and the copy *.moarvm to your nqp's src/vm/moar/stage0 | |||
| you always need to do it when the ops got reordered | 09:30 | ||
| moritz | maybe update_ops.p6 should tell me that | 09:32 | |
| diakopter | yes don't reorder the ops | 09:33 | |
| girhub cries a little at thr extra bw | |||
| moritz didn't reorder the ops | |||
| the script did | 09:34 | ||
| FROGGS | :o) | ||
| moritz | so the script needs to be more intelligent, right? | ||
| FROGGS | well, at least dropping a note wouldn't hurt | 09:38 | |
| moritz: this is what I get in MoarVM/nqp-cc when running `make selftest`: t/nqp/60-bigint.t ..................... No registered operation handler for 'bool_I' | 09:50 | ||
| did you run that test using the nqp-parrot binary by any chance? | |||
| moritz | FROGGS: I did a 'make test' in nqp-cc. I simply assumed it does the right thing | 09:54 | |
| and, why wouldn't it? | |||
| FROGGS | I'm not sure | ||
| moritz: make test does indeed use nqp-parrot | 09:55 | ||
| or better: it uses an nqp from PATH | |||
| moritz | *facepalm* | 09:56 | |
| FROGGS | well, there are tests (t/qast/) that where meant tu run this way | ||
| moritz: you can't come late and expect to get everything in the first run :o) | 09:59 | ||
| moritz | FROGGS: but I can come in late and expect the test target to do something useful :-) | 10:00 | |
| FROGGS | moritz: I guess jnthn can tell you why it should do exactly what it does ;o) | 10:02 | |
| moritz adds a mapping | 10:03 | ||
| ok, does the mapping go into the nqp repo? or into moarvm/nqp-cc/ ? or both? | 10:04 | ||
| FROGGS | nqp is enough, though, I did that for bool_I and isbig_I already | 10:05 | |
| moritz | ok, great | ||
| tahnks | |||
| FROGGS | not ok 46 - bool_I(42) | ||
| not ok 47 - bool_I(0 | 10:06 | ||
| (in nqp, using the runner built using MoarVM) | |||
| nqp -e 'say(nqp::bool_I(42))' | 10:07 | ||
| This representation (P6int) cannot unbox to other types | |||
| ahh, it is not a bigint | |||
| so, the test itself is wrong, roght? | |||
| right? | |||
| diakopter | yeah | 10:08 | |
| well | 10:09 | ||
| I'm not certain | |||
| need jnthn's assessment | 10:10 | ||
| bigint is kindof a gray area | |||
| as to where it's supposed to be in the type system | |||
| FROGGS | hold on, the test creates a bigint using sub box() declared in that file | ||
| nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(42)) | 10:11 | ||
| camelia | nqp: OUTPUTĀ«Confused at line 2, near "say(nqp::b"ā¤current instr.: 'panic' pc 14748 (src/stage2/gen/NQPHLL.pir:5229) (src/stage2/gen/NQPHLL.nqp:279)ā¤Ā» | ||
| FROGGS | nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(42))) | 10:12 | |
| camelia | nqp: OUTPUTĀ«1ā¤Ā» | ||
| FROGGS | nqp: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(0))) | ||
| camelia | nqp: OUTPUTĀ«0ā¤Ā» | ||
| FROGGS | nqp-m: my $knowhow := nqp::knowhow(); my $bi_type := $knowhow.new_type(:name('TestBigInt'), :repr('P6bigint')); $bi_type.HOW.compose($bi_type); sub box($x) { nqp::box_i($x, $bi_type) }; say(nqp::bool_I(box(0))) | ||
| camelia | nqp-moarvm: OUTPUTĀ«Bytecode validation error at offset 22, instruction 4:ā¤register operand index 50 out of range 0..9ā¤Ā» | ||
| diakopter | moritz: yes it needs mapped in nqp-cc also, in case it's ever included int he bootstrap | 10:13 | |
| hm, apparently prove -j80 wasn't a good idea | 10:15 | ||
| FROGGS | in case we still use the nqp-cc by then | ||
| *g* | |||
| diakopter | wut. | 10:16 | |
| how does t\\qregex/01-qregex.t take 5 fewer seconds today than yesterday | |||
| er, less. :D | |||
| FROGGS | diakopter: maybe jnthns patch? he said that the testsuite on his machine took about 4s less or so | 10:17 | |
| moritz | no, fewer | ||
| seconds are countable | |||
| diakopter | less | ||
| it's not countability | |||
| it's discreteness | |||
| FROGGS | looks like Perl6::Ops is the next bigger thing | 10:18 | |
| lunch & | |||
| diakopter | next bigger thing? | ||
| FROGGS | yes | 10:19 | |
| diakopter | bigger how | 10:21 | |
| upon further thought, maybe it is countability o_O | 10:23 | ||
| diakopter decides to profile man-or-boy again | 10:24 | ||
| erm, if the cross-compiler worked o_O | |||
| moritz | blog.oxforddictionaries.com/2012/08...-or-fewer/ makes me believe that "5 less seconds" is acutally correct | ||
| diakopter | (where "correct" is just "what elitists thinks sounds more erudite" | 10:25 | |
| ) | |||
| :) | |||
| moritz | but OTOH I don't understand their "5 items or fewer" example | ||
| diakopter | [elitists like me] | ||
|
10:25
grondilu joined
|
|||
| diakopter | well it made me think of collective noun like sugar | 10:26 | |
| "less sugar" is right. "less cups of sugar" sounds wrong, even though cups aren't discrete | 10:27 | ||
| er. sugar isn't a collective noun. I need to just stfu right now. | 10:28 | ||
| moritz | diakopter: or elitists like me, who learned the language through hard work, and are annoyed when what they learned turned out to be not "correct" :-) | 10:29 | |
| cups sure are discreet | 10:30 | ||
| :-) | |||
| diakopter | *facepalm* ""what elitists thinks" | ||
| apparently it's 3:30 a.m. in my home timezone | |||
|
10:31
woolfy joined
10:32
cognominal joined
|
|||
| dalek | arVM: c76c4db | (Tobias Leich)++ | src/math/bigintops.c: fix thinko, thruthness means non-zero |
11:18 | |
| jnthn | diakopter: I think I know how to make things a bit better wrt MVMCode/frame lifetimes | 11:36 | |
| Will take a look later on | |||
| FROGGS | jnthn: will hllize and hllizefor be noops? | 11:40 | |
| jnthn | Why did we end up with a another bootstrap update? | ||
| FROGGS | moritz: added bool_I to the middle of the list | ||
| jnthn | (stage0) | ||
| FROGGS | err, s/:// | 11:41 | |
| jnthn | But why not add it at the end? | ||
| And let it wait for the re-ordering before we commit to the ordering of what we have forever... | |||
| FROGGS | he didn't know, and didn't thought about moving it to the end | ||
| *and I* | |||
| jnthn | ah, ok | ||
| JimmyZ | +1, I don't like always update stage0 because it inc nqp repo size magically | 11:42 | |
| jnthn | It's not a big deal, it's just that each time we do this, we make the nqp repo a little bigger... | ||
| FROGGS | yeah :/ | ||
| jnthn | JimmyZ: "marginally"? :D | ||
| more history = bigger repo is pretty lame magic :P | 11:43 | ||
| JimmyZ | well, the stage0 files will be inc-ed x.x MB | 11:45 | |
| jnthn | JimmyZ: Maybe, but packfiles compress stuff too | 11:46 | |
| JimmyZ | i.e: it always a pain to me to do full git clone parrot. because it always break at 53% or some point. And then I need to re-git-clone. well I don't have this problem with rakudo because it's repo is much small | 11:48 | |
| jnthn | JimmyZ: If you don't need the full history you could maybe consider a shallow close | 11:49 | |
| *clone | |||
| JimmyZ | hmm, Can I git push a shallow clone with adding my commits to orgin? | 11:50 | |
| jnthn | JimmyZ: I guess if it's not to shallow... | 11:52 | |
| JimmyZ | I can't follow you :( | ||
| jnthn | JimmyZ: I mean, I guess it may be a problem in some cases if you're pushing a branch and don't have the base or something...but guess you'd not hit this | 11:55 | |
| JimmyZ | Oh. I was fearing about something like this | 11:56 | |
| nwc10 | real 0m1.995s | 12:31 | |
| user 0m9.288s | |||
| sys 0m2.617s | |||
| that's configure and 24-way build from clean (admittendly with ccache) | 12:32 | ||
| jnthn | nwc10: build of....? | 12:38 | |
| JimmyZ | jnthn: btw, timotimo and I has the same issue, I'm on linux x64 | ||
| nwc10 | MoarVM | ||
| *not* wrong channel, at least, not this time :-) | |||
| jnthn | nwc10: wtf, you can build MoarVM on 2s? :P | ||
| *in | |||
| nwc10 | seems so | ||
| jnthn | Gee, I want a 24-way... | ||
| nwc10 | Seems so. It was the output of this: | 12:39 | |
| for file in `find . -name \\*.git`; do (cd $file/.. && git clean -dxf); done | |||
| no, not hat | |||
| *after* that, I did this: | |||
| time sh -c 'perl Configure.pl --optimize --prefix=/home/nicholas/Sandpit/moar && make -j24 all' | |||
| JimmyZ | real 0m27.326s | 12:41 | |
| user 1m48.473s | |||
| sys 0m39.265s | |||
| with your cmd :( | |||
| FROGGS | real\t0m9.256s | 12:43 | |
| user\t0m30.956s | |||
| sys\t0m1.432s | |||
| nwc10 | If I zap the cache for ccache, the cold run is: | 12:45 | |
| real 0m4.033s | |||
| user 0m40.966s | |||
| sys 0m7.575s | |||
| this is not *my* machine. (It's the one I referred to as "my" machine) | |||
| anyway, this wasn't meant to be a brag about hardware. | |||
| it was meant to be that jnthn has met the goal of "short build time" rather more effectively than anyone would have guessed | 12:46 | ||
| jnthn | ;) | ||
| FROGGS | sad that nqp does not build in parallel :/ | 12:47 | |
| jnthn | nwc10: I'm curious, can you build NQP for MoarVM (that build won't parallelize well, because bootstrap) | ||
| FROGGS: It basically can't. | |||
| FROGGS: Because most steps depend on the one that came before | |||
| FROGGS | I know | ||
| simple solution is simple: speed up moarvm :o) | 12:48 | ||
| jnthn | Well, we did yesterday | ||
| nwc10: And then when it's built, run make test but add -j24 or so to that line ;) | |||
| nwc10 | actually, I think that the other thing that the short build time indrectly demonstrates is how much we tolerate inefficient slow crap | ||
| jnthn | nwc10: I can make test NQP here with -j 6 in 9 seconds :) | 12:49 | |
| FROGGS | real\t0m10.823s | 12:51 | |
| user\t0m37.444s | |||
| -j4 that is | |||
| time prove -j4 -r --exec "./nqp" t/qregex t/nqp t/p5regex t/qast t/serialization | |||
| reordered the steps though | |||
| this might even be better: time prove -j4 -r --exec "./nqp" t/qregex t/p5regex t/qast t/serialization t/nqp | 12:52 | ||
| real 10.1s | |||
| bbl | |||
| jnthn | hmm, setmethcache is still vulnerable even after the re-ordering | 12:53 | |
| nwc10 | make -j24 for nqp for that MoarVM: | ||
| real 1m58.803s | |||
| user 2m10.150s | |||
| sys 0m1.270s | |||
| jnthn | oh no, setmethcache got fixed later; JimmyZ++ | 12:56 | |
| nwc10: Yeah, it's the prove invocation that could be fun :) | |||
|
12:57
colomon joined
|
|||
| nwc10 | I was trying what FROGGS showed | 12:57 | |
| jnthn | The "time prove ..." bit? | 12:58 | |
| nwc10 | -j4 is fast enough, because t/qregex/01-qregex.t is slow | ||
| yes | |||
| about 8 seconds | |||
| jnthn | Not Bad :) | 12:59 | |
| nwc10 | (total time, but really it's "how long does t/qregex/01-qregex.t take") | ||
| no. I didn't pay for this hardware. :-) | |||
| jnthn | yes, well, 01-qregex.t basically does 700+ evals... | ||
| So compared to the other tests (which are compile then run) it's a heck of a lot of work | 13:00 | ||
|
13:22
colomon joined
|
|||
| dalek | arVM: f04eb35 | jnthn++ | / (8 files): Stub hllize/hllizefor. |
13:25 | |
| arVM: 9ec5767 | jnthn++ | src/ (2 files): Correct possible out-of-date pointer bugs. |
15:26 | ||
| lee_ | diakopter: btw nqp-moar builds for me on OS X now, but capture.t fails with gist.github.com/leedo/4d22a0ea76e6bb4dd24e | 15:44 | |
| everything else passes :) | |||
| dalek | arVM: 3b4b362 | jnthn++ | src/core/coerce.c: Hardening; avoid re-count. |
16:03 | |
| diakopter | lee_: o_O | ||
|
16:26
benabik joined
|
|||
| dalek | arVM: f82639a | jnthn++ | src/6model/reprs/P6opaque.c: A couple more pointer-freshness fixes in P6opaque. Probably not hitting these just yet, but will at some point. |
16:27 | |
|
16:55
cognominal joined
16:57
ssutch joined
|
|||
| FROGGS | current rakudo bt: gist.github.com/FROGGS/561bca9ac7cf945ebc76 | 17:13 | |
| dunno what it means though... | 17:16 | ||
| do we hit some memory limit? or the nursery-size? | |||
| jnthn | oh, you get that too | 17:17 | |
| I jsut get some corruption in the output... | |||
| I wonder if those two are connected... | 17:19 | ||
| oh, good, I get it on Windows with the debug malloc oto | 17:20 | ||
| I already went through the file and didn't find any places we ensure_space the wrong amount, though... | 17:23 | ||
| r: say 0x8C40 - 0x6C30 | 17:40 | ||
| camelia | rakudo e22ac2: OUTPUTĀ«8208ā¤Ā» | ||
| FROGGS | ahh, so we check how many is available before allocating it? | 17:45 | |
| jnthn | yeah | 17:46 | |
| we are overflowing frame_seg somehow | 17:47 | ||
| FROGGS | ahh, hmmm | ||
| jnthn | The buffer is 8192 | ||
| And it claims we wrote way over the end of it | |||
| But it's kinda hard to see how/where | 17:49 | ||
| FROGGS | and what file are you inspecting? | ||
| jnthn | src/mast/compiler.c | 17:50 | |
| While compiling Rakudo's Actions.nqp | 17:52 | ||
| maybe ASAN will find it easier... | |||
| HEAP[moar.exe]: Heap block at 000000001246F560 modified at 0000000012471570 past requested size of 2000 | 17:53 | ||
| Is what it tells me | |||
| FROGGS | not very helpful | ||
|
17:54
BenGoldberg joined
|
|||
| FROGGS | jnthn: you checked the FRAME_HEADER_SIZE? | 18:07 | |
| jnthn | yeah | ||
| FROGGS | yeah, seems right | 18:08 | |
| jnthn | I dunno if these are orthogonal issues or not, but even when I bump the initial memory allocation for the frame_seg to avoid the realloc, I still get corrupt bytecdoe out | 18:10 | |
| nwc10 | For me, for NQP, All tests successful. building MoarVM with gcc's ASAN | 18:30 | |
| which is both nice and not-so-nice | |||
| FROGGS | I am trying valgrind now | 18:31 | |
| nwc10 | as in, "we have normality, I repeat we have normality. Anything you still can't cope with is therefore your own problem." | ||
| FROGGS | I hope it finishes today :o) | ||
| nwc10 | ie it's not pointing out anything obvious that needs fixing which would improve stuff | ||
|
18:34
cognominal joined
|
|||
| jnthn | nwc10: Any chance you could now try the moar-support branch of Rakudo under ASAN? | 18:36 | |
| nwc10 | quite a reasonable chance | ||
| jnthn | Something silly is going on when compiling Actions.nqp, and while VS's debug malloc catches it, unlike ASAN it doesn't tell you where things got messed up. And it's a lot less obvious (to me) than would be desirable... | ||
| FROGGS | valgrind is still running :/ | 18:39 | |
| nwc10 | FROGGS: it does this :-/ | 18:40 | |
| jnthn: started. No idea how far it will get, or how long it will take to get there | |||
| this isn't on "my" machine, this is on (almost) my machine | |||
| which is >5 years old and only has 2 cores | |||
| FROGGS | *g* | ||
| nwc10 | but I am root and I can build | 18:41 | |
| wait a mo - I think I can build gcc on "my" machine | |||
| no, not enough space | |||
| would have to ask root nicely | |||
| 2 cores and less RAM than my laptop (but as it's a desktop likely everything on it is faster) | 18:42 | ||
| FROGGS | ohh, jnthn blogged and I missed it | ||
| nwc10 | paste.scsys.co.uk/271683 | 18:43 | |
| doth go boom | |||
| jnthn | ha, that's th eone | 18:44 | |
| Any chance you can symbolize it? | |||
| nwc10 | yes, already working on that | ||
| just checking that I can run it stand alone | |||
| then will stick it under gdb | |||
| jnthn | Thanks | ||
| That looks like exactly the issue | |||
| It's probably gonna be something really silly :( | 18:45 | ||
| nwc10 | s l o w | ||
| PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | 18:46 | ||
| 9023 nick 20 0 17.0t 921m 7568 R 100.3 46.1 2:03.47 moar | |||
| nwc10 has not seen a 't' before | |||
| jnthn: paste.scsys.co.uk/271684 | 18:49 | ||
| I am not familiar *at all* with the source, but combining that with the previous, looks like a write by write_int32() 2 bytes over then end of an allocated 8192 byte buffer | 18:50 | ||
| is there a way to get tmux to capture all the technicolor glory and paste it somewhere in colour? | 18:51 | ||
| FROGGS | jnthn: valgrind: gist.github.com/FROGGS/ce17ba8f5f06ed009c7f | ||
| jnthn | hmmm...that's while writing handlers | ||
| nwc10 | snap! | 18:52 | |
| jnthn | #define FRAME_HANDLER_SIZE 4 * 4 + 2 * 2 | ||
| That looks right... | |||
| grondilu | shouldn't you ut parens around this? | 18:54 | |
| #define FRAME_HANDLER_SIZE (4 * 4 + 2 * 2) | |||
| nwc10 | src/mast/compiler.c: FRAME_HANDLER_SIZE * fs->num_handlers); | ||
| jnthn | oh f**k | ||
| nwc10 | I'm going for "yes" | ||
| but I would not have thought of that | |||
| FROGGS | haha | 18:55 | |
| that is a nice one | |||
| grondilu remember this as a common thing to know about macros in C | |||
| nwc10 | um, jnthn, that macro is defined in 2 places | ||
| grondilu | always put parens | ||
| jnthn | It is? | ||
| nwc10 | $ git grep FRAME_HANDLER_SIZE | ||
| src/core/bytecode.c:#define FRAME_HANDLER_SIZE 4 * 4 + 2 * 2 | |||
| ... | |||
| src/mast/compiler.c:#define FRAME_HANDLER_SIZE 4 * 4 + 2 * 2 | 18:56 | ||
| jnthn | Thing that reads vs thing that writes | ||
| nwc10 | oh yes | ||
| FROGGS rebuilds | |||
| jnthn | On the one hand, could try to share them. On the other, write only cares for current version whereas read may need to care for historical versions. | 18:57 | |
| FROGGS | src/6model/serialization.c:14:#define HEADER_SIZE 4 * 16 | ||
| nwc10 | so, maybe, define it somewhere as a FRAME_HANDLER_SIZE_V1 | 18:58 | |
| and FRAME_HANDLER_SIZE is defined as FRAME_HANDLER_SIZE_V1 (this week) | |||
| I was wondering how to handle this | |||
| slightly hacky way might end up with the reader being a C file that can be #included more than once to compile in V1, V2 | |||
| until V2 is bootstrapped | |||
| repeat for V3 | 18:59 | ||
| or maybe that sucks too much | |||
| FROGGS | src/strings/utf8.c:186:#define UTF8_MAXINC 32 * 1024 * 1024 | ||
| jnthn: Perl6::Actionbuilt! | 19:01 | ||
| err, Perl6::Action built! | |||
| src/Perl6/Grammar.nqp | 19:02 | ||
| Bytecode validation error at offset 5562, instruction 1011: | |||
| operand type 64 does not match register type 56 | |||
| that is my next stolperstein | |||
| nwc10 | That builds for me with | ||
| FRAME_HEADER_SIZE and FRAME_HANDLER_SIZE wrapped in () | |||
| grondilu | src/mast/compiler: #define FRAME_HEADER_SIZE 7 * 4 + 3 * 2 | 19:03 | |
| ^ should put parens here as well | |||
| nwc10 | paste.scsys.co.uk/271685 | ||
|
19:03
cognominal joined
|
|||
| FROGGS | grondilu: yes, four files all in all | 19:03 | |
| nwc10 tries `make -k` while going for food | 19:04 | ||
| grondilu | r: say 7 * 4 + 3 * 2 | 19:05 | |
| camelia | rakudo e22ac2: OUTPUTĀ«34ā¤Ā» | ||
| nwc10 | oh, it failed before I stood up | ||
| grondilu wonders if one can write #define FRAME_HEADER_SIZE 34 // 7 * 4 + 3 * 2 | 19:06 | ||
.oO( I don't remember if one can put comments in a preprocessor line) |
|||
| FROGGS | grondilu: there are... /* ... */ comments | 19:07 | |
| dalek | arVM: 4b95b95 | jnthn++ | src/ (2 files): Add needed parens around #define sizes. nwc10++, grondilu++ for discovering. |
19:08 | |
| grondilu | yeah but I was wondering if there is not a slight waste of resource when putting the whole arithmetic expression instead of its value | ||
| jnthn | The constant folder will get it :) | ||
| That fixes the segfault, but I still get wrong bytecode out | 19:09 | ||
| When bulding Grammar.nqp and it loads the compiled actions: | 19:10 | ||
| Bytecode validation error at offset 5562, instruction 1011: | |||
| operand type 64 does not match register type 56 | |||
| dalek | arVM: 7f49f3f | (Tobias Leich)++ | src/ (2 files): Add needed parens around #define sizes. (#2) |
||
| nwc10 | at HEAD, ASAN now expodes like this: paste.scsys.co.uk/271686 | 19:37 | |
| FROGGS | so, we read from nowhere? | 19:39 | |
| nwc10 | not quite sure | ||
| FROGGS | I am running valgrind now... | 19:41 | |
| valgrind++ gist.github.com/FROGGS/78ff60b293aa4e996c9b | 19:44 | ||
| it seems to be the exit op | 19:45 | ||
| jnthn | nwc10: What process explodes like that? | 19:52 | |
| nwc10: erm, what invocation,s orry? | |||
| Building Actions.nqp still? | 19:53 | ||
| nwc10 | /home/nick/Sandpit/moar/bin/moar --libpath=/home/nick/Sandpit/moar/languages/nqp/lib /home/nick/Sandpit/moar/languages/nqp/lib/nqp.moarvm --target=mbc --output=blib/Perl6/Grammar.moarvm --encoding=utf8 src/Perl6/Grammar.nqp | ||
| jnthn | nwc10: Does it give an error? | 19:54 | |
| nwc10 | Bytecode validation error at offset 5562, instruction 1011:operand type 64 does not match register type 56frame_name_36 | ||
| jnthn | ok, same here then | ||
| nwc10 | and then ASAN aborts | ||
| well, but your terminal probably didn't mangle the newlines on pasting | 19:55 | ||
| I tried to run it (a second build without ASAN) under valgrind, but valgrind itself seems to SEGV | |||
| jnthn | Grrr...--dump shows that there is indeed a bizare code-gen fail... | 19:58 | |
| FROGGS | nwc10: my valgrind out looks like output of asan fwiw | 19:59 | |
| nwc10 | jnthn: OK, so you can likely solve that without external help? | 20:04 | |
| [Am I allowed to go to bed? :-)] | |||
| but also, it implies that MoarVM is not yet hardened against "garbage in" | 20:05 | ||
| jnthn | nwc10: Well, thing is, the validator correctly points out it's wrong | 20:06 | |
| nwc10: It then crashes *after* the validator has thrown an exception refusing to execute the malformed code. | |||
| nwc10 | oh. | ||
| if I understand it correctly, "that would be bad" | |||
| jnthn | Well, it'd be worse if it tried to actually run the invalid code. :) | 20:07 | |
| FROGGS: It fails at exit, iiuc? | |||
| FROGGS | jnthn: looks like | ||
| jnthn | nwc10: Anyways, sleep is allowed ;-) | 20:08 | |
| FROGGS | both my valgrind and nwc's asan point to an invalid read of size 8 at interp.c line 3180 | ||
| which is exit(GET_REG(cur_op, 2).i64); | |||
| so, the .i64 would fit | |||
| jnthn | Yeah...But that's really odd | ||
| FROGGS | yeah, I don't see anythong obvious in the declaration of the op, nor do I see a related call to exit | 20:09 | |
| jnthn | Well, the exit makes some sense | 20:11 | |
| I think it's the one in HLL::Compiler | |||
| diakopter | jnthn: you have asan | 20:13 | |
| FROGGS | which one of the six? | ||
| jnthn | diakopter: You gave me access to a box with it | 20:14 | |
| diakopter: I was gonna try that after dinner, but before I could get there others had already done it :) | |||
| nwc10 | "the box", or "dinner"? | ||
| diakopter | yeah I was reminding you :D | ||
| "there" | 20:15 | ||
| nwc10 | jnthn: I susggest that you get there, as that way you can (re) validate things after I've turned in | ||
| diakopter | 2>&1 |asan_symbolize | 20:17 | |
| nwc10 | monochrome :-( | ||
| I want symbols and colour. | |||
| pony is optional | 20:18 | ||
| FROGGS | jnthn: you are right, if I comment out the first three exits from HLL::Compiler, it dies differently | 20:24 | |
| I'd think printing to stderr followed by nqp::exit(1) would look identical | 20:26 | ||
| nqp: my $err := nqp::getstderr(); nqp::printfh($err, 'a'); nqp::exit(1); | 20:28 | ||
| camelia | nqp: OUTPUT«a» | ||
| FROGGS | nqp-m: my $err := nqp::getstderr(); nqp::printfh($err, 'a'); nqp::exit(1); # it needs a rebuild ó.ò | ||
| camelia | nqp-moarvm: OUTPUTĀ«Bytecode validation error at offset 22, instruction 4:ā¤register operand index 50 out of range 0..9ā¤Ā» | ||
| FROGGS | weird, it does not | 20:31 | |
| nqp -e 'my $err := nqp::getstderr(); nqp::printfh($err, "a\\n"); nqp::exit(1);' | |||
| a | |||
| no error | |||
| while uv_loop_delete explodes when I strip that nqp::exit(1) | 20:32 | ||
| gnight | 20:43 | ||
| diakopter | o/ | 20:46 | |
| what are we diagnosing now | |||
| FROGGS | diakopter: gist.github.com/FROGGS/78ff60b293aa4e996c9b | 20:49 | |
| jnthn | diakopter: As for me, why Actions.nqp compiles to something wrong | 20:51 | |
| diakopter | Perl6? alrfeady? | 20:53 | |
| jnthn | yeah | ||
| FROGGS | there were no more bugs to explore in nqp | 20:54 | |
| jnthn | It ends up trying to getcode into a str reg | ||
| Validator chokes on it, naturally | |||
| --dump confirms it | |||
| --target=mast also | |||
| diakopter | hunh. | ||
| only thing I can think of that could cause that | 20:55 | ||
| is releasing a register in the qast compiler into the wrong list | |||
| jnthn | But it's meant to be an exclusive register | ||
| diakopter | line no? | 20:56 | |
| well yeah | |||
| it's an exclusive one sure | |||
| but it wasn't before it was returned to the list | |||
| previously | |||
| where's the line no of the getcode emission | 20:57 | ||
| probably typo by me in some prior line | |||
| jnthn | It's one of the ones generated for closure handling in QAST comp | ||
| See clone_inner | |||
| But it's stuff I added :) | |||
| diakopter looking | 20:59 | ||
| line 937 | 21:04 | ||
| could return a string register when it wants an obj | |||
| jnthn | If it did, the stuff in the proto would take care of it | 21:05 | |
| diakopter: It's very odd. I commented out all of actions.nqp and have been gradually uncommenting it. Reached a point where any one more method uncommented triggers the error. | 21:55 | ||
| And once again it looks like: | 21:57 | ||
| 00964 getcode loc_7_str, Frame_447 | |||
| 00965 takeclosure loc_7_str, loc_7_str | |||
| oh my... | 22:00 | ||
| 00948 getcode loc_255_obj, Frame_439 | |||
| 00949 takeclosure loc_255_obj, loc_255_obj | |||
| 00950 getcode loc_0_obj, Frame_440 | |||
| 00951 takeclosure loc_0_obj, loc_0_obj | |||
| ... | |||
| eek! | 22:03 | ||
| write_int16(ws->bytecode_seg, ws->bytecode_pos, (unsigned char)l->index); | |||
| char?! | |||
| dalek | arVM: 5c293a8 | jnthn++ | src/mast/compiler.c: Don't cast local/lexical indexes to 8-bit! They're meant to be 16. Also detect the out-of-range local case. |
22:08 | |
| timotimo | i'm still getting the "Routine declaration requires a signature" error even though i set an absolute path as the prefix like i did in /tmp the one time it worked | 22:16 | |
| though ... the nqp checkout is *under* the moarvm folder .. can that be it? | 22:17 | ||
| jnthn | Feels unlikely to be; feels more like a weird heisenbug... | ||
| We now compile the Perl 6 actions and grammar | 22:19 | ||
| timotimo | dependent on the strlen of the path? >_> | ||
| jnthn | timotimo: Well, something memory-layout-ish / GCish | 22:20 | |
| To progress further with Rakudo on MoarVM we need to finish the extops wiring :) | |||
| grondilu | hang on: nqp.moarvm can compile the Perl6 grammar and actions, now? | 22:27 | |
| timotimo | getting it to compile isn't terribly much more than compiling all of nqp ... | ||
| grondilu | the difficult part will be the CORE.settings? | 22:28 | |
| timotimo | i imagine the metamodel is a bit complicated, too | ||
| grondilu | ok | 22:29 | |
| diakopter | jnthn: how muxch mem | 22:38 | |
| jnthn | diakopter: didn't measure | ||
| jnthn does so | 22:39 | ||
| diakopter | time? | ||
| jnthn | Grammar.nqp tops out at 260MB | 22:40 | |
| Which is the highest anything reaches | |||
| Actions is less than that. | |||
| The stuff that builds so far takes around 47s here | |||
| diakopter | my goal: 5s | 22:41 | |
| jnthn | :) | ||
| Yeah, we've lots of room to improve yet :) | 22:42 | ||
| diakopter | .. and then 1s | ||
| jnthn | Let's focus on making it work first, though ;) | ||
| diakopter | *cry* | ||
| gerd said he'd work on extops today | 22:43 | ||
| jnthn | Well, I'll be tied up tomorrow but can help with 'em a bit also on Tuesday maybe... | 22:44 | |
| I reckon by this time in a week we can have everything that comes before CORE.setting compiling. | |||
| diakopter | .ask not_gerd , | 22:48 | |
| yoleaux | diakopter: I'll pass your message to not_gerd. | ||
| jnthn | Anyway, this is fairly nice progress... | 22:50 | |
| 'night o/ | |||
| lue | I get a segfault trying to compile NQP (using Clang for this): gist.github.com/lue/6968277 | 22:51 | |
| diakopter | oop | ||
|
22:56
benabik joined
|
|||
| diakopter | okay let's see about getting my phone to build this thing | 22:58 | |