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.