00:04:07 -!- tcr [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has quit [Quit: Leaving.] 00:59:00 rbarraud [~rbarraud@118-92-15-104.dsl.dyn.ihug.co.nz] has joined #sbcl 01:44:38 huangjs [~user@watchdog.msi.co.jp] has joined #sbcl 01:44:45 paste.lisp.org didn't show up. http://paste.lisp.org/display/114695 I have a question on SBCL's spinlock implementation 01:53:39 -!- hargettp [~anonymous@pool-71-174-130-208.bstnma.east.verizon.net] has quit [Quit: hargettp] 02:09:15 danlentz [~dan@c-68-32-54-29.hsd1.nj.comcast.net] has joined #sbcl 02:27:50 -!- The_Jon_Smith [~The_Jon_S@ip24-250-13-137.ri.ri.cox.net] has quit [Ping timeout: 276 seconds] 02:40:03 m7d [~lriley@pool-71-102-237-143.snloca.dsl-w.verizon.net] has joined #sbcl 03:18:43 -!- stassats [~stassats@wikipedia/stassats] has quit [Ping timeout: 240 seconds] 03:42:42 hi there? 03:54:47 -!- danlentz [~dan@c-68-32-54-29.hsd1.nj.comcast.net] has quit [Remote host closed the connection] 04:27:27 The_Jon_Smith [~The_Jon_S@ip24-250-13-137.ri.ri.cox.net] has joined #sbcl 04:33:24 -!- m7d [~lriley@pool-71-102-237-143.snloca.dsl-w.verizon.net] has quit [Quit: m7d] 05:56:11 nikodemus [~nikodemus@cs181199216.pp.htv.fi] has joined #sbcl 05:56:11 -!- ChanServ has set mode +o nikodemus 05:56:12 -!- ASau` is now known as ASau 06:00:09 morning 06:11:48 nikodemus: morning, I have a question about SBCL's spinlock implementation. http://paste.lisp.org/display/114695 06:13:15 nikodemus: it seems it calls thread-yield everytime it failes to grab the lock, am I missing anything? 07:24:46 huangjs: otherwise in most cases the volatime read just wastes cpu 07:24:55 volatile, even 07:25:10 that is not the optimal implementation, though, no 07:25:30 it would be better to spin N times between every yield 07:25:58 where N is something between 10 and 1000, probably 07:56:13 who put these regressions in my code? 08:01:28 nikodemus: yes, that's more reasonable I think, maybe something like backoff to make it more scalable. 08:02:33 i have implementation for fair spinlocks somewhere... 08:03:02 nikodemus: I just tested it on a 32core machine, it scales very badly compare to get-mutex on redhad linux 2.6.18-128 amd64. 08:03:15 huangjs: that is fully expected 08:03:33 nikodemus: Ok. do you have the code around now? 08:09:27 http://paste.lisp.org/display/114708 08:10:30 huangjs: but generally speaking we should not be using spinlocks in places where any significant contention is expected 08:10:52 fair spinlocks make bogus assumptions just less catastrophic 08:16:26 nikodemus: do you mean we need to use the POSIX lock instead? But with reasonablely good algorithms, we would expect the spinlocks to be more efficient and more scalable than the OS ones, isn't it? 08:16:46 nikodemus: thanks for the patch 08:18:03 huangjs: no, OS locks will always be better at sleeping, assuming they are well implemented 08:18:12 nikodemus: I'm talking about overall performance 08:18:41 huangjs: if wait times dominate, it is better to have sleep&wakeup via eg. futexes than to spin 08:18:54 nikodemus: i see. 08:19:33 spinlocks only make sense if the cost of the critical section is < a syscall 08:21:03 so (with-spinlock (lock) (push x *list*)) is sensible, because the window where the thread can be suspended by the OS is small, and the window where threads can contest the lock is small, and the protected operation is much cheaper than a syscall 08:21:12 nikodemus: yes, that's the reason I need to use them. 08:22:13 nikodemus: the benchmark I did was pedagogical though, having 32 cores updating a counter do need a very scalable implementation of spinlocks. 08:22:27 yes :) 08:25:21 ok, freeze time 08:36:03 tcr [~tcr@cpc1-bour2-0-0-cust414.15-1.cable.virginmedia.com] has joined #sbcl 08:39:53 tcr1 [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has joined #sbcl 08:42:38 -!- tcr [~tcr@cpc1-bour2-0-0-cust414.15-1.cable.virginmedia.com] has quit [Ping timeout: 245 seconds] 09:04:16 -!- tcr1 [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has quit [Quit: Leaving.] 09:09:35 -!- nikodemus [~nikodemus@cs181199216.pp.htv.fi] has quit [Quit: This computer has gone to sleep] 09:12:38 tcr [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has joined #sbcl 09:22:51 attila_lendvai [~attila_le@89.135.207.151] has joined #sbcl 09:24:41 -!- attila_lendvai [~attila_le@89.135.207.151] has quit [Disconnected by services] 09:24:41 attila_lendvai1 [~attila_le@89.135.207.151] has joined #sbcl 09:24:42 -!- attila_lendvai1 is now known as attila_lendvai 09:24:54 nikodemus [~nikodemus@cs181199216.pp.htv.fi] has joined #sbcl 09:24:54 -!- ChanServ has set mode +o nikodemus 09:32:09 -!- nikodemus [~nikodemus@cs181199216.pp.htv.fi] has quit [Quit: This computer has gone to sleep] 10:29:40 Blkt [~user@net-93-151-225-193.cust.dsl.teletu.it] has joined #sbcl 10:37:23 Is there an accepted way of expressing the "#-sb-xc-host #!+sb-something" feature guard combination? 10:38:04 good day everyone 10:43:48 -!- rbarraud [~rbarraud@118-92-15-104.dsl.dyn.ihug.co.nz] has quit [Ping timeout: 240 seconds] 11:11:10 hargettp [~anonymous@pool-71-174-130-208.bstnma.east.verizon.net] has joined #sbcl 11:20:03 nikodemus [~nikodemus@cs181058025.pp.htv.fi] has joined #sbcl 11:20:03 -!- ChanServ has set mode +o nikodemus 11:38:24 -!- attila_lendvai [~attila_le@89.135.207.151] has quit [Read error: Connection reset by peer] 11:38:26 attila_lendvai1 [~attila_le@89.135.207.151] has joined #sbcl 11:38:27 -!- attila_lendvai1 is now known as attila_lendvai 11:44:38 epic drift on sbcl-devel, again 11:48:33 could anyone tell me how to execute a file exactly after SBCL loads up? 11:48:55 I tried "sbcl --load file.lisp" and I get that NIL or T are unbound 11:53:04 blkt: sbcl --load "file.lisp" -- put quotes around the file name 11:53:48 ah I see 11:54:52 still, I don't get what I wanted 11:55:09 think about a file with a simple (format t "blabla") 11:55:24 I want SBCL to execute it right after the REPL is ready 11:55:31 how should I do that? 11:55:37 is file.lisp in the directory where you are running SBCL? 11:55:43 yes 11:56:38 how do you know the code in file.lisp is not being run? 11:56:50 I get no print on screen 11:57:00 the file contains only (format t "blablabla") 11:57:58 I mean, it works if I execute: 11:58:11 sbcl --eval "(format t \"blabla\")" 11:58:33 but I wanted the code to be in a file 11:59:17 hell, I solved it... 11:59:24 format nil instead of t... 11:59:44 yes 11:59:46 worksforme http://paste.lisp.org/display/114711 12:00:07 well, that would do it, yes :) 12:00:17 sorry guys :D 12:37:04 -!- hargettp [~anonymous@pool-71-174-130-208.bstnma.east.verizon.net] has quit [Quit: hargettp] 12:45:53 hargettp [~anonymous@pool-71-174-130-208.bstnma.east.verizon.net] has joined #sbcl 13:23:13 -!- tcr [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has quit [Quit: Leaving.] 13:23:48 tcr [~tcr@cpc5-bour5-2-0-cust340.15-1.cable.virginmedia.com] has joined #sbcl 14:39:07 -!- Blkt [~user@net-93-151-225-193.cust.dsl.teletu.it] has quit [Read error: Operation timed out] 14:44:07 mega1 [~quassel@catv4E5CABA2.pool.t-online.hu] has joined #sbcl 14:45:42 lisppaste2 [~lisppaste@common-lisp.net] has joined #sbcl 14:45:46 lisppaste2: url? 14:45:46 To use the lisppaste bot, visit http://paste.lisp.org/new/sbcl and enter your paste. 14:47:41 whee 14:48:25 stassats [~stassats@wikipedia/stassats] has joined #sbcl 14:49:26 \o/ 14:50:53 -!- cmm [~cmm@bzq-79-181-202-240.red.bezeqint.net] has quit [Ping timeout: 265 seconds] 14:51:21 cmm [~cmm@bzq-79-181-202-240.red.bezeqint.net] has joined #sbcl 15:35:07 -!- angavrilov [~angavrilo@217.71.227.181] has quit [Ping timeout: 240 seconds] 15:52:34 -!- mbohun [~mbohun@ppp115-156.static.internode.on.net] has quit [Quit: Leaving] 15:55:22 -!- hargettp [~anonymous@pool-71-174-130-208.bstnma.east.verizon.net] has quit [Quit: hargettp] 16:05:49 angavrilov [~angavrilo@217.71.227.181] has joined #sbcl 16:22:57 am I correct in reading the standard that you can unbind symbols in COMMON-LISP (i.e. *PRINT-BASE*)? 16:24:14 i think so, yes 16:24:23 an oversight, i think 16:25:49 boo. 16:29:39 i have an increasing urge to add sb-lisp package... 16:30:26 froydnj: hah, well spotted 16:30:35 stabbity 16:32:00 nikodemus: what would you put in sb-lisp? 16:41:46 prohibit unbinding of standard symbols 16:42:06 maybe use the dylan superclass linearization algorithm 16:42:50 make it a cerror to change a global type declaration incompatibly 16:43:21 not sure, but a playground would be nice 16:43:51 and a pony 16:44:38 -!- Fare [~Fare@ita4fw1.itasoftware.com] has quit [Quit: Leaving] 16:44:41 verily! 16:48:34 I asked before, but nobody seemed to be around: Is there an accepted way of expressing the "#-sb-xc-host #!+sb-something" feature guard combination? 16:49:15 Some of the places in the core sse patches look like they should use something to that effect, instead of only #-sb-xc-host 16:49:51 with sb-something being sb-sse-intrinsics 16:50:58 drewc [~user@S01060013101b6ddb.vc.shawcable.net] has joined #sbcl 16:56:24 angavrilov: I don't think there's a standard way of doing it; whatever works is likely to be good enough 17:00:28 can #! access the sb-xc-host feature? 17:00:51 hm, now how do i tell slime-macroexpand not to truncate the expansion... 17:01:22 it seems that simple #+ cannot work with #!+ names 17:01:48 *that's* better 17:02:16 angavrilov: something like #-sb-xc-host (progn #!+sb-sse ...) 17:02:46 What if it is a typecase entry? Or a list member? 17:04:25 With code it is simpler; e.g. in one of my own patches I used #!+sb-sse-intrinsics (if (and #-sb-xc-host (...) #+sb-xc-host nil ...) ...) 17:08:01 rmarynch [~roman@bras-4-ge-62.122.200.230.utm.if.ua] has joined #sbcl 17:08:18 Good evening :) 17:09:03 In case I want to maximize the compiled code speed, I should enter in REPL (proclaim '(optimize (debug 0) (speed 3) (safety 0)) before compiling it, right? 17:09:28 are there any other policies? 17:10:48 rmarynch: (describe-compiler-policy) 17:10:49 safety 0 isn't a very good thing 17:10:53 indeed 17:11:10 safety 0 doesn't really buy you much for 99% of code 17:11:27 and there isn't any speed difference really between debug 0 and debug 2 17:11:35 debug 3 has speed implications, but not 2 17:11:55 it can buy you headache on why it doesn't work 17:12:03 I think that I have found the bugs in the optimizer, so I want to make sure that it is fully on before making the tickets 17:12:09 i think -- i could misremember the debug point 17:12:23 and debug 0 removes arglist display in slime, which is painful 17:13:08 rmarynch: there is no such thing as "the optimizer", but you know that :) there are many places where decision to do things are taken based on the policy 17:13:42 yes, but let us be relaxed :) 17:14:35 if you want the most bug prone code, it looks something like (speed 3) (debug 3) (compilation-speed 0) (space 0) (safety 2) -- but there is not single selection of policies that will execercise _every_ option the compiler has 17:15:28 I want the fastest code, just to show that it could be _faster_ 17:15:49 rmarynch: (speed 3), everything else at 0 17:16:00 ok, thanks 17:17:02 rmarynch: you realize that most of the "this isn't optimized" cases aren't unknown or interesting unless they come with specific suggestions or have real-world use-cases attached? 17:17:44 nikodemus: I will ask here before putting them into Launchpad 17:18:35 cases that _are_ interesting include for example failures to optimize known functions in idiomatic code, bad assembly from code that tries to be sensibly written, etc 17:19:04 rmarynch: feel free to put them on launchpad -- i don't want to discourage you 17:19:14 how about CSE? 17:19:23 (defun f (x) 17:19:24 (+ (* x 5) (* x 5) (* x 5) (* x 5))) 17:19:32 known 17:19:37 BF28000000 MOV EDI, 40 17:19:37 ; 2C: 4C8D1C25CD020020 LEA R11, [#x200002CD] ; GENERIC-* 17:19:37 ; 34: 41FFD3 CALL R11 17:19:37 ; 37: 480F42E3 CMOVB RSP, RBX 17:19:37 ; 3B: 488955F8 MOV [RBP-8], RDX 17:19:40 ; 3F: 488B55F0 MOV RDX, [RBP-16] 17:19:40 ; 43: BF28000000 MOV EDI, 40 17:19:42 ; 48: 4C8D1C25CD020020 LEA R11, [#x200002CD] ; GENERIC-* 17:19:44 ; 50: 41FFD3 CALL R11 17:19:46 ; 53: 480F42E3 CMOVB RSP, RBX 17:19:48 ; 57: 488BFA MOV RDI, RDX 17:19:50 ; 5A: 488B55F8 MOV RDX, [RBP-8] 17:19:50 please don't do that 17:19:52 ; 5E: 4C8D1C25E0010020 LEA R11, [#x200001E0] ; GENERIC-+ 17:19:54 ; 66: 41FFD3 CALL R11 17:19:56 ; 69: 480F42E3 CMOVB RSP, RBX 17:19:58 ; 6D: 488955F8 MOV [RBP-8], RDX 17:20:00 ; 71: 488B55F0 MOV RDX, [RBP-16] 17:20:03 ; 75: BF28000000 MOV EDI, 40 17:20:06 ; 7A: 4C8D1C25CD020020 LEA R11, [#x200002CD] ; GENERIC-* 17:20:08 ; 82: 41FFD3 CALL R11 17:20:10 ; 85: 480F42E3 CMOVB RSP, RBX 17:20:13 ; 89: 488BFA MOV RDI, RDX 17:20:14 ; 8C: 488B55F8 MOV RDX, [RBP-8] 17:20:16 ; 90: 4C8D1C25E0010020 LEA R11, [#x200001E0] ; GENERIC-+ 17:20:18 ; 98: 41FFD3 CALL R11 17:20:20 ; 9B: 480F42E3 CMOVB RSP, RBX 17:20:22 ; 9F: 488955F8 MOV [RBP-8], RDX 17:20:24 ; A3: 488B55F0 MOV RDX, [RBP-16] 17:20:26 ; A7: BF28000000 MOV EDI, 40 17:20:29 ; AC: 4C8D1C25CD020020 LEA R11, [#x200002CD] ; GENERIC-* 17:20:30 ; B4: 41FFD3 CALL R11 17:20:32 too bad, isn't it? 17:20:36 ok 17:21:42 you can assume that any optimization described in munich or kennedy that we don't implement is known to be missing 17:22:36 okay. So, I should only add these when I have a working patch? 17:22:42 code that implements them is welcome :) 17:22:52 dunno 17:23:45 what i'm trying to say, i think, is that if you're going thought various test-cases and discovering that a "classic" optimization isn't implemented, than filing a bug/wishlist item about that isn't necessarily the most useful thing 17:24:00 agree 17:24:30 if you couple that bug with notes about how to implement it in python, references to papers on the web, whatnot -- then it's much more useful 17:25:12 have you looked at the file OPTIMIZATIONS 17:25:13 ? 17:25:28 fine, from now on I will try to go this way. Yep, I saw it some time ago 17:26:01 if filing a bug about something helps _you_ work on it -- go ahead and file it 17:26:19 -!- attila_lendvai [~attila_le@89.135.207.151] has quit [Quit: Leaving.] 17:26:28 if something is an actual bug or idiomatic code that gets compiled badly -- file a bug 17:26:42 etc. 17:42:23 Blkt [~user@dynamic-adsl-94-37-238-79.clienti.tiscali.it] has joined #sbcl 18:15:18 JFYI, #! mechanism is guaranteed only one argument after interpreter. 18:15:30 By SUS/POSIX. 18:15:53 And BSDs allow only one argument, you can refer to execve(2). 18:16:10 http://man.netbsd.org 18:16:17 http://man.freebsd.org 18:17:57 -!- nikodemus [~nikodemus@cs181058025.pp.htv.fi] has quit [Quit: Leaving] 18:18:00 (I don't understand why I receive mail but can't post.) 18:19:48 -!- rmarynch [~roman@bras-4-ge-62.122.200.230.utm.if.ua] has quit [Quit: Leaving] 19:15:01 nikodemus [~nikodemus@cs181199216.pp.htv.fi] has joined #sbcl 19:15:01 -!- ChanServ has set mode +o nikodemus 19:34:32 Fare [~Fare@ita4fw1.itasoftware.com] has joined #sbcl 20:11:45 -!- nikodemus [~nikodemus@cs181199216.pp.htv.fi] has quit [Quit: This computer has gone to sleep] 20:18:05 -!- stassats [~stassats@wikipedia/stassats] has quit [Ping timeout: 240 seconds] 20:24:58 stassats [~stassats@wikipedia/stassats] has joined #sbcl 21:26:15 -!- Fare [~Fare@ita4fw1.itasoftware.com] has quit [Quit: Leaving] 21:31:47 -!- Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has quit [Ping timeout: 276 seconds] 21:40:19 rbarraud [~rbarraud@118-92-15-104.dsl.dyn.ihug.co.nz] has joined #sbcl 21:44:59 Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has joined #sbcl 21:44:59 -!- ChanServ has set mode +o Krystof 21:58:36 -!- Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has quit [Ping timeout: 272 seconds] 22:11:55 Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has joined #sbcl 22:11:55 -!- ChanServ has set mode +o Krystof 23:17:04 attila_lendvai [~attila_le@catv-89-133-171-82.catv.broadband.hu] has joined #sbcl 23:22:20 -!- drewc [~user@S01060013101b6ddb.vc.shawcable.net] has quit [Read error: Connection reset by peer] 23:24:32 drewc [~user@S01060013101b6ddb.vc.shawcable.net] has joined #sbcl 23:27:04 so question: I wrote a peephole optimizer for sbcl; have we decided that a peephole optimizer is a bad idea? 23:27:41 -!- Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has quit [Ping timeout: 276 seconds] 23:28:00 does it increase performance? 23:29:09 Well, I'm not sure, I only have one optimization in it. 23:29:25 what is it? 23:29:38 Presumably, it could, if I were smart enough to know how to do the 'right' optimizations. 23:29:57 it is mov x y, mov y x 23:30:06 and it replaces that with mov x y 23:30:12 well, that's a start 23:30:26 -!- mega1 [~quassel@catv4E5CABA2.pool.t-online.hu] has quit [Ping timeout: 240 seconds] 23:30:32 mega1 [~quassel@catv4E5CABA2.pool.t-online.hu] has joined #sbcl 23:30:41 yeah, and when compiling it happens about 2000 times or so 23:31:17 so that seems ok 23:32:02 you could also optimize shifts and increments 23:32:13 oh well, i think you know that 23:32:41 i don't know that :-) 23:32:48 have an example? 23:33:10 not at the moment 23:34:57 ok, now i have 23:35:24 cool 23:36:31 stassats pasted "for the peephole optimizer" at http://paste.lisp.org/display/114736 23:37:16 on x86 it does: SHL ECX, 2 SHL ECX, 8 23:37:24 i don't know how common this is 23:38:27 it also does SAR ECX, 2 after that, but i don't remember the difference between arithmetic shifts and logical shifts to say it can be merged somehow 23:40:25 Krystof [~csr21@84-51-132-95.christ977.adsl.metronet.co.uk] has joined #sbcl 23:40:25 -!- ChanServ has set mode +o Krystof 23:41:57 i will get my x86 laptop out 23:43:33 i can annotate it with swap-bytes-64, though i don't know how its disassembly looks 23:44:00 stassats annotated #114736 "swap-bytes-64" at http://paste.lisp.org/display/114736#1 23:56:06 ; 4BC: 48C1E003 SHL RAX, 3 23:56:08 ; 4C0: 48C1E028 SHL RAX, 40 23:56:10 jackpot? 23:59:56 that's the sort of case you want to optimize