all written video podcast

  • Value numbering - Max Bernstein

    Value numbering - Max Bernstein

    2026-04-04
    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...
  • Using Perfetto in ZJIT - Max Bernstein

    Using Perfetto in ZJIT - Max Bernstein

    2026-03-27
    Originally published on Rails At Scale. Look! A trace of slow events in a benchmark! Hover over the image to see it get bigger. A sneak preview of what the trace looks like. Now read on to see what the slow events are and how we got this pretty...
  • A fuzzer for the Toy Optimizer - Max Bernstein

    A fuzzer for the Toy Optimizer - Max Bernstein

    2026-02-25
    Another entry in the Toy Optimizer series. It’s hard to get compiler optimizers right. Even if you build up a painstaking test suite by hand, you will likely miss corner cases, especially corner cases at the interactions of multiple components or...
  • Type-based alias analysis in the Toy Optimizer - Max Bernstein

    Type-based alias analysis in the Toy Optimizer - Max Bernstein

    2026-02-16
    Another entry in the Toy Optimizer series. Last time, we did load-store forwarding in the context of our Toy Optimizer. We managed to cache the results of both reads from and writes to the heap—at compile-time! We were careful to mind object aliasing:...
  • A multi-entry CFG design conundrum - Max Bernstein

    A multi-entry CFG design conundrum - Max Bernstein

    2026-01-22
    Background and bytecode design The ZJIT compiler compiles Ruby bytecode (YARV) to machine code. It starts by transforming the stack machine bytecode into a high-level graph-based intermediate representation called HIR. We use a more or less typical1...
  • The GDB JIT interface - Max Bernstein

    The GDB JIT interface - Max Bernstein

    2025-12-30
    GDB is great for stepping through machine code to figure out what is going on. It uses debug information under the hood to present you with a tidy backtrace and also determine how much machine code to print when you type disassemble. This debug...
  • Load and store forwarding in the Toy Optimizer - Max Bernstein

    Load and store forwarding in the Toy Optimizer - Max Bernstein

    2025-12-24
    Another entry in the Toy Optimizer series. A long, long time ago (two years!) CF Bolz-Tereick and I made a video about load/store forwarding and an accompanying GitHub Gist about load/store forwarding (also called load elimination) in the Toy...
  • ZJIT is now available in Ruby 4.0 - Max Bernstein

    ZJIT is now available in Ruby 4.0 - Max Bernstein

    2025-12-24
    Originally published on Rails At Scale. ZJIT is a new just-in-time (JIT) Ruby compiler built into the reference Ruby implementation, YARV, by the same compiler group that brought you YJIT. We (Aaron Patterson, Aiden Fox Ivey, Alan Wu, Jacob Denbeaux,...
  • How to annotate JITed code for perf/samply - Max Bernstein

    How to annotate JITed code for perf/samply - Max Bernstein

    2025-12-18
    Brief one today. I got asked “does YJIT/ZJIT have support for [Linux] perf?” The answer is yes, and it also works with samply (including on macOS!), because both understand the perf map interface. This is the entirety of the implementation in...
  • A catalog of side effects - Max Bernstein

    A catalog of side effects - Max Bernstein

    2025-11-11
    Optimizing compilers like to keep track of each IR instruction’s effects. An instruction’s effects vary wildly from having no effects at all, to writing a specific variable, to completely unknown (writing all state). This post can be thought of as a...
  • Sorry for marking all the posts as unread - Max Bernstein

    Sorry for marking all the posts as unread - Max Bernstein

    2024-01-31
    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...