
The Panfrost and PanVK open-source driver stack for ARM Mali GPUs crossed a significant threshold on June 3, 2026, when a Rust-written shader compiler landed in Mesa's development tree for the first time for a major GPU family. The compiler, called KRAID, targets ARM Mali v9 "Valhall" and newer architectures — the silicon powering a wide range of Android smartphones and embedded Linux devices. For the Linux graphics community, it marks both a milestone for Rust in serious GPU compiler work and a new foundation for open-source Mali driver quality.
Faith Ekstrand, a longtime Mesa contributor at Collabora, merged the initial KRAID codebase into Mesa 26.2's development tree. The compiler will be developed in-tree alongside the Panfrost (OpenGL ES) and PanVK (Vulkan) drivers, but is currently hidden behind the -Dpanfrost-rust Meson build flag and will not appear in standard Mesa releases until it reaches sufficient maturity.
KRAID Follows NAK's Proven Rust Playbook
KRAID's design is explicitly modeled on NAK — the Nouveau Accelerated Kompiler — which Ekstrand also authored and which became Mesa's first Rust-written GPU back-end compiler when it merged into Mesa 24.0 in early 2024, targeting NVIDIA's Turing and newer GPU families. NAK proved that a clean-room Rust compiler backend could integrate into Mesa's predominantly C codebase without friction, earning a reputation for correctness and maintainability. KRAID extends that pattern to a second, architecturally distinct GPU family.
The choice of Rust is deliberate and technically consequential. Shader compilers are among the most demanding pieces of systems software: they handle register allocation, instruction scheduling, and GPU-specific lowering passes across millions of driver installations. Memory-safety bugs — use-after-free errors, integer overflows in intermediate representation manipulation — are historically difficult to catch through testing in C-based codebases. Rust's ownership and borrowing system makes this entire class of bug a compile-time error rather than a runtime surprise. As Ekstrand wrote when describing NAK's design, the compiler is "SSA-based all the way through to register allocation" and "makes best-practice use of NIR" — Mesa's common shader intermediate representation — delegating most optimization and lowering to the shared infrastructure rather than reimplementing it per-GPU.
How KRAID Translates Shaders to Valhall Hardware
Understanding why KRAID is structured the way it is requires knowing what Valhall's instruction set demands from a compiler.
Valhall, the GPU architecture introduced with the Mali-G77 in 2019 and now running through Mali v9 hardware, made a fundamental change from its Bifrost predecessor. Bifrost used Very Long Instruction Word (VLIW) clause grouping: the compiler was responsible for bundling instructions into "clauses" of up to sixteen instructions and explicitly managing dependency slots between them. This put substantial scheduling burden on the compiler and made the Bifrost compiler complex to write and maintain correctly. As Alyssa Rosenzweig detailed in Collabora's 2021 reverse-engineering work on the Mali G78, "Valhall linearizes Bifrost, removing the Very Long Instruction Word mechanisms of its predecessors. Valhall replaces the compiler's static scheduling with hardware dynamic scheduling" — more closely analogous to an out-of-order CPU. NOP padding between instructions is no longer required, which reduces code size and improves instruction cache utilization.
That hardware shift matters directly for KRAID's architecture. A clean Rust compiler targeting Valhall's scalar ISA does not need to implement instruction grouping logic or static scheduling algorithms. It takes Mesa's standard NIR (New Intermediate Representation) — an SSA-form (static single assignment) intermediate representation shared across all Mesa drivers — and translates it to Valhall's regular hardware instruction encoding. NIR handles most of the heavy algebraic optimization and lowering passes before KRAID's back-end sees the shader. KRAID's job is then focused: translate the already-lowered shader from NIR to Valhall machine code, handle register allocation, and emit correct hardware binaries. The division of labor is the same design philosophy that made NAK tractable: trust the shared Mesa infrastructure for the generic hard parts, keep the GPU-specific back-end as focused as possible.
At merge time, KRAID passes its first dEQP (drawElements Quality Program) compliance test — the industry-standard GPU conformance test suite used to validate OpenGL ES and Vulkan driver correctness. Passing a first dEQP test means the compiler's core pipeline is functional: NIR shaders can be translated to hardware instructions and produce a correct result on real hardware. It is a meaningful gate, but a minimal one.
What This Means for Open-Source Mali Users
The existing open-source Mali stack has made substantial progress in recent years. PanVK reached Vulkan 1.2 conformance on the Mali-G610 in May 2025, with the team targeting Vulkan 1.3 and 1.4 next. The Panfrost OpenGL ES driver is conformant on several Mali generations. ARM itself has endorsed Panfrost as the driver for the Linux community through its partnership with Collabora.
The old Bifrost compiler, while functional, was built iteratively on top of Bifrost's VLIW clause model and required significant adaptation for Valhall. Starting from a clean Rust architecture designed specifically for Valhall's dynamic-scheduling ISA should produce a compiler that is easier to extend — adding new instructions, improving register allocation, supporting new GPU features — and more auditable for correctness. Over time, KRAID is expected to unlock GPU capabilities that the adapted Bifrost compiler struggled to expose efficiently.
The NAK precedent is instructive about the timeline. NAK took several Mesa release cycles from its initial merge in Mesa 24.0 before NVK reached the quality threshold where technically adventurous users could plausibly run it for real workloads. KRAID will follow a similar incremental path through Mesa 26.x and 27.x releases, with compliance coverage and optimization passes being added progressively.
Rust Clears the Bar for GPU Compiler Work
Beyond the immediate Mali impact, KRAID's arrival in mainline Mesa signals something broader for systems programming. Rust has been expanding into low-level infrastructure at accelerating pace: at the December 2025 Linux Kernel Maintainers Summit, the kernel's "experimental" Rust label was officially retired, with DRM maintainer Dave Airlie noting the graphics subsystem was "about a year away" from disallowing new drivers written in C and requiring Rust instead. Kernel maintainer Greg Kroah-Hartman observed that "drivers in Rust are indeed proving to be far safer than those written in C."
GPU shader compiler back-ends, with their stateful IR transformations and zero tolerance for correctness bugs, represent the most demanding end of that spectrum. NAK demonstrated the approach could work for NVIDIA hardware. KRAID extends the proof of concept to ARM's architecture. If it matures as expected, it may well encourage further Rust adoption across Mesa's compiler infrastructure — for a community that has long written this category of software in C, that would be a significant shift.
For Mali users on Linux and Android, the payoff is still months to years away. The compiler is not yet in standard Mesa builds, and reaching daily-driver quality is a long road. But the architectural foundation is now in mainline Mesa, and it is written in Rust.
Frequently Asked Questions
What is KRAID and what does it do?
KRAID is a new Rust-written shader compiler for ARM Mali Valhall GPUs, merged into the Mesa 26.2 development tree on June 3, 2026. It translates Mesa's NIR shader intermediate representation into hardware machine code for Mali v9 and newer GPU architectures, replacing the aging Bifrost-era compiler in the open-source Panfrost and PanVK driver stack.
What is the Panfrost driver and is it ready for daily use?
Panfrost is the open-source driver stack for ARM Mali GPUs in Mesa, covering OpenGL ES through Panfrost and Vulkan through PanVK. As of 2026, PanVK is conformant with Vulkan 1.2 on the Mali-G610 and working toward Vulkan 1.3 and 1.4 on supported hardware. The stack is functional for many workloads but not yet feature-complete across all Mali generations.
How does Rust improve GPU driver development compared to C?
Rust's ownership and borrowing system makes entire categories of bugs — use-after-free, dangling pointers, integer overflows in data structure manipulation — compile-time errors rather than runtime failures. For GPU shader compilers, which involve deeply stateful IR transformations in performance-critical hot paths, eliminating these bug classes at build time reduces the chance of subtle correctness errors reaching users. The Linux kernel project officially confirmed in December 2025 that Rust drivers are proving safer than their C equivalents.
When will KRAID be usable in standard Mesa builds?
KRAID is currently hidden behind the -Dpanfrost-rust Meson build flag and is not included in standard Mesa releases. It has passed its first basic compliance test, but reaching daily-driver quality will take multiple Mesa release cycles. Based on the NAK precedent for NVIDIA hardware, a usable state for adventurous developers is likely 12 to 24 months away.
ⓒ 2026 TECHTIMES.com All rights reserved. Do not reproduce without permission.




