iPX Directory

Directory Technology

Max Bernstein's Blog

1 person subscribes

Paste it into any podcast app or feed reader to subscribe.

Latest posts

Support Local Variables

Discovering and supporting all of the wild semantics for local variables in Ruby was so interesting that the ZJIT team decided to write a paper about it: Support Local Variables (PDF). It’s also the first bit of academic literature that documents and explains ZJIT. It’s published at VMIL 2026, where someone on our team will be presenting it. Abstract Ruby is a dynamically typed and object-oriented

4 Sep 2026
Another partial SSI trick with canonicalize

See the previous post for context and explanation of SSI . After reading Chris Fallin’s aegraph post , new ZJIT contributor dak2 landed a block-local version of the canonicalize function in #16828 . The pseudocode of the block-local canonicalize function looks like this: for block in function . reverse_post_order (): rewrite_map = {} for insn in block . insns : insn . operands . map_in_place ( lam

13 Aug 2026
A quick look at zero-knowledge proofs

NB: This isn’t about crypto. I don’t care about crypto. Chris messaged me the other week asking if I wanted to implement zero-knowledge proofs. I initially was not interested, but then he said: What if I told you there’s a version of them that has nothing to do with cryptocurrencies? What if I told you it involves graph theory? What if I told you there’s a 30 line implementation? Now that was inte

7 Aug 2026
The inliner is yielding benefits for ZJIT

Originally published on Rails At Scale . We recently enabled a really cool feature in ZJIT that makes it feel like a Real Compiler™: the inliner! We’ll write more about it soon. In this post, we’ll talk about one excellent concrete benefit we are already seeing and how it optimizes blocks in pretty much every Ruby program. I’ll start off with a refresher on how blocks work in the Ruby interpreter,

28 Jul 2026
Travel notes: PLDI Boulder

I had another excellent PLDI this past June. It was my fourth 1 . I continued to meet new people and learn new things! Overall: I got to meet a lot of new people, which was exciting. I had some good chats about research. I asked a question at a talk! I got to show Aaron and Jacob PLDI and see them enjoy it. I missed hanging out with CF Bolz-Tereick and Chris Fallin, the usual suspects at conferenc

5 Jul 2026
A survey of inlining heuristics

Compilers, especially method just-in-time compilers, operate on one function at a time. It is a natural code unit size, especially for a dynamic language JIT: at a given point in time, what more information can you gather about other parts of a running, changing system? I don’t have any data to back this up—maybe I should go gather some—but on average, methods are small. Especially in languages su

3 Jun 2026
Checking assembly with Z3

Short post today. New ZJIT contributor dak2 submitted a PR to fix an overflow bug in fixnum division in ZJIT. We did the division fine, but lied about the type of the result in the case of dividing FIXNUM_MIN by -1 . You can see how this is special-cased in CRuby: static inline void rb_fix_divmod_fix ( VALUE a , VALUE b , VALUE * divp , VALUE * modp ) { // ... if ( x == FIXNUM_MIN && y == - 1 ) {

1 Jun 2026
Travel notes: RubyKaigi Hakodate

I just got back from a three and a half week trip to Japan. It was the longest trip I have ever been on (aside from studying abroad in Germany, which felt different). I made the following wild circuit with only a backpack and a duffel: Tokyo Toyama Kanazawa Nara ish Ito Hakodate Nikko Mashiko Karuizawa Tokyo This trip was split into three parts: time with my immediate family, going to a conference

18 May 2026
Partial static single information form

In compilers, static single information form (SSI) is a common extension to static single assignment form (SSA). It was introduced by C. Scott Ananian in 1999 in his MS thesis (PDF) 1 . SSI extends your existing SSA intermediate representation by discovering facts from your existing program and reifying them as path-dependent/flow-sensitive IR nodes. That might sound complicated, but at least the

12 May 2026
Value numbering

Welcome back to compiler land. Today we’re going to talk about value numbering , which is like SSA, but more. Static single assignment (SSA) gives names to values: every expression has a name, and each name corresponds to exactly one expression. It transforms programs like this: x = 0 x = x + 1 x = x + 1 where the variable x is assigned more than once in the program text, into programs like this:

4 Apr 2026
Sorry for marking all the posts as unread

I noticed that the URLs were all a little off (had two slashes instead of one) and went in and fixed it. I did not think everyone's RSS software was going to freak out the way it did. PS: this is a special RSS-only post that is not visible on the site. Enjoy.

31 Jan 2024