Kwasi Buansi

JITVis Summer Research

JITVis Summer Research

Davidson College · Summer 2025 · Dr. Katy Williams, Olivia Burls, and Kwasi Buansi

A visualization tool for debugging Google Chrome's V8 Just-In-Time compiler — combining a heatmap, dual IR view, and minigraph to help compiler experts compare mutant traces across optimization phases.

D3.js V8 JIT Data Visualization Compiler Debugging
View project on GitHub

Before I joined this project, Taft Harrell and Ellora Devulapally, two Davidson College graduates, had already taken the first steps toward visualizing compiler intermediate representations. Their prototype loaded trace files into two views: a static grid of numbered nodes and edges, and a force-directed layout intended to automatically organize the data. As graphs grew denser, the force-directed view collapsed into unreadable "hairballs," and the static grid still made it hard to follow dependencies across phases. Initially, my job was to analyze what Taft and Ellora had already developed, along with the literature behind graph visualization with the goal of creating something more readable.

Eventually, Dr. Williams, my mentor, Olivia Burls, my partner, and I began developing JITVis: a visualization tool for debugging Google Chrome's V8 Just-In-Time (JIT) compiler. Over the summer, our team studied V8's optimization pipeline, reviewed visualization research, and interviewed compiler experts at Google about how they work with tools like Turbolizer and iongraph, two tools that visualize changes made to code by a compiler. The result is JITVis — a tool combining a heatmap for comparing many mutant traces across optimization phases, a dual view for detailed IR analysis, and a minigraph for scanning IR structure. Built with D3.js and informed by expert feedback, JITVis aims to help debuggers find where a compilation diverges without needing to scan thousands of nodes across multiple graphs.

Compilers are software that translate human readable code (i.e. languages like C/C++ or Rust) into lower level machine code. Compilers simultaneously make optimizations to code during the translation, decreasing the runtime of code by leaps and bounds. These optimizations are crucial for websites and search engines, which demand fast startup and runtimes. In fact, speed is so crucial that web browsers, like Google Chrome and Firefox, use a special class of compiler, known as a JIT compiler. JIT compilers have faster startup times compared to regular Ahead-of-Time compilers, and make optimizations during the code's runtime. However, the changes JIT compilers make are difficult to track, so bugs tend to be more difficult to find.

This is where our work comes in. As newcomers to compiler development, we studied Google V8's entire compilation pipeline, learning how exactly input code is optimized while studying pre-existing debugging strategies used by experts. We analyzed data visualization literature and used our findings to develop JITVis. We interviewed a V8 compiler expert on their entire workflow, including techniques they employ when using Turbolizer, outside tools used to generate test cases, and any other knowledge we can use to improve their workflow. We hope JITVis reduces tab-switching and manual cross-file comparisons for compiler experts, while addressing other weaknesses in preexisting alternatives, such as Google's Turbolizer, or Firefox's iongraph.

Background

JIT compilers process human-readable code into machine code in distinct phases. These phases each contain Intermediate Representations (IRs). IRs are essentially a transitory state to make code easier to analyze for the compiler. IRs are represented as graphs, such as Sea-of-Nodes (SoN) or Control Flow (CFG) graphs. Google developers currently visualize these changes by using V8's --trace-turbo command on JavaScript files to produce a .JSON trace file to be uploaded to Turbolizer. Iongraph is an alternative that only supports the CFG layout. Both show each IR phase's respective graph, and Turbolizer specifically has the added benefit of source-code-to-node linkage.

Turbolizer SoN, CFG, and iongraph CFG displayed from left to right.
Turbolizer SoN, CFG, and iongraph CFG displayed from left to right. iongraph only supports the CFG format.

However, there are a few key flaws with both tools:

At the recommendation of Dr. Lim, a compiler expert at Davidson, and our own discretion, JITVis provides two overviews that allow debuggers to quickly locate specific compiler phases, and an additional detail view containing a maximum of two IR graphs of the user's choosing for lower level, phase-by-phase analysis.

Initial Steps

To start, I needed to catch up on what had already been done thus far. Taft and Ellora had already created a force-directed layout, based on a trace file format alternative to Google V8's.

Taft and Ellora's first prototype visualization.
Taft and Ellora's first prototype visualization. To the left is the static view, which displays nodes as numbered circles and their dependencies as edges, similar to Turbolizer but in an unchanging grid. A tooltip to the right of the grid provides details on the selected node. To the right is the force-directed view, which uses force-directed drawing to display nodes and edges.

The force-directed layout fell victim to the hairball effect — the volume and density of the nodes and edges caused the diagram to look unreadable in certain phases, while the static view did not provide any convenient sorting of node positions to make tracing dependencies easier. As such, we decided to abandon the first prototype in favor of something more usable. We conducted a short literature review to find the most ideal graph layouts. My area of focus was on representing changes over time, which in our case meant changes made to IRs across phases. My findings included:

My findings were consistent with Olivia's, making us confident enough to draft a mockup visualization.

Heatmap mockup.
Heatmap mockup. In the grid, rows represent file names, and columns represent phase numbers. Each cell is encoded using a metric of suspiciousness (how likely it is that that specific phase in its corresponding file is buggy).
Dual-view mockup.
Dual-view mockup. On the left side (1), there are two user-inputted IR graphs. The right side (2) shows the side panel that appears when clicking a node.
Minigraph mockup.
Minigraph mockup. This view contains the same filtering and grid layout as the heatmap view. Instead of a suspiciousness score, each cell is encoded with its own miniaturized IR graph.

After designing our mockups, we presented them to Dr. Lim, who liked our idea of an easier way to compare two IR graphs, and our overviews which can be used to more easily find suspicious files for further analysis. After receiving the green light from Dr. Williams, we began developing our prototype visualization.

JITVis Walkthrough

We present JITVis — a tool designed to streamline the JIT compiler debugging process, providing several helpful views in one centralized program.

JITVis user flow.
JITVis user flow. (1) The user starts with a JavaScript file. They may run a fuzzing algorithm to produce mutants to be uploaded into JITVis. (2) The user runs the --trace-turbo command to output JSON trace files. (3) Upload the JSON traces into the program to produce the visualizations in (4), (5), and (6).
JITVis dual view.
JITVis dual view, which uses the Sugiyama layout and d3.js to render turbolizer JSON graphs. Olivia was responsible for the dual view.
JITVis heatmap view.
JITVis heatmap view. The heatmap is a grid in which rows represent each input file, and columns represent each phase. The heatmap allows the user to set a baseline — a specific file to use as a benchmark which all other files are compared to.
Proof-of-concept for the minigraph view.
Proof-of-concept for the minigraph view. Shows a miniaturized version of all IR phase graphs across all selected files.

Creating the Heatmap

Currently, our main tool consists of the dual view and the heatmap view, the latter of which I was tasked with the development of. I implemented a feature in which users can select a "baseline" file to compare differences in nodes per phase with, similar to what a compiler developer might do when searching for suspicious mutant files. The first phase in all other files that differs from the baseline will be highlighted in yellow, making it easier to track diverges in optimization.

While Dr. Lim and Robbie are still working on a more robust metric to determine the suspiciousness of cells in the heatmap, we realized the coarse metric we are currently using actually had a use, as it was successful in determining the first file with relevant differences from the baseline in one example. Furthermore, I added a feature that allows users to highlight files of interest, and sort files based on how much or how little they diverge from the baseline, and a button to filter out all non-highlighted files.

Minigraph Proof-of-Concept

While the minigraph view has not been incorporated in the main tool yet, I developed a proof-of-concept for the view as we deliberate on how best to incorporate it. It uses Olivia's graph drawing algorithm to render small, transparent graphs. The size of each graph is changeable dynamically using the slider in the top bar. Currently, users can only select two files to display each phase, but ideally, it would automatically load in all of the files that have previously been selected, but filter out all of the cells except for the ones the user is interested in, to reduce cognitive load.

Throughout the summer, we drafted and developed JITVis to address current gaps in Google V8's Turbolizer, and Firefox SpiderMonkey's iongraph. JITVis provides users with three different views — a dual view, heatmap, and minigraph view — grounded by data visualization research and informed by interviews with compiler experts at Google.

However, JITVis is still in its infancy. Planned next steps include a new heatmap metric for suspiciousness, linked navigation across views, implementing the minigraph proof-of-concept in the main visualization, AI-assisted summaries of the data, and streamlining the V8 expert's existing workflows. In the long-term, we want JITVis to centralize the expert workflow, including graphs, phase comparisons, and later textual outputs.