freenode/#clasp - IRC Chatlog
Search
11:03:46
drmeister
heisig: Does that cl4py pull request to translate python keywords to common lisp keywords work?
12:52:18
Bike
"there are no conversions between pointers to functions and pointers to objects" ah, i see
12:52:56
jackdaniel
I don't remember well, but rationale was that on some architectures data and functions may be stored in different memories
13:05:38
Bike
we have a file called testing.cc that defines two lisp functions that aren't used anywhere
13:07:08
drmeister
Oh sure we will. At some point we will transition from "garbage dump" to "charming anachronisms".
13:15:39
drmeister
asOrNull is using the TaggedCast (integer stamp comparison) - it only falls through to dynamic_cast in special cases.
13:26:00
Bike
https://github.com/clasp-developers/clasp/blob/master/src/core/metaClass.cc#L106-L122 or this. check it out. remember when classes were different from instances? crazy times
13:26:11
Bike
i wonder if there's a compielr warning about this buried somewhere. maybe it's not smart enough
13:29:46
drmeister
Crap - in cl__streamp I was testing if the argument was a gray stream first. I'm testing for Stream_O first now.
13:31:55
Bike
some of these i'm a little hesitant to remove because i s\till don't quite understand how we're using types
13:32:20
Bike
for example: if (Instance_sp instance = strm.asOrNull<Instance_O>()) return eval::funcall(gray::_sym_open_stream_p, instance);
13:32:50
drmeister
Ok, now I'm making progress again. I just made it 20% faster on top of the 4x faster from yesterday.
13:33:16
drmeister
What's bad about that is if strm is a Stream_sp object then it will invoke dynamic_cast.
13:35:45
Bike
well i mean, say i write if(strm.IsA<Instance_O>()) return eval::funcall(gray::_sym_open_stream_p, strm); instead.
13:37:47
Bike
or if we have a function with return type T_sp, and it does if (Package_sp pkg = name_desig.asOrNull<Package_O>()) return pkg;
13:39:07
Bike
you're sure? there's never going to be a dynamic_cast, even if name_desig is an instance or something?
13:39:20
drmeister
I like to use that kind of prose because we went to the trouble of defining a variable pkg - so we should use it.
13:39:39
Bike
...but i mean, we don't need to define the variable pkg. we could just do name_desig.IsA
13:40:30
drmeister
It's zero cost - it's reinterpret_cast. The cost is figuring out if name_desig is a Package_sp - once you know that - the casting costs nothing but compiler time and we are not going to impact compile time by changing this....
13:41:05
Bike
well i'm talking about changing it to "if (name_desig.IsA<Package_O>()) return name_desig;"
13:42:35
drmeister
But that last one is what I've been using. I've grown to prefer the function syntax rather than the method dot syntax.
13:44:03
drmeister
I wouldn't be surprised if name_desig.IsA<Package_O> is legal I've tried everything but this is what I think we should use now...
13:44:44
drmeister
if (gc::IsA<Package_sp>(name_desig)) { Package_sp pkg = gc::As_unsafe<Package_sp>(name_desig); ...do something with pkg;}
13:45:27
drmeister
Yes, if you don't do anything with pkg then you don't need to do the gc::As_unsafe<Package_sp>(name_desig)
13:47:19
Bike
there's a core__test_tagged_cast... i wonder how many "test" functions are lying around
13:47:57
drmeister
Wow, the guy who is going to work with us in validating Cando is the best in the world.
14:19:30
jackdaniel
we have a featureset which we want to complete before each release, after that comes release candidate with testing across dozen of different platforms x architectures
14:21:04
jackdaniel
and that usually show dreadful regressions and yields some more weeks of development before the release
14:31:56
drmeister
The python bridge is going to be super important - these folks have a lot of validation and statistics code in Python that I don't want to reproduce.
15:17:45
pfdietz
sbcl is just what happens when you polish a code base for a third of a century (counting its time as cmucl). Python integration sounds compelling, btw.
15:18:58
Bike
okay, so this instance/class thing is weird, i'm replacing the asOrNull with just As, since a superclass list should have all instances in it anyway
15:19:03
Bike
but then there's this bit https://github.com/clasp-developers/clasp/blob/master/src/core/metaClass.cc#L100
15:19:19
drmeister
Note line 29 and 18 - where python keyword arguments are converted to CL keyword arguments.
15:19:22
Bike
as far as i can see, this variable is never assigned to without being read. seems like it should be initialized to NULL, or whatever NULL is for a smart pointer
15:20:33
drmeister
Just As will signal an error if the cast can not be made. asOrNull returns the cast pointer or NULL.
15:22:33
drmeister
Instance_sp aCxxDerivableAncestorClass_unsafe; <<- This is initialized to NULL 0x0
15:23:30
drmeister
If you then test: if (!aCxxDerivableAncestorClass_unsafe) { ...this will be evaluated... } else { ... this will NOT be evaluated ...}
15:25:54
drmeister
This is the default constructor: https://github.com/clasp-developers/clasp/blob/dev/include/clasp/gctools/smart_pointers.h#L467
15:31:49
Bike
could we do some weird template shit to get a NULL_SP that's a Void_sp or something so we don't ahve to care
15:32:31
drmeister
I've got a working cando installed in /opt/clasp that does jupyterlab and ileap-boehm. So I'm good for demos.
15:34:11
drmeister
I made these read-line changes in my clasp directory and I'd like to test in cando-dev
16:14:59
drmeister
Bike: Have you had any time to think about inlining array accessors in discriminating functions?
16:58:06
Bike
ok, first shot at it. doing a hundred million reads from a simple vector, vref takes 0.494s, dispatcher version takes 0.860s
17:01:17
drmeister
It's basically free to compare a bunch of hard-coded integers to a stamp. So dispatch is basically free for us.
17:03:51
drmeister
And when you say vref takes 0.494s - how are you doing that and how are you doing it with the dispatcher version?
17:15:44
Bike
(let ((vec (make-array 37 :initial-element (gensym))) (n 12)) (time (loop repeat 100000000 do (vref vec n))))
17:22:13
drmeister
Add (declare (optimize (debug 0))) to your discrminiator - it's spilling register args.
17:23:02
Bike
https://github.com/clasp-developers/clasp/blob/dev/src/llvmo/llvmoPackage.cc#L437-L444 seems like it should work with *standard-output* already
17:24:17
Bike
does debug 0 actually disable that? i just tried with (lambda (x) (declare ...) x) and i still see a bunch of store volatile
17:27:06
drmeister
It should - I made some changes so that if that is in the function somewhere - then it gets applied to the entire function.
17:28:11
drmeister
I generated a CFG graph and rendered it as a PDF - there is still a call in there but it looks pretty good.
17:33:23
Bike
but i'd like to know what call you mean, and where the register spilling is generated so i can see if i have your code there or not, and if you have any idea about the disassemble output stream
17:45:25
drmeister
What I want is if the default (declaim (optimize (debug <whatever>))) is different from what is found in the function then the 'debug-on' slot is set to whatever the programmer explicitly set in the function. So the default is used unless the programmer explicitly set something different.
17:46:37
Bike
it works but it's basically unnecessary, because i already wrote a function to take care of the inner declaration thing, policy-anywhere-p
17:47:08
Bike
and the reason i'm seeing register args saved with (lambda (x) x) is different and stupid
18:29:46
kpoeck
drmeister In the readline-change, don't we need the pattern T_sp result = cl__copy_seq(sbuf_wide); _lisp->put_StrWNs_buffer_string(sbuf_wide);
18:31:41
kpoeck
e.g. n https://github.com/clasp-developers/clasp/blob/dev/src/core/lispStream.cc#L5793
18:53:52
Bike
with generalp replaced with a typeq (which is maybe not the right way to do it, since i think it'll test the header pointlessly) it's now 0.457s, faster than core:vref
18:58:17
kpoeck
So I believe there is a #ifdef DEBUG_MONITOR missing in https://github.com/clasp-developers/clasp/blob/dev/src/llvmo/llvmoExpose.cc#L4018
19:28:41
Bike
man i really want to know why the fuck it insists on keeping the primary return value in an alloca and bitcasting it and stuff
19:29:23
Bike
does llvm not ssa variables in mem2reg if they're assigned too much or something? that seems unlikely