Index

Show enters and exits. Hide enters and exits.

03:40:21evanman
03:40:30evanstrongtalk has some fucking twisty logic.
03:40:47slavaheh
03:44:41evanslava: do you have any logic for deciding if a word should be inlined?
03:46:06slavaevan: manual declaration, size of definition being inlined, size of definition being inlined into, and precision of type info for input parameters
03:46:25slavaif you have runtime profiling though, you'll be able to do much better
03:46:36evani'm runtime profiling
03:46:39evanjust trying to get a handle
03:46:43evani guess i should just give it a try
03:47:00evanand say something like "let the method increase by 3x only"
03:47:25slavaoh yeah, I also make sure I don't inline the same word too many times
06:36:14evanrad.
06:36:20evani've got accessors inlining
06:45:57brixensweet!
06:47:14evanit's doing slot vs hash table lookup detection at JIT time
06:47:20evanand only the relevent code is output
06:47:32evanso doing [].size
06:47:46evanends up just accessing the position in Array where size_ is
06:48:26tmorniniHey all. I get a Bus error with HEAD Rubinius and LLVM. Is my environment broken, or does this seem reasonable?
06:49:06tmorniniIt happens when I run this:
06:49:07tmorniniRBX_LLVM=1 rake build; bin/mspec ci -B full -T -Xjit.enabled
06:49:47brixenhrm, I can try running it
06:50:07tmorniniAgain, this is HEAD LLVM and HEAD Rubinius
06:50:30tmorniniBus error happens when VM tests normally run.
06:50:31brixenah well, I'm not going to compile llvm atm
06:50:47evantmornini: wait
06:50:49evanwhere is the error?
06:50:54evanrunning rake or running mspec
06:51:02tmorniniLet me double check.
06:51:28tmorniniChrist, every time I try this, LLVM has new revs. Incredible!
06:51:38evanheh
06:51:42evani generally don't update LLVM.
06:51:51evani've got it checked out and built
06:51:54brixenwe should probably have the build task use a specific version of llvm
06:51:56evanand I leave it at the rev it's at.
06:51:59brixenyeah
06:52:03evanyeah
06:52:09tmorniniI lied. :-(
06:52:10tmornini~/Desktop/rubinius: bin/mspec ci -B full -T -Xjit.enabledBus error
06:52:13brixenotherwise we could be continually chasing stuff
06:52:22evantmornini: no dots, nothing?
06:52:26tmorniniNo.
06:52:44evani actually suspect something in LLVM.
06:52:48evani know they changed some stuff with the JIT
06:52:50tmorniniIt take a while.
06:52:55tmorninitakes, that is.
06:52:57tmornini1-2 seconds.
06:53:02evanthats a while?
06:53:07evannot for me it's not.
06:53:10tmorniniActually, about 4 secons.
06:53:11tmorniniseconds
06:53:37evantmornini: lets try something.
06:53:37tmorniniMy point is that it isn't instantaneous. Clearly some work happening before the bus error.
06:53:41tmorniniSure.
06:53:50evanupdate your LLVM to rev 73074
06:53:52evanthats what i'm on
06:54:04evanso go back
06:54:20evanbuild that, do a rake vm:clean of rubinius
06:54:22evanbuild and try
06:54:36evani can update my local LLVM and see if it blows up
06:55:20tmorniniDoing this now.
06:55:32tmorniniWill that rebuild LLVM too?
06:55:53evanno
06:55:55evanyou need to do that.
06:55:59tmorniniok
06:57:07tmorniniNew 13" MacBook Pro with SSD, 2.53 GHz: This thing is quick!
06:57:31evannice
06:58:17tmorniniI been disappointed with my Mac since I "upgraded" my black MacBook 13" to a MacBook Pro 15"
06:58:26tmorniniBut this one seems like a keeper. :-)
06:58:54brixenthe 13" is an awesome size for taking with you
06:59:05evanyeah, the 13" is a definite sweet spot
06:59:29tmorniniAgreed. Since I started walking to work every day, rather than walk down the stairs, the 15" was doomed.
06:59:56tmorniniThe new unibody makes this thing a BRICK.
07:00:11tmornini(in a good sense)
07:00:44evanhah
07:00:44evanyeah
07:00:52evanthe daily commute really puts it into perspective
07:01:18tmorniniI had some hands on with Ed's iPhone 3GS, and that thing is wonderful!
07:01:25tmorniniApps open *instantly*.
07:01:49evanyeah, i've been playing with Abby's
07:01:51evani'll probably upgrade
07:02:19tmorniniI think it's funny that I've been buying faster computers for 31 years, and they're always finally fast enough.
07:02:47evanhehe
07:02:48evanyeah
07:02:55evanhumans a pain that way.
07:03:04tmorniniThey're literally something like 100,000x faster than my first. Crazy how software has grown in complexity.
07:03:06evanare a poin, rather.
07:03:50tmorniniLLVM is a beast. I rarely need to compile it from scratch. :-)
07:04:06evanyeah
07:04:33tmorniniWhat are the [1-3] indicative of? Any idea?
07:05:05tmorninii.e. llvm[2]
07:05:07evanhuh?
07:05:08evanoh
07:05:10evanthats make
07:05:11evani dunno.
07:05:13evanmake is crazy.
07:05:19tmornini:-)
07:06:15scooprI think it's nth-sub-make
07:06:23tmorniniThx!
07:07:15evanlooks like slot access inlining improves access by 12%
07:07:21evantesting table ivars now
07:07:59tmorniniI'm watching the really disturbing scene in Pearl Harbor where sailors are drowning inside ships inches away people on the outside.
07:08:09evanyeah, thats fun.
07:08:17evanwatch that on high volume right before bed
07:08:22evanjust to see what kind of weird dreams you have
07:09:05tmorniniPoignant way to say "war sucks".
07:09:39tmorniniSurprisingly effective for a big budget Hollywood film.
07:11:07tmorniniMan, X86ISelDAGToDAG.cpp is a monster.
07:25:25evanabout 9% improvement for table ivars.
07:27:05brixencompactlookuptable or lookuptable?
07:27:29evanfor this, it would have been compact
07:27:33brixenk
07:27:43evanshould be the same no matter which though
07:27:49evani'm doing the lookup via a function call
07:28:06evanso the inlining is just removing the mechanics of method lookup and dispatch
07:28:17brixenI see
07:28:35evanslot inlining uses no functions
07:28:53evanso that helps
07:29:02evanone interesting thing
07:29:18evanseems slot access un-inlined is slower than table ivars!
07:29:26evani'm looking into why now.
07:29:27brixenno way
07:29:40evani think it's because it goes via the generic mechanism
07:29:47brixenahh
07:29:49evanwhich uses STL to detect the ivar is at a slot
07:30:03evani've got AccessVariable doing specialization
07:30:06evanperhaps it's not working
07:30:10evani'll know shortly.
07:31:14evanoh good
07:31:16evannevermind!
07:31:24evanspecialization is working.
07:31:32evani must have inverted the numbers
07:31:38evanmeasure twice, cut once!
07:31:45brixenhah indeed
07:31:57brixenlearn that is shop class?
07:32:00brixendid
07:32:03evanyep
07:32:10evantech ed was what I took
07:32:14evanit was like shop
07:32:24evanbut we also used the computer milling machine
07:32:31brixen'tech ed' sounds cooler
07:32:39evanwe still did stuff like take apart a 2 stroke engine
07:32:42evanand put it back together
07:32:55evanthat seemed very "shop"
07:33:04brixenthe metal shop/small engine repair were separate from woodshop
07:33:07brixenI did woodshop
07:33:11evanah
07:33:23evanso tech ed was not much wood working
07:33:35evanthe milling machine would etch plastic
07:33:45brixensounds fun
07:33:58evanyou'd design a design and load it via floppy into the machine
07:34:01evanit was pretty cool
07:38:20scooprcnc?
07:38:30evanyeah!
07:38:31evanthaht was it.
07:38:36evanway to kick my brain into gear
07:38:53evani can hear my tech ed teacher saying "ok, who's on the CNC machine today?"
07:39:33scoopr=)
07:45:21tarcierican't wait until self-replicating CNC machines are common place
07:45:21tarcieriheh
07:46:10tmorninihmmm. LLVM won't build for me.
07:46:39tmorniniIf I ./configure, it sets up for a debug build, whereas rake build sets up for a release build.
07:46:57tarcieriomfg another t.{6}i nickname!
07:47:10tmorniniIs debug -vs- release important?
07:47:14evanyou can build it release with ./configure by passing it options
07:47:21evanyes
07:47:22evantmornini: just do
07:47:25evanmake clean
07:47:26evanin llvm
07:47:32evanand let rake fully rebuild it then
07:47:38tmorniniOK, doing now.
07:48:19tmorninitarcieri: We should get together and eat some pasta sometime. :-)
07:48:31tarcierihaha
07:48:33tarcieripasta rules
07:51:31tmorninitarcieri: Are the self-repl CNC machines black monoliths?
07:53:59tmorniniBoom! Undefined symbols:
07:53:59tmornini "llvm::sys::AtomicIncrement(unsigned int volatile*)", referenced from:
07:54:41evanug.
07:54:43tmorninisvn info: Last Changed Rev: 73074
07:55:00tarcieritmorini: they look like big cubes of chinsy plastic, actually
07:55:08tmorniniI'll check out fresh.
07:55:12evantmornini: ok
07:55:14evansorry :(
07:55:31tmorninitarcieri: I think they moved manufacturing from Germany to China. :-)
07:57:36tarcierimore like joe's garage
07:58:57tmorniniLLVM guys need to move to Git.
07:58:57tarcierihttp://reprap.org/bin/view/Main/WebHome
08:00:49tmorniniWow, that's very cool.
08:01:18tarcieriyeah pretty crazy idea
08:05:40scooprthat's even *sweeter* http://www.candyfab.org/ !
08:29:18tmorniniOK, that built and runs fine.
08:29:27tmorniniJust for fun, I'll update to LLVM head.
08:29:47evanwhy?
08:29:50evando you love pain?
08:30:03tmorniniTo make sure it doesn't work. :-)
08:32:34evanokey dokey
08:44:49boyscoutRefactor in prep for inlining work - 805f827 - Evan Phoenix
08:44:49boyscoutAdd ability to inline ivar accessors - 3cee96d - Evan Phoenix
08:44:50evanwoop
08:45:10brixennice
08:52:07tmorniniOK, original issue confirmed repeatable. :-)
08:52:27boyscoutCI: 3cee96d success. 2709 files, 10776 examples, 33796 expectations, 0 failures, 0 errors
08:52:44evanheh
08:57:02evanhow I know we're on the right track: http://gist.github.com/135078
08:58:12brixenevan: what's the top?
08:58:15evanMRI
08:58:21brixenah der
08:58:22brixenheh
08:58:29tmorniniNice
09:07:09tmorninievan: Can you gist the ruby code for that test?
09:12:59boyscoutRename Class::direct_superclass to true_superclass - acac5e3 - Evan Phoenix
09:12:59boyscoutFix a return key alergy - 42abd5a - Evan Phoenix
09:19:16boyscoutCI: 42abd5a success. 2709 files, 10776 examples, 33796 expectations, 0 failures, 0 errors
14:01:19sbryant_workMorning
18:17:56evanbrixen: did you change syck to not use RHASH then?
18:18:10brixenyes
18:18:14brixenthere was only one place
18:18:14evank.
18:18:19brixenit needed rb_hash_size
18:18:28evansomeone wants to use this rjb gem
18:18:28brixenbut, there is that RVALUE struct
18:18:35evanwhich is a ruby/java bridge
18:18:42brixenahh
18:18:49brixenwants to use in rbx?
18:18:58evanwhich uses st internally, and RHASH a few places
18:19:04brixenhm
18:19:12evanso we could provide st.c/h for them to use
18:19:23evanbut that doesn't solve the RHASH issue
18:19:24brixenyeah, I pulled st into syck
18:19:40brixenwell, it probably uses RHASH because rb_hash_xxx are static
18:19:49brixentell 'em to file a bug report with MRI
18:19:50evannope
18:19:56evanit seems to manually manipulate one
18:20:01brixenhm
18:20:06evanusing st_foreach, st_delet, and st_insert
18:20:15brixenwell, what's it doing?
18:20:24evanchecking now
18:20:40evanug.
18:20:47evanwell, the foreach is just clearing the hash
18:20:53brixencool
18:20:57brixenthere is rb_hash_clear
18:21:21evanst_insert is just doing an insert
18:21:52evani guess thats it.
18:21:57brixensweet
18:22:15brixenI could try getting it running if you want
18:22:18evanso we should advise the gem author to change what they're doing?
18:22:24brixenwrangling loader.rb atm
18:22:26evannah, i'm about done with it.
18:22:39brixenyes, advise them to file a bug report with mri
18:22:41evanjust wanted to investigate a little
18:22:48evanwhy with MRI?
18:22:56evanshouldn't the gem author change the gem?
18:22:56brixenwell le'me check
18:23:20brixenstatic VALUE
18:23:20brixenrb_hash_clear(hash)
18:23:26brixenwhat's the author to do?
18:23:33evandamnit
18:23:33brixenwrite their own rb_hash_clear
18:23:35evanstupid MRI
18:23:36evangeez.
18:23:36brixenusing st
18:23:39brixenyes
18:24:09evanwe should put together a .h file
18:24:12evanthat has those things in it
18:24:15evancall it compat.h
18:24:26evanand point people to it to use
18:24:35brixenwell, how would that help here?
18:24:45brixenit won't link with MRI
18:24:51evancould have the gem author copy compat.h into their project
18:24:53evansure it will
18:24:58evanwe'll provide a rb_hash_clear in compact.h
18:25:01evancomat.h
18:25:04evanGR. compat.h
18:25:30brixenwell, I suppose
18:25:50brixenseems a painful workaround to just removing those static specifiers
18:25:56evanit is.
18:26:02evanbut it's something we've got control over
18:26:05evanunlike MRI.
18:26:25brixenwell, I'd rather file the bug, if they refuse, we can
18:26:33brixenbut these gem authors should be bitching
18:26:35evanwell, that will only work going forward
18:26:39evangem authors won't change
18:26:48evanbecause they'll say "now my gem doesn't work on 1.8.6"
18:27:19brixenyes
18:28:16evani'm going to wipe up a compat.h now.
18:28:18evanit's easy.
18:34:53evanhm, are there any thing else I should throw in here?
18:35:28brixenthe RSTRING() => RSTRING_PTR(), RSTRING_LEN()
18:36:25evanok, done.
18:36:47evanwe'll call this the missing header file :D (like the missing manual book series)
18:36:56brixenheh
18:38:26brixenthe fact that the hash functions are static when stuff like rb_iterate is not (and was used in syck) is mind-boggling
18:38:31evanin addition to rb_hash_size, i'm going to put RHASH_SIZE()
18:38:45evansince people actually seem to want the size as a long
18:38:46evannot a VALUE
18:39:34evanyeah.
18:45:14evanha
18:45:29evani guess that 1.8 svn has macros to access the fields of RHASH already
18:45:31evangood for them.
18:47:59brixena couple
18:48:13brixenI don't see the advantage over making rb_hash_xx an api
18:48:31evannone.
18:48:35evanjust interesting.
18:48:45brixenyeah
18:57:23brixenevan: did you notice the rdoc interp time dropped quite a bit the past couple days
18:57:31evanhm, nope
18:57:37brixenthe jit time dropped quite a bit last night too
18:58:05brixenyou'll have to zoom the upper right of the graph to see it
18:58:21evanah!
18:58:23evani can't see it!
18:58:36evancan you move the legend to the upper left?
18:58:42evanthe upper right is where all the action is!
18:59:20brixenheh
18:59:29brixenI can look if there's an option
19:00:58evanplease do
19:01:03evani'd never have noticed
19:02:26brixenwould you prefer to remove the legend completely? with hover you can easily find out which line is which
19:03:13brixenit's easy enough to move it too
19:04:56brixenok, top left it is
19:09:57evano/~ have I ever told you your my heeeeroooo o/~
19:18:06brixenhah
19:18:44brixenyou meant http://www.youtube.com/watch?v=FKTDSfbcbBU right?
19:24:10evanthat made me think of that song
19:24:16evanand you moving the legend made me happy
19:24:19evanso thusly.
19:24:27evanso, i'm copying st.c INTO st.h
19:24:41evanand namespacing all the internal functions and macros
19:24:51evanso we can throw this st.h into capi/ for people to use
19:24:56brixencool
19:25:01evanthen they'll get all the st_* functions directly via the header
19:25:11evanand we don't have to worry about symbol conflicts.
19:31:16evanok, i'm giving up on this gem
19:31:17evanit does
19:31:21evanRBASIC(obj)->klass
19:32:43brixenyuck
19:39:10dgtizeddoes it bother anyone else that when you add a complete new file in a commit, the github commit display doesn't display the contents of the added file unless you click on that file?
19:40:42evannope
19:42:01dgtizedI guess I just expect that you should be able to view all the new code, and not just code that changed -- oh well I guess different people view the use of that differently
19:42:20dgtizedwhy are these bench graphs discontinous?
19:42:34dgtizedat least for the mspec ci runs with jit?
19:43:38dgtizedare those instances where mspec ci failed, no timing value was reported, but the graph isn't smart enough to connect the dots?
19:46:32tmorniniIf the benchmark doesn't complete, why would you connect the dots?
19:47:09brixenyeah, if the bench fails, I insert a 'null', which is what flot expects for 'no value'
19:47:22brixenthe discontinuity is on purpose
19:48:22dgtizedok, was just curious that's all -- does it insert a null if all of the runs fail, or if just one of the runs fails?
19:48:55brixenthey are all separate graph lines
19:50:00tmorninibrixen: weren't many of the discontinuities related to build issues?
19:50:19dgtizedbrixen: I meant each of the runs that you are collecting the median from
19:50:22brixentmornini: no, if it's a build issue, all the benches fail
19:50:39brixenand I remove that file, since it's just noise
19:51:23dgtizedie if 4/5 succeed does it just calculate median from the 4 that were a success or does it mark the whole point as null?
19:51:31brixendgtized: the data is only valid if all trials succeed
19:51:33dgtizedok
19:52:29boyscoutStart work on compat.h header, add st.h - 1403324 - Evan Phoenix
19:52:42sbryant_workbrixen: I was looking at flot the other day and you can move legend to be anywhere.
19:52:55sbryant_workI was actually going to write a patch to move it for you :D
19:54:00brixensbryant_work: it's already moved, but thanks :)
19:54:19sbryant_workoh
19:54:24sbryant_workyeah flot is crazy
19:54:36sbryant_workIs there a way to zoom out?
19:55:03brixenif you use two views of the graph, you can have an index view
19:55:07brixenthere's an example
19:55:22brixenor you could use a zoom out button that just redraws the full graph
19:55:48sbryant_workI was going for the later.
19:55:59brixensbryant_work: send me a patch to embed a google maps type control in the graph :)
19:56:26boyscoutCI: 1403324 success. 2709 files, 10776 examples, 33796 expectations, 0 failures, 0 errors
19:56:28sbryant_workbrixen: how about I start with the reset zoom button and then cannibalize the control?
19:56:36brixensbryant_work: and if you could put street view on the graph line so it'll display in perspective and you can walk in both directions
19:56:43sbryant_workshudders at gwt.
19:56:45evanYES
19:56:48evanstreetview!
19:56:51sbryant_workhahah
19:56:58sbryant_workbrixen: I have an idea for that!
19:56:59brixenI'd like a terrain overview as well
19:57:06evanyes, lets do a 3d flyover
19:57:08evanof the data.
19:57:15sbryant_workIt'd be purely superficial but the different streets could be the different plots
19:57:17evanbe sure to put people waving on the peeks of the graph
19:57:25brixenand, could the graph line have address info (ie, click to show me the commit in github)
19:57:42sbryant_workhaha
19:58:00sbryant_workIs anyone putting this on a gist or on the wiki?
19:58:15brixenwhat's 'this'?
19:58:26sbryant_workthis super awesome google maps benchmark idea
19:58:39brixenit's just between us
19:58:46brixenwell, between you and us
19:58:51brixensince you are going to deliver :)
20:01:24sbryant_workSome lofty features for a benchmark graph
20:01:36dgtizedbrixen: so if it's a sporadic spec failure during benchmark, does that get flagged somewhere?
20:02:19brixenyou can file a ticket, or fix it
20:03:16dgtizedI wasn't saying anything was broken, I was inquiring how things worked
20:03:33brixenwell some as anything
20:03:43brixenwhat's special about this situation?
20:04:28brixenare you running the benches or are you asking about the nightly bench run?
20:04:37dgtizedI'm asking about the nightly bench run
20:04:47brixenok
20:04:56brixenwell, I have the stdout from the run
20:05:07brixenthey are mostly there as a signpost
20:05:16brixenif an issue appears, we'll look at it
20:06:16dgtizedso we know that the discontinuities in the graph are do to deterministic failures that invalidated the whole run?
20:06:39brixenhm, no
20:06:54brixenwe know that there was no valid data for that day
20:06:59brixencould be several things
20:10:01dgtizedwell perhaps now the jit is still unstable enough that it's not worth worrying about, but at some point we might want to use the nightly benchmarking to track down non-deterministic bugs in spec runs
20:11:54evandgtized: "now that the jit is still unstable enough"
20:11:56evanthat doesn't parse.
20:13:49dgtizedsorry it should have read "well perhaps for now the jit"
20:14:43brixenyou're assuming it has anything to do with the jit
20:14:58dgtizedthe graph that has lots of discontinous points is when the jit is enabled
20:15:04brixenyes
20:15:11brixencorrelation is not causation
20:15:27brixenit's a stretch to even assume correlation
20:15:40brixenit happened during a run with the jit enabled
20:15:44brixenthat's all we know
20:16:13brixenthe benchmarks are for tracking time, let's leave it at that
20:16:29brixenif you think the jit is an issue, pull a rev for that day and run the specs
20:17:11brixenthe bench runs at 3:30 am pst, so you can know precisely which rev is being run
20:18:07dgtizedok there are two things here, and apparently by accident I hit a button presuming that it was related to the jit so I apologize
20:18:25brixenit's not a button, no apology necessary
20:18:40brixenI'm clarifying what you are assuming
20:18:54brixendoes no good to chase your tail on assumptions
20:19:14dgtizedthing 1) we periodically have non-deterministic bugs that don't show up on every spec run, which means the automated build bot either catches it the first time, or it doesn't ever
20:19:30brixensure
20:20:07dgtizedgiven that the nightly benchmark runs mspec ci several times, it seemed reasonable to me that perhaps we could leverage that to detect those non-deterministic bugs
20:20:22brixenwell, it's leveraged
20:20:25brixenit has a graph
20:20:38brixenbut you'll have to investigate to get any more info
20:20:58dgtizedare those logs accessable without logging into elle or whatever box it's on?
20:21:05brixenno
20:21:39brixenprobably wouldn't be hard to put a link to them
20:21:46evanwoop!
20:21:48brixenif evan wants to set up a route
20:22:00brixenevan: what'cha woopin about
20:22:05evangot the class checking guard setup to not use any functions
20:22:12brixenswee
20:22:14brixen+t
20:22:21evanone cool thing i've realized here
20:22:24dgtizedok, that would be awesome -- because then we would at least be able to check to see if it's just a random spec failure or something serious that is blocking that graph point
20:22:32evanwith type feedback
20:22:40evanwe KNOW if the object should be a ref or an immediate
20:22:43evanso checking the class is easier
20:22:48brixennice
20:22:54evanbecause we can check if it's a ref object, and bail right away if not
20:23:08evanthen pulling out the class (and then class_id) is easy
20:23:23evanthat creates a nice predictable branch
20:23:31evanbecause the ref check is going to almost always be true
20:23:33brixenvery cool
20:47:36evanlooks like the class guard is 7 instructions
20:47:49evanwell, really 6
20:48:09evanactually no
20:48:17evanthere is delay slot code here...
20:49:00evan5
20:49:46evantest, jnz, mov, cmp, jz
20:50:11brixennot too shabby
20:50:15sbryant_worknifty
20:50:36evanthats for a reference object
20:50:44evanthe class guard for an immediate is 2
20:52:15brixenevan: grabbing some lunch and running an errand, bbiab
20:52:19evank
21:12:54evanhm, ok, so if an method has been inlined
21:13:03evanand someone goes off and changes that method in the class
21:13:10evanthe inlined version shouldn't run anymore
21:13:49dbussinkevan: are you also adding tests for stuff like that?
21:13:57sbryant_workevan: makes sense.
21:14:09evandbussink: i will
21:14:29dbussinkbecause it seems too easy to me to forget something at some moment :0
21:14:30evanso what should happen in that case?
21:14:30dbussink:)
21:14:58dbussinkwhether it should reinline the new method you mean?
21:15:01evancould add anothe flag check to the guard, but then we'd never inline again
21:15:27sbryant_workwhat are the qualifications for method inlining?
21:15:29evani suppose the thing to do is go around and set all the methods that inlined the old version back to use the interpreter
21:15:53evanand dump the JITd version, an reset the call counters
21:15:59evanso that it can be watched and JITed again
21:16:20dbussinkthat would be best solution probably, dunno how often something like this happens in for example rails
21:16:20evansbryant_work: well, i'm writing those as well right now :)
21:16:52evansbryant_work: it's related to likely hood (how many classes were seen at a call site)
21:16:58dbussinkevan: what are the current limitations for inlining? no returns / or something else?
21:17:05evansize of method to be inlined (to control balloning)
21:17:26evandbussink: well, the way I'm organizing it
21:17:38evani'm going to lean on LLVMs inliner a little at first
21:17:50evanso techniquely it should be able to inline anything
21:18:09evanwe'll see how that goes
21:18:32evandoing this will mean nested CallFrame objects in one C stack frame
21:18:34evanbut thats ok
21:19:43evandbussink: i'll probably step carefully into this pool though
21:19:51evanie, i'll restrict the form of methods to be inlined
21:19:59evanto see how it behaves
21:20:16sbryant_workWhat kind of savings do you think will be seen?
21:20:28dbussinkevan: btw, did you find some time to look at the Object#dup issue?
21:20:41evandbussink: nope, not yet
21:20:46evanLazyArray sucks
21:20:48evanis the issue.
21:21:05evani have to code some parts of the kernel defensively for it to run
21:21:13evansbryant_work: well, thats where having LLVM comes into play
21:21:26evansbryant_work: the more code exposed to LLVM, the fast that code is.
21:21:39evanand inlining is a great way to expose code.
21:22:44sbryant_workahh I was wondering how that'd come into play
21:22:58evanconsider something like
21:22:59evano = 1
21:23:00sbryant_workI didn't know if you were going to throw things at LLVM or do things before LLVM and let LLVM do them better
21:23:03evandef foo(a)
21:23:06evan return a + 1
21:23:06evanend
21:23:08evanfoo(o)
21:23:23evanif foo is inlined
21:23:31evanthen LLVM will constant prop the addition
21:23:42evanand it will just become 2 at compile time
21:24:00evananother big one is alias analysis
21:24:11sbryant_workwhat is that?
21:24:21sbryant_workI have a guess but sometimes they're wrong
21:24:40evanthats the ability to answer "is x the same as y"
21:24:49evanwith answers being yes, no, and maybe
21:24:58sbryant_workthat's a tricky thing
21:25:11evanyep, and LLVM does a great job it.
21:25:16sbryant_workNice.
21:25:17evana great example is
21:25:19evandef foo(a)
21:25:20evan a
21:25:21evanend
21:25:33evanwe feed LLVM all the ruby semantics
21:25:50evanso a is read in as an argument, stored as a locals
21:25:55evanthen that local is read and returned
21:26:11evanif you look at the code post optimization though, i'll see that LLVM just turns that into
21:26:15evanread argument 0, return
21:26:24evanit forgoes the whole manipulation of the locals
21:26:30sbryant_worksaves a lot of time.
21:26:35evanbecause it can reason that the value in the locals is the same as the argument
21:26:57sbryant_workThat makes sense with an identity function
21:27:06sbryant_workbut something more complex?
21:27:29evanat the ruby level, it can help, sure
21:27:36evanbut it's more about the data movement required to implement ruby
21:27:38evanthat it helps with
21:27:47sbryant_workahh
21:28:54sbryant_workHow about Procs or blocks?
21:29:32evanthey're another unique place
21:29:57evangiven something like
21:30:05evan10.times { puts "sbryant loves ruby" }
21:30:28evaninlining should be able to do a couple things
21:31:51evan1) inline the code for Integer#times into the caller
21:32:04evan2) inline the code for the block into the inlined version of Integer#times
21:32:18evanand poof
21:32:22evanthe closure is gone.
21:32:39evanit's been turned into a while loop running at he call site
21:32:46evans/he/the/
21:32:58sbryant_workyeah, makes sense.
21:35:27sbryant_workevan: you're teaching LLVM about ruby?
21:35:42evanin a manner of speaking, yes.
21:35:46sbryant_workWhat does that mean, like grammar and calling conventions?
21:38:30evanwell, rubinius is long tail from the grammar
21:38:41evanour internal bytecode is our bread and butter
21:39:15evanas for call conventions, ruby has them, but they're not like C's at all
21:39:26evanthey don't say "the arguments go in memory relative to this thing"
21:39:47evanso i had to create a call convention
21:39:55evanthat can be used by the VM
21:44:05sbryant_workahh.
21:44:21sbryant_workSo you taught it about rubinius bytecode?
21:44:53evanin a manner of speaking again :)
21:44:59evanwhat I do is walk the bytecode
21:45:24evanand for each instruction, use LLVM's API to create IR that does the same thing as the bytecode would do
21:45:26sbryant_workhah, sorry if I'm bugging you. Language design is not my strongest skill. So these are actually helpful for me.
21:45:32evanno prob
21:46:14sbryant_workSo then you let LLVM take over and do its thing because it has all it needs to know?
21:46:22evanright
21:46:34evanso now i've got the method as LLVM IR
21:46:41evanwhich LLVM can optimize
21:46:44evanand turn into machine code
21:47:04evanby that stage, the original ruby code has gone through these transforms
21:47:19evantext / node tree / sexp / AST / bytecode / IR
21:47:50evani guess really
21:47:54evantext / node tree / sexp / AST / bytecode / IR / machine code
21:47:57sbryant_workIR is the intermediate representation?
21:48:00evanyeah
21:48:18sbryant_workokay
21:48:21evanLLVM's API has you build a datastructure (IR) of the work to be done
21:48:28sbryant_workI was trying to see how rubinius leveraged LLVM.
21:52:11sbryant_workthanks evan.
21:52:53evanno prob
21:57:40sbryant_workSomeone asked me about the LLVM integration and now I have answers!
21:57:48evanthere ya go!
21:57:53sbryant_workyeah it was quite a while.
22:05:35evanslava: you around?
22:05:41evanby your tweet, i'm guessing not
22:52:06dgtizedevan: with the example of inlining, you still have to push at least one form of closure context though right?
22:54:12evandepends
22:54:13evanwhy?
22:55:09dgtized10.times {|x| a = x }; x = a + 1 still needs to throw because a only exists inside the scope of the times
22:56:01dgtized(and yes I know it's a stupid example, but if I remember correctly there are more useful ones)
22:56:34evan"throw" what?
22:56:43evanthats a parsing issue
22:56:53evanthats decided LONG before inlining
22:58:46dgtizedi'm trying to remember the example that headius pointed out when we were inlining all instances of loop as a while(1)
22:59:00evanthats totally different.
22:59:18evanbecause we flattening the local scope there
22:59:42evanthis inlining would handle that the vars for the block are sepearte from the vars of the method
23:00:14dgtizedby pushing some sort of block context just before entering the inlined loop?
23:01:12dgtizedmy terminology is wrong here, but I guess I'm asking if we basically treat it as 10.times {|x| x } has an enter/leave block on each call for that example, but inlined it would have an enter_block, while loop, x, exit_block
23:01:40evanit's really not about the block
23:01:53evanbut about what data structure is used to store the locals.
23:02:18evanif a block is inlined, the var access that was inlined uses a data structure that is just for those inlined block vars
23:02:27evanthere is no more block context
23:02:34evani did away with it awhile back
23:02:44evanthere is just CallFrame and VariableScope
23:03:18dgtizedok, and CallFrame takes care of giving exceptions the right list of methods to bubble out of?
23:04:29evanno
23:04:47evanexceptions are entirely flattened into execution logic
23:05:08evanCallFrame doesn't even have to know.
23:05:17evanto pass an exception to your caller, you return NULL
23:05:31evanwho sees the null, and runs it's handlers.
23:06:02evanbecause we use dynamic exception handlers now
23:06:12evanthe JIT can see the rescue "stack" at compile time
23:06:29evanand figure out how to run through the handlers by just jumping to code
23:06:45dgtizedok, so it flattens it, but the exception still thinks that it was fired within unflattened code
23:06:47evanunwind an exception through a method with no handlers is ultra fast as a result
23:06:58evanit ends up being
23:07:02evanif(!res) return NULL;
23:07:13evanthat equiv in machine code
23:07:36evandgtized: why would the exception have to reason about who was handling it?
23:07:49dgtizedI just meant for correct backtraces
23:08:10evanthe backtrace is created when the exception is raised now.
23:08:13evanit's not lazy like before.
23:08:16evanwhich is good actually
23:08:22evanlazy backtraces were commonly wrong
23:08:45ddubI just come back from idling to ask whats going on
23:08:49dduband someone's busy writing a novel
23:09:00evanheh
23:10:00dgtizedevan: alright, I think I follow -- anyway I'll think on the inlining -- there is some example that is nibbling around at the back of my brain, I'll come back when it actually bites on something
23:12:40evanok
23:19:52brixenit would be hard to argue there is any worse code in all of rubinius than loader.rb
23:20:06brixenbut I am close to having an improvement I would say
23:20:06evanoh thats sad.
23:20:12evanthats good.
23:20:14brixenheh
23:20:22evani'm adding deoptimization
23:20:29brixensweet
23:30:00ddubis rubinius so fast now that you have to deoptimize it?
23:30:11brixenyes
23:30:17brixenwe are making the others look bad
23:30:26brixenwhich has social consequences
23:31:11ddubjust move those optimizations on the robots_on_unicorns branch
23:31:22ddubyou can merge them into mainline over the next 3-4 years
23:32:00evanhehe
23:32:19brixenwe have ponies prancing on turtles atm, which is a rather apt metaphor
23:32:31brixenthe robots are vaporware
23:33:04ddubof course, they vaporized the software
23:33:07ddubwith their laser eyes
23:33:12brixenheh