Index

Show enters and exits. Hide enters and exits.

00:07:59evanquiet today
00:08:04evanthat too longer than I expected.
00:10:00ujihisaquiet -> less CO2 consumption -> ECO!
00:10:57brixenheh, the quiet of no netsplits is deafening
00:14:42evanhah
00:14:54evani'm working on the answers to 2 questions
00:15:04evan1) how do you detect when to JIT a method.
00:15:22evan2) what happens to the values used to detect JITing when you actually go to JIT
00:15:36evanmeaning, if you use a call counter to determine when to JIT
00:15:36brixeninteresting
00:15:40evanwhan happens to the call counter when you go to JIT
00:15:55brixenI'm also working on 2 questions
00:15:56evanthis is complicated because we inline methods.
00:16:23brixenhmm
00:16:37brixenthe call counter is on the IC though, right?
00:16:56evanno
00:17:04evanthere is counters there
00:17:12evanbut they don't influence when to JIT at all.
00:18:19brixenI thought they trigger a search for a method to start jitting
00:18:26brixenwhat does trigger it then?
00:18:37evana call counter on the method itself.
00:18:48evanwhen the interpreter enters a method, in ticks the counter.
00:18:49brixenoh ok
00:18:52evans/in/it/
00:19:22brixenwell that's hella confusing potentially
00:19:31evanhow?
00:19:38evanthats how it's always worked.
00:19:41brixensince there's one call counter and multiple places the method could be inlined?
00:19:53evannow you're getting into the real questions.
00:19:55brixenor is this what you are working on
00:19:58brixenoh ok
00:20:08evanwhen a counter overflows
00:20:16evanwe consider the call stack to figure out what to actually JIT
00:20:25evanso we don't actually JIT the method that overflowed.
00:20:29evanbecause we wanna inline.
00:20:36brixenright
00:21:04brixenis it possible to begin inlining and never reach the method that triggered the search?
00:21:22brixenbecause of code size or something?
00:21:35brixenwhat is the max inline depth budget now?
00:22:24evandepends.
00:22:45evancheckout vm/llvm/inline_policy.hpp
00:23:47brixenhm
00:24:41evanyou can see there are different policys
00:24:45evanbased now on original size.
00:24:53brixenyeah
00:25:01evanthose are largely just made up
00:25:04evanfyi.
00:25:05evan:D
00:25:17brixenheh
00:25:40brixenyes, a hankering for 10*N*(2^3+2)
00:25:52evanpretty much.
00:26:13brixener another factor of 2 in there
00:26:18brixenanyway
00:28:49evanas you can see
00:28:59evanthis policy class governs whether or not to inline a method.
00:31:43brixenyes
00:39:08BrianRice-workinteresting
00:40:48slavahi BrianRice-work
00:42:12BrianRice-workhowdy
01:09:23evanslava: hows NZ?
01:09:37evanslava: you still going to be working on factor?
03:00:35slavaevan: I'm at a coffee shop, working on it right now in fact :)
03:00:40slavaevan: NZ is really nice. auckland is one of my favorite cities
05:33:17DefilerHrm, I'm having trouble with rbt in gdb
05:33:47Defilerprintbt takes a CallFrame argument now it looks like?
05:44:40brixenDefiler: that's broken
05:44:53brixenyou need to fr to an interpreter frame and do p call_frame->print_backtrace(state)
06:17:50brixenthe #require specs should undeniably be cast in bronze as a warning to all that pass by
06:17:58brixenpass by what, I don't know
06:18:13brixena scene from some horrid horror flick
06:19:16brixenI cannot fathom what inspired this code
06:58:57rueIt would be nice to improve
16:08:58rueevan: The date tag in the rc1 download; should it be considered a filesystem artifact or part of the version?
16:57:09evanrue: thats part of the file.
16:57:21evanit's not an artifact, and not part of the version.
16:57:25lopexevan: probably obvious for you: http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programmi ng_GCAP_09.pdf
16:57:45lopexc++/cache misses
16:58:00evanit was requested that the tarballs included in the filename
16:58:25rueThe date in the file name?
16:58:53evanyep.
16:58:55rueDun really matter to me either way, just fixing up rvm.
17:15:19evanlopex: quite interesting.
17:16:13lopexevan: enebo said click said this is major limiter in perf
17:17:28DefilerDoes 'rp' in gdb not work on Modules?
17:17:36evanlopex: makes sense.
17:17:39evanDefiler: it should.
17:17:41DefilerI get results like "-4467297868000003004" when I try sometimes
17:17:50Defiler$3 = (class rubinius::Module *) 0x8401f083fffff889
17:17:54Defilerresults in that when I rp it
17:18:18evanhuh?
17:18:27evanthat looks like p, not rp.
17:18:28eneboThat talk was about advances in hardware architectures and optimizing compilers is pretty much limited by cache misses now...how previously things like branch predition and the like have been useful but wont get much better
17:19:11Defilerhttp://gist.github.com/259623
17:19:22DefilerOh, whoops.. time for some lunch. sorry; don't mean to gist and run :)
17:19:34DefilerIt's probably something I am mangling on those objects
17:19:43evanenebo: we need better tools for diagnosing cache misses
17:19:47evanthats the limiting factor
17:19:56evani wanna reduce them
17:20:00evanbut SEEING them is quite hard.
17:20:37lopexgcc ... -O10 -show-cache-misses
17:21:03lopexand -print-pretty-diagram
17:21:32lopexand (fancy-colors) sub option
17:22:28evani'd just love someone to explain to me how to use Shark to see them.
17:22:41evanit might be in there
17:22:51evanbut I just don't know what to look for.
17:31:17wayneeseguinevan: I *know* I've asked this particular one before and hence I am being daft, however... http://pastie.org/private/ibcxcoqkq0n8duydeg5kva
17:31:57evanum
17:32:15wayneeseguinis it something to do with the -S ?
17:32:23evanno, gem doesn't need -S
17:32:27evanit's entirely unrelated to that
17:32:29evanyou got a syntax error.
17:32:38evanwhy is a shell script being run as ruby code?
17:32:40evanthats your problem.
17:32:47wayneeseguinok without -s
17:32:47wayneeseguinhttp://pastie.org/private/vayczdy8akywqzhfxlhw
17:33:28evanyes, the -S is fucking it up
17:33:32evanbecause it's finding a gem command
17:33:36evanthats a shell script.
17:33:49evanwhy the 2nd one fails, i dunno.
17:33:54evani'd have to look into that.
17:34:13wayneeseguinahh ok
17:34:18wayneeseguinthe shell gem command does the
17:34:29wayneeseguinexcec "rbx" "$@" trick
17:34:36wayneeseguinIIRC
17:34:51wayneeseguinafter setting up environment like GEM_PATH
17:34:52wayneeseguinand GEM_HOME
18:27:35rueevan: Philosophy: in 1.0.0-rc1, is the entire string the version, or can "rc1" be considered comparable to a patchlevel?
18:28:00evani'd say comparable to patchlevel
18:28:10evani suppose in a way it depends on the context it's being used
18:28:17evanbecause without including it in some contexts
18:28:23evanit will be ambigious when rc2 comes out
18:28:29wayneeseguinrue: best solution would be to remove the - between 1.0.0 and rc1
18:30:07evanhow are you using it?
18:30:24brixenrc1, dev, etc should be considered something like a non-version specifier for disambiguation
18:31:01rueThis is why "version" is such a bad concept :)
18:31:08brixen1.0.0 - no specifier, release version, 1.0.0-rcN, 1.0.1-dev the upcoming 1.0.1 version
18:31:51brixen1.1.0-dev => 1.1.0-rc1
18:33:11wayneeseguinevan: the real issue I have is that rvm uses -'s to separate it's ruby string specifiers
18:33:15evanthe - identifier avoids the 0.99999 version problem
18:33:15wayneeseguinso each component means something
18:33:29wayneeseguin{interpreter,version,patchlevel,tag,revision,etc}
18:33:47evanit would probably be patchlevel in there.
18:33:57wayneeseguinevan: that's how I implemented it
18:34:03evanthats acceptable
18:34:09wayneeseguinevan: rue is helping me make the rvm installer of rbx solid
18:34:12evansince that code must explicit compare patchlevels
18:34:21evanin which case, when rc2 comes out
18:34:23rueRevisions + optional names would be better as the standard approach
18:34:32evanthe difference between rc1 and rc2 is obvious
18:34:32wayneeseguinThe only issue was what to do with hte date tag
18:34:34Zoxcwould like to see a solid rbx windows installer :D
18:34:43evanZoxc: we have to run on windows first
18:34:49evanwe've got no windows devs helping
18:34:50Zoxcaww :(
18:34:57wayneeseguinZoxc: rvm supposedly runs under cygwin ;)
18:35:04wayneeseguinor so I'm told :D
18:35:05ZoxcI'll help after I finish mirb ;D
18:35:06evanif I have to figure it out, i'll do it
18:35:12evanbut i'm holding out hope that a windows dev helps out
18:35:17evanso I don't have to learn it all myself.
18:35:50Zoxcit's usually just avoiding forking and shebangs, and possibly using other APIs
18:35:57DefilerI hate how much damage you have to do to build scripts in general when porting to Windows
18:36:13DefilerAnything that uses make is automatically a hassle :(
18:36:51Zoxcmake usually works fine in msys
18:36:58Zoxcbut I hate make
18:37:05evando you have to install bash first?
18:37:06DefilerOnce you've found the 100 parts you have to change to make Windows happy, yeah
18:37:07evanto make make work?
18:37:14brixenavoiding forking?? no wonder windows sucks so bad
18:37:16brixenboring
18:37:19DefilerYeah
18:37:26Defilerevan: Nope
18:37:39Zoxcwhat's good about forking?
18:37:39Defilerhttp://gnuwin32.sourceforge.net/packages/make.htm
18:37:48brixenZoxc: it's a joke
18:37:53Defilerforking has insanely useful semantics
18:37:55brixenforking => fucking
18:37:59wayneeseguin:D
18:38:03wayneeseguinlikes "forking"
18:38:30brixenand yes, in real terms, forking is a very good thing
18:38:37brixenand windows sucks period
18:38:38Zoxcforks brixen with rake
18:40:51evanmy biggest grip is that fork + threads == unknown behavior
18:40:52brixenis thrown into a state of confusion, which instance should type...
18:41:06evanas in, there is no programmer on the planet that knows the behavior
18:41:11evannor how to properly handle it.
18:41:15Defilerhrm.. let's say I have a dup of an object I captured, and then I have a modified object
18:41:16Defileris there a good way in 1.8 to see the nitty gritty details of what is different?
18:41:17DefilerI've got this before and after metaclass, looks like only the superclass changes, but I want to make sure of that
18:42:03evanDefiler: whether or not it has a metaclass is the only thing
18:42:15evanfor what it's worth #clone duplicates the metaclass also.
18:42:18Zoxcthat's because forking is crazy and usually just a poor solution :)
18:42:29DefilerI can't think of a way to check in MRI whether something already has a metaclass
18:42:30wayneeseguindisagrees
18:42:32wayneeseguin<3 fork
18:42:33Defileris there one?
18:42:47wayneeseguinfork-exec == powerful combo
18:42:49evanDefiler: no, you have to write a C extension to do it
18:43:02DefilerThought so
18:43:30brixenDefiler: or maybe use the memprof thing by joe
18:44:20brixenDefiler: seen? http://timetobleed.com/what-is-a-ruby-object-introducing-memprof-dump/
18:45:08Defileryeah, I love his blog
18:45:24evanhe's insane.
18:45:35evanthe runtime patching of code in memory
18:45:40evani hope no one depends on that.
18:45:57Defilerhis lightning talk at GoRuCo was great
18:46:09evanthe caveats for it actually working are insane.
18:46:18brixen"if a tool is built and no one uses it, does it exist?"
18:46:34brixensomeone somewhere will always use some insane thing
18:46:56wayneeseguinI have a great deal of respect for Joe and his blog is quite possibly my favorite to read
18:47:00evani just hope they don't use it when really need it to work.
18:47:58DefilerThere's really no way to prevent people from shooting themselves in the face
18:48:04evanit feels like a saw who's blade randomly breaks off and flys in your face
18:48:23evanand the density of the material being sawed randomly causes the saw to break
18:52:25evanman, then "when to JIT" question is hard to answer
18:52:41evanSELF uses this interesting "invocation rate" idea
18:53:07BrianRice-workyeah, it makes profile counts within a time window
18:53:17evancounters that are inc'd on entrance to a method, and a backtrace thread divides all counters by a constant factor every N seconds
18:53:24evanbasically, counters with a halflife.
18:54:03BrianRice-workever looked at Strongtalk WRT this?
18:54:23evanthe SELF thesis brings a lot of good points about problems with the halflife counters
18:54:24DefilerEver gazed into the abyss of madness?
18:54:29evanBrianRice-work: i TRIED to look.
18:54:31evani've got the source here
18:54:36BrianRice-workhehe
18:54:39evanbut I couldn't find in the source where it was.
18:54:50evanyes, the Strongtalk code is like staring into the abyss
18:54:56BrianRice-workfair enough.
18:54:57evanmy C++ has gotten strong enough again that I can get more of it.
18:54:59DefilerI think that logic is encoded in the strongtalk source file names and checksums
18:55:06evanbut the organization leaves something to be desired.
18:55:26evanand it's hard to know what to look for
18:55:37evanack "when to JIT" gives me nothing.
18:57:11evanthere are some serious gems in the Strongtalk source though
18:57:15evanhere is your line of the day:
18:57:16evan assert(*((u_char*)_invocation_counter_addr - 2) == 0x81, "not a cmp edx, imm32 instruction anymore?")
18:57:44evanthere is so much win in that i don't even know where to start.
18:57:51evan:)
18:58:10Defilerwe have way more meta-metaclasses involved in booting up rbx than I would have expected
18:58:14BrianRice-work:(
18:58:48evanDefiler: i noticed that myself.
18:59:11DefilerThe first one is the meta-metaclass Object, trying to figure out what the hell is opening it
18:59:18Defilerbut there are several in FFI as well
18:59:36evanfind a CallFrame
18:59:41evanin the stack
18:59:49evanand use call_frame->print_backtrace(state)
18:59:51DefilerThat's all newer than my last involvement unfortunately, haven't quite figured out how to navigate it
19:00:03DefilerSo I'm looking for something in bt that takes a CallFrame as an arg?
19:00:09evanyeah
19:00:16evanshould only be a couple frames away
19:00:33DefilerGotcha.. in this case, vm_attach_method has one, 5 back
19:01:06Defiler0x7fff5fbfccc0: Autoload.__class_init__ in kernel/common/autoload.rb:49 (+135)
19:01:06Defiler0x7fff5fbfdaf0: Object#__script__ in kernel/common/autoload.rb:4 (+29)
19:01:14Defilerhaha, I probably wrote that code. owned.
19:01:40Defilerwaaaaaait..
19:01:58Defilerclass << self in a class body should just be a metaclass, not a meta-metaclass
19:02:26Defilerbut in the MetaClass::attach that results from this, the 'obj' receiver is a MetaClass
19:02:43Defilertry_as<MetaClass> will return NULL when given a Class instance, right?
19:02:55evanif it's not a MetaClass, yes.
19:03:14evana MetaClass is a Class
19:03:19evanbut a Class is not always a MetaClass
19:03:21DefilerThis is ultra mysterious to me then. Huh
19:04:10Defilerobj should be #<Class:Autoload> here not #<MetaClass:Class Object>
19:04:38evanDefiler: gist the gdb bt
19:04:45evanso 20 frames
19:04:49evaner. say 20 frames
19:04:51Defilerk
19:06:01Defilerhttp://gist.github.com/259684
19:06:28evanbingo.
19:06:42DefilerI like/hate it when you say that
19:06:42evanyou're creating a metaclass on the metaclass right there.
19:06:55evansee the nested called to MetaClass::attach?
19:07:14Defileraaaah
19:07:40Defilerooooooohh damnit
19:07:42Defilerright
19:07:51DefilerI need to just try_as<MetaClass> on the klass
19:07:55Defilernot call metaclass(state)
19:08:02evanyes
19:08:04evanif you do that
19:08:06evanyou'll generate one
19:08:11DefilerOK, I'll crush this after this meeting
19:08:16evanCRUSH
19:08:19evanORANGE CRUSH
19:08:24Defiler:)
19:08:25evanWITH A SANDWICH
19:08:45evanI think the Hulk would be a fun pairing partner.
19:10:05brixenI thought you paired with ryan before
19:10:18evanZING
19:10:23brixenheh
19:10:34evanI actually have not paired with ryan very much
19:10:37evana few times.
20:37:53DefilerWOW this behavior is strange
20:38:01DefilerI guess I have to go decode eval.c to see what it really does :(
20:39:52brixenmake sure you wear one of those harness thingies and use the ventilator
20:39:59brixenso if you pass out, we can extract you
20:40:08Defilerhah, good idea
20:40:26DefilerIt definitely is doing something more subtle than changing the superclass of the receiver
20:40:49Defilereven though in running ruby code it really really looks that way
20:40:59DefilerObject.m.superclass == Object.m.m returns true, for example
20:41:09brixenhmm
20:42:05brixengets some lunch
20:42:34DefilerI can't tell you how many times I have seen Exception2MessageMapper working on this :)
20:57:18rueI heard it can cause a condition similar to snow blindness
21:06:19Zoxchow do you show the right name of the method in the backtrace if the method is used multiple places?
21:08:23Defilercan you explain what you mean by that?
21:22:01Zoxc1.9 doesn't seem to handle define_method(:hi, new.method(:hello).to_proc) atleast
21:22:08Zoxcstill shows hello in the backtrace
21:24:25Defilerodd
21:25:48Zoxcso I guess I can attach a name to each compiled block then :D
21:25:54DefilerDon't
21:26:00Defilerget the name from the call site at runtime
21:26:14Defilerat calltime, that is
21:29:15ZoxcI'd have to store the names of the calls then and it might be slightly confusing when looking at the source too
21:29:31DefilerYou already have to do that if you want to run, say, rspec
21:30:03Defilereval("caller(0)", some_proc)
21:30:53ZoxcI probably won't be supporting bindings either
21:31:03DefilerWhat are you building?
21:31:24ZoxcRuby VM =P
21:31:55DefilerIf you're not doing bindings, you're not building a Ruby impl (not being rude, just a heads up heh)
21:32:09Defilerbecause without them you can't run irb, rails, rspec, etc etc etc
21:32:48ZoxcI don't really plan to
21:32:55Zoxcand http://ruby-std.netlab.jp/ approves ;D
21:35:15DefilerYeah, well.. almost no real ruby code would run using only the things defined in that standard
21:35:19Defiler:)
21:38:02ZoxcI'm wanting to embed Ruby into other applications where you would usually use an application specific API, requiring new code anyway
21:39:05DefilerAah, OK. Cool
21:39:27DefilerSo you're going C99, embeddable, etc etc, Lua-style?
21:40:05ZoxcYeah, except I'm using a JIT :)
21:40:18DefilerMy advice is simply to attempt to pass rubyspec where you can
21:40:31Defilerthe consequences of 'aah, I'll leave that out, nobody uses it' can be very difficult to forsee
21:40:45ZoxcI could easily implement binding later on anyway
21:41:02DefilerPretty much every extension or deviation rubinius has ever done has needed pulling eventually
21:41:12Defilermost recently metaclasses being instances of MetaClass
22:08:20Zoxchow does MRI deal with object allocators and C methods operating on these objects?
22:34:06evanZoxc: do you have an example?
22:36:02Zoxcsay Array#size, which could be implemented like return RArray(obj)->size
22:36:18Zoxcit would be kind of bad if that method was moved to the String class
22:44:01brixenZoxc: you can't do that
22:49:14evanZoxc: i don't see how moving a method is related to object allocation
22:49:24evanbut none the less, you can't move methods in ruby.
22:50:25Zoxcdoesn't unbind + bind move methods?
22:50:28evannope
22:50:40Zoxcwhat does it do then?
22:51:05evanMethod#call is a special way to invoke a method that is unrelated to where the method originally lived
22:51:34evanand UnboundMethod#bind validates the object and the class it contains internally
22:51:44evanyou can't bind an Array method to a String object.
22:56:15ZoxcMRI has some special object allocator which I assume ensures that a String.allocate always returns a internal string object
23:09:08evanZoxc: String.allocate can only return a String
23:09:12evanhow could it return anything else?
23:09:15evani don't get your point.
23:10:29Zoxcdunno, but the allocator stuff probably has to do something
23:59:21evanZoxc: it allocates an object of the class you ask it to
23:59:23evanthats all.