jeremyevans has quit [Ping timeout: 265 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #jruby
_whitelogger has joined #jruby
nirvdrum has joined #jruby
nirvdrum has quit [Ping timeout: 268 seconds]
jeremyevans has joined #jruby
ur5us has joined #jruby
_whitelogger has joined #jruby
drbobbeaty has joined #jruby
ur5us has quit [Ping timeout: 268 seconds]
_whitelogger has joined #jruby
lucasb has joined #jruby
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
<headius[m]> Good morning!
<rwilliams[m]> Top of the morning to ya
knu has quit [Quit: Reboot...]
knu has joined #jruby
nirvdrum has joined #jruby
nirvdrum has quit [Ping timeout: 265 seconds]
<headius[m]> woot
<headius[m]> simple script running from bytecode
<headius[m]> hardcoded logic to dump compiled scripts to ~/.ir
<headius[m]> enebo: I did run into some scope filename issues I'm working around for now
<headius[m]> also realized we still need to be able to set scopes into compiled class in the case of jit, where the existing scope is already live and may have things like refinements on it
<headius[m]> so the from-bytecode scope creation is now only done when building from script body
<enebo[m]> headius: yeah I do have a patch which will get rid of actual errors but has a couple of dangling issues. I am incrementally applying pieces to try and get a cleaner solution with no errors
<enebo[m]> headius: worst case end of day the Fs will just end up being issues to solve
<headius[m]> is spec:compile green for you?
<headius[m]> compiler
<enebo[m]> with my patch? or in general
<headius[m]> you said you'd gotten persist to pass
<enebo[m]> I guess the answer is yes to both
<headius[m]> ok
<enebo[m]> yeah persist is fixed
<headius[m]> may be seeing failures because of a file change I made
<enebo[m]> I think you fixed those two jit errors
<enebo[m]> stashing and trying
<headius[m]> that breaks at least two things
<headius[m]> but I need it because IRScope is null for precompiled script
<enebo[m]> yeah more than two really
<enebo[m]> but that is exactly the main change and then fixing from there
<headius[m]> I can twiddle it to null check for now
<enebo[m]> yeah I null check and dump then trace back and figure out best place to setFile
<headius[m]> I'm trying to get my changes committable even though they're hacky
<enebo[m]> I did it before and got down to 1-2F betweeen spec:ruby:fast{,:jit}
<headius[m]> there's a propery compile.cache.classes that turns on the hacky caching
<enebo[m]> fast was green and jit had the two errors
<headius[m]> on CI?
<enebo[m]> no not committed...only talking about my local stuff
<headius[m]> I do see two jit errors still locallyoh ok
<headius[m]> oh ok
<enebo[m]> and for HEAD there are still 2 jit errors
<headius[m]> I have two errors locally from my stuff
<headius[m]> but I'll fix those and push
<enebo[m]> not related to persistence but to FOR and END
<enebo[m]> ok cool
<enebo[m]> I can guarantee I can get to almost no failures and certainly no crashing today for File
<headius[m]> ok
<enebo[m]> I mean I was already there last night so now it is just a second iteration to make sure each individual thing is in right place
<enebo[m]> nearly all failures are around new scopes for eval or root compile
<headius[m]> ok
<enebo[m]> most staticscopes do actually have an appropriate file before starting this
<enebo[m]> headius: one outstanding this I thought you would trip over was IRRuntimeHelpers.prepareScriptScope
<enebo[m]> headius: That does still rely on IRScope.getScriptDynamicScope
<enebo[m]> That I think is the very last thing I am aware of in JIT which uses IRScope besides File
<headius[m]> yeah I do
<headius[m]> I'm skipping that whole chunk if the IRScope is null
<headius[m]> in which case the script just goes ahead with its persisted StaticScope and creates a new DynamicScope
<headius[m]> I don't know what that will brea
<headius[m]> break
<enebo[m]> yeah it is is really only for script and not eval then I doubt much
<enebo[m]> I guess I don't know how much that represents something real...I assume it must
<enebo[m]> going to make some coffee
<headius[m]> do it
<headius[m]> ok one error was because the new duped END scope did not have a parent
<headius[m]> other appears to be due to "for" double-wrapping the parent scope
<headius[m]> so when I try to look up parent scope it's a weird extra one
<headius[m]> enebo: look at IRFor constructors
<enebo[m]> yeah weird...it shold just be super with the staticScope
<enebo[m]> unless something magic breaks from that
<enebo[m]> I have left this tab open for a long time :) https://gist.github.com/enebo/59dae5d15c909b7902c97e2eb920b4c9
<enebo[m]> I think I realized another issue to work through but IR becomes quite a bit simpler without IRFor as an actual concept
<headius[m]> so it wouldn't find it in any of the JIT caches of scope fields/descriptors
<headius[m]> one of them constructs a new scope and then passes that to another constructor that also creates a new scope
<headius[m]> so in JIT I'd have the for scope in hand and try to find the parent, but the parent is two up instead of one
<headius[m]> spec:compiler is green locally, I'm pushing what I have!
<headius[m]> those were out of order messages
<headius[m]> I'll leave it as an exercise for you to figure out the right order
<headius[m]> pushed!
<headius[m]> -Xcompile.cache.classes to try breaking things
<enebo[m]> going to finish file before I go onto that shiny
<headius[m]> I guess we never got metaclass done
<enebo[m]> I can feel that eating the rest of the day
<enebo[m]> well I don't even know how to push that via indy
<headius[m]> chuggity chuggity chug
<enebo[m]> I told you I had it all pushed back to runtimehelpers but I did not know how to do that for indy
<headius[m]> ok
<headius[m]> I'll finish that now then
<enebo[m]> so it is literally just pushing those few things in that helper method through
<headius[m]> but hey we got through a few scripts :-D
<enebo[m]> well with that down it will only be File/FILE require_relative and probably the dynamic scope thing you are bypassing
<enebo[m]> and two of those three will be fixed soon...
<enebo[m]> I think it is possible there are IRScope related access in unexpected places yet but it will not be via method/block/jit so maybe it won't matter
<enebo[m]> getIRScope itself is not inherently evil...it is how all interpreted stuff works so it is mostly making sure we never need it in JIT/AOT
<headius[m]> it is EVIL
<headius[m]> ok what do I need to do for metaclass?
<headius[m]> I need to review that conversation
<headius[m]> o I see
<headius[m]> o i c
<headius[m]> so from there down it's using StaticScope but JIT still tries to pass in IRScope
<headius[m]> gotcha
<headius[m]> hmm line number should be in static scope?
<headius[m]> ick
<headius[m]> metaclass body doesn't have protocol?
<enebo[m]> well that could be an opt but today those are passed as constants
<headius[m]> is this the only one?
<enebo[m]> the only what?
<enebo[m]> File and line can eventually be gotten from StaticScope once we can guarantee it is correct but I am only fixing file today
<enebo[m]> once file is fixed I will remove it from all class/methods and defer back to staticscope
<enebo[m]> same for line but I have not tried to verify line at all on staticScope
<enebo[m]> but metaclass only needs staticscope and maybeusingRefinements
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:b6ea561 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641808014 [150 min 14 sec]
<enebo[m]> the later I knew how to do in indy
<enebo[m]> and file and line of course
<enebo[m]> your no protocol observation is similar to me noticing inliner may have only be using boxed call path
<headius[m]> ok
<headius[m]> CompileIRNoProtocolMethod wants a line number
<enebo[m]> Yeah once file is done I should probably remove from CompiledIR*
<enebo[m]> yes
<enebo[m]> file/line/staticscope for that
<headius[m]> I have no line!
<headius[m]> NO LINE!
<headius[m]> staticscope has no line
<enebo[m]> you pass it from JVM visitor to indy
<enebo[m]> and indy to the helper
<headius[m]> that's fine
<enebo[m]> heh so is there a question still?
<enebo[m]> more or less any reference to IRMetaBlerrggh in that IRRuntimeHelper needs to be passed from JVMVisitor through indy (or gotten from something in bootstrap)
<enebo[m]> I believe my confusion with that one was the extra handle transform
<enebo[m]> prepareBlock did not do that extra stuff
<headius[m]> nah it's ok I can embed all the way from JVMVisitor through to indy
<headius[m]> we'll need to decide on the best way to verify cached IR and class
<headius[m]> I'm not sure e.g. python does anything more than checking last modified
<enebo[m]> yeah it is a good question
<headius[m]> aha I may have a tricky one now
<headius[m]> eval needs parent IRScope to be around?
<headius[m]> seems like that's what's blowing up now
<enebo[m]> oh! uh oh
<enebo[m]> honestly I do not think it is much more that variable access
<headius[m]> yeah I wouldn't expect so but this is killing our internal enumerator.rb
<headius[m]> because we eval some method defs
<enebo[m]> It is a wrinkle which needs to be examined
<headius[m]> probably a good justification for removing eval in kernel though
<enebo[m]> yeah although the odds of rubygems using it are probably fairly high
<enebo[m]> but removing evals would not be a bad thing if we can internally anyways since it kills a parse
<enebo[m]> I am too in-thought on this file stuff to examine what it will take for eval not use a parent one
<enebo[m]> I do feel that is a bit of a rabbit hole since it could be multiple nested closures and see down more than one scope
<enebo[m]> with that said an eval present in a file could just force full serialization of the file
<enebo[m]> that would likely be a quicker path to making this run more stuff
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:c7b1bc7 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641816245 [143 min 4 sec]
<headius[m]> this.closureId = lexicalParent.getNextClosureId();
<headius[m]> that's what it blows up on
<headius[m]> in IRClosure constructor
<headius[m]> I'm sure it would blow up on more though
<enebo[m]> yeah it probably will at least look at local vars but that one is not very important
<enebo[m]> it could be any number so long as it is not the same number as another closure at that level
<enebo[m]> and I am not even sure that is true
<enebo[m]> actually I doubt that is true
<enebo[m]> It is nice to see CLOSURE_4 and know it is the first lexically seen closure
<enebo[m]> but not important for running
knu has quit [Quit: Reboot...]
ur5us has joined #jruby
<headius[m]> I'm replacing these with block evals and define_method for now
<headius[m]> I'm not pressing on eval for the moment because it goes on to use the parent scope for other stuff
<enebo[m]> yeah more than variables?
<headius[m]> well I don't know... IRClosure passes parent scope to parent constructor which sets lexicalParent and that's accessed dozens of places
<headius[m]> I mean it does have to create a scope for eval, so...I'm not sure how to resolve that
<headius[m]> hopefully it's possible to compile and execute an eval without a parent IRScope :-)
<enebo[m]> yeah I am not fully sure but weirdly I just ran into that getNextClosureId() problem
<enebo[m]> It is in eval for jit
<headius[m]> until this is fixed probably will have to turn scope setting back on
<enebo[m]> I think it is fine if eval is present to just do old school full serialize
<enebo[m]> or I should say it is better than nothing
<headius[m]> yeah but I can't
<enebo[m]> we treat it same way as too big method in a file
<headius[m]> unless you mean non-jit IR serialize
<enebo[m]> I mean how AOT worked before we started
<headius[m]> it would basically invalidate the whole file from bytecode jit right now
<enebo[m]> yes it will
<headius[m]> ok
<enebo[m]> I think we will have some slowness from that but overall hopefully most ruby files do not have eval
<headius[m]> well hopefully it's a temporary limitation
<headius[m]> I'd say worst case we have to stand up skeleton IRScope
<enebo[m]> I am a little confused though..I am doing spec:ruby:fast:jit and so we could for JIT still put the live IRScope in there
<enebo[m]> if AOT it is different obviously
<enebo[m]> "in there"...meaning some static field with a live IRScope
<headius[m]> JIT is fine because it always sets live scopes because it has to (and it has them)
<headius[m]> AOT is standing up StaticScope only
<headius[m]> there's no IRScope anymore after AOT
<enebo[m]> ok then I am confused why this is broken since I am not doing AOT
<enebo[m]> I am going to end up having to rediff and then reapply my changes since my stash pop ended in a tiny conflict (which then tried to commit a zillion files)
<headius[m]> what are you doing?
<headius[m]> this breaks any main script with eval in it too
<headius[m]> but I don't think you're doing that
<enebo[m]> no I was just trying to get my file changes working but when I pulled that last commit it detected a conflict when I did a stash pop
<enebo[m]> so now I have this dirty tree which is a combination of your last commit and my changes
<enebo[m]> but your last commit is why I am seeing these errors
<headius[m]> is this the IRClosure line?
<enebo[m]> I may actually go back one commit and be green then apply my changes
<enebo[m]> yeah from IREvalScripty -> IRClosure
<headius[m]> hey almost everything at boot AOTed ok
<enebo[m]> spec:ruby:fast:jit it shows up
<headius[m]> one of them is has a giant hash though
<headius[m]> uri/common.rb
<headius[m]> everything else in kernel and rubygems compiled
<enebo[m]> but your last push broke some non AOT stuff
<headius[m]> yes I'm not surprised
<enebo[m]> yeah I am going to work off previous commit for now to get file working
<headius[m]> you are probably seeing top-level scripts fail because they try to AOT?
<headius[m]> I'm not sure what you're running
<headius[m]> oh spec:ruby:fast
<headius[m]> yeah anything that spawns would blow up
<enebo[m]> ruby:fast:jit
<headius[m]> probably
<headius[m]> I'll check it
<enebo[m]> yeah so likely you are correct...let me look at trace
<enebo[m]> tures//home/enebo/work/jruby/spec/ruby/language/predefined/fixtures/toplevel_binding_id.rb:-1
<enebo[m]> yeah likely top-level runs from within spec
<headius[m]> running now
<headius[m]> I did botch top-level and have a fix for that
<headius[m]> I was setting the scope module to the top self singleton class, not Object
<headius[m]> I'll push what I have, more is working
<enebo[m]> ok
<headius[m]> now I'll restart my run
<headius[m]> other than that giant hash this is pretty good
<enebo[m]> I think I can stash and pop even though part of this stash are your last commits changes
<enebo[m]> it will just notice they are the same
<enebo[m]> I wonder how many files contain evals
<headius[m]> apparently none at boot other than enumerator.rb
<enebo[m]> I am ok with outstanding problems but I suspect we can lightweight an IRScope(s) to make that work
<headius[m]> only eval remaining in kernel is Signal.trap(sig, string) form
<headius[m]> which I didn't even know exists
<enebo[m]> heh yeah weird
<headius[m]> toplevel_binding_spec NPE
<headius[m]> in require_relative
<enebo[m]> simple fix in my code
<headius[m]> I see it
<enebo[m]> change to getScope.getFile() from getScope.getIRSCope.getFile
<headius[m]> scope file change
<headius[m]> yeah
<enebo[m]> I could probably push what I have although it could make us a tiny bit redder but it will make any issues with the change above go away
<headius[m]> huh I did a search for .getIRScope().getFile() and that's the last one
<enebo[m]> yes
<headius[m]> did not check just references to getFile
<enebo[m]> but the problem largely is not accessing that but more than asking staticscope requires a file to actually be set
<enebo[m]> my local changeset fixes nearly all of them (and maybe all of them)
<headius[m]> I can tweak JVMVisitor to only omit scope setting in the caching classes case we're working on
<enebo[m]> current HEAD makes it tough to know
<headius[m]> that should keep things normal running normally
<enebo[m]> tring spec:compiler
<enebo[m]> that is a pretty good test
<headius[m]> that should be green after my push
<enebo[m]> yeah locally is gree for me
<enebo[m]> ok pulled and seeing how things run
<headius[m]> spec run not done but only exceptions so far are from eval
<enebo[m]> if I get spec:ruby:fast{,:jit} and spec:compiler green I push
<headius[m]> with the file fix for require_relative
<enebo[m]> assuming the eval is fixed for jit
<headius[m]> for jit it was never broken
<enebo[m]> well I was seeing spec:ruby:fast:jit broken for me
<enebo[m]> for eval but it was as you thought top-level invocations
<enebo[m]> which you probably fixed now
<enebo[m]> spec:compiler fine
<enebo[m]> running spec:ruby:fast (which is more of a me thing on these staticscope file changes)
<enebo[m]> it was green before so just a little sanity
<enebo[m]> headius: travis is not loving that last commit
<headius[m]> ugh
<headius[m]> define_method problems
<headius[m]> I think I know how to fix
<enebo[m]> I did fix one of those for file locally
<enebo[m]> duplicate() needs to setFile
<enebo[m]> it will also fix for and end
<headius[m]> ah ok
<enebo[m]> I half feel I should just push my changes now :)
<headius[m]> yes
<enebo[m]> whether we are green or not since you commited things asking static scope for file
<enebo[m]> I will push once I see results from this fast run..."fast" run
<headius[m]> not so fast anymore
<headius[m]> need to cull out slow specs again
<enebo[m]> so you made changes to enumerator which is wrong I think
<enebo[m]> a whole bunch of lazy errors
<headius[m]> yeah it's because define_method sucks
<headius[m]> it's not quite an exact replacement for eval'ing a def
<enebo[m]> ok pushed
<headius[m]> I'm looking into it while my spec runs
<enebo[m]> hehe....write a tmp file and load it!
<headius[m]> hah sure
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:17c53f1 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641825445 [145 min 55 sec]
<enebo[m]> you know non-capture evals should be fixable without a parent scope by changing logic a bit
<headius[m]> might be a bug in block_given?
<enebo[m]> Actually maybe not so simple...we look down the scope until we find the variable but evals will just create for the special slot if it cannot fins it
<headius[m]> yeah I don't know how many evals that will cover though
<headius[m]> it wouldn't have helped any of those in enumerator.rb
<enebo[m]> well all method ones should be fine
<enebo[m]> captures are not uncommon but not all of them
<enebo[m]> I will shut up on that idea for now though. I feel like I need to study this a bit to figure it otu
<enebo[m]> ok with my changes pushed test:mri only failed with lazy enum
<headius[m]> hmm strange...setting scopes should have eliminated these eval fails
<headius[m]> method ones definitely capture
<headius[m]> for the name of the method at the very least
<headius[m]> oh wait no you're right
<headius[m]> they are interpolated into the string
<headius[m]> ahh I see... my run unconditionally uses the blank staticscope which wipes out that top level
<headius[m]> enebo: did you see spec fast jit running green?
<headius[m]> I see some failures still but they don't seem related to my work
<enebo[m]> headius: hmm I just ran non-jit a few minutes ago and the lazy enum stuff was broken
<enebo[m]> [115/122] TestLazyEnumerator#test_zip_nested = 0.00 s
<enebo[m]> 22) Error:
<enebo[m]> If you pushed for that then I should repull
<headius[m]> I mean before this recent stuff
<headius[m]> was it ever green
<headius[m]> yeah I have tons of stuff that doesn't pass but seems unrelated
<enebo[m]> oh spec:ruby:fast:jit had like 15-16 EF
<enebo[m]> they were not very important problems but not completely green no
<enebo[m]> have you ever seen massive retests on test:mri:core:jit from the parallel testing stuff
<headius[m]> oh ok
<headius[m]> good
<headius[m]> not massive retests but always some
<headius[m]> so I got 18F8E now
<enebo[m]> This run is redoing 2673
<headius[m]> there are some lazy failures still from my change
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit_irscope_removal:f0821fe by Thomas E. Enebo): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641828466 [162 min 31 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> it does redo any thing that fails
<headius[m]> so you may just have a ton of failures?
<headius[m]> screw it I'm going with the ugly fix for lazy and just redefine the same method N times
<headius[m]> that should get back to flush
<enebo[m]> well I am up to 744 and only have 27
<enebo[m]> mostly lazy but a few IRClosure NPEs
<enebo[m]> actually exactly this output: https://travis-ci.org/jruby/jruby/jobs/641828469
<enebo[m]> well the good news is I do not see any file issues now
<enebo[m]> and I just remembered I have println + printStackTrace in there still
<headius[m]> yeah ok
<enebo[m]> pushed with skipci
<headius[m]> ok I have more fixes locally to push
<headius[m]> I will push with CI once I do a quick sanity check
<enebo[m]> So personally I think for evals we will need to be able to materialize IRScopes as simplest solution
<headius[m]> eval should work again for target script with this push
<headius[m]> hmm ok
<headius[m]> that's a tricky one then
<headius[m]> we need to be able to restore them individually, rather than as a tree
<enebo[m]> well it is but we have a longer term plan to bring back IRScopes like how you did StaticScope with handles
<headius[m]> yeah
<enebo[m]> but for that to work we need to change IRpersist a lot
<enebo[m]> which is ok
<enebo[m]> but it is not for the next week
<headius[m]> right...need to be able to just persist what we can't get out of StaticScope
<enebo[m]> I think we accept this limitation of evals though
<headius[m]> once we can do that we can lazily restore IRScope as needed
<enebo[m]> yeah
<headius[m]> and if we can do that then we only need to restore IRScope up to frame scope
<headius[m]> for an eval
<enebo[m]> and honestly IRScope is for building/compliling so this is a reasonable limitation
<headius[m]> it won't need to restore anything but structural info
<enebo[m]> and when we thinking about AOT loaded code if we ever want that to be able to speculatively optimize in IR we need to be able to this for any scope
<headius[m]> yes
<headius[m]> ok lazy is green so I'm pushing
<headius[m]> bbiab
<enebo[m]> yeah having worked on that yesterday I can say I have a lot more knowledge about persist paged into my brain
<enebo[m]> I will work until at most 5pm today and not tomorrow
<enebo[m]> Monday I think regardless of where we are we make a draft of talk
<enebo[m]> I am fairly bullish on all this right now. We did a ton of runtime decoupling and it is nearly totally done. The only significant goal we wno't get done is incremental parent up loading of IRScopes on demand
<enebo[m]> but that is ok. We will just drop back to 9.2.9 persistent loads for those files which contain evals. Not the end of the world
<headius[m]> Yeah, I need to unify the logic for loading from class to support both
<headius[m]> The pure bytecode logic is really shoehorned in at the moment
<enebo[m]> ah yeah and you plan on working Sunday
<headius[m]> But hey, it appears to be working
<headius[m]> Eval will bite us for gem list since it probably will need to evaluate specs
<enebo[m]> yeah but it was always going to be a cost
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:e1233aa by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641835639 [159 min 14 sec]
<headius[m]> Better
<enebo[m]> yeah I think one failure is probably module wrapper on load getting its scope lost
<enebo[m]> another I am looking at which is somehow optimizedynscopes is getting called when it has no closures within it ... should not happen
<enebo[m]> There is one single lazy enum test failing
<enebo[m]> so we are largely down to 3 issues to being green again
<headius[m]> ok
<headius[m]> ahh I missed a paste
<enebo[m]> ooooh ok that closure thing is END {} in a file so it is not realizing it is an end and thinks it can do analysis
<headius[m]> ah well that's likely a side effect of me trying to patch around it not having its own scope
<enebo[m]> maybe but there is some isEND marker on IRClosure
<headius[m]> wow that pasted terribly
<headius[m]> my brute force elimination of evaled defs
<headius[m]> pushed that fix
<headius[m]> MRI should be ok except for the END thing you're looking at
<headius[m]> looks like END fix would fix -Ptest too
<enebo[m]> well that is the only thing I think it fixes
<headius[m]> aha and I was wondering if I broke load wrapping
<headius[m]> it appears I did
<enebo[m]> the third one I think is about load + wrap
<headius[m]> yeah I was being lazy and didn't do wrapping in AOT script
<enebo[m]> I do not see how that END commit broke anything
<headius[m]> most recent END commit just fixes parent... but previously I cloned scope
<headius[m]> I would suspect the earlier change more
<enebo[m]> cloned end scope itself?
<enebo[m]> just the parent
<headius[m]> end was getting parent's static scope
<headius[m]> so I changed it to get a clone of parent's scope because it can't share a scope for AOT
<enebo[m]> static scope should not be important at all for this ... I don't think so anyways
<headius[m]> maybe not that stuff then
<headius[m]> ok
<enebo[m]> I mean it is fairly clear if it shows up as getClosures() something which adds to that is adding it when it should go oh isEnd() and say nope
<enebo[m]> 10ec7bef9fb0a910c14b8583e6bdd25ed521919d looks suspect but then why would this have passed up til now
<enebo[m]> and it does not really look suspect
<enebo[m]> you duplicate the staticscope so it ends up being needed
<enebo[m]> anyways I will figure it out
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit_irscope_removal:e49609f by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641842319 [162 min 36 sec]
travis-ci has left #jruby [#jruby]
<enebo[m]> ok I have a fix and it is doing what I said it should be doing (but seemingly never was before)
<headius[m]> ok
<headius[m]> I am fixing load wrap
<enebo[m]> your fix for lazy did not seem to work or it changed the result to make another test fail?
<headius[m]> odd that this didn't fail any MRI tests
<headius[m]> hmm really?
<headius[m]> that should have been it
<headius[m]> I'll have a look while this sanity-checks
<headius[m]> bleh maybe I missed two pastes
<headius[m]> this is just an inspect difference
<headius[m]> yup
<enebo[m]> 10ec7bef9fb0a910c14b8583e6bdd25ed521919d did actually cause the END issue in -Ptest but I really don't see how. I guess probably something magical with not setting ScoeType before
<headius[m]> yeah probably never saw the END scope at all before
<headius[m]> now it sees it as a closure
<enebo[m]> I mean yeah that is the exact issue
<enebo[m]> but I only see staticscope changes
<enebo[m]> IRScope analysis does not look at staticscope
<fzakaria[m]> Hey @headius: I got a tiny repro for https://github.com/jruby/jruby/issues/6045
<fzakaria[m]> I'll add a comment with the project name (sorry to interrupt yoru convo)
<headius[m]> ah great thanks
<fzakaria[m]> just cleaning up the example.
<fzakaria[m]> brb gonna reward myself with a beer
<headius[m]> right on
<enebo[m]> ah this must be a flags issue
ur5us has quit [Ping timeout: 268 seconds]
<headius[m]> ok I think I have wrap fixed
<headius[m]> I need to go through these suites and figure out why they're not green on macos
<headius[m]> always a couple failures in jruby and rubyspec
<headius[m]> yeah I get 1F1E in jruby always due to some network difference
<headius[m]> multicast something or other
<headius[m]> and some udp socket binding failure
<enebo[m]> I get 2 errors on spec:ruby:fast due to ip
<enebo[m]> perhaps the same 1F1E
<headius[m]> I pushed wrap and lazy fixes
<headius[m]> yeah could be
<headius[m]> I don't have them in front of me but the spec failures are also network related
<enebo[m]> yyeah mine too
<headius[m]> I think my push should pass everything except those END issues
<enebo[m]> I am getting closre
<headius[m]> closure or closer, either make sense
<headius[m]> I am staring at travis and contemplating food
<headius[m]> I wish appcds archives were portable
<headius[m]> would be nice to precompile everything and ship an archive for it
<headius[m]> jruby AOT passed
<headius[m]> END needs to go away in 3.0
<headius[m]> class Kernel; alias END at_exit; end
<headius[m]> parser still has to change but that would be lke a 99% solution
<headius[m]> hmm wrap isn't quite right, specs failed
<enebo[m]> I think END could be simulated via begin/finally
<headius[m]> ah true it's scoped to script not runtime
<headius[m]> so a begin/ensure that just runs the stacked up END blocks
<headius[m]> and parser just stacks them
<enebo[m]> so in debugging with the commit mentioned above when it switches to full IC I can see no nestedClosures and just FLAGS_COMPUTER
<enebo[m]> err that is when it is working
<enebo[m]> after the commit is contains nestedClosures and has a flag CONTAINS_END
<enebo[m]> err HAS_END_BLOCK
<headius[m]> hmm
<enebo[m]> I don't see how specifying staticscope changes this at all
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit_irscope_removal:8110f45 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641849895 [159 min 39 sec]
travis-ci has left #jruby [#jruby]
<enebo[m]> looks like a few wrap errors still exist
<headius[m]> ok wrap is broken for AOT scripts with or without this branch
<headius[m]> it doesn't pass the proper self through to execution
<headius[m]> man these entry paths from Ruby to code need a total overhaul
<headius[m]> run and parse and load variants have a ton of duplicate code and several paths are not even needed
<headius[m]> well that will fix some AOT failures somewhere
<enebo[m]> HAHAHA OMG
<headius[m]> wrapped AOT load is working now and wrapped interpreted load is repaired
<headius[m]> this should fix remaining spec failures
<enebo[m]> I still don't know why this fails BUT in both before and after commit they both fail to actually full compile on that pass
<headius[m]> aha
<headius[m]> well that's a clue
<headius[m]> that END scope screws everything up
<enebo[m]> well it does or it doesn't but the assert failing changes something because of that staticscope change
<headius[m]> enebo: everything runs fine from precompiled up until specification.rb uses eval
<headius[m]> so that's another big leap forward
<headius[m]> oh and that uri file with a giant hash still doesn't load
<headius[m]> giant hashes I can probably figure out a way around...right now all hashes are created by pushing EVERYTHING onto JVM stack, which is why I had to cap it at like 128
<headius[m]> we need chunking
<headius[m]> we need chung king
<enebo[m]> pushed a fix for END
<headius[m]> we need chongqing
<enebo[m]> Presence of END is already a massive deopt so I am not performing in the presence of an END. The pass was not really running on it anyways
<enebo[m]> So it is not like I eliminated an optimization...I am pretty perplexed though. I really don't see how adding a duplicated staticscope would change anything here
<headius[m]> maybe we should actually try to compile it as an ensure after the trip
<headius[m]> yeah I dunno
<enebo[m]> yeah I also am somewhat game on removing FOR via similar simulation
<enebo[m]> END is easier I think
<headius[m]> uri/mailto.rb has an eval too
<headius[m]> used by gem -v
<enebo[m]> so you plan on working tomorrow and making fallback AOT work when new AOT is either too big or contains and eval?
<headius[m]> yeah that would be a good item for tomorrow
<headius[m]> or just don't even try to AOT
<enebo[m]> I am not working tomorrow
<headius[m]> we will still need source on filesystem for load searches anyway
<headius[m]> is there a way to determine if a file has an eval in it other than walking everything?
<headius[m]> I could disable AOT for those files right now
<enebo[m]> search of all scopes for flags == USES_EVAL is simple enough to systemize it
<enebo[m]> which would be a little different than how too big methods would not AOT but it is just a scope search for that flag
<headius[m]> yeah disabling is the quick fix
<headius[m]> unification is better
<headius[m]> but unification just saves parse+compile at a cost of deserializing
<enebo[m]> I am mostly thinking about this for time and not what we should do
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:541e39e by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641856066 [160 min 32 sec]
<enebo[m]> Ultimately we have same serialized chain as staticscope for irscope and we just grab on demand
<headius[m]> what can I walk on non-dry-run scopes to get children?
<headius[m]> I need to be able to walk whole script to look for evals
<enebo[m]> err yeah not dry hmm
<enebo[m]> we could just enable that now
<enebo[m]> it will just cost a HaspMap instance atm
<enebo[m]> One more commit and we can eliminate that cost by combining with nestedClosures
<enebo[m]> but for now I think that would allow that search
<headius[m]> should I flip it true in manager or force it at parse time?
<headius[m]> same difference really
<enebo[m]> or just delete the checks
<enebo[m]> for adding lexical scopes
<enebo[m]> just add them unconditionally
<enebo[m]> then we will commit to short term combining the two containment fields to get memory back
<headius[m]> ok
<headius[m]> and kill the boolean
<headius[m]> if I make it do the adds it will be pointless to have it
<enebo[m]> I mean the real cost of this will be that module/class bodies will end up with a live hashmap
<enebo[m]> methods which have closures will end up being a little bit bigger (maybe)
<headius[m]> arraylist you mean?
<enebo[m]> ah yeah arraylist
<headius[m]> yeah this won't be very big
<enebo[m]> and we can reduce that to [] + int
<enebo[m]> if we care
<enebo[m]> AOT also will save us a lot of memory already in theory
<headius[m]> yeah
<enebo[m]> so if we post-install + appcds when people install all of stdlib + gems will end up having no ir
<enebo[m]> I guess we dont drop to 0 technically but the heap will be smaller
<headius[m]> I might be close to having rubygems load from cached classes now
<headius[m]> with the eval change
<enebo[m]> nice
<headius[m]> -X+C works now by excluding eval scripts
<headius[m]> so in theory I just have to paste some code over here...
<headius[m]> that's halfway awesome
<headius[m]> yard_minus_0_dot_9_dot_20
<headius[m]> maybe some better mangling in the future
<enebo[m]> so how do we hook up appcds?
<enebo[m]> just jar it up and Class.forName after we load?
<headius[m]> yeah
<headius[m]> or classes on filesystem if cds supports that
<headius[m]> I have been testing with CLASSPATH=~/.ir
<enebo[m]> ah but that will be weird
<enebo[m]> slashes are package names no?
<enebo[m]> or does it no longer care about that any more since the class file already just specifies a package
<enebo[m]> ok -Ptest is green again
<headius[m]> I'm using an old utility method that mangles any string into a valid package + class string
<headius[m]> stdlib red now?
<headius[m]> WHY
<enebo[m]> ah that flaky thing
<enebo[m]> that oflush thing is not 100%
<headius[m]> ah ok
<headius[m]> a bug for the viewers at home
<headius[m]> ok it's working! *
<headius[m]> * I seem to be getting a lot of false positives on my eval search
<headius[m]> 2020-01-25T17:21:42.403-06:00 [main] ERROR Ruby : failed to compile target script: /Users/headius/projects/jruby/lib/ruby/stdlib/psych/visitors/visitor.rb - AOT not supported for scripts containing eval
<headius[m]> there's no eval in that script
<headius[m]> hmm there's a send
<enebo[m]> yes
<headius[m]> it's also flagging block form of module_eval
<headius[m]> enumerator stopped compiling again
<enebo[m]> CallBase.computeEvalFlag
<headius[m]> yeah checking now
<enebo[m]> so more than we want
<headius[m]> hah
<headius[m]> // CON: eval forms with no arguments are block or block pass, and do not need to deopt
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit_irscope_removal:04d8509 by Thomas E. Enebo): The build is still failing. https://travis-ci.org/jruby/jruby/builds/641858180 [162 min 11 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> yeah potentially send is in there too
<headius[m]> I will push what I have and then look into expanding this
<headius[m]> send could be an eval so that kinda sucks
<enebo[m]> yeah
<headius[m]> who would do such a thing
<enebo[m]> going to get dinner
<headius[m]> fine go
<enebo[m]> yeah agreed...they bring it onto themselves
<headius[m]> hey before you go
<headius[m]> paste coming...
<headius[m]> that's what successfully AOTs right now
<enebo[m]> are you just showing me or asking something?
<enebo[m]> and are scripts not namespaced really not saving anything?
<headius[m]> just showing
<headius[m]> the ones that say "no script found " are also not AOTing
<enebo[m]> no class found for is not AOTing?
<headius[m]> yeah
<headius[m]> the ones that say they saved are working from AOT
<headius[m]> this is just s dump
<headius[m]> a dump
<headius[m]> so partial AOT is working for gem -v
<enebo[m]> ok
<enebo[m]> well we are getting there
<headius[m]> I'll poke at this a little before dinner and then I'm off until tomorrow
<enebo[m]> ok good luck
<enebo[m]> ttyl8r
<headius[m]> oh yuck
<headius[m]> USES_EVAL gets set by default on some scopes?
<headius[m]> I'm killing that
<headius[m]> if it's there we'll see it anyway
<headius[m]> ok darn
<headius[m]> removing it breaks something for all modes so that default was covering up some other bad flags
<headius[m]> or wait...nevermind
<headius[m]> ok it's almost working but for a closure in a class body the lexical containment is not working?
<headius[m]> $ jruby -Xjit.logging -e 'class Y; [1].each { class_eval "foo" }; end'
<headius[m]> 2020-01-25T17:55:19.365-06:00 [main] INFO Ruby : done compiling target script: -e
<headius[m]> that should not compile