The Oxidation of Mesa: Inside Kraid, Collabora’s New Rust-Written Compiler for Arm Mali GPUs
Collabora has officially merged Kraid, a groundbreaking Rust-based shader compiler, into Mesa. Replacing the aging Bifrost compiler, Kraid leverages Rust's type-safe traits to share code directly with NVIDIA's Nouveau driver.
Key takeaways
- • Collabora has officially merged Kraid, a groundbreaking Rust-based shader compiler, into Mesa
- • Replacing the aging Bifrost compiler, Kraid leverages Rust's type-safe traits to share code directly with NVIDIA's Nouveau driver

The Oxidation of Mesa: Inside Kraid, Collabora’s New Rust-Written Compiler for Arm Mali GPUs
Open-source graphics development has just marked an incredible milestone in its journey toward memory safety and modular architecture. Collabora officially merged Kraid—a ground-up rewrite of the shader compiler for the Arm Mali GPU driver stack (Panfrost and PanVK)—into the mainline Mesa repository.
What makes Kraid exceptionally exciting is not just its modern codebase, but its implementation in Rust. It serves as a monumental case study for how Rust is rapidly taking over low-level graphics and hardware enablement.
Beyond the Bifrost Bottleneck
For years, the open-source Panfrost driver stack relied on a compiler initially designed around Arm’s Bifrost microarchitecture. As newer architectures like Valhall arrived, support was incrementally bolted on. This legacy setup quickly reached its architectural limits. The team faced persistent structural challenges, particularly when trying to implement native 64-bit sources, cleaner Intermediate Representations (IR), and more reliable register allocation.
Rather than spending months refactoring the aging C-based pipeline, Collabora decided to start fresh with a clean slate—and they chose Rust. Kraid represents a complete paradigm shift, utilizing an encoder derived directly from Arm’s proprietary XML definitions alongside an entirely modernized IR.

The Rust Modularity Advantage: Sharing with NVIDIA
Perhaps the most revolutionary aspect of Kraid is its structural synergy with other drivers. Writing GPU compilers has traditionally been a heavily siloed endeavor; the math for an Arm Mali GPU was isolated from an NVIDIA GPU because their instruction sets differ completely.
Rust changes the game. By leveraging Rust’s highly efficient traits and callbacks, Collabora has implemented core compiler algorithms—such as register allocation, control flow graph construction, and general compiler theory—in a completely pluggable manner.
Consequently, Kraid is able to share these modular core algorithms directly with the Rust-based Nouveau compiler (designed for NVIDIA GPUs). Both drivers maintain their highly specialized, hardware-specific instruction set backends, but they share the heavy lifting of compiler theory. This cross-hardware code sharing was historically a pipe dream in the fragmented world of GPU engineering.
Current Status: How to Test
Kraid is already live in Mesa, though it remains under active development. While it originally passed only a single Vulkan Conformance Test Suite (CTS) test, it now successfully passes all Shader Storage Buffer Object (SSBO) layout tests, and work has begun on a brand-new register allocator.
If you are eager to take the new compiler for a spin, you can enable it using the environment variable:
PAN_USE_KRAID=1
For developers packaging Linux distributions where Rust is not yet fully integrated into the toolchain, Collabora has kept the compiler toggleable via the -Dpanfrost-rust Meson build flag, preventing any sudden build-time breakages. Kraid is yet another triumph for the "oxidization" of the Linux graphics stack, paving the way for safer, faster, and highly collaborative GPU drivers.
Tags
Grounded sources & citations
What to read next

The WebAssembly Divorce: Why Rust Finally Killed `--allow-undefined`

crates.io Fortifies the Supply Chain: Inside Rust's 2026 Security Overhaul and the "Beyond the &" Roadmap

The Great Userland Oxidation: Rust Coreutils 0.9.0, the Zellic Audit, and Microsoft's Windows Port
Enjoyed this? Get the next one
Subscribe to the newsletter and the next playbook lands in your inbox — no spam, unsubscribe anytime.