ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #jruby
sagax has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
nirvdrum has joined #jruby
sagax has joined #jruby
nirvdrum has quit [Ping timeout: 272 seconds]
victori has quit [Quit: ZNC 1.7.5 - https://znc.in]
victori has joined #jruby
ur5us has quit [Ping timeout: 240 seconds]
nirvdrum has joined #jruby
ur5us has joined #jruby
nirvdrum has quit [Ping timeout: 246 seconds]
nirvdrum has joined #jruby
nirvdrum has quit [Ping timeout: 260 seconds]
rusk has joined #jruby
nirvdrum has joined #jruby
ur5us has quit [Ping timeout: 240 seconds]
nirvdrum has quit [Ping timeout: 260 seconds]
shellac has joined #jruby
lucasb has joined #jruby
nirvdrum has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
<headius[m]> lopex: that guy suggested a code change...perhaps he's on the right track?
<headius[m]> I have not looked at it in depth and I just got my coffee now
shellac has joined #jruby
<lopex> what mri does is effectively calling onigenc_mbclen_approximate tere
<lopex> so they advance by 1 on broken characters
<lopex> headius[m]: but they to too much work mostly
<headius[m]> hmmm
<lopex> so that why I came up with those unsafe encoding versions
<lopex> which could be used in thise case
<headius[m]> yeah unfortunately you have to know you have bad bytes to choose one of them
<lopex> headius[m]: yeah, and mostly we do
<headius[m]> hmm
<lopex> that's one of those rare cases
<lopex> headius[m]: we have similar issue with pack/unpack wich produces broken string
<lopex> so
<headius[m]> we could use the unsafe versions by default unless you insist the bytes are good
<lopex> yeah, we could fallback to these on broken/unknown cases
<lopex> just as we feed join with it
<lopex> *joni
<lopex> headius[m]: but I wanted to do better though
<lopex> that is, sprinkle only the affected code with save versions
<lopex> *safe
<lopex> headius[m]: the bad thing with unsafe encodings is that you megamorphize length even more
<headius[m]> yeah I'm not sure what the best trade-off is here
<lopex> headius[m]: I wonder how badly utf8 length tables behave on nowadays hardware too
<headius[m]> a regexp getting stuck forever on bad input is obviously not the path forward
<lopex> those tables might be eating us a lot
<headius[m]> slow is better than never
<headius[m]> mmm yeah we have not done any revisiting of joni performance optimization on recent JDKs
<lopex> in ruby code it shuldnt happen though
<headius[m]> that's true
<lopex> except that pack/unpack
<lopex> and then force_encoding
<headius[m]> could you comment about how this person could use the unsafe encoding to get past the problem?
<headius[m]> then we can discuss on the issue whether we should do something more proactive to avoid this
<headius[m]> we should probably have a joni wiki
<lopex> headius[m]: they're a concept now though
<lopex> I'm somewhat reluctant to the suggested change in that issue since it might diverge from onigmo in behaviour
<lopex> headius[m]: btw those unsave version could be autogenerated via proxies
<lopex> *versions
<lopex> is apt still a thing ?
<headius[m]> we still use annotation processing but on newer JDK you have to pull it from a maven artifact
nirvdrum has quit [Ping timeout: 240 seconds]
<lopex> I'll give it a more thought while getting home
enebo has joined #jruby
<headius[m]> enebo: so hey about that constant change
<headius[m]> I have it on a branch so I could try a few things out, but the latest attempt is green
<headius[m]> I was planning to cp over to irscope remove branch
<headius[m]> then I can finish making AOT mode use no indy sites
<enebo> headius[m]: moving over to branch is fine
<headius[m]> do we have any testing for inliner?
<headius[m]> like in CI
<enebo> headius[m]: inliner is compeltely broken on that branch
<enebo> headius[m]: but I may be able to unbreak it since I believe I can pass StaticScope into profilingcallsite and only get IRScope when things look interesting
<enebo> but I need to spend time verifying that
<headius[m]> ok so I shouldn't sweat that too much
<headius[m]> pushed the change
<enebo> headius[m]: yeah I will try and analyze what is needed after .10 but I am hoping it is not too bad
<headius[m]> ok
<enebo> headius[m]: I think the other problem is we used to irscope.compilable = method in the method constructors
<enebo> headius[m]: that was the other isssue
<enebo> if that had been left we would need to immediately create irscopes
<headius[m]> ah yeah
<enebo> so main issues is detect interesting probably is no big thing since staticscope exists
<enebo> linkage from irscope to method the ir is in is outstanding and I am not sure of best way here
<enebo> meh heh ... anyways something to figure out before we merge
<headius[m]> yeah
<headius[m]> well inlining has never gone live really so it's still in flux anyway
<headius[m]> enebo: so here's a harder question
<headius[m]> all paths to creating SearchConstInstr, for example, are now passing CurrentScope.INSTANCE
<headius[m]> I suppose it's ok to leave it that way since otherwise it ends up being an implicit load of scope
<headius[m]> which we can't change in the future without adding an operand again
<headius[m]> hmm
<enebo> headius[m]: yeah the point of that operand I believe is that if that is in an inlined scope then we can replace it with something else
<headius[m]> right, that seems an ok place to do it then
<headius[m]> maybe some small value in having a LoadCurrentScope instr for all of them but that introduces temp usage again
xardion has quit [Remote host closed the connection]
enebo[m] has joined #jruby
<enebo[m]> yeah I am asking subbu about this offline but I am a bit at a loss after talking about this with you the other day
<enebo[m]> with that said, this is not really conducive to putting out a release either. I also don't know how this affects JIT at all but I guess you are working on constant lookup so you are just trying to understand what may or may not be associated with that operand?
<enebo[m]> as of today I think a comment and just assume current staticscope?
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:32e789e by Charles Oliver Nutter): The build was broken. https://travis-ci.org/jruby/jruby/builds/648974822 [176 min 16 sec]
<enebo[m]> Later today I will see what happens when we inline something with a constant lookup in it
<enebo[m]> I am looking in InlineCloneInfo and I do not see how scopes are adjusted at all
nirvdrum has joined #jruby
<enebo[m]> Oh well we are talking about live values
<enebo[m]> so %current_scope in both scopes are currently temps and both hold their own staticscope instances which may be different
<enebo[m]> by switching to just using the operand then unless we make that operand a caching per scope value then just using that will break inlining
<enebo[m]> we can still fix this by having guest scopes (of method and block) to replace %scope with a tempvar and then assign it
<enebo[m]> but that has to be the reason why this was designed the way it is
<enebo[m]> I do not know of any other potential pass which will migrate instructions into a different lexical scope so this as a one-off probably is fine
<enebo[m]> as a simple up front copy it was a simple generic solution
<enebo[m]> I do think working around it is better for interp and for serialization since we will store/do less
<headius[m]> yeah it will have to get that scope from somewhere so there's got to be something to replace that CurrentScope operand with anyway
<headius[m]> previously it would have been indirected through a temp but it's really not that much different now...just need a different operand
<headius[m]> and this simplifies the non-inlined case which is always CurrentScope
<enebo[m]> A variable for guests in inlining is probably simplest
<enebo[m]> but it is just another operrand I guess
<enebo[m]> This literally is +1 to all interp arrays and +1 instr +2operands per serialize so I am on board
<headius[m]> LoadInlinedScope or something
<enebo[m]> no jst %v_20 and set it to guest staticscope
<enebo[m]> e.g. just alloc a temp and store the value
<enebo[m]> no growth in operands or instrs to support that
<headius[m]> yeah sure
<headius[m]> and rewrite the child instrs that depend on scope to use that
<enebo[m]> yeah it is "special" logic the inliner will need to be changed to do whereas before this was generic as it was done via a variable even if it had a special name
<enebo[m]> but that is ok
<enebo[m]> Now that I have come full circle I can appreciate how this prologue copy was a generic solution to this problem
<enebo[m]> but we do not want to pay the small cost it imposes
<enebo[m]> and had 2-3 passes needed to worry about instrs migrating scopes it probably would be the superior soln...but it is just inlining
<enebo[m]> ultimately though cloneForInlining on CurrentScope will just ask for a temp and write the current staticscope to that
<enebo[m]> current == guess scope being inlined
<enebo[m]> afk a few
<headius[m]> I did a refactor to separate the "indy" and "simple" compilation a bit better in org.jruby.ir.target
<headius[m]> landing non-indy const logic shortly
travis-ci has joined #jruby
<travis-ci> jruby/jruby (jit_irscope_removal:89d36ad by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/648998953 [52 min 15 sec]
travis-ci has left #jruby [#jruby]
<headius[m]> still
rusk has quit [Read error: Connection reset by peer]
nirvdrum has quit [Ping timeout: 260 seconds]
shellac has quit [Read error: Connection reset by peer]
nirvdrum has joined #jruby
<headius[m]> ugh jet lag
<headius[m]> concentration is elusive
subbu is now known as subbu|away
subbu|away is now known as subbu
ur5us has joined #jruby
<headius[m]> mmm food helps
<headius[m]> got into a bit of a rat's nest refactoring the JIT compiler
_whitelogger has joined #jruby
<lopex> almost looked like you have eaten a rat
<lopex> rat, a cure for jet lag
<headius[m]> bit of rat helps
<lopex> headius[m]: responded to that issue, I think I'd need a week to get a really good grasp how to aproach it
<lopex> well, like afterhour week
<lopex> but the changes will be simple
<lopex> headius[m]: can one bypass final classes to overload thinds at runtime ?
<lopex> *things even
<lopex> you can see the problem hounds me so much that even I began to seriously document it
<lopex> but I think we cant afford the waste mri is doing
<lopex> at first shot I;d benchmark getting rid of those length tables
<lopex> especially for utf8
<lopex> but it's hard to come up with this benchmark
<lopex> like...
<lopex> we call length, on average we use the first table
<lopex> which slurps it in the cpu cache
<lopex> just for walking a short string, and then lots of other code will be run anyways
<lopex> so, like, we're repolluting the cache (which from c point might be a benefit), but we also pay those ranges checks
<lopex> dunno, going in the blind here
<headius[m]> at runtime there's no checks for final classes and methods
<headius[m]> well maybe methods
<headius[m]> might raise IncompatibleClassChangeError, I am not sure
<lopex> headius[m]: I mean, range check for the length tables
<lopex> at worst, it's four array lookups
<lopex> accept / not accept
<lopex> I begin to think branching would to much better
<lopex> maybe it would be worth looking at some java impls for decoding
<lopex> but it's a different cache usage mode anyways
<headius[m]> hmm
<lopex> maybe I'm over speculating
<headius[m]> like using a big switch?
<lopex> more like simple ifs
<lopex> and old masks
<lopex> you dont have that many routes
<lopex> max utf8 length is 4
<lopex> so you look at two mos significant bits
<lopex> in hot cas only one
<lopex> *case
<headius[m]> yeah likely faster than going to the array
<headius[m]> the array will have at least a bounds check probably
<headius[m]> and it's opaque
<lopex> and cache slurp
<headius[m]> JVM can't constant fold it
<headius[m]> all array loads in Java are optimization boundaries
<headius[m]> maybe not if it can elide the array allocation but that doesn't apply here
<lopex> headius[m]: look how convoluted it is
<lopex> even if the chance hitting TransZero is like 0.5%
<lopex> the cache effects could be huge riught ?
<lopex> and like in polish it's more like 10%
<lopex> but it's just my wild speculation
<lopex> sure we can suck at emojis and the other long chars
<headius[m]> hmm could be, I don't know
<headius[m]> 1024 bytes wide
<lopex> you mean cache line ?
<lopex> or the array ?
<headius[m]> just thinking about the effects here
<headius[m]> I mean the array
<lopex> shure it will go in and out
<lopex> most eu languages are two bytes max
<headius[m]> so you're thinking if's that check a range would potentially optimize better than going to this table
<lopex> potentially
<lopex> er, both
<lopex> ranges check and lookup
<headius[m]> yeah
<lopex> we still have to range check the string
<lopex> but the most common case is one and two
<headius[m]> we check one <= already so we'd be adding two more of decreasing probability while eliminating the array access entirely
<enebo[m]> does cref ever change?
<lopex> and then we check for 10xxxxxx
<enebo[m]> I believe all uses of it setting are upon definition
<lopex> er 11..
<enebo[m]> one eval case maybe it changes?
<lopex> enebo[m]: is that a comment on this issue ?
<enebo[m]> no I don't think even then
<enebo[m]> hell no
<enebo[m]> :)
<headius[m]> hahah
<lopex> enebo[m]: well, I already made a theory to rationalize it :P
<headius[m]> cref never changes I think
<enebo[m]> just auditing currentscope and so I believe this nth scope stuff would only be relevant in the presence of an eval
<headius[m]> I was even wrong about constants in module methods...they always use lexical scope and the module's inheritance hierarchy, not the included hierarchy
<lopex> headius[m]: btw, still no hope for that hardware counter thingies for measuring perf ?
<headius[m]> maybe? I have not revisited it lately
<headius[m]> the tools that exposed it depended on hooking into linux kernel so I can't easily measure it on MacOS anyway
<headius[m]> I still end up going to assembly or ideal graph to investigate performance
<headius[m]> which would be applicable here
<headius[m]> graal JIT might see through a final array access
<lopex> headius[m]: enebo[m] lol at the history https://www.youtube.com/watch?v=Nb2tebYAaOA&t=12m5s
<lopex> from 1000 bits to 10 mebabits
<lopex> and window widens from 50 to 500
<lopex> wrt branch prediction
<lopex> this is really sad
<lopex> 50 to 500 being the instruction window
<lopex> disregard the hype talk, but it's great listening
<headius[m]> this interviewer sounds like he's half asleep
<lopex> yeah, but I wonder if it;s really happening, 500 insns at once
<lopex> and then graph
<lopex> then in almost the same cycle allocate execution units
<lopex> then execute what you can
<lopex> somewhat different perspective I heard from Click
<lopex> same results, but perspective is definitely different
<headius[m]> oy vey
<headius[m]> I think I finally have all indy out of AOT mode
<headius[m]> side project was to re-add non-indy call site construction so that took a while
<lopex> btw
<lopex> Error while executing GroovyFunction: java.lang.Exception: #<NoMethodError: undefined method `[]' for nil:NilClass>
<lopex> the cost of integration
<lopex> you guessed right it jira
<headius[m]> hah
<headius[m]> groovy wrapping ruby
<headius[m]> but I thought only graalvm could do polyglot
<lopex> in this case it's ruby exception being passed via rest to groovy
<lopex> entertaining nonetheless
<lopex> jira is really useless
<lopex> headius[m]: worse, most instances run on tomcat being run on root
<lopex> so
<lopex> if you have an admin, you have the system
<lopex> just go to groovy console
<lopex> "pwd".execute
<lopex> done
<lopex> headius[m]: they dont sandbox the groovy there
<lopex> and I'm accidentaly involved in jira projects now
<lopex> most usages look like
<headius[m]> hey did anything ever progress with the docker container?
<lopex> headius[m]: ^^
<headius[m]> we got a couple questions about it during rubyfuza
<lopex> headius[m]: you mean non root containers ?
<headius[m]> I mean the official docker image
<headius[m]> not container, wrong terminology
<lopex> for ?
<headius[m]> for JRuby
<lopex> ah
<lopex> headius[m]: well, I admit I volunteered for that
<lopex> and I still do
<headius[m]> woohoo
<lopex> we just keep to go by over (if it's a good english phrase)
<lopex> pass over ?
<lopex> I'm confused
<lopex> headius[m]: enebo[m] but hey https://www.youtube.com/watch?v=hfJinyofQdk
<lopex> you dont stand a chance :P
<headius[m]> hah yeah I started polish on duolingo and that was hard enough
<lopex> headius[m]: I hope I've never leanrt it
<lopex> er, the third is learned ?
<headius[m]> haha
<lopex> headius[m]: but yeah, if you havent seen that you're welcome
<headius[m]> I think both are ok
<headius[m]> learnt isn't used much though
<headius[m]> huh I guess learnt is more common ini British english
<lopex> polish is quite localized so you dont have those confusions
<lopex> yeah
<lopex> headius[m]: I heard you was learing russian at some point ?
<lopex> *were
<headius[m]> yeah I have not reviewed it in some months now though
<lopex> just look what mistakes I make in english
<lopex> doh
<lopex> headius[m]: and oldie http://i.imgur.com/jaYu1.jpg
<lopex> "except furniture"
<lopex> that made me lough
<headius[m]> yeah funny
<headius[m]> I wish languages were easier to learn
<lopex> then go spanish
<lopex> I heard :P
<headius[m]> ugh tfw when you forget how to new an object in bytecode
<lopex> newinstance ?
<lopex> afaik it's putting the class on stack and newinstance
<lopex> ah
<lopex> its init
<headius[m]> yeah I forgot the init
<headius[m]> couldn't figure out why I was getting stack errors
<lopex> headius[m]: btw just noticed .net core is kinda getting popularity again
<lopex> after years of failures
<lopex> not as much a java yet
<lopex> but it;s going
all4miller has joined #jruby
lucasb has quit [Quit: Connection closed for inactivity]
nirvdrum has quit [Ping timeout: 272 seconds]
<headius[m]> enebo: it is done
<headius[m]> finally pushed the last logic to make constant lookups in AOT not use indy
<headius[m]> it's not very efficient but it's working
<headius[m]> and all IR instructions for constant lookup are using the new ConstantLookupSite
travis-ci has joined #jruby
travis-ci has left #jruby [#jruby]
<travis-ci> jruby/jruby (jit_irscope_removal:c24bdd6 by Charles Oliver Nutter): The build is still failing. https://travis-ci.org/jruby/jruby/builds/649186604 [166 min 30 sec]
<headius[m]> hmm weird one
<headius[m]> wow
<headius[m]> lesson learned, don't call MethodVisitor.visitEnd() twice in ASM
<headius[m]> I swear that library has the least amount of error checking of any library I've ever used
<headius[m]> they literally just let things fail down the line as array out of bounds or null pointer or in this case a super weird ClassFormatError
<lopex> hey it's just a single if
<headius[m]> it has been performance golfed too much
<headius[m]> the shipped version of the jar even strips all debug symbols
<headius[m]> 🙄