Exploring the idea of generated web rendering engine.
genera docs spec-change-flow.md

How real spec changes would flow through a generated engine #

Tests the specification-change lifecycle in roadmap.md → "Ongoing development lifecycle" against every change merged to the major specifications between 2026-06-21 and 2026-09-21. Counts come from merged commits and pull requests, classified by hand; browser status from wpt.fyi's 2026-09-20 runs.

Verdict #

The lifecycle as written — hash each section, regenerate the algorithms whose section changed, gate on the cached three-engine corpus — handles cleanly only a minority of real changes. It fails in five systematic ways: meaning changes through definitions that section hashes cannot see; about half of HTML's normative changes land in substrate that is not generated; most hash changes are noise; the regression gate rejects every change where the spec leads the browsers; and spec text is the last signal to arrive, not the first. Each has a concrete fix, listed at the end and carried into the roadmap.

detect:section hashclassifylocalizeregeneratere-verify:regression gatemeaning moves througha redefined termmost hash changesare noisespec text arrives lasthalf of HTML's changeshit hand-written substrategate rejects changes wherethe spec leads browsers

Volume #

Source Merged in window Normative (behaviour, feature, removal)
w3c/csswg-drafts 320 commits ~109 (probably 80–90 after correcting for mislabelling): ~24 layout, ~7 paint, ~42 style, ~30 script, animation, scroll, loading
whatwg/html 99 PRs 52: parser 14, navigation / event loop / script loading 11, DOM and element semantics 17, IDL and realms 5, rendering 3
whatwg/dom — 11
whatwg/fetch, url, webidl, streams — 3, 2, 1, 1 (encoding and infra: none)
w3c/svgwg 27 commits ~7
webappsec-csp 4 2
  • Generated-engine surface: about 10 layout and paint changes a month from CSS and about 25 a month from HTML, DOM, fetch, URL, SVG and CSP. Style changes (owned by Stylo) run about 14 a month.
  • Bursty: HTML had 16, 6 and 30 in successive 30-day windows; CSS layout 5, 13 and 12, with a batch before publication.
  • fxtf-drafts has had no commits since February 2026; its specs now live in csswg-drafts.
  • Busy specs without an oracle-backed engine role: gpuweb 37, webauthn 50, aria 44, webmcp 35, webtransport 31.

Classifying changes #

  • CSS: [editorial] tags are reliable, but message wording is not a normative signal. On 25 sampled diffs the normative/editorial call from messages was right 80% of the time, and every miss was an under-count ("Clarify" commits that change comparisons or thresholds, "Initial plan" rewriting an algorithm, Changes lists calling normative edits "Clarified").
  • HTML: the Editorial/Meta title prefix catches 74% of non-normative PRs; the "normative change" label has 8% recall; the PR template's implementer checklist appears on 85% of normative PRs and on no editorial ones. Prefix, then template, then human triage leaves about 10% for a person.
  • One commit can mix editorial, fix and feature material across both owners (CSS 0499fd631b: a variable rename, a real bug fix, and about 120 new algorithm steps for corner-shape, whose interpolation belongs to Stylo and paint to the engine).
  • Classification therefore belongs at the level of the section diff, by a model pass validated against a hand-labelled set, never from commit wording.

Browser lead and lag #

Two opposite patterns, often in the same spec:

  • Spec catching up to browsers. Most CSS layout clarifications had browsers ahead of the text by 1–18 months: tables fixed-mode (#10937) resolved February 2025, tests from Servo and Blink in March 2025, spec text September 2026; #12076 12–17 months; #7524 about four years; #12612 was literally resolved as "spec what browsers are doing". About 13 of HTML's 52 say all three engines already ship the behaviour, about 6 more say two. Here the cached vote is already right and regeneration should raise the pass rate.
  • Spec leading browsers. In 6 of 8 sampled HTML, DOM and streams changes merged July to September, only one engine passed the linked tests fully on 2026-09-20. Processing instructions (html#12118 with dom#1454, merged June): Chrome 140/140, Firefox 3/140, Safari 0/140. Parser reparenting (html#12830): Chrome and Firefox fail the same subtest, so a 2–1 vote marks the spec-correct output as the outlier. URL ToASCII (url#914): Chrome 739/784, Firefox 721/784, Safari 784/784. In CSS, letter-spacing (#10193) moved to half on each side of every character with no engine and no test; margin-trim (#13731) dropped flex and grid, which Safari shipped in 2023.
  • Tests at merge: 87% of HTML normative changes, landing within three days. For CSS, no findable test at change time for about 6 of 14 shipped-feature layout changes and none of the style changes searched (a lower bound).

Traces #

Definition change (html#12421, "Don't update active document too early"). "A browsing context's active document is its active window's associated Document" becomes a stored field, set in "make active". Only two sections' hashes change; the 26 call sites that use the definition change behaviour with unchanged text. Navigation is substrate, so nothing is generated and the lifecycle has no path for it. CSS #12289 ("scroll container" becoming per-axis across 12 specs) and csswg 4f50f67fa0 (font-synthesis longhands becoming font-affecting, which moves em resolution) have the same shape.

Small edit in a huge algorithm (html#12929). A five-line change inside "apply the history step", already implemented by all three engines. Regenerating the whole algorithm is the most expensive way to get no behaviour change.

Localized, new input shape (html#12830). Detection and localization work as designed; the change needs a new corpus shape (custom-element constructors reparenting during parsing), which the linked WPT PR already contains. The vote disagrees with the spec.

Predicate change, browsers ahead (csswg b2556f8eb0, tables). "Is <length-percentage>, min-content or fit-content" becomes "is not auto or max-content": one predicate to regenerate, one new corpus category, and the cached vote already encodes the new behaviour.

Blocked on the style layer (csswg 16a494b33c, margin-trim). Servo-mode Stylo never computes margin-trim (engine = "gecko"), and its value type still carries the removed keywords. The watcher fires on sections the engine cannot consume.

Cross-spec pairs. About 30% of HTML normative changes pair with a DOM or fetch PR merged the same day (html#12118 with dom#1454, html#12669 with dom#1491, html#12805 with dom#1499, html#12513 with fetch#1931). Regenerating one half leaves parser and DOM inconsistent.

IDL-driven regeneration #

Of about 70 WHATWG normative changes, 5 touched IDL, and IDL-driven regeneration alone fully handles 2–3 (a reflected attribute name, a sequence type that changes conversion, a member reorder that changes enumeration order). By change flow, the 8–15% share in docs/platform-economics.md is an upper bound. Two webref hazards: raw ed/idl/css-font-loading.idl has held Gecko-internal extended attributes and lost members since 2026-07-20, while the curated branch is intact; and SVG IDL references SVGRect, SVGPoint and SVGMatrix, which nothing currently defines.

Changes to the lifecycle #

  1. Normalize before hashing. Strip <wpt> blocks, examples, notes, informative sections and Changes lists; normalize whitespace and variable names; key by definition and anchor identifier, not position. In the CSS window, 23 commits only edited <wpt> blocks, and level swaps and cross-spec moves rewrite hundreds of lines with no change in meaning.
  2. Hash definitions, not just sections. Each generated algorithm's provenance covers its section plus the transitive closure of definitions it references, from webref's definition index; the watcher diffs the definition graph.
  3. One canonical level per algorithm. CSS carries the same text in several levels (sizing 3 and 4, text 3 and 4) and edits land out of sync; provenance pins one and flags divergence.
  4. Debounce. Same-day reverts and "premature change" reverts occur; regenerate on sections stable for several days, or on publication snapshots for drafts, and never auto-regenerate draft-maturity sections.
  5. Classify each change before regenerating: editorial (regenerate only to confirm a differential no-op, which also catches mislabelled changes); spec catching up to browsers (the vote is already right; expect the pass rate to rise); spec leading browsers (below); blocked on the style layer; substrate.
  6. Fork ground truth when the spec leads. Affected corpus cases are marked superseded by the spec revision, the vote is suspended for them while the change's implementation bugs are open (links parsed from the PR template), the linked WPT becomes the acceptance gate for that one change, and the cases rejoin the vote when two engines ship. Superseded cases leave the permanent regression set only by explicit, reviewed action.
  7. Patch-mode regeneration for small diffs in large algorithms, anchored on the spec's numbered-step comments, plus a differential check that old and new code differ only on inputs the diff touches.
  8. Group cross-spec changes into one change set (cross-links in PR bodies, merge date), landed or quarantined together.
  9. A substrate inbox. Navigation, event loop, script loading, and the parser while it is linked, get no regeneration path; changes there go to a person with the linked WPT as the acceptance gate.
  10. A blocked-on-style state. Map sections to the Stylo properties they read, watch Stylo releases and the corresponding Firefox bugs, and accept that some style changes arrive only when Firefox implements them.
  11. Earlier triggers. Watch CSSWG "RESOLVED:" comments and WPT PRs citing spec issues as early warnings that pre-build corpus categories, the one manual step.
  12. WPT as a per-change gate, not a trainer. A WPT change citing a spec issue opens a re-verification of the linked sections, and its inputs are harvested into the corpus. WPT's assertions still never become a training signal.
  13. Consume webref curated, never raw ed/, and treat unresolved IDL types as blockers to report upstream, not regeneration triggers.

Sources #