Show enters and exits. Hide enters and exits.
| 00:01:28 | brixen | now 0ef372 will have special significance |
| 00:01:34 | rue | What kind of behaviour should sexps have? |
| 00:01:39 | Defiler | I'm going to take a dinner break |
| 00:01:48 | rue | Is that even Code As Data compliant? :) |
| 00:03:31 | brixen | we definitely have a problem calling private/protected methods |
| 00:03:55 | rue | Bah, I can stop any time I want |
| 00:04:37 | brixen | I can't, because Hash won't work without it |
| 00:05:05 | brixen | Class#initialize is trying to call a protected instance method on Class |
| 00:05:29 | brixen | which wraps a slot accessor |
| 00:17:50 | evan | and that's not working? |
| 00:18:35 | brixen | evan: oh, got a sec? |
| 00:18:39 | evan | sure |
| 00:18:41 | brixen | I'm in send_method |
| 00:18:55 | brixen | and I need docs |
| 00:19:19 | evan | what do you need? |
| 00:19:23 | brixen | well, I believe it is send method based on the opcode print out |
| 00:19:30 | brixen | what is task->call_flags? |
| 00:19:36 | brixen | what is msg.priv? |
| 00:19:47 | evan | msg.priv indicates if private methods can be considered |
| 00:19:55 | brixen | k |
| 00:19:57 | evan | it's not related to protected |
| 00:20:05 | evan | task->call_flags is how msg.priv is set |
| 00:20:08 | brixen | and that's set to task->call_flags & 1 |
| 00:20:12 | evan | yep. |
| 00:20:18 | brixen | and then task->call_flags is set to 0 |
| 00:20:19 | evan | there is a set_call_flags instruction |
| 00:20:26 | evan | yes, call_flags is reset to 0 |
| 00:20:40 | brixen | so, calling a protected method, what should msg.priv be? |
| 00:20:44 | evan | doesn't matter. |
| 00:20:54 | evan | it's not considered for protected methods |
| 00:20:57 | brixen | k |
| 00:21:26 | evan | look at line 96 of sendsite.cpp |
| 00:21:33 | brixen | well, this isn't a dep thing |
| 00:21:35 | evan | thats where protected methods are validated. |
| 00:21:44 | brixen | k |
| 00:22:57 | brixen | this is common/class.rb:64 calling to bootstrap/class.rb:39 |
| 00:23:26 | brixen | I don't understand the "not being called from the same module" comment in sendsite.cpp:97 |
| 00:24:16 | evan | where is needs_cleanup marked protected? |
| 00:24:22 | brixen | common/class.rb |
| 00:24:27 | evan | ok, i see. |
| 00:24:54 | evan | the logic for protected is that the current self is a kind_of where the method is located |
| 00:25:03 | brixen | k |
| 00:25:27 | evan | you should back track |
| 00:25:34 | evan | it's possible that current_self is not being set properly |
| 00:25:42 | brixen | and current_self is? |
| 00:26:15 | evan | the current self |
| 00:26:16 | evan | :) |
| 00:26:19 | brixen | vs recv? |
| 00:26:22 | brixen | in msg |
| 00:26:23 | evan | yes |
| 00:26:26 | evan | totally different |
| 00:26:29 | brixen | got it |
| 00:26:34 | evan | because if I do |
| 00:26:38 | evan | blah.woo.go |
| 00:26:49 | evan | sweet = self |
| 00:26:53 | evan | sweet is current_self |
| 00:26:57 | evan | the return value from woo is recv |
| 00:26:59 | evan | when calling go |
| 00:27:08 | brixen | hah |
| 00:27:11 | evan | thats in the wrong order, but you get it |
| 00:27:14 | brixen | I'll try to parse that |
| 00:27:15 | brixen | heh |
| 00:28:25 | evan | msg.current_self should be set to task->active->recv |
| 00:28:29 | evan | by a higher layer |
| 00:34:50 | evan | all right, i'm headed out for a bit. |
| 00:57:32 | tarcieri | headius: you work at Sun? |
| 01:00:13 | headius | tarcieri: yes |
| 01:01:59 | tarcieri | headius: I knew a bunch of people who used to work at Sun's Broomfield campus |
| 01:02:09 | tarcieri | emphasis on used to... guess you're sticking around? |
| 01:02:21 | tarcieri | do they pay you to do JRuby stuff? |
| 01:02:25 | headius | jruby pretty much lives autonomously |
| 01:02:27 | headius | yes |
| 01:02:30 | tarcieri | noice |
| 01:02:35 | headius | full time, no strings attached so far |
| 01:02:51 | tarcieri | yeah I suppose everyone I knew who worked there was a server monkey |
| 01:03:30 | headius | still lots of them around...sun's going through a major tansition right now what with everything being open-sourced |
| 01:03:37 | headius | betting the company that it's the right thing to do |
| 01:04:06 | tarcieri | yeah, kinda seems like too little too late at this point |
| 01:04:30 | tarcieri | depends on what, I suppose |
| 01:04:37 | headius | at the very least it will guarantee solaris and java live on |
| 01:04:46 | tarcieri | yeah |
| 01:04:48 | headius | whether that means sun will live on, anyone's guess :) |
| 01:05:03 | tarcieri | I used to be a Solaris administrator... now I want nothing to do with it |
| 01:05:25 | headius | still seems more stable/solid to me than linux, and they finally realized that usability is kinda important |
| 01:05:39 | headius | the solaris 11 stuff is pretty nice |
| 01:05:59 | tarcieri | JDS was... uggghhh |
| 01:06:15 | tarcieri | when that came out most of my users chose to stick with CDE |
| 01:06:37 | tarcieri | I was all psyched for ZFS and it didn't exactly deliver what I was hoping |
| 01:06:54 | tarcieri | using lvm2 + xfs |
| 01:07:55 | headius | solaris guys are taking a lot of hints from debian and ubuntu |
| 01:08:05 | headius | lots of power struggles between the new and old way |
| 01:08:17 | tarcieri | I tried running Nexenta several times |
| 01:08:19 | headius | new is winning |
| 01:08:24 | tarcieri | good |
| 01:09:29 | drbrain | hrm, why is gsub! finding Kernel#gsub not String#gsub |
| 01:11:08 | brixen | drbrain: method tables seem a little wonky or something |
| 01:11:24 | brixen | so far, no methods on an instance of Hash are resolving |
| 01:12:00 | drbrain | I hooked up some config stuff, and now with vm/vm plus.rb it pukes out when $_ is nil |
| 01:12:10 | drbrain | because it does Kernel#gsub instead of String#gsub :( |
| 01:12:13 | brixen | this is what I see trying to send :initialize form Hash.new http://pastie.org/261372 |
| 01:12:29 | brixen | s/form/from |
| 01:12:57 | drbrain | where is frame 6? |
| 01:13:07 | drbrain | oh, send_prim |
| 01:13:41 | drbrain | yours looks like a stack problem |
| 01:13:54 | drbrain | something didn't get filled in in msg properly |
| 01:14:09 | brixen | hmm |
| 02:05:24 | drbrain | ha! prim_tty |
| 02:09:13 | brixen | heh |
| 02:14:27 | drbrain | why do we have both Rubinius::RBX_VERSION and RBX_VERSION (toplevel)? |
| 02:20:37 | CIA-21 | * Move Rubinius::Terminal constant to kernel, wire up IO#tty? to support it. Environment::set_rubinius_constants() is now gone, as it is not needed. - ...; c11533d - Eric Hodel |
| 02:20:50 | drbrain | well, we don't now :) |
| 02:52:40 | drbrain | sweet! now I get two backtraces! |
| 02:54:06 | drbrain | which is as it should be, I guess |
| 02:56:41 | drbrain | something seems to be off in the stack again |
| 02:57:11 | seydar | gratz! |
| 02:58:54 | drbrain | not gratz |
| 02:59:01 | drbrain | gratz sounds like a good thing |
| 02:59:06 | drbrain | this is not good |
| 02:59:10 | seydar | but you got 2 backtraces. i take it you didn't get them before? |
| 02:59:59 | seydar | btw, i've racked up a study plan for compilers, so in a month i'll have racked up 40 hrs. expect me to be mildly useful then! |
| 03:00:00 | drbrain | I'm getting them because the stack seems off |
| 03:00:14 | drbrain | Rubinius is jumping from String#gsub! to Kernel#gsub |
| 03:00:19 | drbrain | awesome |
| 03:00:20 | seydar | the stack is only used, in rubinius, for method arguments, right? |
| 03:00:24 | drbrain | what are you studying? |
| 03:00:47 | seydar | just compilers. i've been snagging dartmouth course info, and just going through papers |
| 03:00:48 | drbrain | well, the VM's stack seems messed up |
| 03:00:53 | drbrain | not the C stack |
| 03:00:56 | drbrain | cool |
| 03:01:07 | seydar | why do you reimplement a stack? |
| 03:01:13 | drbrain | and the VM stack is used for all kinds of stuff |
| 03:01:30 | seydar | do proceed good sir |
| 03:01:34 | drbrain | having a separate stack from the C stack makes a bunch of things easier |
| 03:01:42 | drbrain | like running multiple VMs in the same process |
| 03:02:40 | seydar | do you use the C stack at all? |
| 03:02:50 | drbrain | makes the GC a little simpler too, since it doesn't have to guess about the contents of the C stack |
| 03:03:05 | drbrain | the VM runs on the C stack |
| 03:03:13 | drbrain | and ruby code runs on the VM stack |
| 03:03:29 | seydar | but for running ruby code, no? |
| 03:03:31 | drbrain | but ruby C extensions would run on the C stack, of course |
| 03:03:37 | seydar | sounds icky |
| 03:03:54 | drbrain | no |
| 03:03:55 | seydar | doesn't that raise hell for you? |
| 03:04:03 | seydar | how do you get the two stacks to play nicely? |
| 03:04:27 | drbrain | the VM stack is just a chunk of memory, so it's no problem |
| 03:04:38 | drbrain | weren't you working on a scheme implementation? |
| 03:04:42 | seydar | yea, i am |
| 03:04:59 | seydar | got distracted on a brainfuck one, practicing simple optimizations of parsing |
| 03:05:06 | drbrain | you have something in there that is recognizable as a stack |
| 03:05:30 | seydar | bf or scheme? the scheme one has like, 20 lines of code in it atm |
| 03:05:37 | drbrain | scheme |
| 03:05:50 | drbrain | every time you apply a lambda, you push onto the call stack |
| 03:06:09 | seydar | and for rubinius, you push onto the VM stack |
| 03:06:09 | drbrain | rather, every time you apply a lambda in a non-tail-call position |
| 03:06:29 | drbrain | yes, but you push on for a bunch of other stuff too |
| 03:06:42 | drbrain | since it's a lower-level stack |
| 03:06:44 | seydar | the arguments? |
| 03:07:06 | drbrain | or for if |
| 03:07:12 | seydar | ah |
| 03:08:06 | seydar | dammit i wish i knew more |
| 03:08:21 | drbrain | you're young! it'll happen |
| 03:08:29 | seydar | but the world will pass! |
| 03:08:41 | drbrain | it'll still be there |
| 03:08:50 | seydar | when i FINALLY take a compilers course in spring '09, where will rubinius be? significantly further |
| 03:09:00 | seydar | and i'll be plaing catchup for a whiule |
| 03:09:08 | drbrain | there's plenty of important stuff to do, like making out with girls (or boys, should that be your thing) |
| 03:09:56 | seydar | full of wisdom ^^^^^^^ |
| 03:10:09 | drbrain | if you're writing a scheme or bf interpreter, you're already far enough along |
| 03:14:11 | seydar | then i need to learn c++ |
| 03:14:22 | drbrain | not really |
| 03:14:30 | seydar | plus, i'm following a tutorial on the interpreter for scheme |
| 03:14:35 | drbrain | I barely know enough to be functional |
| 03:14:38 | seydar | hehe |
| 03:14:53 | seydar | what can i do to help with the VM then? |
| 03:14:55 | drbrain | that's fine, if you were taking a class, you'd be doing roughly the same thing |
| 03:15:16 | seydar | im am so thirsty to struggle with something interesting |
| 03:15:16 | drbrain | in a couple days we'll be back to running specs |
| 03:15:34 | drbrain | then you can try to figure out why things work in shotgun, but not in the VM |
| 03:15:41 | seydar | yess |
| 03:15:47 | seydar | "here, have a cookie" |
| 03:16:29 | seydar | sweet |
| 03:16:39 | seydar | im psyched now |
| 03:16:49 | seydar | i've got 15 minutes to kill, need me to do something/ |
| 03:17:22 | drbrain | nothing's coming to mind, since everybody is eating or whatever |
| 03:17:30 | drbrain | I'm trying to figure out why the stack seems messed up |
| 03:17:46 | seydar | pastie it |
| 03:18:02 | drbrain | ok |
| 03:18:24 | drbrain | so, in vm/llvm/instructions.rb in VMMethod::resume there's a #if 0 |
| 03:18:33 | drbrain | if you switch it to a 1, a bunch of crap gets dumped out |
| 03:19:07 | drbrain | so if I run RBX_RUNTIME=runtime vm/vm -e 'puts 3 + 4' |
| 03:19:17 | drbrain | I get those exceptions you were talking about |
| 03:19:32 | drbrain | when built with the dump-crap mode, I get this output: |
| 03:19:38 | drbrain | http://rafb.net/p/pi3Qnl29.html |
| 03:19:46 | drbrain | so there are two possible problems here |
| 03:20:05 | drbrain | oh, let me back up a step |
| 03:20:27 | drbrain | when I add a yield_gdb self in Kernel#gsub, I see that self is a Regexp, not a String |
| 03:20:38 | drbrain | if I add yield_gdb in String#gsub!, I see that self is a String |
| 03:20:45 | drbrain | so, the possible problems: |
| 03:21:28 | drbrain | a) the stack is off by one, and op_push_self ends up putting self (the String) out of range, and the first argument, pattern becomes self for the lookup |
| 03:21:34 | drbrain | b) op_push_self is broken (unlikely) |
| 03:21:42 | drbrain | c) op_send_stack_with_block is broken (unlikely) |
| 03:22:08 | drbrain | yeah, op_send_stack_with_block is called a bunch of times, so its probably ok |
| 03:22:13 | drbrain | same for op_push_self |
| 03:22:46 | seydar | so where could an OB1 error happen? |
| 03:23:42 | drbrain | OB1? |
| 03:23:49 | seydar | off by 1 |
| 03:23:58 | drbrain | that's hard to say |
| 03:24:15 | drbrain | I'm not familiar with the compiler or instructions.rb yet |
| 03:25:47 | seydar | ok. you know the setup of files better than i do, at least. lets start at the top |
| 03:26:20 | drbrain | well, first I was going to yield_gdb self in gsub! |
| 03:26:25 | drbrain | String#gsub! |
| 03:26:38 | drbrain | then breakpoint on op_send_stack_with_block to see if it was all set up right |
| 03:28:21 | drbrain | (I don't know if there's much you can do beyond listening, though :) |
| 03:28:24 | drbrain | :( |
| 03:28:52 | seydar | its fine, my dad tells me stories of when he would debug other people's code by talking to them |
| 03:29:45 | drbrain | ok, so I did that |
| 03:29:56 | seydar | whats the class of self? |
| 03:30:05 | drbrain | and I looked in the Message at the recv slot (which should be my String) |
| 03:30:10 | drbrain | it should be String |
| 03:30:26 | seydar | but what is it really? |
| 03:30:33 | drbrain | but instead I get: KERN_INVALID_ADDRESS at address: 0x54890824 |
| 03:31:05 | drbrain | ok, this is really bad |
| 03:31:22 | drbrain | task->state is 0x1002400, msg.state is 0xe4458bc2 |
| 03:31:32 | drbrain | and everything in this Message looks like it has a bogus address |
| 03:31:43 | seydar | sounds like you're on the edge of your memory |
| 03:31:59 | seydar | if i remember this one tangent a prof went on once about memory space and OSes |
| 03:32:17 | drbrain | oh, I was looking at the wrong one |
| 03:32:27 | drbrain | ok, now I've got something correct |
| 03:32:35 | drbrain | msg hadn't been assigned to yet |
| 03:32:47 | seydar | what file are you working in atm? |
| 03:32:49 | drbrain | ok, my recv is right |
| 03:33:31 | drbrain | send_stack_with_block in vm/instructions.rb |
| 03:35:01 | drbrain | oh, ha, I need to walk along further |
| 03:35:07 | drbrain | its reusing the current message |
| 03:35:59 | drbrain | so it still is all filled in for yield_gdb |
| 03:37:16 | drbrain | ok, so yeah, the stack is off by one |
| 03:38:03 | seydar | what is the equivalent of -> using .? doesn't -> pass pointers around? |
| 03:38:33 | drbrain | -> is used on pointers, . is used on non-pointers |
| 03:38:51 | drbrain | so if you see Object* foo, you would foo->method() |
| 03:38:57 | drbrain | for Object foo, foo.method() |
| 03:39:55 | drbrain | IIRC, Message& msg means msg is a reference to some other piece of memory, and has no local storage |
| 03:40:26 | seydar | gotcha |
| 03:40:28 | seydar | thanks |
| 03:42:01 | seydar | so what is calling op_push_self? |
| 03:42:14 | drbrain | the bytecode told it too |
| 03:42:56 | seydar | which bytecode? is it in send_stack_with_block? |
| 03:43:05 | seydar | wait, nvm |
| 03:43:12 | seydar | i understand what you're saying |
| 03:43:13 | drbrain | it's in runtime/core/string.rbc |
| 03:44:19 | drbrain | ok, so all these values are off by one, and there seems to be an extra nil on top of the stack |
| 03:44:44 | seydar | and is self not even on there? |
| 03:45:03 | seydar | You expected 'String -> Regexp -> String', and its 'Regexp -> String -> Nil'? |
| 03:45:04 | drbrain | self is down one further than it should be |
| 03:45:33 | seydar | if self were to be up one slot, would the nil still be there? |
| 03:45:39 | drbrain | at the start, the stack should have been (from the top) |
| 03:46:04 | drbrain | block, replacement, regexp, self |
| 03:46:13 | drbrain | instead it is nil, block, replacement, regexp, self |
| 03:46:21 | drbrain | yeah |
| 03:46:30 | seydar | bah humbug |
| 03:47:15 | seydar | can you take a look at what's below self in the correct run vs. the incorrect run? |
| 03:47:40 | drbrain | right now there's no correct run, so I'm mostly guessing what that would be |
| 03:47:49 | drbrain | below self is nil |
| 03:48:02 | seydar | that would complicate things |
| 03:48:31 | drbrain | its probably from some operation we're going to resume upon return from gsub! |
| 03:48:37 | drbrain | so it's really none of my business |
| 03:48:56 | seydar | so you think #gsub has the bug, not #gsub!? |
| 03:49:47 | drbrain | no, it's not in #gsub or #gsub! |
| 03:50:03 | drbrain | its in vm/instructions.rb *or* the compiler |
| 03:50:20 | Defiler | ooh someone said instructions.rb |
| 03:50:21 | seydar | but the compilter, isn't that the same from shotgun? |
| 03:50:33 | Defiler | It has been modified to suit the new VM |
| 03:50:34 | drbrain | since the same gsub, gsub! code works the same in shotgun |
| 03:50:39 | Defiler | and there could be problems with that transition |
| 03:50:40 | drbrain | no, there have been changes |
| 03:50:51 | drbrain | Defiler: I've got an off by one error |
| 03:50:52 | Defiler | we changed to left-to-right evaluation order |
| 03:50:57 | drbrain | try vm/vm -e 'puts 3 + 4' |
| 03:51:05 | drbrain | end up with it puking on $_ |
| 03:51:11 | Defiler | dude vm supports -e now? |
| 03:51:15 | Defiler | That is frikkin awesome |
| 03:51:22 | seydar | damn right it is |
| 03:51:24 | drbrain | since it called Regexp#gsub instead of String#gsub like it was supposed to |
| 03:51:29 | drbrain | it tries, but fails :) |
| 03:51:49 | Defiler | OK, let me gdb this bad boy |
| 03:51:59 | drbrain | self (the String) ends up one further down the stack |
| 03:52:07 | seydar | grab a monster and a bag of m&ms - you guys got this |
| 03:52:11 | drbrain | the easy way is to add yield_gdb to String#gsub! |
| 03:52:26 | seydar | later homefries |
| 03:52:27 | drbrain | then add a breakpoint on op_send_stack_with_block when you get there |
| 03:52:32 | drbrain | later |
| 03:52:43 | drbrain | a j over the raise will get you there |
| 03:53:28 | Defiler | aha |
| 03:54:35 | drbrain | so when you get there, and n down to at least msg.stack |
| 03:54:44 | drbrain | you can p *(js->stack - 2) then rp $whatever |
| 03:54:53 | drbrain | and find that its a Regexp instead of a String |
| 03:54:59 | drbrain | and that the String is at -3 |
| 03:56:12 | drbrain | oh, also, js->stack is nil, and js->stack - 1 is the block that should have been popped |
| 03:56:19 | drbrain | ... so then I've got two extra values? |
| 03:57:57 | drbrain | I'm going to start again from the top |
| 03:58:43 | Defiler | Why is there a 0x0 on the stack? |
| 03:58:51 | Defiler | at stack - 3? |
| 03:59:42 | drbrain | I have a Regexp |
| 04:00:16 | Defiler | OK I should see the problem if I step from here |
| 04:00:21 | drbrain | http://rafb.net/p/lQZruo44.html |
| 04:00:29 | Defiler | I think I have it in my sights |
| 04:01:11 | drbrain | that's before the msg.block = stack_pop() |
| 04:01:27 | Defiler | Ok, so this is the _get_field call for 'def env' on BlockContext |
| 04:01:45 | drbrain | maybe I didn't push that |
| 04:01:47 | Defiler | I think it is a name conflict in C++ |
| 04:01:57 | Defiler | because this is a blockcontext |
| 04:02:03 | Defiler | but it was showing MethodContext* in gdb |
| 04:02:11 | CIA-21 | * Wire up BlockContext::env to a primitive so we can fetch it - http://is.gd/1ZkC; 1f5c22a - Eric Hodel |
| 04:02:22 | drbrain | ok, try now |
| 04:02:51 | Defiler | I'm going to finish stepping to test my hypothesis first |
| 04:03:05 | drbrain | if it wasn't bitching about $_, you weren't in the same place |
| 04:03:33 | Defiler | it was bitching |
| 04:03:46 | drbrain | ok |
| 04:03:50 | Defiler | OK, so the top two items on the stack are reversed |
| 04:03:52 | Defiler | that is the problem |
| 04:03:57 | Defiler | so I vote compiler |
| 04:04:01 | Defiler | but let's see |
| 04:04:42 | Defiler | ok, not compiler |
| 04:05:15 | Defiler | damn, phone call |
| 04:05:29 | drbrain | me too, since this seems pretty straightforward for the instructions leading up to it |
| 04:10:38 | drbrain | oh, its one of these that comes after |
| 04:10:46 | drbrain | between 36 and 48 |
| 04:32:22 | brixen | hm, so attempting to find Class.allocate from a call to super() in Hash.allocate walks MT's in Hash, Enumerable, Object, and Kernel |
| 04:32:28 | brixen | so the same ancestors as MRI |
| 04:32:41 | brixen | but where is it supposed to look in Class? |
| 04:33:57 | drbrain | ... that sounds wrong |
| 04:34:11 | drbrain | shouldn't it be Hash, Class, Module, Object, Kernel? |
| 04:34:40 | brixen | well, dunno |
| 04:34:48 | brixen | le'me try to trace it in shotgun |
| 04:35:01 | drbrain | since you're calling Hash::allocate, instead of Hash#allocate |
| 04:35:06 | brixen | yeah |
| 04:47:30 | Defiler | Is it just me or is the stack null here? |
| 04:47:36 | Defiler | I'm looking at context_get_field |
| 04:47:40 | drbrain | it is |
| 04:47:52 | drbrain | oh, I don't know about that |
| 04:47:52 | Defiler | That seems bad. :) |
| 04:48:05 | drbrain | but, there's a pass through BlockPass' bytecode |
| 04:48:11 | drbrain | and this is obviously bad |
| 04:48:28 | drbrain | dup_top is_nil goto_if_true |
| 04:48:46 | Defiler | p js->stack is 0x0 |
| 04:49:07 | brixen | there was an sassert to prevent NULL from getting into the stack |
| 04:49:12 | drbrain | I'm not seeing that, but we're probably looking in different spots |
| 04:49:57 | brixen | in the define of stack_push |
| 04:49:58 | drbrain | no, this gsub! is called without a block |
| 04:50:11 | brixen | but not in stack_set_top |
| 04:50:15 | Defiler | msg.task->js->stack is 0x0 in rubinius::Task::send_message |
| 04:50:23 | Defiler | on the message that was built for this send |
| 04:50:29 | mass | is doing a restore wipe on his iphone |
| 04:50:35 | brixen | Defiler: perhaps add an sassert to stack_set_top |
| 04:50:40 | Defiler | That might be OK for all I know. just seems odd |
| 04:50:41 | mass | there is a crash report on it which causes the crash reporter to crash |
| 04:50:55 | drbrain | haha |
| 04:51:40 | mass | anytime I want a core file all I have to do is plug in a USB cable |
| 04:52:21 | mass | I wiped the crash report directory clean, plugged in the iphone, zipped up everything in the directory afterwards and attached it to a bug report. |
| 04:53:01 | brixen | according to ruby programming language, method lookup goes into included modules and ancestor modules, and then to superclasses |
| 04:53:35 | brixen | we're invoking method missing after looking in the modules |
| 04:53:46 | drbrain | still, there should be a Class andModule in that list |
| 04:53:54 | brixen | right |
| 04:54:00 | brixen | those would be superclasses |
| 04:56:10 | brixen | hmm, but class method resolution is a bit different |
| 04:56:28 | drbrain | ugh, this mismatch between compiler and instructions.rb is a PITA |
| 04:56:34 | drbrain | I can't find shit |
| 04:56:36 | Defiler | It would have to be, or it would be recursive, right? |
| 04:56:39 | drbrain | because none of the names match |
| 04:57:01 | Defiler | Maybe not |
| 04:58:32 | Defiler | How do I dump the gdb commands I have typed in this session so far to a file? |
| 04:58:40 | Defiler | or make a file that replays them? |
| 04:58:53 | drbrain | it should be in ~/.gdb_history |
| 05:25:18 | Defiler | oh hoh |
| 05:25:37 | Defiler | obj->reference_p() should always be true for Strings I assume? |
| 05:25:37 | Defiler | heh |
| 05:26:17 | Defiler | http://rafb.net/p/dU1BPV40.html |
| 05:26:32 | drbrain | should be true |
| 05:28:52 | Defiler | it is false for this one |
| 05:29:38 | brixen | what was the shortcut command for __show__(obj) ? |
| 05:29:43 | Defiler | rp |
| 05:29:46 | drbrain | rp |
| 05:29:55 | drbrain | see .gdb_init |
| 05:30:03 | drbrain | err, .gdbinit |
| 05:30:04 | Defiler | you can see me using it in that rafb paste as well |
| 05:30:18 | brixen | thanks |
| 05:31:14 | Defiler | huh. it appears to only be false in gdb, but the program flow is correct |
| 05:31:30 | Defiler | that's comforting ha ha |
| 05:31:54 | Defiler | what no it did it wrong wtf |
| 05:32:40 | Defiler | OK, what the hell is going on here? http://rafb.net/p/gUOaUa36.html |
| 05:32:43 | drbrain | I gave it up, it was too twisty |
| 05:33:08 | brixen | http://pastie.org/261459 |
| 05:33:14 | brixen | that's what I'm talking about |
| 05:33:18 | brixen | I'll push in a sec |
| 05:33:25 | brixen | should make inspecting LT's much nicer |
| 05:33:37 | Defiler | brixen: Cool |
| 05:34:04 | Defiler | Is it possible to see what value T::type has taken on in gdb? |
| 05:36:13 | Defiler | OK, I need to disable optimizations |
| 05:36:18 | Defiler | do we have an env var for it? |
| 05:36:21 | Defiler | or do I just hack the rakefile |
| 05:37:34 | drbrain | I don't think we do |
| 05:38:01 | Defiler | Yeah, no -O at all |
| 05:38:08 | Defiler | but gdb says "static field type optimized out" |
| 05:43:01 | evan | yeah |
| 05:43:06 | evan | const static == gone entirely |
| 05:47:10 | CIA-21 | * Teach LookupTable how to show itself in gdb. - http://is.gd/1ZrY; 1bad43c - Brian Ford |
| 05:47:46 | drbrain | sounds naughty |
| 05:47:50 | brixen | heh |
| 05:47:54 | Defiler | unified_load is so hideous |
| 05:47:59 | brixen | indeed |
| 05:48:09 | brixen | on both counts |
| 05:51:00 | Defiler | $LOAD_PATH is [0] |
| 05:51:04 | Defiler | Fun. |
| 05:52:05 | drbrain | it is? |
| 05:52:10 | Defiler | Yeah |
| 05:52:15 | drbrain | it was ['.'] on Monday |
| 05:53:20 | Defiler | $LOAD_PATH.unshift(*ENV['RUBYLIB'].split(':')) |
| 05:53:23 | Defiler | it is that line that does it |
| 05:53:59 | drbrain | awesome |
| 05:54:46 | Defiler | oh sorry |
| 05:54:55 | Defiler | it is this one |
| 05:54:55 | Defiler | $LOAD_PATH.insert($LOAD_PATH.index('.'), *additions) |
| 05:58:08 | Defiler | haha! |
| 05:58:10 | brixen | evan: got some spare cycles? |
| 05:58:15 | Defiler | Unable to load default compiler: No method 'ffi_get_field' on File::Stat::Struct (Class) |
| 05:58:29 | Defiler | FFI::Struct(File::Stat::Struct)#[] at kernel/platform/ffi.rb:604 |
| 05:58:47 | Defiler | Array#insert is hosed up |
| 05:58:54 | Defiler | but I don't have time to look at why right now |
| 05:59:08 | Defiler | Probably it is Array#[]= since insert doesn't do much work |
| 06:01:36 | Defiler | OK, so what do gsub! and Array#insert have in common |
| 06:02:10 | evan | brixen: sure, wassup |
| 06:02:17 | brixen | evan: http://pastie.org/261473 |
| 06:02:26 | evan | Defiler: ah, yes. the ffi_get_field/ffi_set_field aren't hooked up |
| 06:02:35 | evan | Defiler: they're all written in MemoryPointer |
| 06:02:40 | evan | need to be wired out primitives |
| 06:02:57 | brixen | evan: I'm trying to figure out why searching for .allocate from super() in Hash.allocate doesn't find Class |
| 06:03:09 | brixen | but it does in Rubinius::RubyConfig |
| 06:03:13 | brixen | for example |
| 06:03:19 | brixen | see top of pastie |
| 06:03:31 | Defiler | evan: How does $_ wire up in cpp? |
| 06:03:36 | brixen | I br on sendsite.cpp:72 and wait for :allocate to be called |
| 06:03:40 | evan | brixen: RubyConfig doesn't use super |
| 06:03:44 | brixen | yes |
| 06:03:51 | evan | brixen: so you mean why does going directly work |
| 06:03:55 | evan | but via super not |
| 06:03:59 | brixen | right |
| 06:04:23 | evan | ok |
| 06:04:27 | evan | there are a couple bugs I see |
| 06:04:30 | evan | in instructions.rb |
| 06:04:36 | evan | in all the send_super_* methods |
| 06:04:39 | Defiler | aha! |
| 06:04:44 | evan | msg.priv should be = true |
| 06:04:47 | evan | not using call_flags |
| 06:04:51 | brixen | k |
| 06:04:56 | evan | super calls by default can access private methods |
| 06:05:03 | evan | an no call_flags are emitted for supers |
| 06:05:13 | evan | so msg.priv was always false in a send_super_* |
| 06:05:15 | Defiler | We definitely have some kind of stack management bug here |
| 06:05:27 | evan | Defiler: there is no globals in C++ |
| 06:05:30 | Defiler | Coercion error: Proc.to_str => String failed |
| 06:05:32 | Defiler | etc |
| 06:05:43 | evan | ruby globals |
| 06:05:44 | Defiler | $_ is the wacky last match thing |
| 06:05:50 | Defiler | and it needs a field, right |
| 06:05:50 | evan | right |
| 06:05:52 | evan | no |
| 06:05:54 | evan | it does not. |
| 06:06:03 | Defiler | I thought we had it on MethodContext before? |
| 06:06:03 | evan | it didn't in shotgun |
| 06:06:05 | drbrain | no, $_ is the last thing read via Kernel#gets |
| 06:06:05 | evan | nope. |
| 06:06:20 | drbrain | but in the $_ case, it jumps from String#gsub to Kernel#gsub! |
| 06:06:26 | drbrain | because recv is wrong |
| 06:06:26 | evan | which is wrong |
| 06:06:33 | evan | it's actually right |
| 06:06:37 | evan | i was debugging that earlier today |
| 06:06:39 | Defiler | Also, we init it to nil |
| 06:06:45 | evan | i'm not sure why it didn't use String#gsub |
| 06:06:46 | Defiler | but it has a guard against nil |
| 06:07:11 | evan | Defiler: thats expected |
| 06:07:12 | evan | try in MRI |
| 06:07:15 | Defiler | Yeah |
| 06:07:21 | evan | >> p $_ # nil |
| 06:07:25 | evan | >> gsub |
| 06:07:28 | evan | TypeError: ... |
| 06:07:28 | Defiler | but that's why that error was confusing |
| 06:07:39 | Defiler | because it was nil due to not being set correctly |
| 06:07:46 | evan | no |
| 06:07:48 | evan | thats not true |
| 06:07:52 | evan | it's never been set |
| 06:07:55 | evan | thats why it's nil. |
| 06:07:59 | evan | why do you think it should be set to something? |
| 06:08:00 | Defiler | That's what I just said |
| 06:08:05 | drbrain | it shouldn't be set, we never should have called Kernel#gets |
| 06:08:12 | drbrain | err, we never called Kernel#gets |
| 06:08:23 | Defiler | gsub you mean right? |
| 06:08:28 | evan | no |
| 06:08:35 | evan | if Kernel#gets is not called |
| 06:08:37 | evan | $_ is nil |
| 06:08:43 | evan | thats MRI behavior |
| 06:08:52 | evan | if you call Kernel#gsub and $_ is nil |
| 06:08:55 | Defiler | Oh.. look at that.. Kernel(Regexp)#gsub in the backtrace |
| 06:08:56 | evan | you get a TypeError |
| 06:08:58 | evan | Defiler: yes |
| 06:08:59 | Defiler | that should never happen, right? |
| 06:09:02 | evan | exactly |
| 06:09:11 | evan | you're getting confused by something COMPLETELY different |
| 06:09:13 | Defiler | Sorry, it is late here. |
| 06:09:16 | evan | that code is calling the wrong gsub method. |
| 06:09:21 | evan | it should be calling String#gsub |
| 06:09:28 | evan | but for some reason, it finds Kernel#gsub |
| 06:09:34 | drbrain | yeah, somehow there's an extra thingy on the stack |
| 06:09:36 | evan | I was going to track that a bit tonight |
| 06:09:50 | Defiler | It would be nice to add a locate_method test for this |
| 06:09:59 | drbrain | evan: the pattern you called String#gsub! with ends up as self for the next call |
| 06:10:12 | drbrain | it's not a problem looking up methods, it's that recv is wrong |
| 06:10:33 | evan | you mean the " str = gsub(pattern, replacement, &block) |
| 06:10:35 | evan | line right? |
| 06:10:45 | evan | the receiver of the gsub message is something weird |
| 06:10:47 | evan | NOT self |
| 06:10:53 | evan | thats what you're assuming yes? |
| 06:10:56 | drbrain | right |
| 06:11:01 | evan | right |
| 06:11:05 | evan | i wasn't going to assume that |
| 06:11:07 | evan | i was going to verify it |
| 06:11:30 | drbrain | I walked around in gdb when it's setting up the #gsub call, and the stack is off by one |
| 06:11:47 | evan | oh! got a op trace run? |
| 06:12:14 | drbrain | http://rafb.net/p/IOPhCs80.html |
| 06:14:30 | evan | ok, one sec. |
| 06:14:35 | evan | i'm comparing it to a compiler stream output |
| 06:14:47 | evan | perhaps block_pass is going the wrong place on the stack |
| 06:15:04 | drbrain | maybe, there doesn't seem to be a block to pass in this code |
| 06:15:09 | evan | sure there is |
| 06:15:14 | evan | gsub(pattern, replacement, &block) |
| 06:15:17 | evan | the &block |
| 06:15:17 | drbrain | the call in __split_path__ above it is: |
| 06:15:27 | drbrain | path.gsub!(/\.(so|bundle|dll|dylib)$/, ".#{Rubinius::LIBSUFFIX}") |
| 06:15:32 | drbrain | should be nil |
| 06:15:36 | drbrain | that's all |
| 06:15:38 | evan | huh? |
| 06:15:49 | evan | i guess we're looking 2 different places |
| 06:16:01 | evan | i'm just trynig to figure out why gsub! isn't calling the right gsub |
| 06:16:08 | evan | how it got there doesn't directly concern me |
| 06:16:14 | drbrain | ok |
| 06:16:27 | evan | because this is pretty basic functionality |
| 06:16:41 | drbrain | in my particular case of analyzing this, it's called from __split_path__ when I do vm -e 'puts 3 + 4' |
| 06:16:57 | drbrain | so for this run through the opcode stream, the block should be nil |
| 06:17:13 | evan | ah! ok. |
| 06:17:16 | evan | i see why you bring that up |
| 06:17:17 | evan | ok |
| 06:17:19 | evan | thats good |
| 06:17:23 | evan | it's secondary confirmation |
| 06:17:52 | Defiler | I'm running a conditional breakpoint for when the message name is the symbol :gsub! |
| 06:17:56 | Defiler | hopefully that will work |
| 06:18:15 | evan | the compiler output is pretty clearly fucked up |
| 06:18:35 | evan | http://rafb.net/p/BSnxGP22.html |
| 06:18:45 | evan | thats 'gsub(1,2,&3)' |
| 06:19:00 | evan | see the weird [:find_const, 0] stuck in the stream? |
| 06:19:04 | evan | thats the problem |
| 06:19:10 | Defiler | Whoa |
| 06:21:36 | Defiler | are we sure class Alias in bytecode.rb is right? |
| 06:21:54 | Defiler | and if so, is VAlias just under it wrong? |
| 06:21:56 | evan | pretty sure |
| 06:23:56 | evan | Defiler: whats wrong with them? |
| 06:24:33 | Defiler | reversed args on the stack |
| 06:24:35 | Defiler | just wondering |
| 06:25:02 | evan | check Globals.add_alias |
| 06:25:10 | evan | perhaps it's expecting that order |
| 06:25:19 | evan | which probably should be changed |
| 06:25:21 | evan | if it does. |
| 06:26:35 | evan | yep |
| 06:26:36 | Defiler | This looks like blockpass bytecode |
| 06:26:38 | evan | class BlockPass was wrong |
| 06:26:44 | evan | it as leaving the Proc constant on the stack |
| 06:26:47 | evan | if the block was nil |
| 06:26:49 | evan | fixed |
| 06:26:50 | evan | testing now. |
| 06:26:52 | Defiler | oh, I see it |
| 06:26:55 | evan | yeah |
| 06:26:59 | evan | thats just a fuck up my be |
| 06:27:05 | evan | when rotating the stack |
| 06:27:32 | evan | yep |
| 06:27:34 | evan | that fixed it. |
| 06:27:37 | evan | i'll push |
| 06:27:45 | Defiler | cool |
| 06:28:35 | CIA-21 | * Fix BlockPass from leaving crap on the stack - http://is.gd/1Zuw; 0eb736a - Evan Phoenix |
| 06:28:58 | evan | ok |
| 06:29:03 | evan | now $LOAD_PATH is getting Fixnums in it |
| 06:29:05 | evan | it seems |
| 06:29:12 | Defiler | I have a fix for that here |
| 06:29:20 | Defiler | but it presumably is caused by another problem we actually need to fix |
| 06:29:27 | evan | oh? |
| 06:29:32 | evan | wassat |
| 06:29:34 | Defiler | It was happening in Array#insert though, and it was too complicated to want to debug this with |
| 06:29:47 | Defiler | in loader.rb there is a call to insert that I switched to be an unshift |
| 06:29:49 | Defiler | and that made it happy |
| 06:30:03 | evan | ah, so #insert is busted |
| 06:30:35 | brixen | my turn |
| 06:30:46 | evan | Defiler: ok, did that |
| 06:30:46 | Defiler | Try it with that |
| 06:30:51 | Defiler | (pushed) |
| 06:30:51 | evan | see it blow up on ffi_get_field |
| 06:30:56 | CIA-21 | * Use unshift instead of insert in loader.rb - http://is.gd/1ZuI; 83f5d4d - Wilson Bilkovich |
| 06:30:58 | Defiler | Yeah, cool. |
| 06:31:38 | evan | brixen: ok go! |
| 06:31:52 | evan | YAY! |
| 06:31:52 | brixen | how do we add assertions for msg.priv = true in these instructions tests? |
| 06:31:59 | evan | got 15 new HD channels today! |
| 06:32:20 | brixen | and I only see two send_super_* instructions, one already had msg.priv = true |
| 06:32:26 | brixen | changing the other didn't help |
| 06:32:27 | drbrain | I might consider getting cable if I could get only HD channels |
| 06:32:49 | CIA-21 | * Adjust field widths to be more sane - http://is.gd/1ZuP; 57c23e6 - Eric Hodel |
| 06:32:53 | brixen | I don't see how send_xx is the problem when it's not looking in the right modules |
| 06:33:15 | evan | brixen: ok |
| 06:33:19 | evan | well, it was a shot in the dark |
| 06:33:21 | evan | and it was wrong |
| 06:33:22 | mernen | hey, I |
| 06:33:25 | mernen | whoops |
| 06:33:55 | mernen | hey, I've got a couple patches to make the test suite compile under gcc 4.2. They don't pass, but well, it's a start |
| 06:34:11 | mernen | just tested, it still passes cleanly on osx |
| 06:34:24 | mernen | any problem if I push them? |
| 06:34:37 | evan | mernen: what OS? |
| 06:34:40 | evan | we're all on gcc 4.2 |
| 06:34:41 | evan | on OS X |
| 06:34:54 | mernen | ubuntu 8.10 |
| 06:35:04 | brixen | I'm on 4.0.1 on os x |
| 06:35:13 | evan | oh! |
| 06:35:14 | Defiler | evan: are ffi_get_field and memorypointer_get_field different? |
| 06:35:15 | evan | i guess so am I |
| 06:35:15 | dbussink | 4.0.1 is still the default on os x |
| 06:35:17 | evan | der. |
| 06:35:20 | mernen | yeah, I'm on 4.0.1 here too |
| 06:35:27 | evan | mernen: yeah, go ahead and push |
| 06:35:50 | evan | Defiler: all ffi_get_field should become memorypointer_get_field |
| 06:35:56 | Defiler | OK, thought so |
| 06:35:59 | evan | ditto for ffi_set_field |
| 06:36:32 | evan | brixen: alrighty |
| 06:36:43 | evan | a quick run down |
| 06:36:53 | evan | calling super() in Hash.allocate doesn't find Class.allocate |
| 06:36:55 | evan | correct? |
| 06:36:59 | brixen | yep |
| 06:37:16 | evan | I'm wondering if Hash's metaclass isn't hooked up right |
| 06:37:22 | evan | that could cause the problem too |
| 06:37:24 | brixen | me too |
| 06:37:30 | brixen | but Hash is pure ruby |
| 06:37:44 | evan | but the way Hash, the class, is created, isn't |
| 06:37:44 | brixen | so, not sure where to start tracking that |
| 06:37:54 | evan | wow, WAY too many commas in that sentence |
| 06:37:58 | evan | that was like comma crack |
| 06:38:04 | brixen | heh |
| 06:38:10 | Defiler | evan: Right now, ffi_get_field (now memorypointer) is hooked up via an attach_function call |
| 06:38:18 | Defiler | Shouldn't I make a method that wraps the primitive in the kernel |
| 06:38:20 | Defiler | instead? |
| 06:38:25 | CIA-21 | * Use unsigned literals to make stricter compilers (gcc 4.2) happier. - http://is.gd/1Zv5; 8ca001a - Daniel Luz |
| 06:38:27 | CIA-21 | * Declare test string buffers as char[] to ensure their mutability. Required for gcc 4.2. - http://is.gd/1Zv7; e1cce51 - Daniel Luz |
| 06:38:29 | CIA-21 | * Cast comparison value to native_int to make stricter compilers happy. - http://is.gd/1Zv8; 32bc147 - Daniel Luz |
| 06:38:38 | evan | Defiler: it should be a primitive instead, yes. |
| 06:39:32 | brixen | evan: I don't understand what ya mean by Hash, the class, the way it is created, is not pure ruby |
| 06:39:52 | evan | brixen: you have |
| 06:39:53 | evan | class Hash |
| 06:39:54 | evan | at the top |
| 06:40:03 | evan | how does that go off and create a Hash? |
| 06:40:16 | evan | it uses the open_class instruction |
| 06:40:21 | evan | which is not in ruby |
| 06:40:27 | brixen | right |
| 06:40:32 | evan | thats what I mean. |
| 06:40:35 | brixen | k |
| 06:40:44 | brixen | there's no special constructor for it, is what I mean |
| 06:40:47 | brixen | by pure ruby |
| 06:40:49 | evan | right |
| 06:40:51 | evan | gotcha |
| 06:41:02 | evan | but the metaclass should be hooked up correctly by open_class |
| 06:41:06 | evan | so we should look in that direction |
| 06:41:09 | brixen | k |
| 06:41:19 | evan | the test_open_class should verify our assumptions |
| 06:41:33 | evan | i'm going to go watch project runway a bit |
| 06:41:41 | evan | but here's the test params |
| 06:42:07 | evan | the new class's metaclass should have a superclass that points to the metaclass of the classes superclass |
| 06:42:15 | evan | does that make sense? |
| 06:42:19 | brixen | yep |
| 06:42:30 | evan | so, write a test for that assumption |
| 06:42:33 | evan | and we'll go from there |
| 06:42:35 | brixen | k |
| 06:45:20 | evan | let me know how that goes |
| 06:45:41 | brixen | k |
| 06:46:09 | Defiler | hell yeah got it |
| 06:46:30 | Defiler | no such file to load -- compiler/init |
| 06:46:36 | Defiler | is the new error |
| 06:47:01 | evan | cool |
| 06:47:04 | evan | call it a night |
| 06:47:09 | evan | go play |
| 06:47:10 | evan | :D |
| 06:47:44 | Defiler | http://rafb.net/p/21pyzI13.html |
| 06:47:47 | Defiler | that looks OK, right? |
| 06:48:17 | evan | sure |
| 06:48:30 | evan | def memorypointer_get_field |
| 06:48:33 | evan | is quite a mouthful |
| 06:48:34 | Defiler | I guess the wrapper could be called 'set_field' but that name is so scary heh |
| 06:48:34 | evan | but fine. |
| 06:48:47 | Defiler | I can easily rename it |
| 06:48:54 | evan | I should probably banish 'field' from my method naming vocab |
| 06:49:11 | Defiler | How about 'set_at_offset' and 'get_at_offset'? |
| 06:49:19 | evan | great |
| 06:52:05 | Defiler | When we get mspec up and running I am going to take a chainsaw to kernel/common/compile.rb |
| 06:52:13 | Defiler | Chainsaw Maid |
| 06:52:36 | evan | it's been quite a pain |
| 06:52:42 | evan | but yeah, |
| 06:52:47 | evan | the impl is crazy. |
| 06:53:08 | Defiler | Not touching it until the require tests are passing though heh |
| 06:53:20 | evan | good plan |
| 06:55:55 | brixen | evan: did you explain this before? what happened to push_encloser? |
| 06:56:16 | evan | it was pre-StaticScope |
| 06:56:26 | brixen | ok, opcode docs are out of date |
| 06:56:30 | evan | so I finally eliminated it |
| 06:56:36 | Defiler | It turned out to be crazy hard to try to manage the scopes at that level |
| 06:56:37 | evan | add_scope is used now |
| 06:56:51 | brixen | k |
| 06:56:55 | CIA-21 | * Avoid creating an extra BlockContext on every require - http://is.gd/1Zwz; fba6b2c - Wilson Bilkovich |
| 06:56:59 | evan | as the first instruction of a module/class body |
| 06:56:59 | CIA-21 | * Rename memorypointer_*_field prims to _*_at_offset and wire them. - http://is.gd/1ZwA; 47ef8d3 - Wilson Bilkovich |
| 06:59:22 | CIA-21 | * Correct the primitive name in ffi.rb (oops) - http://is.gd/1ZwE; 68af39d - Wilson Bilkovich |
| 07:00:29 | Defiler | http://rafb.net/p/3bbwr670.html |
| 07:00:33 | Defiler | leaving it there for the night |
| 07:00:59 | evan | Defiler: looks good |
| 07:01:00 | evan | ! |
| 07:03:12 | drbrain | "compiler/init..bundle" |
| 07:03:15 | drbrain | ha! |
| 07:03:55 | Defiler | You probably still have that gsub commented out? |
| 07:04:31 | drbrain | nope |
| 07:04:39 | drbrain | it seems broken |
| 07:05:11 | drbrain | (the gsub) |
| 07:05:11 | Defiler | this code uses a ton of masgn |
| 07:05:17 | Defiler | Any chance we still have masgn problems? |
| 07:05:23 | drbrain | could be LIBSUFFIX or path |
| 07:05:27 | drbrain | err, gsub |
| 07:05:41 | drbrain | I'm seeing File.file? return false for a file that exists |
| 07:05:59 | Defiler | that sounds fruitful |
| 07:07:29 | drbrain | haha, to_s(2) doesn't work |
| 07:11:31 | drbrain | heh, this file is regular and a character device! |
| 07:11:38 | evan | hehe |
| 07:13:55 | drbrain | and something else |
| 07:14:45 | drbrain | I'm too tired to look at this any further tonight |
| 07:14:49 | drbrain | 'night! |
| 07:14:51 | evan | nite! |
| 07:27:48 | evan | RAWR. |
| 07:28:01 | evan | 64bit stat strikes again! |
| 07:35:17 | CIA-21 | * Fix so ffi_stat calls the 64bit version of stat - http://is.gd/1Zz6; 0144441 - Evan Phoenix |
| 07:35:20 | CIA-21 | * Fail hard if compiler/init.rbc is missing - http://is.gd/1Zz7; 5dd02c5 - Evan Phoenix |
| 07:42:46 | Defiler | badass |
| 07:42:46 | dbussink | evan: hmm, shotgun used compiler flags for those 64 bit fs support |
| 07:42:53 | Defiler | Called unbound or invalid primitive from: load_from_file |
| 07:43:05 | evan | Defiler: yep |
| 07:43:08 | evan | fixing that now |
| 07:43:16 | evan | we've got a pure ruby unmarshaler now |
| 07:43:22 | evan | just got to wire it in |
| 07:43:32 | Defiler | awesome |
| 07:43:32 | evan | dbussink: yeah, I know |
| 07:43:34 | evan | dbussink: thats a hack |
| 07:43:54 | dbussink | maybe we want a central header that handles this kind of stuff? |
| 07:44:10 | dbussink | so it sets up all defines for various platforms |
| 07:44:32 | evan | probably eyah |
| 07:45:13 | Defiler | I guess we need loader.rb to figure out whether it is running from an install or from a checkout |
| 07:45:33 | Defiler | Looking at that todo in there that wants to use the configure-based lib path |
| 07:45:53 | Defiler | If we turned that on we would end up loading installed libs when we wanted libs in the checkout I think |
| 07:46:01 | evan | well |
| 07:46:06 | evan | configure-based is compile time only |
| 07:46:09 | evan | it's not dynamic |
| 07:47:36 | Defiler | That's what I mean |
| 07:47:49 | Defiler | if we pull it in in the loader, it will be the same value every time, even if we are running from checkout |
| 07:48:42 | Defiler | There should really be a __DIR__ method like the __FILE__ method |
| 07:48:58 | Defiler | since so many people do File.dirname(__FILE__) blah |
| 07:51:45 | headius | evan: I had an idea |
| 07:51:55 | evan | gets the media on the phone |
| 07:51:57 | evan | :D |
| 07:52:27 | headius | actually, it's fading now |
| 07:52:46 | headius | I was thinking duby could target rubinius bytecode also but that wouldn't really gain you anything without static-typed opcodes |
| 07:52:54 | headius | it would basically just erase the types |
| 07:53:32 | headius | trying to think of a better way to build the native (C/ASM/whatever) backend |
| 07:54:01 | headius | dumping out C code is gross and problematic because where C requires explicit exit points Ruby allows implicit exit points |
| 07:54:09 | evan | yep |
| 07:54:23 | evan | so, what do ya get by dumping out rubinius bytecode? |
| 07:54:25 | headius | dumping JVM bytecode or rbx bytecode is trivial because you just return the last value |
| 07:54:48 | headius | since all bodies eventually leave something on the stack |
| 07:54:56 | headius | well, I guess not a whole lot |
| 07:55:11 | headius | the benefit of duby is in the inferred types |
| 07:55:45 | headius | I suppose if you added a send operation that could be statically bound at load time, it could make use of that |
| 07:56:23 | evan | hm |
| 07:56:24 | headius | argument types aren't really important, but if there were a static_send with a type path declaration, duby could emit that |
| 07:56:59 | headius | the protocol would be that it binds to the method present when that bytecode is loaded |
| 07:57:11 | headius | forever |
| 07:58:00 | headius | similar to JVM's invoke bytecodes but without requiring a static signature as well |
| 08:00:34 | headius | anyway |
| 08:00:36 | headius | back to work |
| 08:02:13 | evan | headius: how late do you work? |
| 08:02:29 | headius | until I can't keep my eyes open anymore |
| 08:02:41 | headius | llvm isn't stack-based, is it |
| 08:02:45 | evan | nope |
| 08:02:49 | headius | darn |
| 08:02:49 | evan | SSA |
| 08:02:59 | evan | it's super easy to make it stack based though |
| 08:03:16 | headius | that might be the easiest native backend for duby |
| 08:03:17 | evan | you just assign everything to a variable |
| 08:03:22 | evan | and return the name of the variable you assign to |
| 08:03:29 | evan | so you basically have a pointer to the top of the stack |
| 08:03:36 | headius | I'll have to look into that later |
| 09:50:22 | evan | HOT. |
| 09:50:33 | evan | got lib/compiler/init.rbc loaded. |
| 10:43:21 | dbussink | evan: party time! |
| 14:53:48 | rue | Good morning |
| 17:13:31 | rue | Evening |
| 17:15:17 | dbussink | rue: howdy |
| 17:21:11 | brixen | can I get another pair of eyes on this: http://pastie.org/261822 |
| 17:21:19 | brixen | or eye if that's all you can spare ;) |
| 17:21:31 | brixen | the rbx section is from shotgun |
| 17:21:36 | brixen | not cpp |
| 17:22:22 | brixen | looks like we're not setting up F.metaclass.superclass correctly |
| 17:22:54 | brixen | I'm going to try to figure out what cpp does now |
| 17:23:15 | Defiler | check out attach_metaclass probably |
| 17:24:38 | brixen | Defiler: but would you agree that we appear to be doing it wrong in shotgun? |
| 17:25:08 | brixen | what I believe evan told me was that: F.metaclass.superclass == F.superclass.metaclass |
| 17:25:15 | brixen | which is true in shotgun, but false in MRI |
| 17:25:25 | brixen | so, I'm trying to figure out if evan is confused or I am :) |
| 17:25:57 | brixen | alternatively, parse this line: |
| 17:25:58 | brixen | 22:42 evan >> the new class's metaclass should have a superclass that points to the metaclass of the classes superclass |
| 17:26:29 | brixen | Guest76243: cloking? |
| 17:26:31 | brixen | heh |
| 17:26:51 | brixen | or cloaking if you're a native speller :P |
| 17:27:44 | rue | Actually |
| 17:29:09 | rue | The superclass of an object's metaclass should be the metaclass of the object's class' superclass |
| 17:29:11 | rue | I think |
| 17:29:22 | brixen | rue: use ruby please :P |
| 17:30:15 | brixen | did you mean? F.metaclass.superclass == F.class.superclass.metaclass |
| 17:30:22 | brixen | because that's false in MRI |
| 17:32:26 | Defiler | what is Class.metaclass in rbx? |
| 17:32:57 | Defiler | Class itself, right? |
| 17:33:14 | brixen | MetaClass Class |
| 17:33:30 | rue | class A; end; class B < A; end; b = B.new; b.class => B; b.class.superclass => A; b.metaclass => MetaB; b.metaclass.class => (Metaclass or Class) |
| 17:33:44 | rue | Remember, MRI does not have MetaClass |
| 17:33:52 | brixen | it does |
| 17:34:01 | brixen | it just doesn't have a nice way to get it |
| 17:34:16 | brixen | it doesn't have a class MetaClass |
| 17:34:21 | rue | Correct |
| 17:34:21 | brixen | it's anonymous |
| 17:34:37 | rue | The class of a MRI metaclass is Class |
| 17:34:49 | brixen | same with rbx |
| 17:34:49 | rue | The class of an rbx metaclass is MetaClass |
| 17:34:53 | brixen | MetaClass < Class |
| 17:35:06 | rue | Not the same, you have an extra step in the chain |
| 17:35:21 | brixen | hmm |
| 17:36:22 | brixen | rue: so, you're saying this is correct in rbx: F.metaclass.superclass == F.superclass.metaclass # => true |
| 17:39:24 | Defiler | Is there code that isn't working, or does it just seem odd? |
| 17:40:04 | brixen | Defiler: super() is not working |
| 17:40:34 | Defiler | Got some sample code? |
| 17:40:39 | brixen | so, in rbx, F.superclass.metaclass == MetaObject, F.superclass.metaclass == MetaObject |
| 17:40:41 | Defiler | Or is it any use of super at all? |
| 17:40:57 | brixen | class Hash; def self.allocate; super(); end; end |
| 17:40:58 | Defiler | you have one of those reversed |
| 17:41:04 | brixen | not in rbx |
| 17:41:06 | brixen | try it |
| 17:41:12 | Defiler | You wrote the same line twice |
| 17:41:17 | brixen | erg |
| 17:41:33 | brixen | F.metaclass.superclass == MetaObject |
| 17:41:33 | Defiler | Does super work in instance methods? |
| 17:41:36 | brixen | in the second |
| 17:42:09 | brixen | in MRI: F.superclass.metaclass == MetaClass:Class (<Class:Class>) |
| 17:42:18 | brixen | F.metaclass.superclass == MetaObject |
| 17:43:00 | brixen | Defiler: I haven't tried instance methods |
| 17:43:41 | Defiler | I get "Called unbound or invalid primitive from: open_with_mode" |
| 17:43:54 | Defiler | when I try to run a script with an instance method call to super |
| 17:44:28 | brixen | k |
| 17:44:33 | evan | morning |
| 17:44:37 | brixen | morning |
| 17:44:46 | brixen | nice work on loading compiler/init :) |
| 17:44:50 | evan | thanks! |
| 17:44:57 | evan | went on a bit of a tear |
| 17:45:00 | evan | last night |
| 17:45:03 | brixen | no doubt |
| 17:45:05 | Defiler | Yeah, saw that. Heh |
| 17:45:08 | brixen | surprised you're awake |
| 17:45:33 | Defiler | brixen: What local changes do you have? |
| 17:46:15 | brixen | nothing that would affect this |
| 17:46:36 | Defiler | OK, so what happens when you try to run RBX_RUNTIME=runtime vm/vm some.rbc |
| 17:46:44 | Defiler | where some.rb is just (3 + 4).__show__ ? |
| 17:47:08 | rue | brixen: I have not quite decided yet :P |
| 17:47:12 | brixen | rue: k |
| 17:47:19 | evan | brixen: you can't look at the proper superclass in MRI |
| 17:47:22 | evan | to test that |
| 17:47:26 | evan | it skips it. |
| 17:47:35 | brixen | evan: ok, so shotgun is right? |
| 17:47:45 | evan | so you can't ask F.metaclass.superclass and get the correct answer |
| 17:47:51 | evan | yeah, shotgun is correct |
| 17:47:53 | brixen | k |
| 17:48:04 | brixen | I need help writing the test in open_class to show this |
| 17:48:37 | brixen | I tried this: http://pastie.org/261852 |
| 17:48:55 | brixen | also, I'm still on page 0 of "how to write instruction tests" :P |
| 17:49:04 | rue | Hm |
| 17:50:01 | brixen | Defiler: I can't load all of runtime because I have a Hash class that expects to call super() in .allocate |
| 17:50:13 | brixen | and other kernel stuff needs to instantiate a Hash |
| 17:50:30 | evan | brixen: that seems fine |
| 17:50:40 | Defiler | Yeah, it looks OK to me too |
| 17:50:50 | brixen | evan: excellent, cus it fails :) |
| 17:50:56 | evan | bingo |
| 17:51:20 | Defiler | so the superclass of the attached metaclass is being set to what? |
| 17:51:31 | evan | oh wait. |
| 17:51:32 | Defiler | Can you add a local variable there and print it? |
| 17:51:33 | evan | hold on. |
| 17:51:45 | evan | test_open_class isn't asking for a subclass of TrueClass |
| 17:51:50 | evan | which is what you're testing |
| 17:51:54 | Defiler | ohhh yeah |
| 17:51:56 | brixen | yeah, that's my problem |
| 17:51:58 | Defiler | it is just a constant on TrueClass |
| 17:52:10 | evan | the 'task->push(Qnil)" |
| 17:52:16 | evan | replace the Qnil with an existing class |
| 17:52:28 | brixen | why wouldn't that be open_class_under? |
| 17:52:31 | evan | no |
| 17:52:37 | evan | open_class_under is for the syntax |
| 17:52:39 | evan | class A::B |
| 17:52:39 | Defiler | replace it with G(true_class) |
| 17:52:44 | Defiler | instead of Qnil |
| 17:52:47 | Defiler | and see what happens |
| 17:52:47 | brixen | k |
| 17:52:49 | evan | under refers to where the constant is located |
| 17:52:51 | evan | not it's superclass |
| 17:52:59 | brixen | and why is SS set to G(true_class) |
| 17:53:05 | brixen | I can't find docs on that either :P |
| 17:53:25 | Defiler | We are opening class 'C' inside TrueClass |
| 17:53:34 | Defiler | so the sendsite is on trueclass |
| 17:53:38 | evan | yes |
| 17:53:40 | brixen | k |
| 17:53:45 | evan | thats testing that open_class uses the current lexical scope |
| 17:53:56 | evan | the StaticScope stuff sets up the lexical scope |
| 17:54:25 | brixen | k |
| 17:54:28 | Defiler | It is a little confusing because the scenario being set up in this test is unlikely in real life |
| 17:54:40 | Defiler | but the same functions are being called at least |
| 17:54:49 | brixen | I basically understood that, but translating it into code is the problem |
| 17:54:56 | brixen | we need docs on how to write instruction tests |
| 17:54:58 | mass | good day everyone |
| 17:55:03 | mass | &yawn; |
| 17:55:03 | brixen | hides |
| 17:55:06 | Defiler | brixen: I will do some |
| 17:55:15 | brixen | Defiler: you will be my hero |
| 17:55:16 | Defiler | since I've got more of them to do today |
| 17:55:17 | brixen | again :) |
| 17:55:18 | mass | I nominate brixen |
| 17:55:42 | Defiler | Actually, I do have one question about them that evan can probably answer |
| 17:55:57 | brixen | ok, that test passes if task->push(G(true_class)) |
| 17:55:58 | Defiler | When we declare the 'stream' opcode array in the test glue.. |
| 17:55:58 | evan | yessum? |
| 17:56:14 | Defiler | Is it OK to fill that with zeroes first? |
| 17:56:21 | evan | fill what? |
| 17:56:24 | evan | your lunch box? |
| 17:56:25 | Defiler | the memory |
| 17:56:38 | evan | replace that with a real noun |
| 17:56:53 | brixen | right, so you don't have to do stream[1] = (opcode)0; all the time |
| 17:56:58 | brixen | or stream[n] |
| 17:56:59 | Defiler | In memory, 'stream' starts with the opcodes we are going to run for this test |
| 17:57:04 | Defiler | No, you would still need that |
| 17:57:16 | brixen | if they were all 0 to begin with? |
| 17:57:20 | evan | so whats 'that'? |
| 17:57:29 | Defiler | but when you ask gdb to print the stream, it has a bunch of values after the section that this test will run() |
| 17:57:34 | rue | Hm, no, I do not think that `B.metaclass.superclass == B.superclass.metaclass` should be true |
| 17:57:50 | Defiler | that I have been assuming are just previous values/objects residing in that region of memory. am I wrong about that? |
| 17:58:19 | Defiler | brixen: 0 isn't arbitrary.. when you see instruction tests setting it that way, it is because the opcode they are going to run takes arguments, and we are passing it a zero |
| 17:58:33 | Defiler | It just so happens that the tests often use 0 for their index, etc.. but it could also be 11 |
| 17:58:36 | brixen | ok |
| 17:58:42 | evan | Defiler: i still don't get what you're asking |
| 17:58:46 | brixen | can we ditch run() as well |
| 17:58:49 | Defiler | Let me paste a gdb session |
| 17:58:51 | evan | brixen: no |
| 17:58:59 | Defiler | I don't see how, since you need to be able to have multiple per test method |
| 17:59:00 | evan | it has to be there |
| 17:59:05 | evan | otherwise, how is the code run? |
| 17:59:09 | brixen | why does it have to be a macro |
| 17:59:15 | brixen | why not the real code? |
| 17:59:33 | evan | because it abstracts the tests from knowing their setup |
| 17:59:45 | evan | which has saved me from having to edit every damn test a number of times |
| 17:59:47 | brixen | k, well with docs it will be better |
| 17:59:52 | brixen | right now it's just confusing IMO |
| 18:00:13 | evan | why? |
| 18:00:15 | brixen | run() // magic happens here |
| 18:00:18 | evan | so we can document it |
| 18:00:18 | Defiler | sec. someone at the door |
| 18:00:29 | evan | run() means "perform the opcode you're testing" |
| 18:00:45 | evan | perhaps a better name is in order |
| 18:01:04 | rue | perform_the_opcode_being_tested() |
| 18:01:26 | brixen | I'm just saying, looking at the tests was like my first month of learning spanish, I understood every few words but no sentences |
| 18:01:31 | evan | perhaps a bit verbose |
| 18:02:03 | evan | brixen: thats true of any framework you don't know. |
| 18:02:04 | brixen | probably 20 lines of docs at the top would do |
| 18:02:30 | evan | if you need a rails analogy, run == render |
| 18:02:48 | brixen | I don't need an anology |
| 18:02:59 | brixen | I need a connection between run() (empty meaning) and task-> |
| 18:03:03 | brixen | which does stuff |
| 18:03:11 | Defiler | evan: http://rafb.net/p/VypFvj18.html |
| 18:03:13 | brixen | once I looked at the gen'd test file it made more sense |
| 18:03:30 | Defiler | That's what I mean.. 29 is the opcode we are testing, and that line is about to set the open_class index to zero.. |
| 18:03:42 | Defiler | ..but the stuff after it isn't going to be run just now in this test, no? |
| 18:03:47 | evan | Defiler: oh. |
| 18:04:13 | evan | Defiler: sure |
| 18:04:21 | Defiler | brixen: #define run(val) task->execute_stream(stream) |
| 18:04:22 | evan | just add a memset() in the setup code |
| 18:04:30 | Defiler | OK, cool. Doing that |
| 18:04:41 | brixen | Defiler: yeah, got that |
| 18:04:53 | Defiler | So we could just replace the 'runs' with calls to that |
| 18:05:37 | brixen | Defiler: if you could just doc a test, we'll see if that helps others with the confusion |
| 18:06:30 | Defiler | Will do |
| 18:06:49 | brixen | thanks |
| 18:07:39 | rue | This is a bit complicated, actually |
| 18:09:21 | Defiler | (gdb) p stream |
| 18:09:22 | Defiler | $1 = {0 <repeats 100 times>} |
| 18:09:23 | Defiler | hell yeah |
| 18:10:05 | rue | Because an MRI metaclass' superclass is always a metaclass |
| 18:10:16 | Defiler | god damn that is so much easier to read |
| 18:14:06 | drbrain | what's our status this morning? |
| 18:14:38 | evan | lib/compiler/init.rbc is loading |
| 18:15:49 | Defiler | I miss our old checkin bots |
| 18:15:52 | Defiler | CIA is terrible |
| 18:16:24 | evan | yeah |
| 18:16:40 | drbrain | I end up in kernel/delta/marshal.rb:13 |
| 18:17:38 | evan | yep |
| 18:17:39 | evan | me too |
| 18:17:49 | evan | thats where we are |
| 18:20:42 | drbrain | args.last is broken :( |
| 18:20:47 | drbrain | I ran vm plus.rbc |
| 18:20:51 | drbrain | I'll poke at it |
| 18:20:58 | evan | k |
| 18:21:01 | drbrain | err, Array#last |
| 18:24:48 | drbrain | ah, at(-1) isn't working |
| 18:27:18 | brixen | oh man, I love rp |
| 18:27:49 | brixen | fixing up MetaClass and others to print nice info |
| 18:27:59 | brixen | like our rbx #inspect did |
| 18:29:58 | drbrain | how do I indicate a primitive failure? |
| 18:30:06 | drbrain | Array::aref should barf on -1 |
| 18:30:10 | drbrain | it doesn't |
| 18:30:42 | brixen | raise |
| 18:30:56 | brixen | ArgumentError::raise e.g. |
| 18:31:00 | evan | Array::aref needs to throw a primitive failure |
| 18:31:02 | evan | in that case. |
| 18:31:13 | brixen | oh yeah PrimitiveFailed |
| 18:31:18 | evan | so the ruby code can handle it |
| 18:31:31 | evan | it's just eating the out of bounds indexes and returning nil |
| 18:31:38 | drbrain | ok, now I've got an example |
| 18:31:47 | drbrain | evan: I know, I wrote it :) |
| 18:31:52 | evan | ah! |
| 18:31:58 | evan | well then we've got the man for the job |
| 18:33:38 | drbrain | urg, TS_ASSERT_THROWS is backwards |
| 18:33:43 | drbrain | expected comes first! |
| 18:34:22 | brixen | not in OO, obj.should_throw something |
| 18:34:50 | drbrain | it's a unit test framework, so expected comes first |
| 18:35:42 | brixen | hm, perhaps it's the first unit test framework with correct ordering ;) |
| 18:42:37 | rue | By the by, I think the Github repo could use a bit of tightening |
| 18:44:35 | evan | tightening? |
| 18:44:41 | evan | a new belt perhaps? |
| 18:45:11 | rue | Corset? I was thinking git-prune (or whatever it was called) |
| 18:47:41 | evan | not sure what ya mean |
| 18:48:05 | Defiler | Are you saying we have unreachable objects to get rid of? |
| 18:48:19 | Defiler | oh, so we do |
| 18:48:33 | evan | github runs it automatically |
| 18:48:38 | evan | you can run it locally |
| 18:48:41 | evan | and should once in a while |
| 18:48:57 | Defiler | hoh dang that made things faster |
| 18:49:03 | evan | yeah |
| 18:49:08 | rue | Pruning, packing? |
| 18:49:26 | evan | git am (and thus git rebase) runs git gc automatically at certain times |
| 18:50:08 | rue | Ah yes, git-gc |
| 18:50:20 | Defiler | brixen: How about I comment up the first test in the file? Or should I do a sample one as a big-ass comment at the top? |
| 18:50:26 | Defiler | (re: instructions.rb) |
| 18:50:39 | brixen | Defiler: I think straight docs at the top |
| 18:50:46 | brixen | but do what works for ya |
| 18:50:51 | brixen | I'll give you feedback |
| 18:51:00 | rue | I was trying to think about what they named the GC command in git.. *facepalm |
| 18:51:26 | brixen | yeah, one of the more clearly named commands |
| 18:56:33 | evan | man |
| 18:56:38 | evan | iphone really makes my speakers freak out |
| 18:56:44 | evan | these computer speakers are really old |
| 18:56:50 | evan | i guess I need some newer, shielded ones |
| 18:57:09 | tarcieri | evan: its awesomely unshielded GSM? |
| 18:57:26 | tarcieri | i've had that problem with every AT&T/Cingular phone I've ever owned |
| 18:57:47 | drbrain | damn you CIA! where's my commits? |
| 18:58:00 | evan | github is looking at it |
| 18:58:05 | evan | their hook to send to CIA is busted. |
| 18:58:07 | evan | it seems |
| 18:58:10 | drbrain | I love how some cars in GTAIV have speakers that freak out |
| 18:58:20 | evan | yeah, when your phone rings? |
| 18:58:27 | drbrain | yeah |
| 18:58:57 | drbrain | I have the run_ruby task setting RBX_RUNTIME now |
| 18:59:15 | evan | k |
| 18:59:17 | drbrain | and vm/vm plus.rbc is now at the same spot as -e |
| 18:59:43 | evan | pulling in new code |
| 19:00:02 | drbrain | (or rake run_ruby[plus.rb] |
| 19:01:45 | evan | drbrain: still on marshal.rb:13, yes? |
| 19:02:50 | drbrain | yup |
| 19:03:00 | evan | you're working on that then? |
| 19:03:14 | drbrain | I thought somebody else was |
| 19:03:20 | drbrain | if not, I will |
| 19:03:26 | evan | go for it |
| 19:03:33 | drbrain | ok |
| 19:09:10 | evan | ooh, 'git log --graph' is cool. |
| 19:09:36 | rue | I think two years from now we will still find yet-undiscovered git secrets |
| 19:10:18 | tarcieri | I take it that's a git 1.6 thing |
| 19:10:54 | evan | might bee |
| 19:10:55 | evan | be |
| 19:11:02 | evan | it's like an ascii gitk |
| 19:12:12 | drbrain | gah, this is like walking in a minefield |
| 19:16:39 | drbrain | in IO#seek, how did prim_seek(-@buffer.size, SEEK_CUR) ever work? |
| 19:16:46 | drbrain | I don't see a #size on IO::Buffer in shotgun |
| 19:17:13 | drbrain | the problem seems to be we've read one too many lines from the rbc |
| 19:17:19 | drbrain | but IO#lineno is worthless for this |
| 19:17:28 | evan | oh |
| 19:17:36 | drbrain | oh, it was a String subclass |
| 19:17:41 | evan | it worked because IO::Buffer used to be a String subclass |
| 19:17:42 | evan | yeah |
| 19:17:51 | evan | .size should be replaced with .unused |
| 19:17:58 | drbrain | thanks |
| 19:18:43 | drbrain | @used ? |
| 19:18:54 | drbrain | or a new method that's @total - @used? |
| 19:19:42 | evan | it's already there |
| 19:19:57 | evan | IO::Buffer#unused |
| 19:20:12 | drbrain | oh, heh |
| 19:20:23 | drbrain | it was invisible, I swear! |
| 19:21:15 | evan | heh |
| 19:27:25 | drbrain | no, unused is wrong |
| 19:27:30 | drbrain | since shotgun has it |
| 19:29:22 | drbrain | looks like it should be @used |
| 19:29:26 | evan | hm. |
| 19:29:30 | evan | ah |
| 19:29:33 | evan | yeah, I see. |
| 19:29:44 | evan | that wants to rewind the current size of the buffered data |
| 19:29:56 | drbrain | yeah |
| 19:30:05 | evan | @used is how much data the Buffer contains |
| 19:30:07 | evan | gotcha |
| 19:30:07 | drbrain | and I'm getting EINVAL right now |
| 19:30:13 | drbrain | (I wired it up to FFI instead) |
| 19:30:29 | evan | calling seek? |
| 19:30:35 | drbrain | yes |
| 19:30:39 | evan | yeah |
| 19:30:41 | evan | you probably can't |
| 19:30:42 | drbrain | lseek |
| 19:30:44 | evan | yeah |
| 19:30:48 | evan | lseek is like stat |
| 19:30:49 | drbrain | since that what the io_seek prim did |
| 19:30:54 | evan | yeah |
| 19:30:57 | evan | if you use FFI |
| 19:30:59 | evan | you get the 32bit version |
| 19:31:10 | evan | but everything else is using 64bit stuff |
| 19:32:49 | evan | brb. |
| 19:41:55 | drbrain | is native_int big enough to hold an off_t? |
| 19:42:22 | Defiler | Platform-specific answer |
| 19:42:41 | drbrain | I'm thinking its never true |
| 19:42:41 | Defiler | if the platform makes off_t 64bit even with 32bit pointers, no |
| 19:42:45 | drbrain | err, not true for 32 bit |
| 19:42:58 | Defiler | the ML2N macro in shotgun could handle it though |
| 19:43:05 | Defiler | I can't remember what it is called in VM |
| 19:43:11 | drbrain | to_long_long() |
| 19:43:18 | Defiler | probably yeah |
| 19:43:47 | Defiler | brixen: OK, check that out |
| 19:43:53 | brixen | k |
| 19:46:58 | brixen | Defiler: can you pull and walk through how we'd test msg.priv = true in that commit? |
| 19:47:48 | brixen | also, could we clarify: * A Task for with that CM activated. |
| 19:48:00 | Defiler | Yeah, I am making some edits. sec |
| 19:48:01 | brixen | otherwise, those docs are super helpful |
| 19:48:07 | brixen | k |
| 19:49:13 | drbrain | damn, my primitive still failed |
| 19:50:50 | drbrain | is there a C++ way to do std::string + int ? |
| 19:50:55 | drbrain | I'm using std::string + sprintf |
| 19:50:59 | Defiler | brixen: OK. We can check this by having a second run() that changes the send we are doing to be non-private |
| 19:51:47 | brixen | drbrain: you could use a strstream << int I believe |
| 19:52:03 | Defiler | but we will have to figure out what to call to create this method hierarchy |
| 19:52:19 | brixen | Defiler: a second call to run() doesn't seem like it'd test what we want |
| 19:52:33 | Defiler | Well, the first run() would be what is there now |
| 19:52:50 | brixen | k, but when I changed that to = true, the test did not fail |
| 19:53:00 | Defiler | and then we would replace the sendsite |
| 19:53:02 | brixen | so, it must have been set up that way |
| 19:53:03 | Defiler | I guess |
| 19:53:07 | Defiler | and run it again |
| 19:53:47 | Defiler | msg.send_site = as<SendSite>(task->literals->field[index]); |
| 19:53:59 | Defiler | whatever we shove into the literals list for the test there |
| 19:54:08 | Defiler | will be the sendsite used by send_message |
| 19:54:26 | rue | drbrain: Yes, strstreams are best when constructing like that |
| 19:55:39 | Defiler | brixen: Check out vm/builtin/sendsite.cpp and look at the ::resolve functions, if you haven't |
| 19:55:40 | brixen | Defiler: I want to test that msg.priv = true before the task->send_message(msg) runs |
| 19:55:54 | Defiler | why? |
| 19:56:10 | brixen | because that is a precondition for me |
| 19:56:22 | Defiler | The message is not exposed by the instruction |
| 19:56:25 | brixen | send_message(msg) should have certain behavior based on what is in msg |
| 19:56:28 | Defiler | It just creates it locally and passes it into send_message |
| 19:56:36 | Defiler | You can test that in the send_message test |
| 19:56:46 | Defiler | but this is the opcode test |
| 19:56:58 | Defiler | and checking the internal state in the middle of the operation seems weird to me |
| 19:57:10 | brixen | the send_super_stack_with_splat is setting up a particular msg and invoking send_message |
| 19:57:11 | Defiler | You are emitting an instruction and asking it to do something for you on the stack |
| 19:57:51 | brixen | a good test to me is confirm msg is set right, and that results in a particular behavior |
| 19:57:54 | Defiler | This doesn't seem like the right place to test that |
| 19:58:04 | brixen | well, it's being done in that instruction |
| 19:58:04 | Defiler | Everything in this call path is now hard-coded to true |
| 19:58:10 | brixen | so I guess I'm confused |
| 19:58:33 | Defiler | msg.priv = true is done in the method_missing branch |
| 19:58:39 | Defiler | and in the instruction body you have msg.priv = TRUE |
| 19:58:51 | brixen | true == TRUE |
| 19:58:55 | Defiler | I don't think we need to test that the compiler knows how to set something to TRUE |
| 19:59:12 | Defiler | So I think what you are describing is a send_message test, not a send_super_stack_with_splat test |
| 19:59:26 | Defiler | Here, we should test that we can make a super send off the stack with a splat |
| 19:59:34 | brixen | well, one send_super_* had true and one had task->call_flags & 1 |
| 19:59:46 | Defiler | Right. and we could have written a failing test for that |
| 19:59:56 | Defiler | because a properly-constructed send would fail |
| 20:00:00 | brixen | those aren't equiv according to evan |
| 20:00:09 | Defiler | what aren't equiv? |
| 20:00:09 | brixen | so I want to see a test that makes one fail and the other not fail |
| 20:00:13 | evan | because call_flags can be 0 |
| 20:00:17 | evan | and for super calls |
| 20:00:23 | evan | you ALWYS look for private methods |
| 20:00:29 | drbrain | is strstream even standard anymore? |
| 20:00:31 | Defiler | Yeah I know why it is hard-coded |
| 20:00:33 | Defiler | That is correct |
| 20:00:49 | Defiler | What I'm saying is that testing that it is true in a function that has it set literally like that seems wrong |
| 20:00:53 | Defiler | and silly |
| 20:01:04 | Defiler | Here, we should test that the send works |
| 20:01:13 | brixen | here's my question: "Why didn't the test fail when I changed msg.priv = task->call_flags & 1 to msg.priv = true?" |
| 20:01:14 | rue | drbrain: The header is sstream, the classes are ({o,i})stringstream |
| 20:01:36 | evan | brixen: which test? |
| 20:01:37 | evan | i'll look. |
| 20:01:40 | Defiler | Why would it fail? |
| 20:01:51 | brixen | git show 5a4b58c |
| 20:02:03 | brixen | Defiler: because if they are equivalent, I didn't need to change anything |
| 20:02:10 | brixen | why wouldn't it fail? |
| 20:02:12 | evan | they're not equiv |
| 20:02:18 | Defiler | The method you are trying to call isn't private |
| 20:02:24 | evan | because the method isn't private |
| 20:02:35 | brixen | then that line of code is not tested |
| 20:02:36 | Defiler | msg.priv means it allows private sends |
| 20:02:41 | brixen | I got that part |
| 20:02:41 | evan | brixen: yes, thats correct. |
| 20:02:46 | brixen | I want a test! |
| 20:02:47 | Defiler | That is correct, and is what I was trying to tell you |
| 20:02:48 | rue | drbrain: istringstreams allow pretty useful scanf-type reading. Plus you can make your own types work with them by providing the << functions |
| 20:02:49 | evan | this is not testing that msg.priv = true |
| 20:02:53 | evan | brixen: so write one! |
| 20:02:54 | Defiler | because we need two run() calls to test it |
| 20:02:55 | drbrain | hrm, I'm getting EBADF |
| 20:02:57 | evan | make the super method private |
| 20:03:20 | rue | And by << I mean >> |
| 20:03:23 | Defiler | leave the test as is, and then under it, twiddle the super method to be private, make the stack look the way you want, and run again |
| 20:03:39 | brixen | thanks |
| 20:03:50 | Defiler | that test will pass, though, since this code looks right |
| 20:03:55 | Defiler | (now) |
| 20:04:13 | Defiler | but you can change msg.priv = FALSE and see it fail |
| 20:04:13 | evan | and you can verify it by setting msg.priv = false |
| 20:04:15 | evan | and seeing it fail |
| 20:04:18 | evan | then change it back to true |
| 20:04:19 | evan | and it should pass |
| 20:04:24 | Defiler | *highfive* |
| 20:04:31 | evan | *highfive* |
| 20:04:34 | brixen | yay |
| 20:05:57 | drbrain | lunches |
| 20:06:30 | evan | dito |
| 20:06:32 | evan | ditto |
| 20:06:41 | evan | just gave fog a bath |
| 20:06:42 | evan | that was fun. |
| 20:08:31 | mernen | ugh, bad news... strnstr is a BSD-only function |
| 20:09:20 | mernen | some say it's flawed on osx 10.4 too |
| 20:09:53 | evan | mernen: ack. |
| 20:10:00 | evan | well, you can replace it with strstr() |
| 20:10:07 | evan | ust be sure that the buffers are null terminated. |
| 20:10:15 | mernen | is that safe? |
| 20:10:23 | evan | if they're null terminated, yeah. |
| 20:10:25 | evan | though, actually |
| 20:10:28 | evan | now that I think abuot it |
| 20:10:34 | evan | strstr has the wrong logic |
| 20:10:37 | mernen | I mean, can you actually be sure they're null-terminated strings |
| 20:10:40 | evan | because we allow our buffers to have nulls |
| 20:10:45 | mernen | exactly |
| 20:10:51 | evan | so strstr is going to fail when it should pass |
| 20:10:52 | evan | in some cases |
| 20:10:55 | mernen | strnstr seems to also be a bad choice |
| 20:10:59 | evan | yeah |
| 20:11:07 | evan | sounds like it needs to be a hand coded loop |
| 20:11:09 | mernen | there's memmem, but guess what... GNU-only |
| 20:11:10 | evan | or something else |
| 20:11:18 | evan | ah, hrm. |
| 20:11:20 | evan | well, i have to run to lunch. |
| 20:12:04 | mernen | I'll see if I can write something later |
| 20:12:11 | mernen | a simple dumb scanning loop would do anyway |
| 20:18:03 | brixen | evan: *ignoring* included modules, is this correct so far? http://pastie.org/261964 |
| 20:20:59 | Defiler | What is the MetaClass (Object) part? |
| 20:21:03 | Defiler | I didn't realize there were two links there |
| 20:22:58 | brixen | F.metaclass.superclass == Object.metaclass |
| 20:23:06 | brixen | or, IOW |
| 20:23:11 | Defiler | oh really |
| 20:23:17 | Defiler | oh I remember this yeah |
| 20:23:19 | brixen | F.metaclass.superclass == F.superclass.metaclass |
| 20:23:55 | Defiler | well, that explains why Object.metaclass.superclass has to be Class |
| 20:24:02 | Defiler | and not some other metaclass |
| 20:24:17 | Defiler | otherwise you would jump over it |
| 20:25:29 | brixen | grabbing some food and ibuprofen for this killer headache |
| 20:25:34 | Defiler | =( |
| 20:25:39 | Defiler | diagram looks good though |
| 20:27:09 | brixen | btw, we need more explicity criteria for test completeness |
| 20:27:19 | brixen | that previous test was apparently correct, but incomplete |
| 20:27:28 | brixen | too bad we don't have heckle for cxxtest |
| 20:27:30 | Defiler | Sure. Once we have tests for everything, we should do another pass and look for holes |
| 20:27:37 | Defiler | haha imagine how long that would take to run |
| 20:27:44 | brixen | heh, true |
| 20:28:23 | brixen | also, opcode docs need overhaul |
| 20:28:31 | brixen | e.g. no push_encloser |
| 20:29:57 | Defiler | Yeah |
| 20:30:07 | Defiler | some don't even have docs |
| 20:31:46 | rue | So by convention the metaclass hierarchy can be made parallel |
| 20:32:05 | Defiler | I like seeing it in the order it will really be checked |
| 20:33:57 | rue | In MRI, F.metaclass.superclass == F.superclass.metaclass.superclass |
| 20:34:05 | goodney | evan: you around? |
| 20:34:08 | Defiler | He's at lunch |
| 20:34:15 | goodney | a |
| 20:34:16 | goodney | h |
| 20:34:19 | goodney | so i see |
| 20:58:58 | rue | MRI breaks down badly |
| 21:07:05 | brixen | cpp has the classes set up the same as that diagram, which I'm pretty sure is correct |
| 21:07:14 | brixen | so lookup must be broken somewhere |
| 21:08:29 | brixen | and :allocate is in Class.method_table as a CM, not a MV, so it must be public |
| 21:10:37 | brixen | /* If this was a private send, then we can handle use |
| 21:10:37 | brixen | * any method seen. */ |
| 21:10:40 | drbrain | why is lseek() giving me EBADF? |
| 21:10:55 | drbrain | I don't see where the fd gets closed |
| 21:10:56 | brixen | drbrain: does it work from C++, not FFI? |
| 21:11:08 | drbrain | it does not work from either |
| 21:11:17 | brixen | in that comment above, what is a "private send"? that's not ruby terminology |
| 21:11:29 | drbrain | tries some things |
| 21:11:35 | rue | Essentially the method lookup works so that if B < A; mb = B.new.metaclass; mb < mB < mA. I think |
| 21:11:45 | brixen | rue: I want to word it better |
| 21:12:24 | brixen | "If we're allow to look at private methods, use any method that matches +name+" ? |
| 21:12:40 | brixen | allowed |
| 21:13:02 | Defiler | brixen: private send means a send without a receiver |
| 21:13:11 | brixen | Defiler: ah, thanks |
| 21:13:17 | Defiler | without a lexical receiver, I should say |
| 21:13:21 | brixen | right |
| 21:13:29 | Defiler | or, I guess, one with literal self as the receiver |
| 21:13:41 | Defiler | but I think the sexps are a little different. doesn't effect us here |
| 21:13:49 | Defiler | affect |
| 21:14:05 | brixen | we should have a glossary |
| 21:14:21 | brixen | I shall make one right this minute |
| 21:14:58 | Defiler | awesome |
| 21:16:36 | brixen | I guess we should rdoc it |
| 21:16:50 | brixen | what is a definition list in rdoc? |
| 21:17:02 | Defiler | I have no idea how to use rdoc =( |
| 21:17:02 | drbrain | use foo:: |
| 21:17:12 | drbrain | ri RDoc::Markup |
| 21:17:36 | Defiler | Nothing known |
| 21:17:52 | drbrain | you must not have RDoc 2 |
| 21:17:55 | drbrain | sec |
| 21:17:55 | Defiler | main RDoc page has some stuff though |
| 21:18:26 | drbrain | http://rdoc.rubyforge.org/classes/RDoc/Markup.html |
| 21:18:28 | Defiler | god this is huge |
| 21:19:09 | Defiler | cool though |
| 21:19:15 | Defiler | I didn't know about foo:: |
| 21:20:56 | Defiler | Wow rdoc just uses regexps to parse |
| 21:21:20 | drbrain | depends |
| 21:21:35 | drbrain | it's got a son of irb for ruby parsing |
| 21:21:42 | drbrain | for everything else, regexp |
| 21:22:48 | brixen | drbrain: would you mind reformatting if I push? then we have an example |
| 21:23:13 | drbrain | ok |
| 21:25:17 | brixen | drbrain: ok, pushed. feel free to revise however |
| 21:25:50 | brixen | we should be throwing words/phrases into that whenever, regardless of whether we have a good definition |
| 21:25:52 | Defiler | so CIA is totally jacked up I guess |
| 21:26:02 | brixen | it's not CIA |
| 21:26:04 | brixen | it's github |
| 21:26:07 | drbrain | which file am I looking at? |
| 21:26:13 | brixen | doc/glossary.txt |
| 21:26:16 | Defiler | yeah, saying zargle:: wtf is this? would be an awesome patch |
| 21:27:02 | drbrain | I'll make these changes, but also point them out as I go |
| 21:27:14 | brixen | that blurb on private send should probably cross-ref "lexical" blah |
| 21:27:18 | brixen | k |
| 21:27:22 | brixen | that helps |
| 21:27:30 | drbrain | to continue a <pre> block, you need to add whitespace on the empty lines matching the indent |
| 21:27:43 | brixen | ahh, I stripped |
| 21:28:18 | drbrain | and the "A method call" line was indented, which would turn that into a <pre>, probably not what you wanted |
| 21:28:28 | brixen | right |
| 21:28:53 | drbrain | try that |
| 21:28:57 | drbrain | I pushed |
| 21:29:00 | brixen | k |
| 21:29:43 | brixen | cool, thanks |
| 21:30:02 | drbrain | RDoc is semi-smart about huge <dl>s, but it's eaiser to just use <h1>, <h2> usually |
| 21:30:20 | drbrain | you have to maintain indentation all over the place and it gets to be a hassle |
| 21:30:28 | brixen | k |
| 21:34:34 | drbrain | wait, what? it was closed! |
| 21:37:33 | drbrain | oh, hah, I'm a dummy |
| 22:07:07 | brixen | ok, pushed more glossary, please check it |
| 22:11:57 | john | just curious, what are the plans for rubinius when ruby 1.9 comes out? Are you going to make a separate version that has compatibility with 1.9? |
| 22:12:26 | zenspider | not that I know of... not yet planned that way at least. |
| 22:12:42 | brixen | probably have to cross that when we know what 1.9 will actually be |
| 22:12:52 | brixen | for now, pure speculation |
| 22:12:54 | zenspider | I'd rather see us provide a gem or something that shims 1.9 functionality onto rubinius |
| 22:13:07 | brixen | which would be pretty easy |
| 22:13:27 | Defiler | We can do that now that the parser is in ruby |
| 22:13:31 | john | ah, just wondering, didn't they already release their release schedule for 1.9? I thought they had it set for december 08, i read that somewhere on the redmine.ruby-lang.org site wiki |
| 22:13:35 | Defiler | Because 1.9 has syntax changes |
| 22:14:37 | zenspider | Defiler: yup. it'd be easier if we switch to a subclassable PEG parser, but that is gonna be a while off. |
| 22:15:05 | jbarnette | zenspider: have you been looking at any specific PEG parsers? |
| 22:15:27 | jbarnette | zenspider: or thinking about rolling your own? |
| 22:18:58 | zenspider | <zenspider> I've started a port of ometa, but haven't had time to go back and |
| 22:19:09 | zenspider | finish it off. [14:16] |
| 22:19:20 | zenspider | <zenspider> I might be doing it wrong, as a straight pull port, instead of |
| 22:19:31 | zenspider | doing a push port. [14:17] |
| 22:19:34 | zenspider | |
| 22:19:39 | zenspider | stupid cafe network |
| 22:19:44 | john | thats where i read it: http://www.rubyinside.com/ruby-1-9-0-3-and-drops-support-for-9-platforms-970.html |
| 22:19:50 | john | Further to the above, Ruby 1.9.0-4 is due on August 25, 1.9.0-5 on September 25, 1.9.1 RC1 on October 25 (this will be quite a significant test - put it in your calendar), 1.9.1 RC2 on November 25, and 1.9.1 proper on December 20, 2008. |
| 22:19:52 | zenspider | the real problem is that ometa doesn't have good tests, so it is harder to port |
| 22:22:10 | jbarnette | zenspider: ah, right, I remember you working on that a few months ago |
| 22:22:33 | jbarnette | zenspider: i've been dicking around with Treetop, but I've been very frustrated by its lack of diagnostics |
| 22:22:42 | brixen | Defiler: I'm using __allocate__ for now and going back to finish debugging Hash |
| 22:22:49 | brixen | Defiler: then I'll look at super() some more |
| 22:22:54 | zenspider | it is a good system, I just think it is a bit much |
| 22:23:06 | zenspider | teh thing about ometa is it seems as stripped down as possible |
| 22:23:13 | jbarnette | absolutely |
| 22:23:56 | brixen | jbarnette: have you talked to nathan about it's lack of diagnostics? |
| 22:24:05 | brixen | (not sure what that is) |
| 22:24:16 | jbarnette | brixen: i just checked out the code last night; it's on my list :) |
| 22:24:20 | brixen | k |
| 22:24:30 | brixen | nathan is fun to talk to |
| 22:27:28 | rue | john_: Traditionally Christmas Day is the release day in the winter |
| 22:28:00 | rue | s/is/has been/ |
| 22:28:07 | brixen | is there a way to do the equiv of bin/rbx describe foo.rb ? |
| 22:28:18 | john | rue: just saying what i read, thats all |
| 22:35:14 | zenspider | btw, I'm renaming :fixnum nodes to :int |
| 22:36:09 | rue | john_: I was mainly wondering why they were changing it :) |
| 22:36:12 | goodney | evan: you back from lunch? |
| 22:36:20 | evan | yep |
| 22:36:23 | rue | brixen: lib/bin/describe.rb ? |
| 22:36:38 | goodney | we're in a lockdown! I'm locked in OHE122 learning about databases! |
| 22:36:46 | rue | Uh-oh |
| 22:36:47 | evan | what?! |
| 22:36:54 | evan | was there a bomb threat? |
| 22:36:54 | rue | Is it _hierarchical_ databases? |
| 22:36:57 | john | rue: maybe they wanted to give themselves a few days of a buffer, /shrug but right now they released 1.9.0-4 2 days early but that doesn't say they will stay ahead of schedule |
| 22:37:06 | rue | john_: Hehe, might be |
| 22:37:13 | goodney | bank robbery, shootout => manhunt |
| 22:38:08 | evan | wow! |
| 22:38:55 | zenspider | rue: 1965 or so. |
| 22:40:48 | brixen | evan: k, pushed that diag in glossary |
| 22:41:16 | evan | coolness |
| 22:41:18 | brixen | evan: btw, Hash is setup exactly like that diagram, so it must be in method lookup |
| 22:41:29 | evan | alright |
| 22:41:31 | brixen | I've put in __allocate__ for now so I can get hash in |
| 22:41:32 | evan | want me to take a look at it? |
| 22:41:50 | brixen | well, I'd like to find it, but I'm sure you'll find it much faster |
| 22:42:18 | brixen | there's other problems with method calls it appears |
| 22:42:36 | evan | I don't want to styme your learning |
| 22:42:40 | evan | so just let me know |
| 22:42:56 | brixen | e.g. http://pastie.org/262107 |
| 22:43:17 | brixen | I'd like to get Hash in instead of rebasing these 7 commits endlessly :) |
| 22:43:32 | brixen | perhaps I should just squash them |
| 22:43:50 | Defiler | or just push it and we can all try to fix it |
| 22:43:59 | Defiler | It isn't like anyone is using cpp for production right now :) |
| 22:44:13 | brixen | heh, true |
| 22:44:26 | brixen | well, there are two problems, the one I just pastied and super |
| 22:44:32 | Defiler | this is open source we do what we want *thug life* |
| 22:44:40 | brixen | so, we can work in parallel |
| 22:44:54 | evan | brixen: just use __allocate__ then |
| 22:44:58 | evan | agardiner: HEY! |
| 22:45:04 | agardiner | hi there! |
| 22:45:05 | brixen | agardiner: wb mate :) |
| 22:45:15 | agardiner | hehe! thanks! |
| 22:45:24 | agardiner | been a while... |
| 22:45:28 | Defiler | The season turns and agardiner is reborn once again |
| 22:45:29 | brixen | evan: __allocate__ gets me to http://pastie.org/262107 |
| 22:45:41 | evan | hm, ok. |
| 22:45:43 | agardiner | Defiler: :-D |
| 22:45:43 | evan | let me look |
| 22:46:11 | agardiner | so, been trying to keep abreast of things via IRC logs... |
| 22:46:12 | evan | brixen: oh! probably a compiler bug. |
| 22:46:14 | brixen | self shouldn't be nil |
| 22:46:20 | evan | i'll bet the stack isn't reversed properly for += |
| 22:46:25 | Defiler | oh hoh |
| 22:46:26 | brixen | should be instance of Hash |
| 22:46:47 | evan | op_asgn2 o/~ suuuucks o/~ |
| 22:46:53 | evan | let me take a peek |
| 22:47:25 | Defiler | hrm |
| 22:47:34 | Defiler | this is OpAssign1 right? |
| 22:47:42 | evan | a.b += 1 is op_asgn2 |
| 22:47:49 | Defiler | oh right |
| 22:48:05 | zenspider | Defiler: look at pt_testcase.rb |
| 22:48:13 | zenspider | tons of examples for all that stuff |
| 22:48:16 | evan | yep |
| 22:48:36 | evan | zenspider: can I make a change to op_assign_spec.rb? |
| 22:48:40 | evan | i may need to |
| 22:49:54 | Defiler | going to left-to-right sure got rid of a lot of swaps. heh |
| 22:50:28 | evan | yep. |
| 22:50:34 | evan | i see the problem |
| 22:50:38 | evan | the sexp form is different |
| 22:50:41 | rue | agardiner: Hi! |
| 22:50:49 | agardiner | hiya rue |
| 22:51:18 | agardiner | watcha up to? |
| 22:51:49 | agardiner | still wrestling with apache? |
| 22:52:47 | rue | agardiner: C++ branch now |
| 22:53:00 | agardiner | ah, all hands on deck, huh? |
| 22:53:15 | evan | yep |
| 22:53:15 | agardiner | sounds like things are getting close...? |
| 22:53:37 | drbrain | hrm, my IO::Buffer is not getting filled in with anything |
| 22:53:52 | zenspider | evan: just lemme know when you make a change there... I'm focusing on simple right now... |
| 22:54:01 | evan | ok |
| 22:54:01 | zenspider | you do some really nasty stuff to the sexps :( |
| 22:54:02 | drbrain | or something |
| 22:54:15 | evan | zenspider: it's really a tiny change |
| 22:54:21 | evan | i'm removing one element from a sexp |
| 22:54:54 | zenspider | how much farther is that from the UR sexp? |
| 22:55:05 | evan | let me check. |
| 22:55:18 | evan | s(:op_asgn2, s(:vcall, :a), :b=, :^, s(:lit, 8)) |
| 22:55:20 | evan | versus |
| 22:55:26 | evan | s(:op_asgn2, s(:call, nil, :a, s(:arglist)), :b=, :^, s(:lit, 8)) |
| 22:55:47 | zenspider | you're just doing the vcall rewrite? |
| 22:55:53 | evan | no |
| 22:55:57 | evan | it was |
| 22:56:03 | evan | s(:op_asgn2, s(:call, nil, :a, s(:arglist)), :b=, :^, s(:lit, 8)) |
| 22:56:04 | evan | ack |
| 22:56:11 | evan | s(:op_asgn2, s(:call, nil, :a, s(:arglist)), :b, :^, :b=, s(:lit, 8)) |
| 22:56:14 | evan | it was ^^ that |
| 22:56:22 | evan | i'm making it the PT version |
| 22:56:37 | zenspider | ah. ok. yeah... anything that gets us closer to UR is cool |
| 22:56:41 | evan | yeah |
| 22:56:44 | evan | it's closer |
| 22:56:50 | evan | i'm not going to make any changes that get further |
| 22:56:52 | evan | from UR |
| 22:56:55 | zenspider | that's essentially what I'm doing for all these errors |
| 22:57:02 | evan | thats just counter to what we're trynig to do |
| 23:00:17 | zenspider | evan: http://rafb.net/p/EFamUI27.html that's what I've got currently. it already diverges from your changes in that you didn't actually map some stuff |
| 23:00:22 | zenspider | but it seems right |
| 23:01:05 | evan | cool |
| 23:01:07 | evan | looks right |
| 23:01:29 | zenspider | you don't have :symbol, do you? |
| 23:01:34 | zenspider | I haven't seen it. |
| 23:01:38 | evan | no |
| 23:01:42 | evan | we don't |
| 23:01:45 | zenspider | you just seem to use them bare instead (see :alias) |
| 23:01:58 | evan | there are few places where they're bare, yes |
| 23:02:12 | evan | a literal symbol shows up in [:lit] |
| 23:02:55 | zenspider | I thought you said yesterday that there was no reason to use lit anymore? |
| 23:03:01 | zenspider | or did I misunderstand the above? |
| 23:03:18 | evan | must be a misunderstanding |
| 23:03:25 | evan | I don't think I said that |
| 23:03:28 | evan | I don't care too much |
| 23:03:43 | evan | i like having them be explicit |
| 23:04:06 | evan | but not super concerned about this |
| 23:04:23 | evan | the only one I can think of thats more concerning is Regexp |
| 23:04:25 | zenspider | interesting. ok. |
| 23:04:28 | evan | as I told ya last week |
| 23:04:52 | evan | the rest don't require deconstruction |
| 23:04:54 | evan | Regexp does |
| 23:04:56 | zenspider | yeah... that is the only one that might get folded back into UR... |
| 23:05:02 | zenspider | range does |
| 23:05:05 | evan | ah yes |
| 23:05:06 | evan | range |
| 23:05:18 | evan | the Range one is also for consistence |
| 23:05:23 | evan | since there is already a :dot2 |
| 23:06:09 | drbrain | how do bytes get into an IO::Buffer? |
| 23:06:17 | zenspider | but dot2 is supposed to be for non-literal object ranges... |
| 23:06:24 | zenspider | drbrain: they walk |
| 23:06:26 | evan | drbrain: Scheduler.send_on_readable puts them in there |
| 23:06:35 | zenspider | running was deemed too hazardous |
| 23:06:47 | evan | zenspider: yeah, but i figured that having them in lit was an optimization |
| 23:07:08 | drbrain | I'm coming to the conclusion that it is not doing its job |
| 23:07:22 | evan | drbrain: it's possible. |
| 23:07:37 | evan | drbrain: b event.cpp:106 |
| 23:07:40 | evan | in gdb |
| 23:07:42 | evan | then run it |
| 23:07:43 | drbrain | ok |
| 23:07:47 | evan | thats where an IO::Buffer is filled |
| 23:12:35 | zenspider | evan: wow you're inconsistent :P |
| 23:12:42 | evan | eh? |
| 23:13:02 | zenspider | optimize... deoptimize... make up your mind. |
| 23:13:21 | evan | i'm not an absolutist |
| 23:13:24 | evan | i get to change my mind |
| 23:14:47 | brixen | evan: in class Hash; def self.allocate; super(); end; end <-- what should msg.current_self be ? |
| 23:14:53 | brixen | at the point of super() |
| 23:15:05 | evan | Hash, the object. |
| 23:15:31 | brixen | not nil |
| 23:15:34 | brixen | IOW |
| 23:15:37 | evan | no |
| 23:15:38 | evan | not nil. |
| 23:15:41 | brixen | k |
| 23:15:42 | evan | if it's nil |
| 23:15:45 | brixen | it is |
| 23:15:45 | drbrain | evan: how does it get from TypedRoot<IOBuffer*> buffer to the IOBuffer*? |
| 23:15:46 | evan | then something isn't setting it. |
| 23:15:48 | brixen | k |
| 23:15:53 | evan | drbrain: .get() |
| 23:15:56 | drbrain | stepping through this, it seems to not go into IOBuffer->read_bytes |
| 23:15:57 | Defiler | I've never seen it not be nil, myself |
| 23:16:05 | Defiler | that I can recall |
| 23:16:47 | brixen | Defiler: http://pastie.org/262143 |
| 23:16:59 | brixen | also, what is msg.module? |
| 23:17:07 | evan | brixen: it's filled in by the lookup mechanism |
| 23:17:15 | evan | brixen: it's the Module* where the method was found |
| 23:17:22 | brixen | hmm |
| 23:17:48 | evan | zenspider: http://rafb.net/p/WFVo5143.html |
| 23:17:49 | evan | that fine? |
| 23:18:53 | rue | msg.method_found_in # ? :) |
| 23:21:27 | Defiler | brixen: It is set in executor |
| 23:21:32 | Defiler | VMMethod::executor |
| 23:21:48 | Defiler | (amongst others) |
| 23:22:02 | evan | Defiler: current_self isn't |
| 23:22:07 | zenspider | evan: booteeful |
| 23:22:11 | evan | zenspider: ok. |
| 23:22:38 | Defiler | evan: I was answering him about module |
| 23:22:42 | Defiler | not current_self |
| 23:22:56 | evan | msg.module isn't set there either |
| 23:22:57 | evan | it's read there |
| 23:23:27 | evan | zenspider: do you have a better name you refer to the op_asgn2 logic by? |
| 23:23:38 | evan | just curious |
| 23:23:47 | brixen | evan: what's the idea of TaskProbe and would a probe at instructions.cpp make more sense for now than if 0/1 ? |
| 23:24:11 | evan | brixen: yeah, good call |
| 23:24:16 | evan | a probe call there would be better |
| 23:24:19 | brixen | k, I'll add it |
| 23:24:37 | evan | the idea behind the probe is to centralize all that noisy logic |
| 23:24:42 | brixen | cool |
| 23:25:03 | brixen | should we distinguish them or just all on or all off? |
| 23:25:07 | rue | Method overloading might help the cases where multiple different locations manipulate some data structure slightly differently |
| 23:25:15 | rue | Assuming those cannot be combined anyway |
| 23:25:24 | evan | brixen: dunno, thats why they're centralized, so we can easily change them all :D |
| 23:25:35 | brixen | right, but I don't want to turn them all on |
| 23:25:38 | brixen | is what I mean |
| 23:25:42 | evan | add a flag |
| 23:25:49 | evan | to turn just the one you want on |
| 23:25:52 | brixen | PROBE=opcode |
| 23:25:54 | brixen | something like that? |
| 23:25:55 | evan | sure |
| 23:25:56 | brixen | k |
| 23:26:07 | evan | every method in probe could have a bool flag also |
| 23:26:10 | evan | that indicates if it should fire |
| 23:26:20 | evan | then just wire up some easy logic to set the flags |
| 23:27:07 | brixen | I'm thinking just a set of bit flags |
| 23:27:24 | brixen | set with stuff like PROBE=1 all, PROBE=opcode just opcode |
| 23:27:54 | brixen | PROBE=1 // turn them all on |
| 23:27:57 | brixen | to be more clear |
| 23:28:50 | evan | sure, up to you. |
| 23:29:35 | evan | brixen: pushed a potential fix for that Hash problem |
| 23:29:37 | evan | give it a shot |
| 23:29:43 | evan | be sure to kernel:clean before though |
| 23:30:04 | brixen | k, thanks |
| 23:32:54 | drbrain | should break rubinius::IOBuffer::create stop somewhere? |
| 23:33:00 | drbrain | it doesn't seem to be called |
| 23:33:19 | drbrain | I'm trying to figure out who's setting used to 0 |
| 23:33:32 | evan | no |
| 23:33:42 | evan | I don't think that we're creating IOBuffers with that |
| 23:33:44 | drbrain | so I figured break in IOBuffer::create, continue until it's created the buffer I want, then set a watchpoint |
| 23:33:52 | evan | the ones used are created entirely in ruby |
| 23:34:13 | evan | drbrain: calling ::create is not automatic |
| 23:34:18 | evan | it has to be wired up to prim |
| 23:34:24 | evan | which IO::Buffer doesn't have |
| 23:34:32 | drbrain | yeah |
| 23:35:01 | drbrain | http://rafb.net/p/8PFOCJ51.html |
| 23:35:05 | brixen | evan: before it was expected 1 given 0, now it's expected 1 given 3 :) |
| 23:35:23 | brixen | if we could convert those to $'s instead |
| 23:35:24 | evan | brixen: could you paste me the code? |
| 23:35:27 | evan | thats doing the call |
| 23:35:27 | drbrain | I added a begin/end p in IO::Buffer#shift_front |
| 23:35:29 | evan | the actual code |
| 23:35:35 | brixen | sure |
| 23:35:46 | drbrain | and it seems that something is wiping out my buffer |
| 23:35:55 | evan | drbrain: yeah! eeks. |
| 23:35:59 | evan | where did that buffer goe |
| 23:36:29 | evan | drbrain: there are only a few things that set @used = 0 |
| 23:36:32 | evan | should be easy to find |
| 23:36:35 | brixen | evan: http://pastie.org/262156 |
| 23:36:40 | brixen | the call is on 198 |
| 23:36:46 | brixen | self.size += 1 |
| 23:37:06 | evan | and could you paste the output again? |
| 23:37:08 | brixen | same code as in here: http://pastie.org/262107 |
| 23:37:09 | evan | so I don't get confused |
| 23:37:22 | brixen | I'll have to create it, sec |
| 23:37:28 | evan | brixen: yeah, but that code isn't the actual code you're running |
| 23:37:36 | evan | i need to see if there is something else thats bleeding through |
| 23:37:38 | evan | and screwing it up |
| 23:37:42 | brixen | k |
| 23:38:41 | brixen | evan: then you want this too: http://pastie.org/262159 |
| 23:38:58 | brixen | evan: the first is bootstrap/hash, the one just pastied is common/hash |
| 23:39:28 | evan | ok |
| 23:39:33 | evan | and the output when running it? |
| 23:39:37 | brixen | how much of the opcode do you want |
| 23:39:41 | brixen | I'm waiting for it |
| 23:39:41 | evan | the last 50 |
| 23:39:43 | brixen | k |
| 23:40:23 | brixen | http://pastie.org/262161 |
| 23:40:36 | brixen | there's a few extra heh |
| 23:41:36 | evan | um |
| 23:41:39 | seydar | drbrain: what was your problem from last night? |
| 23:41:40 | evan | it's not self.size += 1 |
| 23:41:41 | evan | at all |
| 23:41:58 | evan | it's the @bins[bin] = Bucket.new key, nil, key_hash |
| 23:42:03 | brixen | yeah, this is different |
| 23:42:09 | evan | ok, so we fixed one |
| 23:42:18 | brixen | yeah, last was 198 |
| 23:42:28 | evan | alrighty |
| 23:43:55 | evan | brixen: i have to ask |
| 23:44:00 | evan | why is Bucket a Tuple subclass? |
| 23:44:18 | brixen | at put |
| 23:44:18 | zenspider | the walrus said it was |
| 23:44:24 | brixen | would be faster than ivar lookup |
| 23:44:32 | zenspider | lolrus is a bucket expert, after all |
| 23:44:34 | evan | brixen: it's not though |
| 23:44:43 | brixen | well, easy to change |
| 23:44:46 | evan | ok |
| 23:44:47 | evan | just curious |
| 23:44:47 | brixen | why isn't it faster? |
| 23:44:58 | brixen | the code path for at is alot less it seems to me |
| 23:45:01 | evan | back in the day, I measured this |
| 23:45:05 | evan | well |
| 23:45:11 | evan | you're adding an extra method call in there |
| 23:45:16 | evan | that negates any savings |
| 23:45:16 | brixen | sure |
| 23:45:22 | evan | if there was any |
| 23:45:29 | zenspider | we really shouldn't be making design decisions (at this level) based on speed |
| 23:45:53 | brixen | I doubt this is the problem though |
| 23:45:56 | evan | it's not |
| 23:45:59 | evan | i was just curious |
| 23:46:03 | evan | alright, back on the trail. |
| 23:46:19 | zenspider | wanders off |
| 23:46:44 | evan | brixen: oh ha! |
| 23:46:58 | evan | that IS the problem. |
| 23:47:07 | evan | since it's Tuple subclass |
| 23:47:12 | evan | it's calling Tuple.new |
| 23:47:26 | evan | which is hooked directly up to tuple_allocate |
| 23:47:46 | brixen | ok, easy to fix |
| 23:47:47 | brixen | one sec |
| 23:47:52 | evan | k |
| 23:48:14 | evan | we should have a comment in Tuple that says if you subclass it |
| 23:48:18 | evan | you can't have an initialize |
| 23:48:20 | evan | because thats true |
| 23:48:39 | seydar | evan: could you call super instead? |
| 23:48:44 | evan | nope |
| 23:48:50 | evan | never gets that far |
| 23:49:04 | evan | Tuple.new goes directly to a primitive |
| 23:49:06 | evan | no initialize is called |
| 23:49:25 | evan | Tuple isn't really made to be subclassed |
| 23:49:30 | evan | it's too simple |
| 23:49:33 | evan | it's made to be delgated to |
| 23:50:33 | brixen | I have specs for this part that I can actually run without kill MRI or shotgun |
| 23:50:59 | evan | you're running them under vm? |
| 23:51:26 | brixen | yeah, with bin/mspec -tr |
| 23:51:38 | seydar | Would making a wrapper class around Tuple kill the speed increase? |
| 23:51:38 | evan | er? |
| 23:51:40 | evan | thats under MRI |
| 23:51:43 | brixen | and loading the bootstrap/hash and lib/core_bridge/hash |
| 23:51:46 | evan | i'm confused |
| 23:51:58 | evan | "run without kill MRI" |
| 23:52:01 | brixen | evan: sorry, in the cpp dir |
| 23:52:01 | evan | ? |
| 23:52:07 | brixen | using MRI |
| 23:52:15 | brixen | if I load common/hash, it kills MRI |
| 23:52:19 | evan | i'm still confused. |
| 23:52:25 | brixen | nvm then |
| 23:52:27 | evan | k |
| 23:53:53 | evan | brixen: it runs under MRI because core_bridge/tuple.rb is totally wrong |
| 23:54:07 | evan | well, not totally |
| 23:54:14 | brixen | you don't have mine |
| 23:54:15 | evan | but how a Tuple is created doesn't match how Rubinius does it |
| 23:54:17 | evan | thus the disconnect |
| 23:54:39 | brixen | right, Tuple in MRI is Array and can be subclassed |
| 23:54:50 | brixen | anyway, it's a very simple change |
| 23:54:54 | brixen | and all the specs pass |
| 23:55:01 | brixen | so, I'll try running it under the vm |
| 23:55:03 | evan | k |
| 23:55:54 | brixen | I think I'll delete core_bridge anyway, it's never really worked out |
| 23:56:03 | evan | k |
| 23:56:09 | brixen | and it's impossible to really replace Hash in MRI |
| 23:56:30 | brixen | but I can test stuff like Hash::Bucket fine |