2015-01-24T00:00:46Z p_l: stassats: did you switchoff SMT? 2015-01-24T00:01:20Z p_l: it's on the list of things I hope to test, the differences between various SMT levels 2015-01-24T00:03:31Z Bicyclidine quit (Ping timeout: 256 seconds) 2015-01-24T00:03:56Z nyef: stassats: LR on what platform? 2015-01-24T00:05:18Z nyef: Typically a register called LR is a "return address" register in some way, which we tend to double-up on and use as LIP, since we need it to have interior-pointer nature anyway for when we do a call to an assembly-fun with the :raw call-style. 2015-01-24T00:05:19Z stassats quit (Ping timeout: 265 seconds) 2015-01-24T00:05:28Z nyef: ... Of course. 2015-01-24T00:06:14Z beslyrus quit (Quit: Client Quit) 2015-01-24T00:09:02Z slyrus quit (Ping timeout: 245 seconds) 2015-01-24T00:09:49Z nyef: Quadrescence: Are you up for an SBCL-hacking challenge? 2015-01-24T00:10:28Z Quadrescence: maybe if I can forecast some degree of success 2015-01-24T00:10:59Z nyef: Quadrescence: In arm-assem.S there are two places where reg_NULL gets loaded with NIL from a location called known_nil. The challenge is to make it get loaded with the ADDRESS of known_nil and have the entire system still work. 2015-01-24T00:13:42Z nyef: Preferably make it a build-time option which way it works. 2015-01-24T00:15:15Z Bicyclidine joined #sbcl 2015-01-24T00:15:30Z nyef: If you get this working, I'll tell you what the next couple steps are. d-: 2015-01-24T00:16:14Z Quadrescence: Hah 2015-01-24T00:17:17Z nyef: Seriously, that's the HARD bit. 2015-01-24T00:19:06Z nyef: For that matter, once you have that much you can find the record of what I did with PPC to guide you the rest of the way. 2015-01-24T00:19:51Z nyef: And you'll save yourself a thousand dollars. d-: 2015-01-24T00:27:07Z csziacobus joined #sbcl 2015-01-24T00:37:03Z Shinmera quit (Quit: しつれいしなければならないんです。) 2015-01-24T00:38:33Z slyrus joined #sbcl 2015-01-24T00:56:07Z Bicyclidine quit (Ping timeout: 245 seconds) 2015-01-24T01:23:03Z attila_lendvai quit (Quit: Leaving.) 2015-01-24T02:23:09Z slyrus quit (Ping timeout: 245 seconds) 2015-01-24T02:33:06Z dougk_ joined #sbcl 2015-01-24T02:40:17Z psy_ quit (Remote host closed the connection) 2015-01-24T02:53:06Z Bicyclidine joined #sbcl 2015-01-24T02:54:17Z Bicyclidine quit (Client Quit) 2015-01-24T03:19:08Z oleo is now known as Guest45850 2015-01-24T03:20:00Z oleo__ joined #sbcl 2015-01-24T03:22:39Z Guest45850 quit (Ping timeout: 276 seconds) 2015-01-24T03:22:51Z dougk_ quit (Ping timeout: 264 seconds) 2015-01-24T03:26:19Z dougk_ joined #sbcl 2015-01-24T03:30:42Z dougk_ quit (Ping timeout: 245 seconds) 2015-01-24T03:35:07Z Adlai quit (Ping timeout: 250 seconds) 2015-01-24T03:38:57Z christop1 quit (Ping timeout: 265 seconds) 2015-01-24T03:38:59Z Adlai joined #sbcl 2015-01-24T03:52:17Z christop1 joined #sbcl 2015-01-24T03:56:02Z echo-area joined #sbcl 2015-01-24T04:02:31Z dekhoda joined #sbcl 2015-01-24T04:06:56Z dougk_ joined #sbcl 2015-01-24T04:07:57Z burtons joined #sbcl 2015-01-24T04:08:54Z burtons: after reading this little bit on tree shaking i decided to try it: 2015-01-24T04:08:56Z burtons: What our "tree-shaker" did was simply destroy the package system, and then do a 2015-01-24T04:08:56Z burtons: GC. Any symbols remaining were put back in the package they were originally 2015-01-24T04:08:56Z burtons: in, allowing debugging. 2015-01-24T04:09:34Z burtons: after looking around a bit, I found that theres sb-impl::*package-names* that holds the list of packages 2015-01-24T04:10:00Z echo-are` joined #sbcl 2015-01-24T04:10:07Z burtons: so, to 'destroy to package system' I tried (clrhash sb-impl::*package-names*) and then (gc t) follwed by a save-lisp-and-die 2015-01-24T04:10:08Z echo-area quit (Read error: Connection reset by peer) 2015-01-24T04:10:34Z burtons: i don't think anything was gc'd and the size of the image didn't decrease 2015-01-24T04:10:57Z burtons: any other ideas on how one could 'destroy the package system' to start off with a dumb tree shaker? 2015-01-24T04:11:01Z nyef: And nothing disappeared because all of the packages were retained by the SYMBOL-PACKAGE slots and the inter-package references? 2015-01-24T04:11:09Z burtons: you tell me 2015-01-24T04:11:11Z burtons: :) 2015-01-24T04:11:43Z burtons: this is pretty much my first time looking into sbcl so it was just a shot in the dark 2015-01-24T04:12:04Z psy_ joined #sbcl 2015-01-24T04:12:27Z nyef: If you're going to be messing with the package system, I'd start by looking at SYS:SRC;CODE;PACKAGE.LISP and SYS:SRC;CODE;TARGET-PACKAGE.LISP. 2015-01-24T04:12:36Z burtons: already there 2015-01-24T04:12:41Z burtons: that's where I found *package-names* 2015-01-24T04:13:19Z burtons: i'll look into the symbol-package slots 2015-01-24T04:13:32Z nyef: Yes, but note the relations between packages. You'll need to destroy those. And then there's SYMBOL-PACKAGE. And you'll need to NOT destroy the KEYWORD package... 2015-01-24T04:14:11Z nyef: Umm... And I don't know if anything would be retained in the infodb. 2015-01-24T04:14:24Z nyef: That might only track symbols, not packages. 2015-01-24T04:14:34Z burtons: but does the idea seem sound? 2015-01-24T04:14:49Z nyef: It's an interesting approach, at least. 2015-01-24T04:15:09Z burtons: https://groups.google.com/d/msg/comp.lang.lisp/6zpZsWFFW18/WMy4PyA9B4kJ 2015-01-24T04:15:16Z nyef: I'm never quite sure what I think about tree shakers generally, though. 2015-01-24T04:15:21Z burtons: sounds like it's what they used to do in CMUCL 2015-01-24T04:15:37Z nyef: Oh! I have my bandwidth back. 2015-01-24T04:15:37Z burtons: i just thought it would be a interesting little project to learn a bit about sbcl internals 2015-01-24T04:16:21Z nyef: Wow, from Pi day twenty years ago? 2015-01-24T04:16:34Z burtons: yeah, it's an old post 2015-01-24T04:17:50Z burtons: ok, now i'm confused. i'm looking into the symbol-package stuff and the definition of %set-symbol-package is calling %symbol-package... same thing for symbol-package 2015-01-24T04:18:08Z burtons: where are symbol-packages stored? in the plist? 2015-01-24T04:18:25Z nyef: That gets into compiler magic. 2015-01-24T04:18:51Z burtons: nope, not in the plist 2015-01-24T04:19:00Z nyef: The compiler knows how to "open code" things like SYMBOL-PACKAGE to produce an (optional) type-check followed by a memory reference. 2015-01-24T04:19:14Z burtons: ok 2015-01-24T04:19:42Z burtons: not quite sure what that means yet :) 2015-01-24T04:19:46Z nyef: If you have a look at SYS:SRC;COMPILER;GENERIC;OBJDEF.LISP you'll find a !DEFINE-PRIMITIVE-OBJECT for SYMBOL. 2015-01-24T04:20:38Z nyef: It describes the layout of a symbol in memory, associates it to type tags, adds some magic for allocating symbols, and so on. 2015-01-24T04:21:04Z burtons: so that low level 2015-01-24T04:21:28Z burtons: would there be a way to destroy the references to symbol packages, or would the compiler have to be modified? 2015-01-24T04:21:30Z nyef: The :REF-TRANS and :SET-TRANS slot options tell the compiler that a slot should have read and write accessors generated. 2015-01-24T04:21:53Z nyef: Given a symbol, use %SET-SYMBOL-PACKAGE directly if necessary. 2015-01-24T04:21:54Z burtons: yup, just found those 2015-01-24T04:22:26Z Bike: could you just loop through all symbols uninterning them and then deleting the packages? 2015-01-24T04:22:33Z burtons: so if you were to iterate over all the symbols and %set-symbol-package to nil, that would be a start? 2015-01-24T04:23:22Z nyef: Bike: Unintern has quite a bit of overhead... 2015-01-24T04:23:45Z nyef: Bike: Plus it can prompt name conflicts. 2015-01-24T04:24:00Z nyef: (If it's a shadowing symbol, for example.) 2015-01-24T04:25:22Z nyef: The last two paragraphs in Rob's post rather sum up my current feeling about smaller lisp executables. 2015-01-24T04:25:51Z nyef: Don't try to shake parts of the system loose. Instead, arrange not to link them in in the first place. 2015-01-24T04:26:02Z nyef: But that takes quite a bit of prep work to make happen. 2015-01-24T04:26:24Z burtons: i think a dumb tree shaker would be better than none for some deployments 2015-01-24T04:26:38Z nyef: That's plausible as well. 2015-01-24T04:26:55Z burtons: how would one get a list of symbols in a package? 2015-01-24T04:27:09Z nyef: Portably or unportably? 2015-01-24T04:27:11Z burtons: i don't see anything obvious in the package- 2015-01-24T04:27:15Z burtons: unportably 2015-01-24T04:28:19Z nyef: Ah. You don't, easily. You basically have to grub them out of the package hashtable. At which point you may as well use one of the standard iterators. 2015-01-24T04:28:31Z burtons: i think do-symbols would work 2015-01-24T04:28:57Z nyef: Yeah, that'd be the one. 2015-01-24T04:30:35Z burtons: slime sure doesn't like my attempt to clear the symbol packages :) 2015-01-24T04:30:58Z burtons: doesn't like clearing *package-names* either, but whatever 2015-01-24T04:32:06Z nyef: Well, you ARE messing with a critical chunk of the programmer (user) interface. 2015-01-24T04:32:28Z burtons: play hard or die trying 2015-01-24T04:33:14Z burtons: hmm, clearing the symbol package kills the system 2015-01-24T04:33:22Z burtons: ends me up in the debugger right after 2015-01-24T04:33:37Z burtons: (maphash (lambda (package-name package) 2015-01-24T04:33:38Z burtons: (do-symbols (symbol package-name) 2015-01-24T04:33:38Z burtons: (sb-impl::%set-symbol-package symbol nil))) sb-impl::*package-names*) 2015-01-24T04:33:58Z nyef: Yeah, not unexpected. You also need to not clear the symbol-package if the symbol is a keyword. 2015-01-24T04:34:08Z burtons: ok 2015-01-24T04:35:04Z nyef: And you're going to run into a number of issues if you try to do this interactively, since the interactive system relies on packages basically working. 2015-01-24T04:35:28Z burtons: so run the code with --eval 2015-01-24T04:35:30Z burtons: ? 2015-01-24T04:35:57Z nyef: Or --load, or cat | sbcl, or... 2015-01-24T04:36:12Z nyef: Or just be prepared to have to re-load your code often. 2015-01-24T04:36:25Z nyef: Essentially once per test run, really. 2015-01-24T04:36:42Z burtons: ok, not killing keywords doesn't dump me in the debugger, so that's a bit better 2015-01-24T04:36:59Z burtons: all symbols are printed as #: now 2015-01-24T04:37:09Z burtons: still trying interactively for now 2015-01-24T04:37:34Z burtons: i'm sure calling remhash during a maphash is a no no 2015-01-24T04:38:09Z nyef: Yeah, I think that might be against the rules. 2015-01-24T04:38:23Z nyef: What are you trying to remhash? 2015-01-24T04:38:28Z dougk_ quit (Ping timeout: 244 seconds) 2015-01-24T04:38:47Z burtons: the packages from *package-names*, except for the keywords package 2015-01-24T04:38:49Z echo-are` is now known as echo-area 2015-01-24T04:39:07Z burtons: is it called "keywords"? 2015-01-24T04:39:17Z nyef: Don't bother. Create a new hashtable with just keyword and maybe common-lisp... 2015-01-24T04:39:36Z nyef: Have a poke around, there should be a symbol *keyword-package* or similar with a direct reference. 2015-01-24T04:39:50Z nyef: It's required to be called "KEYWORD", but may have aliases. 2015-01-24T04:41:24Z pacon joined #sbcl 2015-01-24T04:42:05Z pacon quit (Read error: Connection reset by peer) 2015-01-24T04:42:30Z burtons: all i see is a "keyword" package 2015-01-24T04:42:49Z nyef: There may be some case-mangling going on. 2015-01-24T04:43:07Z burtons: i'm just printing the package name strings 2015-01-24T04:43:16Z dougk_ joined #sbcl 2015-01-24T04:43:24Z burtons: ok, so i've set all symbol-packages to nil 2015-01-24T04:43:28Z burtons: cleared *package-names* 2015-01-24T04:43:35Z nyef: Ah, sb-int:*keyword-package*. 2015-01-24T04:43:39Z burtons: did a gc, save still nothing 2015-01-24T04:43:47Z burtons: no reduction in size i mean 2015-01-24T04:43:53Z burtons: there must be other references 2015-01-24T04:44:08Z burtons: gc doesn't seem to do anything 2015-01-24T04:44:42Z nyef: Yeah, that's the other bit. The entire system sort of hangs together even without the package system. 2015-01-24T04:45:07Z burtons: too bad, i was hoping for a good result to a friday night quick hack :) 2015-01-24T04:45:36Z burtons: what if all the symbols were uninterened as well 2015-01-24T04:45:52Z burtons: wouldn't the compiler already have numeric references to everything? 2015-01-24T04:46:09Z nyef: Well, what you are doing IS basically uninterning all of the symbols. 2015-01-24T04:46:22Z burtons: by setting the symbol-package to nil? 2015-01-24T04:46:53Z nyef: Umm... Oh, right, you're not clearing the package internal-symbol and external-symbol hashtables yet, are you? 2015-01-24T04:47:09Z burtons: no 2015-01-24T04:47:25Z burtons: i don't think so, just using %set-symbol-package to nil 2015-01-24T04:47:36Z nyef: Or breaking the %use-list or %used-by-list in the packages... 2015-01-24T04:47:57Z nyef: ... And it looks like the TABLES slot would need resetting. 2015-01-24T04:48:14Z burtons: i would think that ripping the packages out of *package-names* would leave them to be collected unless there's other references 2015-01-24T04:48:21Z nyef: And even with all of this damage to the package structure, I'm not expecting much. 2015-01-24T04:48:39Z burtons: well, the original idea was to destroy the package system :) 2015-01-24T04:49:00Z pacon joined #sbcl 2015-01-24T04:49:05Z nyef: IIRC, there's a direct reference to at least the COMMON-LISP package somewhere around, and almost all packages :USE that. 2015-01-24T04:49:21Z nyef: And there are forward and backward links between the package objects themselves. 2015-01-24T04:49:58Z burtons: i don't think links between packages would matter if the top level references to them is in *package-names* 2015-01-24T04:50:27Z nyef: Yes, but they matter as soon as the top-level references are gone. 2015-01-24T04:50:47Z burtons: why is that? i would think they would all be dangling after that and the gc could pick them up 2015-01-24T04:51:27Z nyef: There are other references to specific packages, such as to the keyword and common-lisp packages, and almost every package will have a reference to and from the common-lisp package. 2015-01-24T04:51:50Z burtons: ah, yeah 2015-01-24T04:52:03Z burtons: ok, so clear the use-list and used-by-lists 2015-01-24T04:55:25Z burtons: hmm, can't setf package-use-list 2015-01-24T04:55:51Z nyef: Because it's package-%use-list. 2015-01-24T04:56:40Z burtons: thanks. gc still does nothing after doing that as well... 2015-01-24T04:56:55Z burtons: time to reset the tables slot 2015-01-24T04:56:58Z nyef: Are you calling GC directly? 2015-01-24T04:57:16Z burtons: yesa 2015-01-24T04:57:38Z nyef: With :FULL T ? 2015-01-24T04:57:58Z burtons: no, just (gc t) 2015-01-24T04:58:04Z burtons: didn't realize that was a keyword 2015-01-24T04:59:08Z nyef: I'm going to have to wish you luck, because I have about a minute left before my DSL modem turns into a pumpkin. 2015-01-24T04:59:41Z burtons: ok, hopefully you gave me all the advice i need 2015-01-24T04:59:44Z burtons: thanks 2015-01-24T04:59:51Z burtons: if it works i'll report back 2015-01-24T05:00:07Z nyef: And if it doesn't, you'll be back with more questions, I'm sure. (-: 2015-01-24T05:00:19Z nyef: Good night, and good luck. 2015-01-24T05:00:22Z nyef quit (Quit: G'night all) 2015-01-24T05:03:18Z dougk_ quit (Ping timeout: 245 seconds) 2015-01-24T05:08:18Z burtons: damn, it worked 2015-01-24T05:08:36Z burtons: image went from ~90meg to 50 2015-01-24T05:12:02Z dougk_ joined #sbcl 2015-01-24T05:18:20Z burtons: if anybody cares to see the code for the dirty tree shaking save: https://gist.github.com/burtonsamograd/f08f561264ff94391300 2015-01-24T05:18:41Z burtons: basic test of running a hello world works 2015-01-24T05:20:14Z dougk_ quit (Ping timeout: 245 seconds) 2015-01-24T05:20:39Z scymtym: burtons: are the final GC and S-L-A-D inside DOLIST on purpose? 2015-01-24T05:21:34Z dougk_ joined #sbcl 2015-01-24T05:34:11Z burtons: yes 2015-01-24T05:34:17Z burtons: oh, no 2015-01-24T05:34:20Z burtons: oops 2015-01-24T05:34:21Z burtons: thanks 2015-01-24T05:35:11Z burtons: still the same results on size 2015-01-24T05:38:47Z burtons: fixed in the gist 2015-01-24T05:50:17Z burtons: hmm, not too impressive when i have cl-cffi-gtk loaded 2015-01-24T05:50:31Z burtons: goes from 86M to 73M 2015-01-24T05:51:08Z burtons: oh well, it was fun to hack up 2015-01-24T06:00:26Z csziacobus quit (Quit: csziacobus) 2015-01-24T06:02:16Z dougk_ quit (Ping timeout: 272 seconds) 2015-01-24T06:16:35Z pacon quit (Read error: Connection reset by peer) 2015-01-24T06:47:46Z alchemis7 joined #sbcl 2015-01-24T07:47:00Z gingerale joined #sbcl 2015-01-24T07:55:50Z sdemarre joined #sbcl 2015-01-24T08:07:33Z Shinmera joined #sbcl 2015-01-24T08:48:45Z angavrilov joined #sbcl 2015-01-24T08:54:34Z pacon joined #sbcl 2015-01-24T09:08:42Z Shinmera quit (Quit: しつれいしなければならないんです。) 2015-01-24T09:08:51Z Shinmera joined #sbcl 2015-01-24T09:14:41Z gingerale quit (Ping timeout: 252 seconds) 2015-01-24T09:34:14Z stassats joined #sbcl 2015-01-24T09:50:08Z oleo__ quit (Quit: Verlassend) 2015-01-24T09:57:27Z oleo joined #sbcl 2015-01-24T10:00:49Z slyrus joined #sbcl 2015-01-24T10:32:44Z stassats: well, i found a register, but it seems to be used by linux 2015-01-24T11:25:37Z eudoxia joined #sbcl 2015-01-24T11:28:51Z dekhoda quit (Quit: dekhoda) 2015-01-24T12:09:49Z dekhoda joined #sbcl 2015-01-24T12:21:07Z Quadrescence quit (Quit: This computer has gone to sleep) 2015-01-24T12:28:33Z dekhoda quit (Quit: dekhoda) 2015-01-24T12:38:36Z Shinmera quit (Quit: しつれいしなければならないんです。) 2015-01-24T12:39:15Z Shinmera joined #sbcl 2015-01-24T13:35:39Z dougk_ joined #sbcl 2015-01-24T14:05:55Z attila_lendvai joined #sbcl 2015-01-24T14:05:55Z attila_lendvai quit (Changing host) 2015-01-24T14:05:55Z attila_lendvai joined #sbcl 2015-01-24T14:36:52Z nyef joined #sbcl 2015-01-24T14:39:06Z stassats: so, glibc is using the read-only user register for TLS 2015-01-24T14:39:20Z stassats: that leaves the r/w register, but i can't seem to be able to put anything useful into it 2015-01-24T14:39:44Z stassats: talking about http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/Babeihid.html 2015-01-24T14:44:34Z nyef: How do you mean "can't seem to put anything useful into it"? 2015-01-24T14:45:00Z stassats: i set it to a value, read it, and it's not what i put there 2015-01-24T14:45:11Z nyef: Hrm. 2015-01-24T14:45:15Z LiamH joined #sbcl 2015-01-24T14:45:22Z nyef: That's neat. 2015-01-24T14:45:25Z stassats: maybe i'm just doing bad inline asm 2015-01-24T14:45:51Z stassats: right, i'm using the output as input 2015-01-24T14:46:11Z stassats: ok, got it 2015-01-24T14:46:34Z stassats: so, i have a register 2015-01-24T14:46:50Z stassats: which cannot be used as a base, though 2015-01-24T14:48:10Z nyef: Hrm. That rules out most of the fixed-use registers such as reg_NULL, reg_CODE, reg_CFP... 2015-01-24T14:48:10Z stassats: so, doing accessing thread slots would require a temporary register 2015-01-24T14:48:23Z nyef: Thus, yes, a temporary. 2015-01-24T14:48:30Z nyef: It'd be workable, though, I guess. 2015-01-24T14:48:57Z stassats: and it's unclear on which CPUs this thing is present 2015-01-24T14:51:39Z stassats: armv6 2015-01-24T14:52:03Z nyef: IIRC, we're not guaranteeing armv5 compatibility, so you should be safe on that end. 2015-01-24T14:52:26Z nyef: What about other possible users, or do we restore it on any call into and return into lisp? 2015-01-24T14:53:02Z stassats: the kernel says, armv6 may have this, armv6k has this 2015-01-24T14:53:19Z stassats: nyef: restoring should be a good idea 2015-01-24T14:53:59Z stassats: let me check if it's actually thread-local 2015-01-24T14:54:23Z nyef: There's also the question of if anyone else is using it. 2015-01-24T14:54:50Z stassats: glibc uses the other one 2015-01-24T14:54:51Z nyef: ("Oh, this one OpenGL library uses it, but it's one of the more popular ones.") 2015-01-24T14:55:43Z stassats: oops, doesn't seem to be thread local 2015-01-24T14:56:06Z stassats: at least on that kernel 2015-01-24T14:56:27Z nyef: May not be PROCESS local on that kernel. 2015-01-24T14:57:28Z stassats: i know, let's write our own kernel 2015-01-24T14:57:40Z nyef: Been there, tried that. 2015-01-24T14:57:58Z stassats: access to all registers 2015-01-24T14:58:01Z nyef: Still have the patches to a pre-1.0 SBCL for it. 2015-01-24T14:58:25Z nyef: Kindof fun hacking page-table entries with Lisp, though. (-: 2015-01-24T14:59:31Z stassats: so, the weird kernel status and inability to use it as a base register rules this out 2015-01-24T14:59:37Z stassats: but it's still interesting 2015-01-24T15:01:01Z stassats: using it for NIL, well, moving NIL around and it can become immediate encodable 2015-01-24T15:01:57Z dougk_ quit (Ping timeout: 245 seconds) 2015-01-24T15:02:43Z stassats: changing 0x800000B to x8000000B, and it's encodable 2015-01-24T15:03:34Z stassats: or even 0x1000000B 2015-01-24T15:03:56Z nyef: Isn't NIL required to be the lowest-addressed object on the heap for some reason? 2015-01-24T15:04:19Z stassats: it's an offset for static space 2015-01-24T15:05:05Z stassats: chaing it to 0x1000000B will require moving the static space 128M up 2015-01-24T15:06:57Z chu_ joined #sbcl 2015-01-24T15:07:37Z stassats: or if we move it to 0x4, then T can be encodable too 2015-01-24T15:08:33Z chu quit (Ping timeout: 276 seconds) 2015-01-24T15:09:59Z stassats: LDR LEXENV, [NULL, #1241] ; TWO-ARG-+ 2015-01-24T15:10:19Z stassats: could be ADD LEXENV, NULL, #1241 LDR LEXENV [LEXENV] 2015-01-24T15:11:10Z stassats: err, make that MOV LEXENV, 0x800000B LDR LEXENV, [LEXENV, #1241] 2015-01-24T15:14:14Z stassats: and i would trade CSP for NULL, not for a thread register 2015-01-24T15:14:21Z stassats: threading, who needs threading anyway? 2015-01-24T15:17:48Z stassats: i should just try removing reg_NULL and see what happens 2015-01-24T15:19:34Z dougk_ joined #sbcl 2015-01-24T15:28:09Z dougk_ quit (Ping timeout: 245 seconds) 2015-01-24T15:34:14Z stassats: couldn't map static space to 0x40000000 2015-01-24T15:46:05Z chu_ quit (Ping timeout: 246 seconds) 2015-01-24T15:46:42Z pacon quit (Read error: Connection reset by peer) 2015-01-24T15:51:25Z chu joined #sbcl 2015-01-24T15:54:55Z oleo quit (Read error: Connection reset by peer) 2015-01-24T15:57:03Z oleo joined #sbcl 2015-01-24T16:26:22Z slyrus quit (Ping timeout: 240 seconds) 2015-01-24T16:33:24Z Quadrescence joined #sbcl 2015-01-24T16:42:32Z eudoxia quit (Quit: Leaving) 2015-01-24T16:48:02Z oleo quit (Quit: Verlassend) 2015-01-24T16:49:55Z attila_lendvai quit (Ping timeout: 256 seconds) 2015-01-24T16:50:16Z attila_lendvai joined #sbcl 2015-01-24T16:50:16Z attila_lendvai quit (Changing host) 2015-01-24T16:50:16Z attila_lendvai joined #sbcl 2015-01-24T16:57:17Z attila_lendvai quit (Ping timeout: 256 seconds) 2015-01-24T17:00:26Z oleo joined #sbcl 2015-01-24T17:27:03Z burtons quit (Ping timeout: 264 seconds) 2015-01-24T17:42:12Z attila_lendvai joined #sbcl 2015-01-24T17:47:15Z pkhuong: there's always the option of stealing one FP register :| 2015-01-24T17:48:20Z stassats: if only it could be used as a base register 2015-01-24T17:49:53Z stassats: so, the debugger actually checks if the variables are initialized at the PC 2015-01-24T17:49:59Z nyef: Can you use it for arg-passing, maybe? Or... as one of the unboxed registers? 2015-01-24T17:50:11Z stassats: one problem though, the elsewhere PC is always larger than the start-pc 2015-01-24T17:50:52Z stassats: so, arg-count error from elsewhere-pc passes validation checks 2015-01-24T17:52:53Z nyef: What stops you from swapping the segments? 2015-01-24T17:53:20Z stassats: what do you mean? 2015-01-24T17:53:39Z nyef: Put the elsewhere segment first instead of last. 2015-01-24T17:54:11Z stassats: then when an error comes from the point where the environment is initialized, nothing would be valid 2015-01-24T17:54:44Z stassats: so, now you would need two elsewheres 2015-01-24T17:55:26Z nyef: Ugh. 2015-01-24T17:55:36Z nyef: More accurate validity map, then? 2015-01-24T17:55:48Z stassats: maybe it's accurate, and it doesn't check it? 2015-01-24T17:56:23Z stassats: i'm in the process of figuring out what the debug-fun block is 2015-01-24T17:57:25Z nyef: You realize that after this you're going to be our local expert on how the debugger works, right? 2015-01-24T17:57:50Z stassats: if i manage to figure it out 2015-01-24T17:58:05Z eudoxia joined #sbcl 2015-01-24T18:47:48Z eudoxia quit (Quit: Leaving) 2015-01-24T18:49:41Z eudoxia joined #sbcl 2015-01-24T18:50:22Z _8hzp quit (Remote host closed the connection) 2015-01-24T19:01:21Z stassats: and those variables are marked as always live, as long as they are after the start-pc 2015-01-24T19:09:50Z stassats: if i can figure from which blocks a particular elswhere location can be reached 2015-01-24T19:10:02Z stassats: then i can figure if a variable is alive 2015-01-24T19:22:55Z eudoxia quit (Read error: Connection reset by peer) 2015-01-24T19:28:23Z burtons joined #sbcl 2015-01-24T19:37:07Z stassats: so, the problem with arg-count is clear, and actually the patch submitted to sbcl-devel could work 2015-01-24T19:37:34Z stassats: although i can still imagine an interrupt happening in elsewhere without before the trap runs 2015-01-24T19:38:37Z nyef has a single-instruction stepper interrupt that works on x86. Easy enough to arrange. 2015-01-24T19:38:53Z nyef: (You didn't want to hear that, did you?) 2015-01-24T19:38:57Z stassats: i can see a solution: writing the block from which the elsewhere bit is linked and then using it for getting live tns 2015-01-24T19:39:28Z stassats: now to the local call thing being bonkers 2015-01-24T19:39:29Z nyef: ... Does that work with the error-trap coalescing thing? 2015-01-24T19:39:48Z stassats: nyef: do we have that? 2015-01-24T19:40:06Z nyef: There was some noise about it a while back, I don't know if it ever got merged. 2015-01-24T19:40:44Z nyef: I wasn't happy with it precisely because it discarded control-flow information that could be used by anything with the brains to parse a debug-info structure. 2015-01-24T19:41:02Z stassats: but wait, i think it gets the location of the error even if it's in elsewhere, so maybe nothing new should be saved 2015-01-24T19:44:20Z stassats: but for some reason type-check error locations labels are not marked as elsewherish 2015-01-24T19:46:52Z stassats: maybe it's not elsewhere then 2015-01-24T19:50:20Z stassats: ok, so we indeed can't locate elsewhere errors 2015-01-24T19:50:36Z stassats: unbound-symbol-error is one of those things 2015-01-24T19:53:47Z sdemarre quit (Ping timeout: 252 seconds) 2015-01-24T19:54:43Z stassats: i think that should be easy to rectify, as long as all elsewheres come from the same blocks 2015-01-24T19:57:49Z stassats: though error in elsewhere seems to manage to figure out live variables 2015-01-24T20:08:23Z dougk_ joined #sbcl 2015-01-24T20:38:31Z stassats: i think i know why undefined variables are not located probably, it's translated into (symbol-value 'x) and throws off source location stuff 2015-01-24T20:39:06Z stassats: because (symbol-value 'x) is properly located 2015-01-24T20:39:38Z prxq joined #sbcl 2015-01-24T20:49:53Z dougk_ quit (Ping timeout: 246 seconds) 2015-01-24T20:58:59Z chu_ joined #sbcl 2015-01-24T20:59:13Z chu quit (Ping timeout: 255 seconds) 2015-01-24T21:07:30Z stassats: the local call thingy, the variable is marked as always-live-p, but it's location is a register and it's not saved 2015-01-24T21:07:37Z stassats: even though it's said to be :debug-environment 2015-01-24T21:18:50Z drmeister quit 2015-01-24T21:19:08Z drmeister joined #sbcl 2015-01-24T21:19:29Z stassats: which seems to only happen with a local tail call 2015-01-24T21:27:30Z angavrilov quit (Remote host closed the connection) 2015-01-24T21:29:01Z Quadrescence: stassats, can we add (declare (tail-call FUNCTION-NAME)) 2015-01-24T21:29:13Z stassats: what for? 2015-01-24T21:29:44Z Quadrescence: so I can control whether a named function gets compiled with tail-call elimination 2015-01-24T21:30:07Z stassats: it always does, unless you ask not to 2015-01-24T21:30:11Z Quadrescence: or maybe (declare (optimize (tail-call 1))) or something 2015-01-24T21:30:17Z Quadrescence: stassats, is that DEBUG=0? 2015-01-24T21:30:26Z stassats: debug up to 2 2015-01-24T21:30:50Z Quadrescence: I guess I need to make an implementation table 2015-01-24T21:30:59Z Quadrescence: I'm just a fan of fine-grained control of transformations 2015-01-24T21:31:08Z stassats: maybe have been up to 1 in the past 2015-01-24T21:31:12Z stassats: may 2015-01-24T21:33:28Z stassats: and the tail call is not a jump, it just flows in the next segment 2015-01-24T21:34:28Z Quadrescence: that is nice 2015-01-24T21:34:38Z stassats: no, i'm talking about my bug 2015-01-24T21:34:47Z Quadrescence: oh 2015-01-24T21:35:31Z stassats: such a combination causes a disagreement between parts 2015-01-24T21:54:39Z stassats: shortest test case: (defun test (x) (flet ((tail ())) (declare (notinline tail)) (err x) (tail))) 2015-01-24T21:55:35Z stassats: incidentally, (defun test (x) (flet ((tail ())) (declare (notinline tail)) (break "~x" x) (tail))) will show that it's coming from TAIL, because the return-pc happens in the next segment, the tail's one 2015-01-24T22:01:37Z slyrus joined #sbcl 2015-01-24T22:16:38Z slyrus quit (Ping timeout: 245 seconds) 2015-01-24T22:31:50Z stassats: ok, i give up for today 2015-01-24T22:32:08Z stassats: for some reason :debug-environment isn't respected 2015-01-24T22:32:20Z stassats: and the tn actually gets life-time analyzed 2015-01-24T22:36:49Z nyef: I'd check the PACK logic and to make sure that the TN gets added to the appropriate list. 2015-01-24T22:37:40Z stassats: i've been looking all over where there are references to :debug-environment and can't find anything 2015-01-24T22:38:01Z stassats: it's not in the global-tn conflicts, but no idea why 2015-01-24T22:38:12Z nyef: Oh, and the LIFE phase. Hrm. 2015-01-24T22:39:17Z nyef: Is it getting converted from :debug-environment to :environment? 2015-01-24T22:39:38Z stassats: no, it stays :debug-environment 2015-01-24T22:39:59Z stassats: that's the problem, the contract of :debug-environment is violated 2015-01-24T22:40:07Z stassats: it's not saved 2015-01-24T22:40:31Z nyef has long since paged out most of what he knows about LIFE and PACK. 2015-01-24T22:52:28Z chu_ quit (Ping timeout: 245 seconds) 2015-01-24T22:54:20Z chu joined #sbcl 2015-01-24T23:02:10Z csziacobus joined #sbcl 2015-01-24T23:06:41Z burtons: hey nyef, that tree shaker i was working on last night works, at least for a hello world 2015-01-24T23:06:54Z nyef: burtons: Congratulations. 2015-01-24T23:07:00Z nyef: What constitutes "works"? 2015-01-24T23:07:04Z burtons: https://gist.github.com/burtonsamograd/23fe84801fa10616e926 2015-01-24T23:07:14Z burtons: the hello world runs and it reduces the binary size 2015-01-24T23:07:24Z burtons: got about a 40-50% reduction 2015-01-24T23:07:34Z burtons: i haven't had time to try it on anything else yet 2015-01-24T23:07:44Z nyef: That's... actually somewhat impressive. 2015-01-24T23:07:52Z burtons: doesn't give very good results when i load something big like cl-cffi-gtk though 2015-01-24T23:08:00Z burtons: only about a 10% reduction 2015-01-24T23:08:17Z burtons: even for just the hello world, so there must be some other references around 2015-01-24T23:08:51Z nyef: It's possibly something like cl-cffi-gtk uses CLOS, CLOS uses the compiler, the compiler is large. 2015-01-24T23:09:16Z burtons: do you know if cffi use the compiler at runtime? 2015-01-24T23:09:27Z burtons: but yes, cl-cffi-gtk does use clos 2015-01-24T23:09:27Z nyef: I have no idea, TBH. 2015-01-24T23:09:54Z burtons: well, it ended up working at least somewhat with not too much code, so thanks for the help 2015-01-24T23:09:59Z nyef: I know that PCL (the CLOS implementation in SBCL) uses the compiler for something to do with discrimination functions or effective-method-functions or something like that. 2015-01-24T23:11:20Z burtons: so then tree shaking even if it was clever would have a hard time getting around that 2015-01-24T23:11:48Z stassats: hm, seems like the deleted TN isn't marked :LIVE in all blocks 2015-01-24T23:12:56Z burtons: a compressed tree shaken binary of hello world comes out to 11M 2015-01-24T23:13:19Z stassats: that seems like what compression alone gives me 2015-01-24T23:13:41Z burtons: maybe it was one when i loaded cl-cffi-gtk 2015-01-24T23:13:45Z burtons: let me try a simple one 2015-01-24T23:14:20Z burtons: 9961520 bytes 2015-01-24T23:16:08Z burtons: i got some more size reduction improvements when i cleared more of the package slots, especially internal-symbols and external-symbols 2015-01-24T23:16:13Z burtons: that gave me another 10% 2015-01-24T23:24:41Z prxq quit (Remote host closed the connection) 2015-01-24T23:24:56Z chu quit (Ping timeout: 246 seconds) 2015-01-24T23:26:52Z chu joined #sbcl 2015-01-24T23:41:23Z stassats quit (Ping timeout: 246 seconds) 2015-01-24T23:44:56Z Shinmera quit (Quit: しつれいしなければならないんです。) 2015-01-24T23:53:38Z christop1 is now known as christoph_debian