| IRC logs at
Set by AlexDaniel on 12 June 2018.
00:46 leont left
timotimo should we be kicking out deopt points when an op is replaced with one that can't actually deopt? 01:19
01:23 ggoebel joined 01:25 ggoebel_ joined 01:27 ggoebel left 01:37 squashable6 left 01:38 squashable6 joined 02:23 AlexDani` joined 02:27 AlexDaniel left 02:44 AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined 03:56 Kaiepi left, Kaiepi joined 04:29 Kaiepi left, Kaiepi joined 04:48 Kaiepi left, Kaiepi joined 05:13 Kaeipi joined 05:14 Kaiepi left
nwc10 good *, #moarvm 05:15
05:27 squashable6 left 05:30 squashable6 joined 06:43 domidumont joined 06:55 MasterDuke joined 07:12 raku-bridge left 07:13 raku-bridge joined, raku-bridge left, raku-bridge joined 07:34 Altai-man joined 07:54 zakharyas joined 07:55 zakharyas1 joined 07:58 zakharyas left 09:01 lizmat_ joined 09:03 lizmat__ joined 09:04 lizmat left, lizmat___ joined 09:07 lizmat_ left, lizmat__ left 09:08 lizmat___ is now known as lizmat
jnthn morning o/ 09:23
timotimo: I don't think there's any value in removing them from the linked list of annotations; anything that wants to know if there's a real chance of deopt can check the property on the op at the point it wishes to know that
timotimo: There is some value if we can somehow compress the deopt table though 09:24
Because at the moment it can have quite a few unused entries in
nwc10 \o 09:26
jnthn goes to make coffee, discovers he already made one, just left it on the machine 09:31
nwc10 did you get bonus flavour?
MasterDuke +1-1 for past jnthn
jnthn nwc10: Pretty sure not 09:32
It tastes normal, anyway :) 09:33
nwc10 good
MasterDuke nwc10: seems like you know more about building gmp than i do. any idea why i'm getting `/usr/bin/ld: 3rdparty/gmp/libgmp.a(bdiv_q_1.o): warning: relocation against `__gmp_binvert_limb_table' in read-only section `.text'/usr/bin/ld: 3rdparty/gmp/libgmp.a(bdiv_q_1.o): relocation R_X86_64_PC32 against symbol `__gmp_binvert_limb_table' can not be used 09:37
when making a shared object; recompile with -fPIC/usr/bin/ld: final link failed: bad value`
but it looks like both it and moarvm are in fact being complied with -fPIC 09:38
oh, and this is only after actually putting some gmp function calls in bigintops.c. otherwise it builds fine 09:39
nwc10 er. 09:40
no, I don't know about that one. That's far more a generic "something about linking, ELF formats, and PIC" sort of error
09:40 sena_kun joined
MasterDuke heh. you also probably know more about any/all of those subjects than i do 09:41
nwc10 what I do know (and this is fun from up to 20 years ago) was that x86 is very lax. And it turns out that it is quite happy to link libraries compiled without -fPIC to code which is, and then made into a shared object 09:42
and this was really painful when people were trying to port to ARM, because ARM could not (at least not the 32 bit instruction set, easily)
so eventually the ARM toolchain folks came up with a hack that would work
09:42 Altai-man left
nwc10 along comes amd64 with a similar restrction 09:43
amd64 is "big" enough that all the projects were forced to fix their build flags
rather than things work around it
the possible problem here might be as simple as "we need to build that nested gmp with -fPIC"
even though it "looks" like we wanted to build a static library 09:44
MasterDuke i did think to check, and it looks like the Makefile in 3rdparty/gmp does have -fPIC
10:21 Kaeipi left, Merfont joined 10:41 leont joined 10:50 zakharyas1 left
MasterDuke this is more annoying than i'd hoped. nothing i've tried has changed anything 11:03
12:43 ChanServ sets mode: +o jnthn, jnthn sets mode: +b AlexDan*!*@*, AlexDaniel was kicked by jnthn (AlexDaniel)), jnthn sets mode: -o jnthn 13:09 pamplemousse joined
timotimo jnthn: i was assuming all the "set" and "getspeshslot" operations were left in the code because of deopt points making them artificially "needed" 13:10
jnthn timotimo: No, see 13:13
However, I had pondered that the getspeshslot case could set up a table of spesh slots to write into registers pre deopt so we can kick them out 13:14
timotimo heck yeah
i was also thinking the materialization mechanism should be useful for this 13:15
hum. there's also some two-argument PHIs left in there 13:19
it's possible that those trip us up 13:20
but they also shouldn't exist in the first place, and last time i tried to make one-argument PHI nodes go away, stuff broke in all kinds of places
jnthn Yeah, I realized it would be quite possible to do that at the time I was working on PEA 13:25
MasterDuke tobs: ping 13:27
13:40 Altai-man joined 13:43 sena_kun left
MasterDuke hm. i sort of get things to build if i use the instead of .a 13:43
13:43 lucasb joined
MasterDuke heh. looks like my attempt to init a gmp bigint by pointing it at the tommath bigints array of digits works 13:48
huh. but breaks when the number gets too big... 13:50
jnthn I'm a tiny bit surprised it works at all, if you mean what I think you mean :) 13:52
MasterDuke `mpz_t gmp; mpz_init(gmp); mpz_import(gmp, ia->used, 1, sizeof(ia->dp[0]), 0, 0, ia->dp);` 13:54
dirty hack? check. easy way to try some gmp vs tommath comparisons? also check 13:55
timotimo just gotta make sure you don't free the data twice
MasterDuke i like to live dangerously and not free it at all 13:56
timotimo brilliant
RAM is cheap
MasterDuke as i learned from watching the first half of mc hammer: behind the music, "the money never runs out" 13:57
jnthn Going by the names, the folks who came up with the fast primality testing algo are from the part of the world I'm living in :)
timotimo the one for 32bit and 64bit integers? using the hash map and a smaller amount of directed test rounds?
MasterDuke Comenius University, Bratislava, Slovakia
13:58 zakharyas joined
jnthn hah, I even know how the building looks :) 13:59
I used to live 5 minutes walk from it
Well, or at least one part of it, maybe it has multiple locations 14:00
MasterDuke `say (10_000_000_000..10_000_100_000).grep(*.is-prime).tail; say now - INIT now` with moarvm/rakudo master took ~26s. using gmp's mpz_probab_prime_p (with 100 rounds) takes ~0.14s
jnthn o.O the same results? :)
MasterDuke heh. yep
jnthn Wow
MasterDuke yeah. gmp is fast 14:01
timotimo huh
but why
MasterDuke hand-optimized assembly for my cpu
jnthn That's still a hell of a speedup
MasterDuke and i think some differences in the composition of algorithms 14:02
jnthn Yeah, that feels to me like there's something algorithmic going on too
MasterDuke AlexDaniel pointed out a comment in the tommath implementation that if you set a define it'll do something faster, but maybe less precise and i don't think we set that define 14:03
haven't tested that difference
tobs MasterDuke: so it's better (read: working at all) when we build and install a shared library? 14:17
(I'm still at work for some time, so can't really update any PRs to that effect)
MasterDuke yeah. i just changed the references to libgmp.a in MoarVM's Makefile to (and copied them to the same place libgmp.a was copied to) 14:18
Geth MoarVM: 25c70bfe01 | (Nicholas Clark)++ | 5 files
Hash tables must also resize if the max probe distance is hit on an empty slot.

Not just for the case of max probe distance being hit during the move operation to open up a slot to maintain the Robin Hood invariant.
This is a bug, but it's extremely unlikely that anyone would hit it. It would take either extremely pathological data, or an extremely large data set with ... (6 more lines)
tobs The .so needs to be installed anyway, so that `cp .libs/libgmp.a .` hack in the build rule should go away. (Just leaving a note about that in the hive-mind :-) )
MasterDuke k 14:22
afk for a little bit, will be back later 14:30
Geth MoarVM/new-disp: 87b32ba5da | (Jonathan Worthington)++ | 3 files
Move dispatch program cleanup out of transition

Avoids a bunch of repetition, but more importantly means that we can choose when we're going to free it, which we'll need a bit more control over for the sake of resumption.
14:42 zakharyas1 joined, Merfont left, Kaiepi joined 14:45 zakharyas left 14:51 Kaeipi joined, Kaiepi left 14:54 pamplemousse left
Geth MoarVM/new-disp: 06d5443893 | (Jonathan Worthington)++ | 8 files
Basic invocation of a dispatch resume callback

Such that we find the current resumable dispatch we're running on the stack and invoke the resume callback, which should then be able to do further dispatcher delegations and build up a dispatch program for the resumption.
jnthn That seems to basically work, except we can't get the the args of the initial dispatch, which we require in order to do the resume 15:21
Well, and then all the other missing pieces :)
timotimo first the missing pieces, then all the other missing pieces 15:25
jnthn Pretty much 15:27
The tricky balancing act of trying to keep the stuff in the VM general, but also make sure it can know enough that we optimize things well 15:28
timotimo yeah 15:30
15:32 pamplemousse_ joined 15:37 pamplemousse__ joined 15:40 pamplemousse_ left 16:59 domidumont left 17:41 sena_kun joined 17:43 Altai-man left 18:18 zakharyas1 left
MasterDuke hm. because `mpz_t i` is actually a one-element array of a struct, compared to `mp_int i` actually being an instance of the struct, where there's `mp_int *i` i can just use `mpz_t i`, correct? 18:25
ok, ignore that question 18:35
new question. gmp doesn't seem to have the concept of a negative 0. is that going to be a problem? 18:36
19:07 zakharyas joined 19:23 pamplemousse__ left
jnthn MasterDuke: I don't believe so; Raku doesn't distinguish those 20:08
m: say -0 20:09
camelia 0
jnthn m: say -0 === 0
camelia True
jnthn m: say -0e0 === 0e0
camelia False
jnthn I can't think of why you'd want a negative zero in integer math anyway.
MasterDuke cool, makes things easier 20:18
jnthn Yes, we might get a simplification out of not having to deal with that
MasterDuke ugh. all this special handling for bit ops is annoying. much of it might go away, but figuring that out... 20:23
20:23 evalable6 left, linkable6 left 20:25 evalable6 joined, linkable6 joined
timotimo yeah, having to fake up two's complement, yay 20:26
nwc10 do you mean that? Negative zero would imply one's complement (or sign and magnitude) 20:27
timotimo i meant for implementing bitwise ops 20:28
nwc10 ah OK. I suspect I'm confused and should go to bed
MasterDuke tommath is not two's-complement for bitops, so there's a bunch of stuff we do. gmp is, so hopefully it should end up simpler 20:31
20:34 zakharyas left
MasterDuke and just to make the whole project simpler, tommath always has the dest argument as the last one, but gmp has it as the first one... 20:38
jnthn I confused the heck out of myself earlier this month by reading assembler output in the style that puts the destination last but not realizing it :) 20:40
sena_kun Ouch, this sounds pretty unusual to do. 20:44
jnthn There's (as I roughly understand it) two common styles for x86/x64 at least 20:49
The one I like reading, and the one that confuses me every time :)
MasterDuke timotimo: know why you did this? 20:55
timotimo probably about how it reacts to negative numbers
jnthn I'm perhaps misremembering, but isn't C's one undefiend on negative numbers? 20:56
ah, not quite, I guess, but 20:57
MasterDuke do we want negative numbers back
timotimo why, who took them?
jnthn Oh, no, I was close; according to the bit of spec referenced in it's implementation defined 20:58
If both are negative
There'll be spectests about this, I'd hope
MasterDuke well, i think tommath and gmp are the same, both always give positives 20:59
jnthn haha 21:00
> Back in the day, someone designing the x86 instruction set decided it was right and good to round integer division toward zero rather than round down. (May the fleas of a thousand camels nest in his mother's beard.)
That's a curse I'd not heard before :)
Anyway, yes, looks like the C modulo operator is "here be dragons", though we could maybe do a sign check and then sue it 21:01
If tommath and gmp do the same, then great. 21:02
MasterDuke cool, gmp has an fdiv that 'rounds q down towards -infinity, and r will have the same sign as d. The f stands for “floor”.' 21:03
timotimo do dragons normally react to being sued?
MasterDuke which may simplify things, based on 21:04
jnthn timotimo: Their lawyers get fired...literally
timotimo must be hard to be a dragonslawyer 21:05
jnthn :D
timotimo hm, is there a reason why you sometimes say lawyer and sometimes attourney?
is that british vs american?
MasterDuke don't think so. british is barrister 21:06
timotimo ah because they are "on the bar"
MasterDuke i think lawyer and attorney are pretty much the same in american
jnthn I think lawyer is germanic and attorney is romance 21:08
MasterDuke but barrister, soliciter, and lawyer have different meanings in british, aiui 21:09
jnthn I believe so, yes, though don't ask me what they are :)
Czech has pravnik and advokat which are synonyms, the former derived from the Czech word for law and the other one feeling loan-ish 21:10
From somewhere.
Ah, Latin apparently
I'd never quite put together "barrister" and "on the bar" :) 21:12
One of those "how didn't I see it" moments
MasterDuke if i never have to find out the difference during my time here i'll be happy
jnthn I got curious, and 21:13
game time, bbl
MasterDuke ugh. only 34% through bigintops.c. also time to take a break and lose at quake champions 21:28
timotimo IMPRESSIVE 21:32
MasterDuke wish i got that more often... 21:34
timotimo that's headshots with the railgun, right? 21:35
i haven't played very much quake 21:36
MasterDuke two consecutive railgun hits
at least it is in quake champions. don't remember the previous quakes
timotimo ah 21:37
21:43 sena_kun left
timotimo time for me to retire now / and become a duck 21:46
MasterDuke float? 21:52
23:10 dogbert17 left 23:11 harrow` joined 23:13 harrow left 23:27 reportable6 left