2015-12-15T00:00:24Z whiteline joined #sbcl 2015-12-15T00:06:26Z sjl quit (Ping timeout: 240 seconds) 2015-12-15T00:17:48Z nyef: So, I'm thinking allocation overflow, uninitialized space (so, zeroed, effectively), passed to an alien routine, and cheneygc is stupid about that sort of thing. In fact, I think it's actually in one of my sets of notes that the cheneygc refusal to trigger appropriately on alien WP violations is stupid. 2015-12-15T00:18:37Z nyef: Hrm... Where's the array allocators for this thing? 2015-12-15T00:22:35Z nyef: Yup. That's what's going on, and PPC/cheneygc is also vulnerable. 2015-12-15T00:23:05Z nyef: A long-known, inconsistently-understood, inconsistently-worked-around issue. 2015-12-15T00:27:04Z scymtym_ quit (Ping timeout: 250 seconds) 2015-12-15T00:28:17Z sjl joined #sbcl 2015-12-15T00:40:17Z ehaliewicz joined #sbcl 2015-12-15T00:43:20Z nyef: Preliminary conclusion: A test case for this shouldn't be difficult to write. Condition on :cheneygc, get the current dynamic space size and the current trigger, allocate an array large enough to blow past the trigger, call out to bzero it or something, and if an error occurs then the test fails... except that getting the trigger value from the lisp side isn't easy. 2015-12-15T00:53:12Z nyef: ... Though I think it should be exposable as an alien variable, even without linkage-table. 2015-12-15T01:06:54Z nyef: Looks like it, but it can't be exposed as an alien variable on non-linkage-table gencgc systems. 2015-12-15T01:09:36Z nyef: So, I'm feeling a LOT happier about the state of things now that I've got this bug at least figured out, and a plan for nailing it properly and making sure that it gets fixed everywhere and cannot recur. 2015-12-15T02:05:19Z nzambe quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) 2015-12-15T02:06:00Z nzambe joined #sbcl 2015-12-15T02:10:54Z adhoc quit (Ping timeout: 256 seconds) 2015-12-15T02:12:24Z adhoc joined #sbcl 2015-12-15T02:15:47Z carvite quit (Ping timeout: 276 seconds) 2015-12-15T02:16:46Z carvite joined #sbcl 2015-12-15T02:45:46Z edgar-rft quit (Quit: edgar-rft) 2015-12-15T02:46:26Z loke: I've found a case which is suboptimisally optimised. 2015-12-15T02:46:50Z loke: the form (<= 0 x 100) is compiled into at least one conditional jump 2015-12-15T02:47:27Z loke: I mean, the following: 2015-12-15T02:47:36Z loke: (if (<= 0 x 100) "x" "y") 2015-12-15T02:47:55Z loke: While the following equivalent compiles to a single CMOVBE: 2015-12-15T02:48:11Z loke: (if (typep x '(integer 0 100) "x" "y") 2015-12-15T02:48:38Z loke: Note that there is a type declaration around the entire thing: (declare (type x fixnum)) 2015-12-15T02:49:13Z loke: I was thinking of creating a DEFTRANSFORM that transforms the former to the latter, but I'm wondering if that's the proper way to do this? 2015-12-15T02:51:26Z nyef: The IF form is (AND (<= 0 x) (<= x 100)) ? 2015-12-15T02:57:03Z loke: nyef: Well, in the code it's the way I wrote it, but the generated code does indeed seem to do what you said. First it checks for X>=0, and returns "y" if not, then it does a compare with 100 and CMOVLE. 2015-12-15T02:57:30Z loke: the first comparison is what triggers a jump in the true case. 2015-12-15T02:58:07Z nyef: Right, because the compiler does some transform to reduce most n-ary math operations to 2-ary operations where possible, and then open-codes the 2-ary operations. 2015-12-15T02:58:41Z loke: So is the solution to use a transformation for the three-value case where the lower buould is 0? 2015-12-15T02:58:51Z loke: and should DEFTRANSFORM or DEFOPTIMIZER be used here? 2015-12-15T02:58:58Z loke: bound 2015-12-15T02:59:06Z nyef: And here's where my ability to advise runs out. 2015-12-15T02:59:56Z nyef: I'd suggest first finding that transform to 2-ary operations, and see if that adds any new constraints to the problem. 2015-12-15T02:59:57Z loke: I have to admit that I don't really understand DEFOPTIMIZER. 2015-12-15T03:00:15Z nyef: It's just another set of function namespaces. 2015-12-15T03:00:58Z loke: It's done in srctran.lisp: 2015-12-15T03:00:59Z loke: (define-source-transform <= (&rest args) (multi-compare '<= args nil 'real)) 2015-12-15T03:01:04Z nyef: Drill down two or three levels into DEFOPTIMIZER and you wind up in a structure, IIRC. FUN-INFO-FUNS or the like. 2015-12-15T03:01:28Z nyef: Okay, so I think that that occurs before DEFTRANSFORM can get its paws on it. 2015-12-15T03:01:48Z loke: Ah yes. Of course. 2015-12-15T03:02:17Z loke: That's annoying, because I don't think you have type information at the level of define-source-transform? 2015-12-15T03:03:03Z loke: Unless you transform to something bizarre like: 2015-12-15T03:05:01Z loke: (<= x y z) into (if (and (typep ,y 'fixnum) (constantp x) (constantp z)) (typep ,y '(integer ,x ,z)) (<= x y z)) 2015-12-15T03:05:22Z loke: And then hope for the type inference later to do the right thing 2015-12-15T03:07:43Z nyef: And you're operating on a level of the system that I don't fully comprehend. 2015-12-15T03:11:56Z nyef: Heh! SBCL can have a MOST-POSITIVE-BIGNUM as well, in theory. 2015-12-15T03:12:59Z nyef: Hrm. Though, looking at the maximum length constant, it seems that it could be larger than dynamic space? 2015-12-15T03:20:59Z csziacobus: https://www.jwz.org/blog/2008/03/most-positive-bignum/ 2015-12-15T03:21:36Z csziacobus quit (Quit: csziacobus) 2015-12-15T03:23:30Z nyef: Yes, exactly. 2015-12-15T03:24:10Z nyef: ... And now I'm thinking somewhat idly about possibly fixing up nevermore again and trying to run that code. 2015-12-15T03:49:43Z csziacobus joined #sbcl 2015-12-15T03:53:46Z ehaliewicz quit (Remote host closed the connection) 2015-12-15T03:58:58Z loke: csziacobus: Man, that jwz page is horribly unreadable. 2015-12-15T03:59:09Z loke: Thank FSM for the readability plugin. 2015-12-15T04:03:37Z SamSkulls joined #sbcl 2015-12-15T04:06:16Z nyef: Hrm... This is familiar-seeming. I think I've done this sort of header-word hacking in SBCL for something to do with changing an array type at runtime. 2015-12-15T04:06:46Z nyef: ... I wonder what for? 2015-12-15T04:09:46Z nyef: Ah! Found it. 2015-12-15T04:11:41Z csziacobus quit (Quit: csziacobus) 2015-12-15T04:11:51Z nyef: Heh. Okay, so I had a (vector character) which was a copy of my string, and I needed an octet vector of the underlying octets for the string, but it still had to be the 32-bits-per-character format. 2015-12-15T04:14:01Z nyef: So I popped a WITHOUT-GCING, used GET-LISP-OBJ-ADDRESS and INT-SAP to get a direct pointer, a SYMBOL-MACROLET to bind to the header and array length, and then smacked a new widetag in and scaled the length appropriately. 2015-12-15T04:14:31Z nyef: And commented it appropriately, too. (-: 2015-12-15T04:20:29Z kanru joined #sbcl 2015-12-15T04:27:46Z csziacobus joined #sbcl 2015-12-15T04:41:57Z csziacobus quit (Quit: csziacobus) 2015-12-15T04:59:12Z SamSkulls quit (Ping timeout: 250 seconds) 2015-12-15T05:06:38Z csziacobus joined #sbcl 2015-12-15T05:15:17Z csziacobus quit (Quit: csziacobus) 2015-12-15T05:20:26Z psy_ quit (Ping timeout: 240 seconds) 2015-12-15T05:54:05Z psy_ joined #sbcl 2015-12-15T06:03:48Z derrida quit (Ping timeout: 256 seconds) 2015-12-15T06:05:48Z kanru quit (Remote host closed the connection) 2015-12-15T06:12:32Z kanru joined #sbcl 2015-12-15T06:16:19Z psy_ quit (Quit: Leaving) 2015-12-15T07:02:44Z adhoc quit (Ping timeout: 256 seconds) 2015-12-15T07:04:25Z adhoc joined #sbcl 2015-12-15T07:11:54Z gingerale joined #sbcl 2015-12-15T07:32:12Z DeadTrickster quit (Ping timeout: 256 seconds) 2015-12-15T07:57:01Z Cymew joined #sbcl 2015-12-15T08:01:32Z failproofshark quit (Remote host closed the connection) 2015-12-15T08:19:14Z scymtym_ joined #sbcl 2015-12-15T08:20:56Z rszeno joined #sbcl 2015-12-15T08:22:23Z DeadTrickster joined #sbcl 2015-12-15T09:50:30Z rszeno quit (Quit: Leaving.) 2015-12-15T10:29:50Z ASau quit (Ping timeout: 250 seconds) 2015-12-15T10:38:04Z sjl quit (Ping timeout: 250 seconds) 2015-12-15T10:56:26Z adhoc quit (Ping timeout: 240 seconds) 2015-12-15T11:08:24Z scymtym_ quit (Ping timeout: 250 seconds) 2015-12-15T11:08:33Z attila_lendvai joined #sbcl 2015-12-15T11:08:33Z attila_lendvai quit (Changing host) 2015-12-15T11:08:33Z attila_lendvai joined #sbcl 2015-12-15T11:09:08Z adhoc joined #sbcl 2015-12-15T11:34:44Z Bike quit (Ping timeout: 256 seconds) 2015-12-15T11:35:20Z Bike joined #sbcl 2015-12-15T11:38:28Z sjl joined #sbcl 2015-12-15T12:18:46Z attila_lendvai quit (Ping timeout: 240 seconds) 2015-12-15T13:23:16Z stassats joined #sbcl 2015-12-15T13:54:24Z edgar-rft joined #sbcl 2015-12-15T13:54:46Z stassats quit (Ping timeout: 240 seconds) 2015-12-15T13:56:38Z stassats joined #sbcl 2015-12-15T13:57:40Z psilord quit (Quit: Leaving.) 2015-12-15T15:08:08Z gingerale quit (Remote host closed the connection) 2015-12-15T15:15:55Z psilord joined #sbcl 2015-12-15T15:32:40Z dougk_ joined #sbcl 2015-12-15T16:00:58Z mordocai joined #sbcl 2015-12-15T16:36:46Z Cymew quit (Ping timeout: 256 seconds) 2015-12-15T16:50:16Z core1 quit (Quit: Leaving.) 2015-12-15T16:50:32Z core1 joined #sbcl 2015-12-15T16:51:06Z sjl quit (Ping timeout: 240 seconds) 2015-12-15T16:54:26Z core2 joined #sbcl 2015-12-15T16:54:50Z core2 is now known as Guest53899 2015-12-15T16:57:09Z core1 quit (Ping timeout: 255 seconds) 2015-12-15T16:57:25Z Guest53899 left #sbcl 2015-12-15T16:58:41Z psy_ joined #sbcl 2015-12-15T16:59:19Z psy_ quit (Max SendQ exceeded) 2015-12-15T16:59:39Z psy_ joined #sbcl 2015-12-15T17:01:27Z gingerale joined #sbcl 2015-12-15T17:09:33Z Cymew joined #sbcl 2015-12-15T17:20:05Z failproofshark joined #sbcl 2015-12-15T17:24:15Z Cymew quit (Ping timeout: 240 seconds) 2015-12-15T17:28:26Z sjl joined #sbcl 2015-12-15T18:20:54Z clique joined #sbcl 2015-12-15T18:21:05Z jlarocco joined #sbcl 2015-12-15T18:57:21Z ehaliewicz joined #sbcl 2015-12-15T18:59:12Z ehaliewicz quit (Remote host closed the connection) 2015-12-15T19:01:13Z clique quit (Ping timeout: 252 seconds) 2015-12-15T19:31:37Z stassats: still trying to rein in copy propagation 2015-12-15T19:36:10Z stassats: looks like it's doing https://en.wikipedia.org/wiki/Reaching_definition 2015-12-15T19:36:26Z whiteline quit (Ping timeout: 240 seconds) 2015-12-15T19:38:24Z nyef: That... sounds about right. 2015-12-15T19:39:30Z whiteline joined #sbcl 2015-12-15T19:39:37Z stassats: the problem is that the set of definitions grows 2015-12-15T19:40:01Z stassats: if each block just reads one variable 2015-12-15T19:40:43Z stassats: each subsequent block will have x+1 tns in its reached set 2015-12-15T19:43:52Z nyef: Right. 2015-12-15T19:44:30Z stassats: i assume it uses this to determine that tn in one block is still the same tn in another block 2015-12-15T19:45:35Z nyef: It's not TNs, though, is it? TNs are very linear. Doesn't it have to be variables that are getting tracked? 2015-12-15T19:45:54Z stassats: it uses tns 2015-12-15T19:45:55Z ferada quit (Ping timeout: 260 seconds) 2015-12-15T19:46:27Z stassats: from MOVE and removes the MOVEs that are not needed 2015-12-15T19:48:06Z stassats: GEN is tns that are written by a single MOVE 2015-12-15T19:48:59Z stassats: KILL is vops that are written by some other stuff and that are read by MOVE 2015-12-15T19:49:55Z stassats: so, the very first block has a KILL set that contains all the tns 2015-12-15T19:50:52Z stassats: the test case http://paste.lisp.org/display/215083 2015-12-15T19:52:32Z prxq joined #sbcl 2015-12-15T19:52:39Z ferada joined #sbcl 2015-12-15T19:54:30Z adhoc quit (Ping timeout: 272 seconds) 2015-12-15T19:55:40Z stassats: so, the first block, X is being written to in the XEP or what have you, and it puts all the reads into the kill list 2015-12-15T19:55:43Z nyef: That's interesting, in a "we should be able to have the compiler collapse that down to a single assignment" kind of way. 2015-12-15T19:55:57Z adhoc joined #sbcl 2015-12-15T19:56:02Z stassats: CAR can change 2015-12-15T19:56:16Z nyef: Not in that context, it can't. 2015-12-15T19:56:17Z stassats: imagine a spinlock of some sort 2015-12-15T19:56:32Z nyef: A spinlock would have a barrier. 2015-12-15T19:56:56Z stassats: that's entirely not the point 2015-12-15T19:57:15Z nyef: Right, I'm just saying "here's a related opportunity for more excellence". 2015-12-15T19:57:35Z stassats: not before i'm done using this test case 2015-12-15T19:57:52Z stassats: aref x i is more noisy 2015-12-15T19:58:03Z nyef: (And not quite in the "opportunity for excellence" meaning "complete disaster that needs immediate attention" way.) 2015-12-15T19:58:48Z stassats: so, KILL contains all the copies of X that read from it in the future 2015-12-15T19:59:11Z stassats: not clear how it helps, though 2015-12-15T19:59:15Z nyef: Oh! This is the TNs-live-backwards thing, isn't it? 2015-12-15T19:59:34Z stassats: it processes things forwards, i think 2015-12-15T19:59:43Z nyef: The TNs are born at their DEST, and live backwards until they arrive at their USEs. 2015-12-15T19:59:53Z nyef: At which point they get KILLed? 2015-12-15T20:00:28Z stassats: here it operates on VOPs, and their args 2015-12-15T20:01:10Z stassats: examines each VOP of each block, notes which tns are only used by MOVE 2015-12-15T20:01:27Z ASau joined #sbcl 2015-12-15T20:01:28Z stassats: only written to, that is 2015-12-15T20:01:39Z nyef: ... Is this COPYPROP, or LIFE? 2015-12-15T20:01:47Z stassats: copyprop 2015-12-15T20:02:20Z nyef: Hunh. Post-IR2TRAN, or at least post-LTN? 2015-12-15T20:03:13Z stassats: first thing after ir2convert 2015-12-15T20:05:42Z stassats: so, that KILL for the future reads isn't really helpful 2015-12-15T20:06:27Z stassats: the write is in this block, all reads are in the future, so, after it's written it should reach those places, shouldn't it? 2015-12-15T20:07:07Z stassats: besides, nothing matches the KILL set, since it's only applied to the current block 2015-12-15T20:07:20Z nyef: I'm getting a sense of it having something to do with backpropagation, backwards analysis, something like that? 2015-12-15T20:08:08Z stassats: it seems all forward to me 2015-12-15T20:08:34Z stassats: need to see what all those tns in the last block are copies of 2015-12-15T20:09:00Z stassats: maybe it should just store what's being copied? 2015-12-15T20:09:39Z stassats: i'm refining my understanding as i go, don't have a complete picture to reach any solution yet 2015-12-15T20:13:48Z stassats: ok, it's X 2015-12-15T20:14:02Z stassats: as i expected 2015-12-15T20:14:18Z nyef: So, what is the function of the KILL set? 2015-12-15T20:14:34Z stassats: it's not a problem, the problem is the OUT set 2015-12-15T20:15:54Z stassats: KILL set works both ways, but only when it sees something from the past does do anything useful 2015-12-15T20:16:12Z stassats: but it's the OUT set that accumulates all the copies of X 2015-12-15T20:16:50Z stassats: ok, i think i see now what it does 2015-12-15T20:16:56Z stassats: the whole picture 2015-12-15T20:17:07Z stassats: a bit blurry, but i can make out the outlines 2015-12-15T20:34:51Z angavrilov_ quit (Remote host closed the connection) 2015-12-15T21:01:32Z gingerale quit (Remote host closed the connection) 2015-12-15T21:04:30Z scymtym_ joined #sbcl 2015-12-15T21:04:31Z sbcl joined #sbcl 2015-12-15T21:04:38Z sbcl left #sbcl 2015-12-15T21:04:54Z clique joined #sbcl 2015-12-15T21:55:34Z psilord quit (Quit: Leaving.) 2015-12-15T22:08:52Z prxq quit (Remote host closed the connection) 2015-12-15T22:32:30Z Xof quit (Remote host closed the connection) 2015-12-15T22:35:10Z clique quit (Ping timeout: 252 seconds) 2015-12-15T22:40:35Z Xof joined #sbcl 2015-12-15T22:52:59Z psilord joined #sbcl 2015-12-15T23:10:19Z yvm quit (Ping timeout: 260 seconds) 2015-12-15T23:36:48Z lnostdal_ quit (Ping timeout: 272 seconds) 2015-12-15T23:37:02Z lnostdal_ joined #sbcl 2015-12-15T23:39:20Z stassats quit (Ping timeout: 272 seconds) 2015-12-15T23:48:15Z |3b| quit (Read error: Connection reset by peer) 2015-12-15T23:49:45Z |3b| joined #sbcl 2015-12-15T23:51:48Z mordocai quit (Remote host closed the connection) 2015-12-15T23:54:45Z eudoxia joined #sbcl