SYSTEM Cited by 1 source
Web Platform Tests (WPT)¶
Web Platform Tests (web-platform-tests.org) is the cross-browser conformance test suite for web platform APIs — one shared corpus of tests that every browser engine (Chromium/Blink, Firefox/Gecko, Safari/WebKit) and increasingly every server-side JS runtime (Node.js, Deno, Bun, Cloudflare Workers) runs to verify spec conformance.
Why it shows up on this wiki¶
WPT is the canonical executable specification for web standards. When a new implementation of a spec'd API needs a pass/fail oracle, WPT is that oracle. Two load-bearing consequences surface in the wiki corpus:
- AI-driven reimplementations become tractable.
Vercel's 2026-04-21 disclosure of
fast-webstreams names
WPT as what made AI-assisted rework feasible:
"The amazing Web Platform Tests gave us 1,116 tests as an immediate, machine-checkable answer to 'did we break anything?'" Canonicalised at patterns/ai-reimplementation-against-conformance-suite.
- The tests catch the optimiser's shortcuts. Vercel reports: "We tried many shortcuts. Almost every one of them broke a Web Platform Test, and the test was usually right." The tests encode real edge cases — cancellation-during-read, error identity through locked streams, thenable interception — that naive optimisations silently break.
Streams suite specifics¶
The WPT streams suite has 1,116 tests covering
ReadableStream / WritableStream / TransformStream
(as of 2026-04-21). Baseline pass rates per the Vercel
disclosure:
| Implementation | Pass | Fail |
|---|---|---|
| Node.js native | 1,099 | 17 |
| fast-webstreams | 1,100 | 16 |
Remaining failures are either shared with native
(e.g. unimplemented type: 'owning' transfer mode for
the ReadableStream.transfer() semantics) or
architectural differences that don't affect real
applications.
WPT monkey-patches the test harness¶
One notable WPT testing practice: the tests monkey-patch host objects to verify implementation correctness. Examples cited in the 2026-04-21 post:
- WPT monkey-patches
Function.prototype.calland verifies that stream implementations do not use it to invoke user-provided callbacks — forcing the use ofReflect.applyinstead. - WPT puts
.thenon read results and verifies the stream handles thenable interception correctly (becausePromise.resolve(obj)always checks for thenables).
This "test the test" discipline means a "fast" implementation cannot skip spec edges without WPT failing loudly.
How WPT is consumed¶
- Browser engines: WPT is part of each engine's CI.
- Node.js: the
test/wptdirectory in the Node source tree runs upstream WPT against Node's implementations (URL, fetch, streams, etc.). - Bun / Deno / Workers: each maintains its own WPT ingestion process; Workers in particular has a published dashboard.
- Library implementations: e.g. fast-webstreams runs WPT as part of its development loop.
Canonical citation pattern: "X passes N of M WPT cases" — a standard shorthand for spec compliance.
Relationship to tests-as-executable-spec pattern¶
WPT is the web-standards tier of the broader patterns/tests-as-executable-specifications pattern. Where an AWS Architecture Blog post names tests as a specification aid for agents, WPT is the longer-standing, cross-browser precedent at the spec implementation tier — the pattern's canonical large-scale realisation. See also concepts/specification-driven-development at the formal-spec altitude.
Seen in¶
- sources/2026-04-21-vercel-we-ralph-wiggumed-webstreams-to-make-them-10x-faster
— canonical wiki instance as AI-reimplementation
oracle. 1,116 streams tests; fast-webstreams passes
1,100; native Node passes 1,099; WPT catches every
shortcut the optimiser tried; monkey-patching
Function.prototype.callenforcesReflect.applydiscipline.
Related¶
- systems/web-streams-api — the spec family WPT tests in the 2026-04-21 instance.
- systems/fast-webstreams — the consumer of WPT as oracle in the 2026-04-21 story.
- systems/nodejs — a WPT consumer; also the runtime fast-webstreams targets.
- patterns/tests-as-executable-specifications — the pattern WPT is a large-scale instance of.
- patterns/ai-reimplementation-against-conformance-suite — the workflow WPT enables.
- concepts/specification-driven-development — the formal-spec-tier sibling concept.