Index

Show enters and exits. Hide enters and exits.

00:40:18headiushey guys, I thought of another concern for capi
00:40:27headiusthat pushed me back into the "we won't implement it" column
00:40:42headiusit seems like it will make it impossible to get rid of the gil
00:41:18headiussince you could have threads manipulating data structs in both C and Ruby at the same time, which for you guys with copying will be a showstopper
00:42:08headiusthe only way it could work is if all threads have to freeze when extension code is running, which means you'd have to wait for them to reach safe points every time
00:42:53headiusit's also totally incompatible with MVM unless you use the new MVM extension stuff ruby 1.9 guys have been working on
00:48:21rueWell, no, it just means that synchronisation may be needed when an extension accesses Ruby data
00:48:38slavaVM extensions
00:48:38slavalol
00:48:48slavajust port everything to FFI mang
00:49:14rueslava: They put too much logic in the extensions
00:49:39sbryantslava: in a perfect world, but support Capi will make rubinius that much more attractive from an adoption standpoint
00:49:45headiusrue: synchronization on every access would be even worse
00:50:03headiussince you'd have to have synchronization on the ruby side too, and you wouldn't know when there might be an extension modifying it
00:50:09slavasbryant: depends on how much capi affects stability, performance, concurrency, etc
00:50:15headiusyou'd essentially have to make all core collections be synchronized
00:50:18slavasbryant: people who want perfect compatibility with extensins will use mri anyway
00:50:31headiusslava: yeah, that's about what I figure too
00:50:34rueheadius: *Maybe* synchronise
00:50:44sbryantslava: I agree-ish
00:50:52sbryantIt's a pretty gray area.
00:51:02headiusrue: there is no such thing as maybe synchronize, unless you're going to add another conditional check on every access to a collection to see if it's been leaked to the outside world
00:51:10headiusand then hope that across threads that flag isn't stale in a cache somewhere
00:51:14rue'Course there is
00:51:31rueI do not mean a runtime check
00:52:28rueThe current handle implementation uses actual handles, which should take care of objects the GC moved
00:53:21evanheadius: some of those are probably true
00:53:33evanheadius: but thats still not a good enough reason to not do it
00:53:44headiuswell, I disagree on that point
00:53:44evanwe just fall on different sides of this line
00:53:56evansure, you're allowed to disagree.
00:53:58rueWhich data structures are being manipulated?
00:54:17rueThat is, without a user explicitly doing so without synchronising themselves
00:54:24headiusyou should probably make sure people know that's going to be a problem with native exts
00:54:49headiusif we could get enough people showing that native exts prevent parallel threading in the C impls we could start weaning more people off them
00:55:07headiusand with things like the swig ffi generator, they shouldn't need them in most cases anyway
00:55:40headiusthis might be a good point to bring up during our talk
00:55:47sbryantProbably a stupid question but is there an FFI for MRI (1.8.x and 1.9.x) ?
00:55:50headiusyou like C exts, but do you know what you're sacrificing?
00:55:56evanheadius: i think we can wean them off without saying "fuck you, rewrite them now."
00:55:57ruesbryant: ruby-ffi
00:56:38rueI am not above flat-out lying about it to get them to use FFI, but I still do not understand which data it is that we are worried about
00:56:42headiusI dunno, I'm kind of a "fuck you" kind of gut
00:56:50evani know you are
00:56:53evani'm just not :)
00:57:06headiusrue: like array data...you guys have to copy it in and out if people directly access it
00:57:18headiusthat only works if you can guarantee only one side or the other is accessing it at a time
00:57:27headiuswith parallel threads, you can't
00:57:47evanheadius: i also thing there is a middle ground
00:57:49rueHow is that different from manipulating an Array in two threads just in Ruby?
00:57:58evanjust like people have migrated their extensions for 1.9
00:58:09evanproviding a saner C API can help mitigate
00:58:20evanand having our own capi impl means we can create those sane apis
00:58:22evanand provide them
00:58:28evanand provide shims to use them on 1.8
00:59:01rueNah.
00:59:10headiusevan: certainly, and if people migrate to the sane API (which would probably look more like JNI) I'm all for implementing it
00:59:16evanright
00:59:21headiusbut implementing what we have right now is incompatible with parallel execution
00:59:22evanwell, money talks
00:59:28headiusso we can't really help on that end
00:59:30evanso having such an API means people can actually migrate
00:59:36rueJust provide an easy way to compile a library to which FFI can be attached
00:59:45evanheadius: then hold off
00:59:48headiusI think they might migrate this far and no further unless MRI starts to push people too
00:59:51evanlet us weather this storm
00:59:57headiusyou need to get MRI on board
00:59:58evanand help write new, saner APIs
01:00:07headiusor it's never going to happen
01:00:10evannot entirely
01:00:13evanbecause we can provide a shim.c and shim.h
01:00:22evanthat implement the new APIs for 1.8
01:00:27headiuswe need to get MRI to ship a ruby-safe.h though
01:00:34headiusso people have the option of moving to these APIs
01:00:34evandoing so also means MRI is more likely to get involved
01:00:39evanbecause it lowers the barrier for them.
01:02:08headiusyeah, don't think I don't appreciate what you're doing in this area
01:02:24headiusI'm just bummed we can't implement what you have now without totally crippling threads
01:02:29evansure
01:02:34evanit's a bummer
01:02:36evanbut don't forget
01:02:48evanfor us, this is an integration API
01:02:56evanin the same way you have all the code to integrate with java
01:03:06evanso it just pays off less for you than us
01:03:08headiusoh yeah, I realize that
01:03:15headiusyou don't have a java to fall back on
01:03:20evanright
01:03:25headiusI know you guys have to do something
01:03:36headiusI just keep checking back on subtend to see if we'd be able to do it
01:03:54headiuswmeissner convinced me again it's just not feasible
01:03:57rueheadius: Am I missing something, or are you saying that the GIL is needed to protect against people who do not synchronise their threaded code?
01:04:24headiusrue: I'm saying you could get native extensions and ruby code seeing different *copies* of the data at the same time
01:04:25evanheadius: :D
01:04:30headiusand having native code wipe out ruby code's changes
01:04:35evanheadius: we can play a lot more tricks to make it work than you can
01:04:43headiusif you didn't segfault, you'd surely corrupt
01:04:45evanheadius: like me integrating support for it directly into the GC
01:04:54evanthan you can't play
01:04:55evanrather.
01:05:00headiusevan: copying is going to be the nonstarter though
01:05:05evanwhy
01:05:13headiusyou can't be copying data around and still allow concurrent access
01:06:14evanoh that
01:06:19evanwell, JNI copies
01:06:21evanwhat does it do?
01:06:36headiusin JNI you use an API to manipulate data struct internals that are shared with Java
01:06:41headiusyou never get a pointer to anything
01:06:53evanwe never give pointers either
01:07:14evanso if thats the only requirement, we're good
01:07:34headiuswhat about rarry ptr, or whatever it's called
01:07:47rueThose changes are synched, too?
01:07:48evanthats a pointer to C struct we allocate on the C heap
01:08:00evanrue: yeah, they're sync'd at critical points
01:08:07headiuswhich contains what?
01:08:15evanan array of handles
01:09:21brixenalso, modifying an ext to not use RSTRING and RARRAY is easier than rewriting it
01:10:03headiusfair enough, I'm not arguing that...and if they don't use those they'll be closer to something we can support
01:10:07headiusI'm arguing that they won't
01:10:19brixenthey have the option to
01:10:27rueIt *is* certainly possible to get bad data, but only if the user fails to synchronise
01:10:29headiusI'll have to get wmeissner to talk to you guys
01:10:32brixenI'm not sure they'd rewrite in ffi either
01:10:35headiussee if things have improved
01:10:41brixenbut we give them that option too
01:10:51evanheadius: on another topic
01:10:53headiushe took a recent look and what he described that we'd have to do was simply not doable
01:10:58evanheadius: how do ya want to handle the talk?
01:10:58sbryantheadius: if you make the barrier of entry low, desire for portability will drive those simple rewrites
01:11:02evanjust sync up on details in vegas?
01:11:16sbryantrather simple changes, not rewrites
01:11:17headiusevan: yeah, we don't talk until day 2
01:11:22evanheadius: i'd love to hear his asessment
01:11:24rueheadius: I think GC is where you would have a problem
01:11:25headiusI'll get some time this coming week to work on slides
01:11:27evanheadius: because maybe we've overlooked something
01:11:42headiusevan: do you have a current plan for eliminating the gil?
01:11:53headiusbecause I think that's where a lot of complexity comes in
01:11:55evannothing solid no
01:12:11evanbut the plan is how john rose pointed out to me
01:12:26evanwhich is take the one lock and first make it 2 locks
01:12:27evanthen 3
01:12:28evanthen 4
01:12:42evanwhich is take the one lock and first make it 2 locks
01:12:43evanthen 3
01:12:45evanthen 4
01:12:52evan(^^ for headius)
01:13:12sbryantevan: that's going to be painful :(
01:13:19headiusbleh hotel wireless
01:13:21headiusI sent this last: if you haven't started planning for that I'm worried you're painting yourselves into a corner
01:13:24headiusI missed anything after
01:13:43evansbryant: i'm open to other suggestions
01:13:48evanheadius: nothing after that
01:15:19headiusbleh
01:15:21headiusI'm on another host now
01:15:24headiusI'll read log for a sec
01:15:27evanheh
01:15:29evannothing was said
01:15:39evanwe waited for ya :)
01:16:34headiussigh...internet on the road
01:16:37headiuslogs are behind
01:16:48evanyou hear me now?
01:16:51headiusyes
01:16:53evank
01:16:56sbryantevan: bah, new MBP isn't as fast as I'd like it to be, sorry for the delay. It's going to be painful no matter what you do. At least in my experience.
01:17:06evansbryant: right
01:17:24headiuslogs must update every ten mins or so, eh?
01:17:29evandunno
01:17:51evansbryant: planning to remove the gil at this point would introduce too much additional work
01:18:15evanit's certainly on our minds, but we're not many/any decisions based on it atm
01:18:18sbryantevan: I have no perspective, there for cannot offer a valuable opinion
01:18:27evansbryant: :D no prob.
01:18:32sbryantand I just Englished all over the place :D
01:19:33sbryantevan: what's currently on rubinius roadmap?
01:19:48evanbrixen and I were just discussing that
01:20:03evanGIL removal is not an the roadmap for 1.0
01:20:09evanit's in the cloud after 1.0
01:20:11sbryantUnderstandable
01:20:18rueThere really are not that many things that need to be locked
01:21:09headiusit's not locking as much as preventing segfaults when people read across each others boundaries
01:21:32headiusyou can do all sorts of concurrent modification of structures in java, but you only get java exceptions
01:21:37rueSegfaults will teach them
01:21:39headiusnot crashes
01:21:58headiusrue: heh, sounds like a 'fuck you' approach :)
01:22:05sbryanthaha.
01:22:11evanheadius: the handle API abstracts access pretty clearly
01:22:46headiusdid you and john get to talk much about how to eliminate the gil?
01:22:47evanso there is very limited chance for the user to corrupt a GC object
01:22:49rueheadius: Yeah. Personally I have no problem with crashing if the user fails to synch their code
01:22:51evanheadius: yeah
01:22:55evanfor about an hour
01:23:18evanrue: esp if we convert the segfault into an exception!
01:23:19evanbingo!
01:23:30sbryantI'm all or that.
01:23:32sbryantfor*
01:23:36evani've done that before
01:23:41rueI was thinking more like converting it into some type of ASCII middle finger
01:23:43evanrubinius has had that feature on and off
01:24:02evanSEGFAULT DETECTED: Please wait while we call your mom.
01:24:18sbryantJust rickroll them.
01:25:25evanhehe
01:25:59sbryantHe'll never let you down and hurt you.
01:26:13evanhaha
01:26:19sbryant:D
01:26:24evanPONY TIME DETECTED: Preparing cake party...
01:26:30sbryanthaha
01:27:42sbryantDoes anyone here use emacs for development and if so do you have any tips for rubinius development/debuging
01:28:01evan<= macvim + gdb
01:28:19sbryantYeah, I'm an emacs whore
01:28:46sbryanttook me a while to learn to love it, but now I have Stockholm Syndrome and couldn't be happier.
01:32:43brixenevan: I'm tempted to leave MetaClass at global namespace Ruby should have that class anyway ;)
01:32:43ruecgdb is fun
01:32:54brixenevan: should I namespace it?
01:33:10brixener because Ruby*
01:33:18rueMetaClass is probably the likeliest name conflict after Tuple
01:33:32evannah
01:33:36evanleave it toplevel
01:33:38brixenk
01:33:44brixenand IncludedModule?
01:33:51evanmm
01:33:53evannamespace it.
01:33:55brixenk
01:37:35sbryantbrixen: did you ever resolve that problem with pup.rb?
01:37:45evanyeah
01:37:47evani solved it.
01:37:50evanlike usual
01:37:50evan:D
01:38:21sbryantyou're the man now dog :)
01:38:36evando people even remember what movie that was from?
01:38:45yakischlobafinding forrester?
01:38:47sbryantFinding Forrester
01:38:51evandouble ding!
01:38:53evanok, good.
01:38:54sbryantevan: seems so :)
01:38:57evanyou can use it then.
01:39:02evan:D
01:39:07yakischloba(took me a second. star wars?)
01:39:13sbryantevan: it was on the teevee the other day
01:39:28sbryantIn glorious HD.
01:40:09evanhah
01:55:54evanrad
01:56:09evani've got code exposed to LLVM enough that it's making some rad optimizations
01:56:25sbryantevan: neat!
01:56:27evanhttp://gist.github.com/100866
01:56:34sbryantevan: tailcall recursion optiomizations?>
01:56:36evanthats for
01:56:42evandef blah(obj); 1 == obj; end
01:56:56evancheck out the bottom define
01:57:00evanthats the optimized version
01:57:14sbryantreading now
01:57:41evanline 81 is particularly awesome
01:58:02sbryantI wish this made more sense to me
01:58:06evani'll explain
01:58:14evansee %arg_val on line 81?
01:58:27sbryantyeah
01:58:57evanthats obj, but accessed directly from the argument array
01:59:04evanwhich is passed in by the caller
01:59:18evanthats awesome because llvm has seen through 2 levels of storage to do that
01:59:37evanit 1) saw the move from the arguments array to the locals array
01:59:45evanand 2) saw the move from the locals array to the stack
01:59:50evanso it eliminates using both of those
01:59:54sbryantthat is pretty jawsome
01:59:55evanand goes directly to the source
02:00:00sbryant<3 LLVM
02:00:47evanoh
02:01:03sbryantIs LLVM going to be required for rubinius?
02:01:03evanit also converted stack push/poping into direct stack references
02:01:11sbryantOh that is awesome.
02:01:28evanie, the stack pointer was competely eliminated
02:01:32evanit %stack_top in the top version
02:01:33sbryantYeah I got that.
02:01:35evanit's
02:01:42evanyou can see it being used
02:01:50evanand it completely eliminates it in the bottom one
02:01:50sbryantSo instead of a dereference it can access the memory directly
02:01:57evanright
02:02:09evaninstead of manipulating the stack pointer to point to the current top of the stack
02:02:17evanit did all the stack movement calculation at compile time
02:02:29evanand access the stack at fixed offsets instead
02:03:24evansbryant: LLVM will be required for the JIT, yeah.
02:03:25sbryantis LLVM going to be required going forward?
02:03:27sbryantOr is it already
02:03:29sbryantahh
02:03:30sbryantgotcha
02:03:30evanwe currently ship with a version of LLVM
02:03:44evanso we'll probably do 2 things
02:03:49evan1) upgrade our builtin version
02:03:59evan2) only use it if there isn't an installed version
02:04:12sbryantI like that appraoch
02:04:32evanprobably provide a way for the results of doing an internal build be saved
02:04:37evanie, install that version
02:05:05yakischlobahttp://pastie.org/private/hvecgtowd5rxchurpunqa this a readline issue? need to update it or something?
02:05:24evanhrm
02:05:26evanyakischloba: what OS ?
02:05:29yakischlobatiger
02:05:37evani thought we fixed this...
02:05:59yakischlobahave i done something funky to my system then? what is the issue
02:06:28evanhm, no.
02:07:17evanhrm
02:07:28yakischlobafresh pull, btw
02:07:32evanyeah
02:07:33evanit's not that
02:07:44evanyakischloba: whats the output of
02:07:47evansw_vers
02:07:48evanfor you?
02:08:05yakischlobahttp://pastie.org/private/hvecgtowd5rxchurpunqa
02:08:20evanhm
02:09:02evanyakischloba: ok, do this
02:09:06evangdb --args bin/rbx -v
02:09:09evanthen, in gdb
02:09:11evanb mmap
02:09:12evanrun
02:09:17evanwhen it stops on mmap
02:09:19evando
02:09:20evanbt
02:09:23evanand paste the results
02:10:15yakischlobak sec
02:11:00yakischlobahttp://pastie.org/private/hvecgtowd5rxchurpunqa
02:11:44yakischlobahttp://pastie.org/private/sozmvti2abt6rxayaowmg
02:12:05evanah yes.
02:12:14evanok, that makes sense.
02:13:17evanyakischloba: i'll try and get to that a bit later
02:13:22evanit's something we need to adapt in the code
02:13:33evanor if you want
02:13:33yakischlobasure, np. holler at me when you push a fix, if you dont mind
02:13:41evanyou could try replacing mmap with malloc
02:13:47evansee if you can get it going that way
02:14:04yakischlobableh. i don't have time to get into it right now, i was just trying to build so i could play with it later this evening
02:14:13evanah ok.
02:22:01sbryantevan: so back to our LLVM love fest, what else is LLVM doing for rubinius?
02:32:45evansbryant: providing a JIT is a lot
02:32:48evanthats it's main duty
02:35:08sbryantevan: makes sense
17:11:49brixenevan: you mentioned renaming StaticScope and VariableScope, want me to do that while I'm namespacing all these?
17:29:49rue`sed s/StaticScope/Ponies/g vm/**/*`
17:35:00brixenyou forgot the kernel files
17:41:55rueIt is more fun this way
17:42:59brixenwe've got a lot of impl classes, I've got 11 of them namespaced
19:00:04evanallo
19:03:08scooprhalo
19:03:22scooprhowsit going
19:03:39evanoh, good
19:03:44evanit's the day before moving day
19:03:47evanwhen means it's moving day
19:08:05scooprah right
19:08:23scoopreverything packed? ;)
19:08:29evannot really, no.
19:08:35evani'm moving just over 1 mile
19:08:51evanwhich means we've procrastinated
19:08:59evanthankfully, we've got awesome boxes this time
19:22:40boyscoutSearch parent VariableScopes for eval locals - 51ad981 - Evan Phoenix
19:22:54evanbrixen: that should fix locals in irb
19:24:07boyscoutCI: 51ad981 success. 1503 files, 7246 examples, 23660 expectations, 0 failures, 0 errors
19:25:09brixenevan: sweet
20:57:46rueKnew it