00:06 pyrimidine joined 00:09 japhb joined 00:20 jeffythedragonsl joined
jeffythedragonsl Hey anyone there? 00:20
00:21 jeffythedragonsl joined
jeffythedragonsl Wanted some feedback on the MVM rename 00:22
00:36 japhb joined
TimToady jnthn is asleep currently 00:56
01:06 zakharyas joined 01:08 japhb joined
MasterDuke timotimo: for the heck of it i just jitted isprime_I and profiled the code dogbert17 posted earlier before after my change. before, 20% of the frames were speshed, after 20% were jitted. however, the total time spent was pretty much exactly equal, same with perf reports 01:25
timotimo hm, how long are those frames that were now being jitted? 01:26
can i see the jit log and/or spesh log?
(compression helps a lot here)
MasterDuke long?
timotimo well, how many instructions?
our jit is mostly good for removing interpreter overhead at the moment - which will change with brrt's next generation JIT 01:27
MasterDuke let me gist the logs
timotimo maybe only the relevant parts :)
i really ought to build a tool to do stuff with spesh and jit logs
MasterDuke gist.github.com/MasterDuke17/1a09a...64ecdab8f, pr1.log is MVM_JIT_LOG before, pr2.log is after 01:29
oooh, added feature to the qt profiler viewer would be awesome!
timotimo not sure if i want to write it in cpp 01:32
MasterDuke heh, i sympathize 110% 01:33
timotimo do you see that your 20001 number is being used as a floating point number?
MasterDuke !!!! 01:34
timotimo what's the source code again? 01:35
01:35 japhb joined
MasterDuke i converted it to nqp. `'my $b := nqp::knowhow().new_type(:name("TestBigInt"), :repr("P6bigint")); sub a() { my int $numPrimes := 0; my int $x := 1; while ++$x { if nqp::isprime_I(nqp::box_i($x, $b), 100) && ++$numPrimes == 5_001 { say($x); last } } }; a()'` 01:35
timotimo yeah, so try with nqp::iseq_i there 01:37
MasterDuke gist updated 01:41
timotimo -append_ins: <coerce_in> 01:43
-append_ins: <const_n64>
-append_ins: <eq_n>
+append_ins: <const_i64_16>
+append_ins: <eq_i>
exactly the kind of change i was hoping for
-Bytecode size: 1443
+Bytecode size: 1413
^- hardly noticable
i don't know where the other differences come from 01:45
MasterDuke i added the perf reports to the gist 01:49
timotimo do we always go through bigints to figure out if a thing is a prime? 01:53
MasterDuke yeah 01:56
timotimo well, that's dumb :) 01:57
but did you see the talk from dana jacobsen?
MasterDuke not live, is the video available now? 01:58
timotimo don't know 01:59
they said they have very good speed improvements that they can send upstream 02:00
japhb Who is they, and what is upstream? 02:01
timotimo dana jacobsen. we are upstream
but also there's a dumb bug in libtom
02:01 yoleaux2 joined
timotimo where it implements the algorithm for primality testing by using the first 100 bases instead of 100 random bases 02:02
japhb OK, fair enough. Speed improvements to what? To our math? To our general speed? To our GC?
timotimo and there's a published attack to generate numbers that will test as Prime for that
02:02 yoleaux2 joined
timotimo speed improvements to .is-prime 02:02
MasterDuke oh good, then i'm not going to touch anything
japhb Oh. That's useful, but not critical ...
yoleaux2 6 Feb 2017 10:59Z <samcv> japhb: that probably happened because you are not added to the rt list or something. send an email to That one was waiting in human moderation because you're not subscribed to the list. email [email@hidden.address] and they can add you
6 Feb 2017 11:00Z <samcv> japhb: otherwise takes human moderation for it to go through
02:24 pyrimidine joined 02:46 samcv joined 03:28 agentzh joined 04:27 pyrimidine joined 05:10 pyrimidine joined 05:14 pyrimidine joined 07:09 pyrimidine joined 07:14 pyrimidi_ joined 08:15 pyrimidine joined 08:28 nebuchadnezzar joined
Geth MoarVM: ffe92b73ff | (Samantha McVey)++ | 3 files
Add a MVM_COLLATION_QC property

This property is 0 or False when the codepoint is a starter in one of the collation weights that is a sequence of codepoints. Currently we only apply weights for single codepoints and not sequences, but this property will be needed as our support of the Unicode Collation Algorithm increases.
09:06
09:10 pyrimidine joined 09:15 pyrimidi_ joined 09:40 btyler_ joined, [Coke]_ joined 09:41 sivoais_ joined
jnthn morning o/ 09:50
yoleaux2 02:26Z <TimToady> jnthn: the %?LANG mechanism is rather bogus, insofar as it can't actually tell you the current language, only the language after the last add_categorical, which retroactively redefines %?LANG for earlier parts of the block
09:53 mtj_ joined
jnthn .tell TimToady %?LANG is there for the sake of EVAL. I consider this as just another example of what we see in `EVAL 'say $x'; my $x = 42` - that is, by runtime certain things exist at block-level, even if the compiler had a finer-grained view of them earlier. 09:58
yoleaux2 jnthn: I'll pass your message to TimToady.
10:00 pyrimidine joined
Geth MoarVM: 2c2374c01f | (Bart Wiegmans)++ | 2 files
Add data section for JIT code

This enables us to store (function) pointers and the like in a separate section rather than having to shuffle them in via constant expressions (ie. movabs). Expected to be a code-size saving, might eventually be used to canonicalize pointers and make JIT code serializable.
10:28
MoarVM: 2d81976c6c | (Bart Wiegmans)++ | 7 files
Emit data node for extop 'fake' registers

This should plug a minor memory leak from malloc()-ing 'fake' registers used for extop support. Introduces a MVM_JIT_DATA node type.
MoarVM: 1706706081 | (Jonathan Worthington)++ | 7 files
Merge pull request #516 from MoarVM/jit-data-section

Add data section for JIT compiled code
10:34 TimToady joined 10:38 catbert17 joined 10:49 pyrimidine joined 11:13 pyrimidine joined 11:15 pyrimidine joined 11:34 pyrimidine joined 11:58 catbert17 joined 12:36 pyrimidine joined 12:47 pyrimidine joined 12:59 catbert17 joined 13:49 pyrimidine joined
IOninja Are there any issues with adding `#include <stdlib.h>` in src/core/interp.c ? 14:08
I guess I can find out what it does and copy the function I want... 14:09
arnsholt What function from stdlib is it you want to use? 14:10
IOninja oh, nm, it's only for ints I think
arnsholt: abs
arnsholt Shouldn't be a problem, I think 14:11
And there's labs for long
IOninja I got MVMnum64 num tho
arnsholt Right 14:12
IOninja are && and || in C short-curcuiting? 14:14
timotimo i believe so
arnsholt They are 14:15
Thus the idiom "if(pointer && pointer->member) { /* something with pointer->member */ }"
timotimo annoyingly, can't have a conditional mov in assembler 14:16
IOninja m: say abs -0e0 14:37
camelia rakudo-moar a63d82: OUTPUTĀ«-0ā¤Ā»
IOninja ^ wrong
j: say abs -0e0
camelia rakudo-jvm fb4f16: OUTPUTĀ«0ā¤Ā»
IOninja Right.
Geth MoarVM: zoffixznet++ created pull request #526:
Fix abs_n op for negative zeros
timotimo hah, that's weird
hm, gcc probably compiles that to good assembly code 14:39
arnsholt IOninja: commented 14:51
14:51 pyrimidine joined
IOninja arnsholt: saw somewhere that it's only part of library since "C99" is that normal? What C version do we use? 14:53
arnsholt Ah, FFS >.< 14:55
Lemme see if Visual C has it
IOninja hm, copysign(num, 1.0) didn't do nothing. abs -1e0 reutrns -1 14:57
IOninja tries copysignf
arnsholt Looks like it's in Visual Studio since at least VS 2015
Oh, you'll probably want copysignl, sorry
samcv IOninja, C version -10
some old one is all i know. you have to be careful
not to make it angry 14:58
arnsholt jnthn: How recent a version of Visual Studio do we need to support, d'you think?
IOninja I'm gussing 10 is 2010 and so is newewr than C99?
timotimo hahahahahaha
no
MSVC hasn't advanced in the C standard it supports in over 10 years 14:59
maybe even over 15 years
samcv ^
timotimo microsoft just says "if you need newer C features, just use MSVC++"
samcv :\
is it still actively developed?
timotimo i think development has picked up in the recent years?
samcv s/C++/C# 15:00
timotimo they keep buying experts from all over the field, at some point they *must* end up doing something for C
arnsholt Visual C only has partial support for C99
samcv we have like C85?
idk. something something
arnsholt C89, yeah
samcv yeah
timotimo C89Ā½
arnsholt Yeah#
samcv also why don't we use -c89 for gcc 15:01
so it can error at you for doing things
timotimo we used to have -fpedantic i think
arnsholt Probably because VSC does support *some* of C99
But not all of it
samcv i think we still do? idk i remember compiling stuff fine sometimes
but then MSVC wouldn't let it
timotimo one of the worst offenders usually is that someone puts stuff before declarations
and we make that case error with flags
samcv it took a stricter version of not combining code and declarations
timotimo i wonder why we don't seem to have appveyor set up for moarvm?
samcv lazy lists 15:02
arnsholt Yeah, interleaving declarations and code is C99 and not supported by VSC
timotimo visual studio code? :P
ilmari does it support designated struct initializers yet?
arnsholt Also for(int i; ...; ...) { ... }
timotimo correct
arnsholt timotimo: Whatever =p
ilmari struct foo = { .bar = 42, .baz = 37 };
timotimo if we had that we ought to make all our reprs use that 15:03
but i don't think we do?
samcv never seen that notation ilmari
arnsholt Probably not
ilmari used all over the linux kernel
and (ab)used to impressive effect here: fanf.livejournal.com/148506.html 15:04
named and optional function arguments in C99
with only a tiny amount of preprocessor hackery
samcv lol. 15:05
wtf
ilmari because you can mix designated and non-designated initialisers, and the non-designated ones continue in order after the designated one
samcv does C++ have named arguments?
arnsholt "It's not even completely horrible!" What an endorsement! 15:06
timotimo no, cpp doesn't have that 15:07
ilmari ISO:IEC 9899-1999 Ā§6.7.8.17 15:08
ISO/IEC 9899:1999, to use the correct syntax 15:09
IOninja arnsholt: tried copysign/copysignf/copysignl none change the sign. I'm assuming that's due to number being MVMnum64 num which copysign doesn't know how to operate on? 15:10
timotimo no, MVMnum64 is just a typedef 15:11
IOninja ah
timotimo it's probably typedefd to "double"
IOninja oh good god 15:12
I never saved the result of copysign
timotimo ooooh! 15:13
IOninja It works! :) 15:14
arnsholt++ it's better too 'cause IEEE talks about signs on NaNs, which the *-1 thing don't do, but I see we don't got signed NaNs on Perl 6 level so kinda ignored that 15:16
just gonna finish stresstesting and update the PR
jnthn I can test stuff on MSVC if needed 15:21
I do builds there every so often
IOninja jnthn: arnsholt PR updated with the copysign thing: github.com/MoarVM/MoarVM/pull/526 15:23
samcv IOninja, so we should have signed NaN? 15:25
.oO(ā€½)
15:26
jnthn
.oO( I prefer garlic NaN... )
IOninja samcv: no idea. Probably not? It says standard don't specify signs on NaNs but stuff like abs()/negate() sets their signs and its relevant in ordering? or something or other gist.github.com/zoffixznet/a8f68ae...13b50248c7 15:28
m: use nqp; dd nqp::neg_n(NaN) 15:29
camelia rakudo-moar a63d82: OUTPUTĀ«NaNā¤Ā»
IOninja m: use nqp; dd nqp::neg_n(Inf/Inf)
camelia rakudo-moar a63d82: OUTPUTĀ«NaNā¤Ā»
IOninja shrugs
Here's the whole thing if you want to read it: www.csee.umbc.edu/~tsimo1/CMSC455/I...4-2008.pdf the stuff I quoted is from 6.3 The sign bit, and there's also section 5.5.1 Sign bit operations 15:31
jnthn PR busts the build, I'm afraid...commented on PR
arnsholt Oh. Maybe the Moar build does have -lm? 15:32
I guess I just assumed it did
IOninja What's that? linking math.h stuff?
arnsholt Yeah, math library
IOninja There was already #include <math.h> so I guess it's used elsewhere 15:33
And it builds in whatever my box uses to build it.
IOninja reverts back to the 1.0/num thing, I guess
15:39 pyrimidine joined 15:41 FROGGS joined
IOninja PR updated to use the 1.0/num to detect the negative zero 15:41
and mutliply negative stuff by -1 instead of using copysign thing 15:42
samcv wow the full test for unicode collation is 17MB! 15:55
i only ran the short test which is like 4MB :P
probably same result but will run it just to make sure 15:56
[Coke] m: say $ENV<PATH>; # it'd be nice if this perhaps suggested the dynvar.
camelia rakudo-moar a63d82: OUTPUTĀ«===SORRY!=== Error while compiling <tmp>ā¤Variable '$ENV' is not declaredā¤at <tmp>:1ā¤------> say ā$ENV<PATH>; # it'd be nice if this perhaā¤Ā»
IOninja m: say $*ENV<PATH> // 'meow'; # it'd be nice if this pointed out Perl 5'ism 15:58
camelia rakudo-moar a63d82: OUTPUTĀ«meowā¤Ā»
[Coke] ... ooops, wrong window.
IOninja Burned myself twice with that :)
[Coke] I had someone at work here try $*ENV{PATH}, and was surprised when it worked. (turned out he deployed the wrong docker image, whoops) 15:59
er, $ENV{PATH}, even!
16:18 FROGGS_ joined 16:25 pyrimidine joined 16:47 pyrimidine joined
Geth MoarVM: 64118b2a38 | (Jonathan Worthington)++ | src/instrument/crossthreadwrite.c
Filter out multi-cache noise in cross-thread log.

Bit of a cheaty heuristic, but this whole instrumentation is a hack awaiting a true deadlock detector anyway.
16:47
MoarVM: 3cc2f1c75b | (Jonathan Worthington)++ | src/instrument/crossthreadwrite.c
Another heuristic to cut CTW-log junk.
17:19
17:21 lucasb joined
lucasb re naming consistency, I couldn't grasp the meaning of "Some names have a VM prefix for vm-specific but multi-backend types and some purely MoarVM-specific types have a MVM prefix" 17:23
can someone elaborate a bit more? :)
why would it be ok to have a VMArray, but not a VMString? how are they different? 17:24
jnthn Some REPRs are specific to MoarVM (and other backends that aren't 6model-based don't even use the REPR system for them) 17:26
Others are cross-backend
Such as VMArray, P6int, CStruct, and so forth.
MVMString is the way MoarVM chooses to represent its strings, but for JS and the JVM we can just use whatever they have
Similar for exceptions 17:27
lucasb well, it'll take a while for me to understand this :| 17:29
I'm looking at 6model/reprs/MVMArray.h; it's the implementation of a "MoarVM array", right? how is this generic that other backends may use this same representation (elems,start,ssize,slots) ? 17:31
(I guess I'm making a huge confusion. thanks jnthn++ for the patience)
jnthn nqp: class C is repr('VMArray') { } 17:32
camelia ( no output )
jnthn nqp-j: class C is repr('VMArray') { }
Aww, guess no bot for that
r-j: class C is repr('VMArray') { }
camelia ( no output )
jnthn Ah, there we go
So VMArray is available on all backends 17:33
r-j: class C is repr('MVMString') { }
camelia rakudo-jvm fb4f16: OUTPUTĀ«===SORRY!===ā¤java.lang.RuntimeException: No REPR MVMStringā¤Ā»
jnthn That ain't
m: class C is repr('MVMString') { }
camelia ( no output )
jnthn And that's a very weird thing to do :)
(You can't actually do anything useful whatsoever with it)
lucasb ah, clarifying examples :)
jnthn MoarVM uses 6model for every single garbage-collectable entity, though. 17:34
Other VMs do not natively provide it
The REPRs that are registered with a name starting with MVM are MoarVM-specific
lucasb I see written "core representations" in the comments. Does moarvm has to deal with NON-core representations at any time? 17:39
jnthn We've kinda pondered making that pluggable 17:40
Though I'm not hugely enthusiastic about that, to be honest.
And there's only so many useful ones you can probably write :) 17:41
Supporting extension ops has largely been a nuisance.
The only reason it's manageable at all is because we control the only use of them that exists :)
lucasb extension ops was the other thing I was gonna ask. are they what, like opcodes defined elsewhere, not in more core? 17:43
jnthn Right 17:44
Rakudo has a bunch
I'd like to converge on not needing them 17:45
But there's so many bigger fish to try at the moment... :)
The main reason they exist historically is because in theory writing common bits in C is more efficient
In reality, in a world with spesh/JIT, it tends to make things worse
lucasb last question: I see MVMCFunction lives on the MVMCFunction.h file, while the other MVMCSomething's live on the CSomething.h files. is this a file naming inconsistency too? 17:47
jnthn No
17:48 pyrimidine joined
lucasb ah, ok 17:48
jnthn CStruct is actually one of the most "public" REPRs; NativeCall code uses iet
*uses it
MVMCFunction is used in the VM bootstrap
And for not much else
lucasb right, understood. thanks for the explanations, jnthn. I'll try to digest everything. 17:50
jnthn :) 17:55
afk for a bit
18:12 lucasb joined
lucasb source comment says representation IDs are determined by the order they are registered. is it relevant to keep the order and the ids in sync? 18:15
some entries in the ordered lists doesn't seen to match:
github.com/MoarVM/MoarVM/blob/mast....h#L88-L97
github.com/MoarVM/MoarVM/blob/mast...#L231-L240
samcv i've been trying to think how i will implement collation weights for sequences of cpā€¦ still haven't finally brainstormed that part up 18:54
the implementation as data part at least, how to store the data structure
i made a MVM_COLLATION_QC that is set to 0 in case the cp is a starter in one of the sequences that have weights 18:55
but not sure how to store the actual data for accessing yet
if anybody has any ideas i'm all ears
18:59 pyrimidine joined
lucasb re the mismatch of repr ids and the order of registration, I guess it doesn't matter because they are registered with the ID they claim to have, not with sequentially incremented integers. 19:06
(but I would still sort those entries accordingly :) 19:08
IOninja my PR passed travis and was approved for merging: github.com/MoarVM/MoarVM/pull/526
\o/
samcv IOninja, commented 19:13
IOninja Note to self, do NOT run grep -FR '/*' . in MoarVM's checkout to see if /* needs a newline after it :) 19:14
there's like a gazillion matches in src/strings/unicode_db.c 19:15
samcv heh 19:16
IOninja samcv: updated
samcv IOninja, also one tip for when you update a pr and amend `git commit --amend --date now` 19:17
then it will show up properly on github
to show you altered it
git doesn't change timestamp when you amend
(by default)
IOninja noted, thanks
samcv also why do you need `num < 0 || num == 0` 19:18
why not `num <= 0`
oh nvm i see the &&
IOninja Yeah, I figured that's faster than doing 1/num for all negatives 19:19
samcv yeah
Geth MoarVM: fd7300d273 | (Zoffix Znet)++ | src/core/interp.c
Fix abs_n op for negative zeros

Currently, abs_n(-0e0) leaves the sign intact, returning -0e0.
IEEE 754-2008[^1], section 5.5.1 says "abs(x) copies a floating-point operand x to a destination in the same format, setting the sign bit to 0 (positive)." Which means the -0e0 needs to become 0e0. ... (5 more lines)
19:20
IOninja \o/
Geth MoarVM: d10ba497f1 | (Jonathan Worthington)++ | src/core/interp.c
Merge pull request #526 from zoffixznet/fix-abs-n

Fix abs_n op for negative zeros
jnthn IEEEninja :) 19:21
19:24 SmokeMachine joined 19:44 pyrimidine joined 19:49 pyrimidi_ joined 20:15 zostay joined 20:21 patrickz joined
Geth MoarVM: nanis++ created pull request #528:
On Windows, improve handling of Unicode in command line arguments and environment strings
20:26
20:28 pyrimidine joined
IOninja sweet 20:31
20:37 pyrimidine joined 21:47 pyrimidine joined 21:49 pyrimidi_ joined 22:05 pyrimidine joined 22:25 pyrimidine joined 22:43 travis-ci joined
travis-ci MoarVM build failed. Jonathan Worthington 'Another heuristic to cut CTW-log junk.' 22:43
travis-ci.org/MoarVM/MoarVM/builds/199684243 github.com/MoarVM/MoarVM/compare/6...c2f1c75be4
22:43 travis-ci left 22:44 pyrimidine joined
IOninja ^ just a bumpage race 23:01
23:02 pyrimidine joined 23:22 pyrimidine joined 23:40 pyrimidine joined 23:47 tbhIsck joined
tbhIsck Was lurking around and noticed #526, out of curiosity, why "Fix abs_n op" doesnt uses fabs ? 23:49
23:49 pyrimidine joined 23:50 Ven joined
tbhIsck in gcc it compiles to andpd which sets the sign bit to 0 23:51
faster in the case of 0 or -0 inputs 23:52
23:58 pyrimidine joined