---
title: "Bez: Generating a browser engine from specs and tests"
subtitle: "A generated web rendering engine verified against Chromium, Firefox, and WebKit"
slug: bez-generating-a-browser-engine-from-specs-and-tests
url: https://listedarticles.com/articles/bez-generating-a-browser-engine-from-specs-and-tests
canonical_url: https://tangled.org/burrito.space/bez
content_type: research
language: en
published_at: 2026-10-02T00:00:00.000Z
updated_at: 2026-10-02T00:12:50.938Z
author: "burrito.space"
author_url: https://tangled.org/burrito.space/bez
authored_by: human
publisher: "burrito.space"
publisher_url: https://tangled.org/burrito.space/bez
topics: ["Open Source", "Web Development", "Research", "Programming", "Systems Programming", "AI"]
license: all-rights-reserved
word_count: 368
reading_minutes: 2
citation: "burrito.space, burrito.space. \"Bez: Generating a browser engine from specs and tests.\" 2 Oct 2026. https://tangled.org/burrito.space/bez (all-rights-reserved)"
# The full text follows. The web page shows an extract and sends readers
# to the source above; quote the citation and link the canonical URL.
---

# Bez: Generating a browser engine from specs and tests

*A generated web rendering engine verified against Chromium, Firefox, and WebKit*

> Bez generates Rust web-engine code from specifications, admitting candidates only when three shipping browsers agree on geometry—aiming for complete or content-scoped engines that update by regeneration.

# Bez - a generated web engine

Generate a web rendering engine from specs and tests.

## Why

Building a web engine by hand costs hundreds of engineers and many years, so only a few companies can have one, and only they decide how the web works. Bez generates the engine instead: from the specifications, with the three shipping browsers (checked against each other) and WPT as the tests. Once the pipeline exists, each extra engine costs very little.

## Goals

- **Complete, or tree-shaken.** The default build is a complete engine. For uses other than a web browser, a build can instead contain only the web features its content uses.
- **Fast on any device.** A smaller engine does less work and needs less memory.
- **Easy to embed.** A small engine with a clear API, for apps and devices that today ship all of Chromium or go without.
- **Fastest to update.** When a spec or test changes, the affected code is regenerated and re-verified, not rewritten by hand.

## How it works

Spec text → model writes many candidates → candidate runs inside the engine → Chromium/Firefox/WebKit cached dumps check whether boxes and places match → on yes, commit as ordinary Rust; on no, regenerate.

## Status

DOM, style, box tree and fragment tree are hand-written and pass browser checks. Nine CSS 2.1 layout rules live in generated layout code; eight were written by models and admitted against the three-browser vote. Together they pass all 227 recipe cases and all 11 usable WPT normal-flow pages. Overall generated coverage against browser-compat-data remains small (~0.6% generated as of 2026-09-25).

## Findings so far

- Three browsers mostly agree; the third names the odd one out (699/705 browser-pair comparisons agreed across 235 documents).
- A Firefox length-rounding difference (1/60 vs 1/64 px) is a real web-compat bug matching known Mozilla breakage.
- A stable three-engine majority covers 94.8% of WPT test/subtest keys.
- Conformance suites (WPT canvas, WebGL, Web Audio, WebGPU CTS) are usable as oracles when two of three engines agree.
- Margin collapsing as Datalog agreed with browsers on 1195/1195 offsets and caught a seeded bug geometry checks missed.
- About 55–60% of engine-relevant compat entries have a usable automated oracle and generatable spec prose.

*Original: [tangled.org/burrito.space/bez](https://tangled.org/burrito.space/bez)*
