MasterDuke | timotimo: interesting. is there anything that prevents ops from being implemented on the JIT? | 01:32 | |
timotimo | some ops are harder than others. some aren't worth the effort | 01:33 | |
a big chunk of ops are implemented as calls into the same function the interpreter would call | 01:34 | ||
others are implemented straight in assembly language | |||
the former you find in graph.c, the latter in emit*.dasc | |||
the JIT can also do a nice trick called "devirtualization" (and it points out when it can or can't do it in the jit log) where if the REPR in question is known, one less pointer has to be chased down to do the call | 01:35 | ||
MasterDuke | so just looking at a profile and seeing a lot of interpreted frames doesn't necessarily mean the script would run faster if those were JITed? | ||
timotimo | if they are interpreted, rather than speshed, they won't have a chance to hit the jit even if all ops were implemented | 01:36 | |
you can only go from orange to green by improving the jit. you can't go straight from red to green | |||
MasterDuke | ah, interesting | ||
timotimo | you can grep for BAIL in a jit log to see what's what | 01:37 | |
and going through the file looking for what lines come before a BAIL line tells you what functions didn't get compiled because of that | 01:38 | ||
MasterDuke | timotimo: btw, i have an idea for an advent post i would love to read that i think you're qualified to write. a trace of what exactly happens when you run perl6 -e 'say "hello world"' | ||
timotimo | oh | ||
yeah, maybe i could write that | 01:39 | ||
MasterDuke | what's the first line of code? where does it transition from moar to nqp to perl6? | ||
timotimo | mhm | ||
MasterDuke | it's something i've been thinking about for a while (that is, persuading someone who knows these things to write them down) | 01:40 | |
timotimo | hah | ||
yeah, i'll see about that | |||
need to get some sleep first, though | |||
MasterDuke | cool | ||
dalek | kudo/nom: 01775b7 | (Zoffix Znet)++ | src/Perl6/ (2 files): Add support for U+2212 minus in Num and compound literals Makes the following parse correctly: 42e−42, <−1/2>, <−42+42i>, and <42−42i> |
03:19 | |
ast: 09f30c6 | (Zoffix Znet)++ | S (2 files): Add tests for U+2212 minus in Nums and compound literals Fixed in commit: github.com/rakudo/rakudo/commit/01775b73db |
03:21 | ||
AlexDaniel | \o/ | 03:26 | |
dalek | kudo/nom: 6cd2144 | (Zoffix Znet)++ | src/Perl6/ (2 files): Add suport for U+2212 minus with literal Ints in signatures Fixes part of RT#129912: rt.perl.org/Ticket/Display.html?id=129915 |
03:43 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129912 | ||
ast: 141fedc | (Zoffix Znet)++ | S06-signature/types.t: Test U+2212 minus works with Int literals in signature RT#129915: rt.perl.org/Ticket/Update.html?id=129915 Fix commit: github.com/rakudo/rakudo/commit/6cd2144b5a |
03:46 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129915 | ||
dalek | kudo/nom: ae614f9 | (Zoffix Znet)++ | src/Perl6/ (2 files): Fix issues with Inf term - Fix -Inf² not following mathematical order of operations | `-Inf` was written as a single token, preventing tighter ops | working on plain Inf first - Fix −Inf, ∞, -∞, and −∞ not being accepted as a type constraint in signatures |
04:44 | |
ast: 5944f8c | (Zoffix Znet)++ | S0 (3 files): Test issues with Inf term RT#129915 rt.perl.org/Ticket/Display.html?id=129915 Fix commit: github.com/rakudo/rakudo/commit/ae614f94b0 |
|||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129915 | ||
kudo/nom: d704820 | lizmat++ | / (3 files): Make native shaped array initialization much faster - copy from a data structure: 6x - copy from a similarly shaped non-native shaped array: 4x Benchmarked for a 2x2 matrix: larger matrices will be faster still. |
09:50 | ||
psch | ...why do neither nqp-j nor nqp-m actually *do* anything with the flag that marks a Frame as the Frame to run state init code..? | 09:58 | |
as in, in the whole code base there's exactly two occurences of the corresponding flags, and in both backends that's the definition and then the assignment | 09:59 | ||
[TuxCM] | This is Rakudo version 2016.11-106-gd70482033 built on MoarVM version 2016.11-27-g3171dbbe | 10:09 | |
csv-ip5xs 3.257 | |||
test 14.759 | |||
test-t 6.688 | |||
csv-parser 14.251 | |||
travis-ci | Rakudo build failed. Elizabeth Mattijsen 'Make native shaped array initialization much faster | 10:40 | |
travis-ci.org/rakudo/rakudo/builds/180925582 github.com/rakudo/rakudo/compare/a...0482033d55 | |||
buggable | [travis build above] ☠ Did not recognize some failures. Check results manually. | ||
psch | i absolutely don't get it | 11:35 | |
i mean, the logic for putting state vars into the Frame's lexical storage looks semantically identically across nqp-{j,m} | 11:36 | ||
github.com/MoarVM/MoarVM/blob/mast...ame.c#L607 on moar | |||
github.com/perl6/nqp/blob/master/s....java#L148 on jvm | 11:37 | ||
timotimo | it's also important that the right flags get set ... i think? | ||
or ... maybe cloning? | |||
psch | both come down to "if we don't have lexical storage for state vars yet, allocate it, if we don't have the state var yet, clone it from the static info" | ||
timotimo | ah, OK | ||
psch | at least if i get the C switch/goto stuff right :P | 11:38 | |
i mean, i'm pretty sure i do understand it correctly, but who knows :P | |||
and, well, mucking about with that nqp-j code only got me different kinds of wrong results | 11:41 | ||
timotimo | there's been multiple cases in the past where things weren't cloned when they were supposed to | 11:47 | |
so maybe you're getting something like that? | |||
psch | yeah i was wondering just now if i might have to clone the coderef | ||
the one that gets fed into the CallFrame constructor | |||
but that actually seems a bit silly | 11:48 | ||
on the other hand, that's where we get the static info from, which is where we get the original value from vOv | |||
dalek | kudo/nom: 947422b | lizmat++ | / (2 files): Add an iterator for native 1dimmed arrays Makes it about 17x faster (for a 100 element shaped 1dimmed array) |
15:01 | |
travis-ci | Rakudo build passed. Elizabeth Mattijsen 'Add an iterator for native 1dimmed arrays | 15:47 | |
travis-ci.org/rakudo/rakudo/builds/180963477 github.com/rakudo/rakudo/compare/d...7422b17980 | |||
dalek | kudo/nom: 3e93ddd | lizmat++ | / (2 files): Add an iterator for native >1 dimmed arrays Makes it about 11x faster (for a 10x10 element shaped 2dimmed array) |
16:27 | |
kudo/nom: ec56bf2 | lizmat++ | src/core/ (3 files): Move values to ShapedArrayCommon role Now that all of the clients have their own .iterator. Makes .values on native shaped arrays about 11x faster (based on a 10x10 matrix) |
16:42 | ||
babydrop | There's no simple way to negate a number in Perl6/Grammar, is there? I basically need a version of this token that negates the number instead of attaching a prefix:<-> op to the AST github.com/rakudo/rakudo/blob/nom/...7162-L7167 | 17:17 | |
there's nqp::neg* for num/int, but I also need to take care of Rats and Complex | 17:18 | ||
Maybe there's a way to change the generated stuff for them to negate numerator (or real/img parts) | |||
timotimo | babydrop: one way to do stuff is to find the symbol for the negation prefix op and just run it on the object you've constructed | 17:21 | |
babydrop | Thanks. Lemme try that out | 17:23 | |
timotimo | not sure if there's something specific you need to do to make it actually work | ||
for example we have "compile_in_context" for compiling stuff that belongs to the current compilee | 17:24 | ||
dalek | kudo/nom: 39261e7 | lizmat++ | / (2 files): Add optimised .(anti)pairs for native shaped arrays Makes them about 7x faster |
17:34 | |
babydrop | hm hm "Cannot call Numeric; no signatures match" | 17:35 | |
that's with gist.github.com/zoffixznet/6b22174...a28b53d3c0 | 17:37 | ||
timotimo | hmm, could it be the right op hasn't been defined at that point yet? | 17:39 | |
babydrop | It may be due to my messing up the type_constraint (inadvertently breaking it for version/str literals). At least now it seems to compile | 17:59 | |
Nope, never mind... I messed it up now that it never was called :P | 18:01 | ||
"Object of type Int in QAST::WVal, but not in SC" heh | 18:25 | ||
What's SC? | |||
cygx | babydrop: Serialization Context | 18:29 | |
babydrop | Thanks. | ||
cygx sneaks a peek at the draft advent calendar postings... | 18:40 | ||
japhb | Who does "BRIAN D FOY" show up as on the #perl6* channels? | 18:43 | |
Because the code in his advent posting got damaged by wordpress | |||
psch | japhb: afaik he doesn't | 18:44 | |
japhb: i'd guess tweeting at him is your best bet | 18:45 | ||
japhb | psch: I have not the tweets. Have you? | ||
psch | japhb: no, i'm not on twitter | 18:46 | |
timotimo++ is i think | |||
timotimo | uh oh, what did i do? | 18:48 | |
oh, i can do it | |||
what exactly should i tell him? | 18:49 | ||
is it the same $foo<bar> damage? | |||
psch | i'd guess "replace your < and > with < and >" maybe? | ||
i don't know what the damage is though | 18:50 | ||
japhb: is there more broken than angle brackets? | |||
timotimo | well, if it's the same as with our first post, it'll have swallowed everything inside the angle brackets | 18:53 | |
i don't see the problem | 18:54 | ||
psch | i honestly haven't looked at it, so uhm :) | 18:55 | |
japhb | Yeah, it was just angle brackets. But since he was talking about allomorphs, the angle brackets were pretty important (and used in both code blocks and text) | 18:57 | |
timotimo: fourth line of the first code block, for example | |||
timotimo | seems like that'd just be <4> | 18:59 | |
japhb | timotimo: Someone new to Perl 6 would be totally confused. | 19:01 | |
timotimo | yes | ||
i tried to repair the few instances i saw | |||
japhb | timotimo: There's an < missing its ; | ||
At least two places, actually | 19:02 | ||
And the text and code following " Several mandates that apply to us have drop-dead dates in 2017. | 19:03 | ||
Gah | |||
timotimo | huh? i put ; there >:( | ||
japhb | And the text and code following "Consider the angle brackets version of quote words operator" is still messed up | ||
timotimo | wordpress apparently just discarded my shit | 19:04 | |
%hash = ; | 19:05 | ||
what goes there, i wonder? | |||
why is it supposed to be %hash = <4>? that's wrong! | 19:06 | ||
fuck you, wordpress, fuck you very, very much. | 19:07 | ||
psch | timotimo: have you twote at bdfoy yet? | ||
timotimo | yes | ||
psch | alright | ||
timotimo | i twatted him | ||
babydrop | you... what? :) | 19:16 | |
timotimo | tweetified | 19:18 | |
cygx | twaught | 19:22 | |
babydrop | hm, OK so what do I do about the SC thing? | 19:33 | |
I tried $*W.add_numeric_constant thing, but still same error | 19:34 | ||
These being my current changes: gist.github.com/zoffixznet/b846354...969f4be04a | 19:35 | ||
timotimo | don't know, that should have worked :( | 19:42 | |
psch | you're not serializing the negated int | 19:59 | |
s/int/numeric value/ | |||
at least that's what the error says | |||
babydrop | What does that mean? | ||
psch | i'm not sure add_numeric_constant does that properly | ||
oh hm, can you try unboxing the return value before the binding in line 12 in the second file? | 20:00 | ||
err | |||
it's only one file, my bad | |||
ah, but that breaks Complex etc again :/ | |||
well, $*W.add_numeric_constant can only deal with Int and Num in the first place | 20:01 | ||
m: use nqp; my Int $x = 5; say nqp::isbig_I($x) | 20:02 | ||
camelia | rakudo-moar 39261e: OUTPUT«P6opaque: get_boxed_ref could not unbox for the representation '20' of type Scalar in block <unit> at <tmp> line 1» | ||
babydrop | The error is currently triggered by an Int fwiw | ||
psch | m: use nqp; my Int $x = 5; say nqp::isbig_I(nqp::unbox_i($x)) | ||
camelia | rakudo-moar 39261e: OUTPUT«0» | ||
psch | i'd try the unbox | ||
as in | |||
- $val := $neg-op($val); | |||
+ $val := nqp::unbox_i($neg-op($val)); | 20:03 | ||
+however many spaces you have there for the right indent level | |||
i'm honestly kind of confused what add_numeric_constant does there anyway | |||
i mean, in general | 20:04 | ||
timotimo | oh | ||
babydrop has a general object they want in there | |||
psch | 'cause nqp::isbig_I doesn't seem to work on boxed Ints on a Perl 6 level | ||
timotimo | so should use $*W.add_object instead | ||
psch | probably even $*W.add_object_if_no_sc | 20:05 | |
but yes, that seems better for the other numbery types | |||
(the difference between add_object and add_object_if_no_sc isn't quite clear to me so maybe that advice is wrong :P ) | 20:06 | ||
i mean, of course i can see what the code does, but the intricacies of a serialization context... | |||
timotimo | i suppose add_object may transfer ownership? | 20:07 | |
psch | right, it would if there's already an SC set | 20:08 | |
as in, it always does | |||
babydrop | Changing to $val := $*W.add_object($neg-op($val)); gives Object of type BOOTInt in QAST::WVal, but not in SC | ||
timotimo | ... :o | 20:11 | |
psch | that's funny, because add_object should add it to the SC :| | ||
oh | 20:12 | ||
what *is* the actual compile time value btw? | |||
like, just debug say it and comment stuff that doesn't work i guess? | |||
babydrop | The nqp::say("Calling neg op " ~ $val.HOW.name($val) ~ " " ~ $val); on the previous line gives "Calling neg op Int 42" | ||
psch | maybe try adding the original value to the SC as well? | 20:13 | |
'cause the ast still shows up i guess | 20:14 | ||
babydrop | That's the original value, before $neq-op is called | ||
psch | right, but you're only calling add_object on $neg-op($val) | ||
i'm saying also call $*W.add_object($val) | |||
because it still exists in the AST | |||
timotimo | and add_object also returns the thing you have, yeah? | 20:15 | |
psch | and, well, that's exactly what the error says | ||
you have something in the AST (in a WVal) which isn't in the SC | |||
right, so you could do like $*W.add_object($neg-op($*W.add_object($val))) i suppose | |||
timotimo | huh | 20:17 | |
babydrop | the $val := $*W.add_object($neg-op($*W.add_object($val))); shows the same error :( | 20:19 | |
psch | hm, in that case i'm out of idea :/ | ||
i'd suggest trying a different layer of the compiler stack, but that seems hardly feasible | 20:20 | ||
when during compilation does it error out anyway? | |||
timotimo | most probably during the mast phase | ||
babydrop | oh wtf | 20:23 | |
here's the current changes: gist.github.com/zoffixznet/79fbda2...136ffed909 and here's the output: gist.github.com/zoffixznet/f81ed16...178efedc78 | 20:24 | ||
42 turns into 14 :S | |||
timotimo | so some other value is taking it's place? | 20:25 | |
psch | that or it's negating really weirdly :S | 20:28 | |
babydrop | w00t made it work | 20:37 | |
gist.github.com/zoffixznet/ca7feb1...4567aea4b0 | |||
.add_object doesn't return what we thought it returns, I guess | 20:38 | ||
psch | oh | ||
yeah | |||
it returns the index inside the SC | |||
soo that probably was the 14 | 20:40 | ||
babydrop | yeah | ||
psch | geez if you'd have tested with that :P | ||
babydrop | haha :D | ||
dalek | kudo/nom: 471cea2 | lizmat++ | / (2 files): Provide optimised .(anti)pairs for native 1dimmed arrays Makes them about 30% faster |
20:55 | |
MasterDuke | babydrop: it doesn't work to just multiply by -1? | 21:15 | |
babydrop | nqp doesn't know how to do that for Rats and Complex | 21:16 | |
MasterDuke | ah | ||
dalek | kudo/nom: 965fa4d | lizmat++ | / (2 files): Add optimised .kv for native shaped arrays Makes them about 16 faster (based on a 10x10 matrix) |
21:32 | |
timotimo | 16x faster? | 21:33 | |
lizmat | timotimo: yes | 21:37 | |
yoleaux2 | 1 Dec 2016 12:12Z <gfldex> lizmat: please add to the next weekly that the commits 19169cc, 3ffdc37, b9a6dc8, 0bf8b18, c7b14ae, ce7c9f6 clarify the relationship between containers, default types and type constraints -- what used to be a rich source of confusion | ||
lizmat | timotimo: not enough ? | 21:38 | |
:-) | 21:40 | ||
dalek | kudo/nom: d26f4ba | (Zoffix Znet)++ | src/core/Num (2 files): Move ≅(±Inf,±Inf) to Num We need to parse Numeric without relying on knowing how to negate literals. |
||
timotimo | lizmat: just missing the x ;) | 21:43 | |
dalek | kudo/nom: 5baa064 | (Zoffix Znet)++ | src/Perl6/ (2 files): Implement negation for all numerics in signature literals Currently, only negated Ints can be specified as negatives in signatures. This PR allows for all numeric literals to be prepended with either normal or U+2212 minus, so we could use stuff like sub f(−½){}, sub f(−1.5){}, etc. |
||
lizmat | timotimo: ah, good point :-) too late now | ||
timotimo | not that important :) | ||
dalek | ast: c027893 | (Zoffix Znet)++ | S06-signature/types.t: Test all numeric literals in signatures Rakudo commit: github.com/rakudo/rakudo/commit/5baa064640 |
21:45 | |
kudo/nom: c1a3a3c | lizmat++ | / (2 files): Provide optimised .kv for native 1dimmed arrays Makes them about 30% faster |
21:46 | ||
MasterDuke | timotimo: is it relatively simple to explain how the values seen in a profile are calculated from the json? | 22:19 | |
timotimo | it requires a walk of the whole tree | 22:20 | |
MasterDuke | yeah, but looking at the json, the neither the total_time nor the top level inclusive_time seem to be the sum of the rest of the inclusive times | 22:24 | |
babydrop | m: dd <0x5.5> | ||
camelia | rakudo-moar c1a3a3: OUTPUT«RatStr.new(5.3125, "0x5.5")» | ||
babydrop | m: dd 0x5.5 | ||
camelia | rakudo-moar c1a3a3: OUTPUT«===SORRY!=== Error while compiling <tmp>Malformed postfix callat <tmp>:1------> dd 0x5.⏏5» | ||
timotimo | MasterDuke: sorry, i haven't actually looked at the data part of the profiler in a while. maybe reading the code for the qtprofiler helps you figure it out? | 22:33 | |
dogbert2 | lizmat: so HARNESS_TYPE=6 runs more tests that the normal 'make spectest' then? | 22:35 | |
yoleaux2 | 13 Sep 2016 21:11Z <Zoffix> dogbert2: (RE: spectest failures), yeah, create an RT ticket for them. | ||
dogbert2 oh no my nick is wrong | 22:36 | ||
babydrop | dogbert2: from what I recall, that just switches the harness to Perl 6's harness | 22:37 | |
dogbert2 | babydrop: aha | 22:38 | |
is it slower/faster/buggier? | 22:39 | ||
babydrop | slower and buggier | ||
dogbert2 | running it now, will be interesting to see what happens though | 22:41 | |
dogbert2 finds it difficult to type with sunglasses on | |||
make spectest HARNESS_TYPE=6 failed after t/spec/S32-str/indices.t :( | 22:59 | ||
dalek | kudo/nom: 971e147 | (Zoffix Znet)++ | src/core/ (2 files): Give X::Syntax::Number::InvalidCharacter .at attribute The .pos is used by something else and when we trow from Grammar, gets overwritten with some other value, resuling in incorrect information shown in the exception. |
23:14 | |
ast: faaec89 | (Zoffix Znet)++ | S32-str/parse-base.t: Test for .at, not .pos in parse-base exception tests |