<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk" -->

---
title: Kraid: A new compiler for Panfrost | daily.dev
description: Collabora is building Kraid, a new Rust-based compiler for the Panfrost Mesa driver stack targeting Mali GPUs (Bifrost, Valhall, and beyond). The existing...
canonical: https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Kraid: A new compiler for Panfrost | daily.dev
og:description: Collabora is building Kraid, a new Rust-based compiler for the Panfrost Mesa driver stack targeting Mali GPUs (Bifrost, Valhall, and beyond). The existing...
og:url: https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk
og:image: https://api.daily.dev/og/posts/GbxsVBZrk.png
og:image:alt: Kraid: A new compiler for Panfrost
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Kraid: A new compiler for Panfrost

**[Collabora Blog](https://daily.dev/sources/collabora)** · 8 min read · 0 upvotes · 0 comments

## Summary

Collabora is building Kraid, a new Rust-based compiler for the Panfrost Mesa driver stack targeting Mali GPUs (Bifrost, Valhall, and beyond). The existing compiler was originally designed for Bifrost and has accumulated structural limitations: 64-bit source handling tied to Bifrost register conventions, a fundamentally 32-bit IR that wastes registers for 16-bit scalar values, tight coupling between the IR and ISA encoding, a slow iterative register allocator that can fail on large shaders, and conflated swizzle/widen modeling that caused bugs. Rather than incremental patches that risk upstream regressions, the team chose a full rewrite. Key improvements include proper 64-bit and 16-bit SSA definitions, a core IR decoupled from encoding, an encoder/disassembler derived from Arm-provided XML, a new SSA-based register allocator, hardware unit tests (inspired by the Nouveau compiler), and better opcode generalization across data types. Kraid is written in Rust, sharing algorithms and data structures with the Nouveau compiler via Rust traits. It has already been merged into Mesa behind a PAN_USE_KRAID=1 environment variable and a -Dpanfrost-rust Meson option, allowing opt-in development without disrupting existing users. At merge time it passed one Vulkan CTS test; at writing it passes all SSBO layout tests. A full switchover is targeted for sometime next year, with a milestone demo planned for the X.Org Developers Conference.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.collabora.com/news-and-blog/news-and-events/kraid-a-new-compiler-for-panfrost.html>

## Questions this post answers

### Why is the Panfrost compiler being rewritten instead of incrementally improved?

A full rewrite was chosen because several structural problems — including 64-bit source handling tied to Bifrost register conventions, a 32-bit-only IR, tight coupling between IR and ISA encoding, and a failing register allocator — are too intertwined to fix incrementally without risking upstream regressions in the production driver customers depend on. A clean rewrite also allows switching to the new compiler only once it is proven out.

_Developers following open source GPU driver work track decisions like this on daily.dev._

### How do I enable the new Kraid compiler in Panfrost/Mesa?

Kraid is enabled via the PAN_USE_KRAID=1 environment variable at runtime, and requires the -Dpanfrost-rust Meson build option at compile time. Omitting the Meson option removes the Rust build-time dependency entirely, allowing builds on systems that do not yet have Rust in their toolchain. The feature is hidden by default to avoid disrupting existing users while development continues upstream.

_Engineers integrating Mesa builds for embedded or bespoke Linux distros find build-option details like these on daily.dev._

### What does Kraid share with the Nouveau Rust compiler in Mesa?

Kraid and the Nouveau compiler share core algorithms and data structures that are independent of any specific GPU instruction set — general compiler theory constructs implemented using Rust traits and callbacks in a pluggable way. Each compiler maintains its own ISA-specific details while reusing the same underlying algorithm implementations, reducing duplicated effort across the two driver stacks.

_Rust compiler engineers working across GPU driver stacks find cross-project reuse patterns like this on daily.dev._

## Similar posts on daily.dev

- [KRAID Being Developed As New Compiler For Modern Arm Mali Graphics](https://daily.dev/posts/kraid-being-developed-as-new-compiler-for-modern-arm-mali-graphics-lbqgb3uje) · Phoronix · 0 upvotes · 0 comments
- [Kraid is a now a real compiler](https://daily.dev/posts/kraid-is-a-now-a-real-compiler-mrj1orw77) · Collabora Blog · 0 upvotes · 0 comments
- [Panfrost, Kraid, Tyr, and more at XDC 2026](https://daily.dev/posts/panfrost-kraid-tyr-and-more-at-xdc-2026-rxhyon6pb) · Collabora Blog · 0 upvotes · 0 comments
- [The future for Tyr](https://daily.dev/posts/the-future-for-tyr-xdzk3dk6f) · Hacker News · 1 upvotes · 0 comments
- [Mesa's Rusticl Now Enables Arm Mali Panfrost Driver Support By Default](https://daily.dev/posts/mesa-s-rusticl-now-enables-arm-mali-panfrost-driver-support-by-default-itpmna5qe) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#rust](https://daily.dev/tags/rust), [#compiler](https://daily.dev/tags/compiler), [#mesa](https://daily.dev/tags/mesa)

[View this post on daily.dev](https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Kraid: A new compiler for Panfrost","url":"https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk"},"datePublished":"2026-08-11T08:57:20.173Z","dateModified":"2026-08-11T09:43:32.504Z","description":"Collabora is building Kraid, a new Rust-based compiler for the Panfrost Mesa driver stack targeting Mali GPUs (Bifrost, Valhall, and beyond). The existing...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b12d00313df16d8d50affe2e6028e37c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/b12d00313df16d8d50affe2e6028e37c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Collabora Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collabora Blog","logo":"https://media.daily.dev/image/upload/s--ZGZ0FjqS--/f_auto,q_auto/v1786438306/logos/collabora?_a=BAMAMicg0","url":"https://daily.dev/sources/collabora"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rust,compiler,mesa","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collabora Blog","item":"https://daily.dev/sources/collabora"},{"@type":"ListItem","position":3,"name":"Kraid: A new compiler for Panfrost"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/kraid-a-new-compiler-for-panfrost-gbxsvbzrk#faq","mainEntity":[{"@type":"Question","name":"Why is the Panfrost compiler being rewritten instead of incrementally improved?","acceptedAnswer":{"@type":"Answer","text":"A full rewrite was chosen because several structural problems — including 64-bit source handling tied to Bifrost register conventions, a 32-bit-only IR, tight coupling between IR and ISA encoding, and a failing register allocator — are too intertwined to fix incrementally without risking upstream regressions in the production driver customers depend on. A clean rewrite also allows switching to the new compiler only once it is proven out. Developers following open source GPU driver work track decisions like this on daily.dev."}},{"@type":"Question","name":"How do I enable the new Kraid compiler in Panfrost/Mesa?","acceptedAnswer":{"@type":"Answer","text":"Kraid is enabled via the PAN_USE_KRAID=1 environment variable at runtime, and requires the -Dpanfrost-rust Meson build option at compile time. Omitting the Meson option removes the Rust build-time dependency entirely, allowing builds on systems that do not yet have Rust in their toolchain. The feature is hidden by default to avoid disrupting existing users while development continues upstream. Engineers integrating Mesa builds for embedded or bespoke Linux distros find build-option details like these on daily.dev."}},{"@type":"Question","name":"What does Kraid share with the Nouveau Rust compiler in Mesa?","acceptedAnswer":{"@type":"Answer","text":"Kraid and the Nouveau compiler share core algorithms and data structures that are independent of any specific GPU instruction set — general compiler theory constructs implemented using Rust traits and callbacks in a pluggable way. Each compiler maintains its own ISA-specific details while reusing the same underlying algorithm implementations, reducing duplicated effort across the two driver stacks. Rust compiler engineers working across GPU driver stacks find cross-project reuse patterns like this on daily.dev."}}]}
```

