Yuku
Testing
Yuku is checked against the specs and against independent tools on tens of thousands of files: the parser against Test262 and Oxc’s ASTs, the analyzer against the TypeScript checker and typescript-eslint, the printer against its own output and the Zig printer. Every suite runs on Linux, macOS, and Windows on every commit, and every one passes in full.
| Suite | Checked against | Checked | Result |
|---|---|---|---|
| Parser | Test262, TypeScript, Babel, Oxc | 57,538 tests | All pass |
| Semantic analysis | The TypeScript checker, scope-manager | 21,998,189 comparisons | All agree |
| Codegen | Reparsing its output, the Zig printer | 684,345 checks | All pass |
| Source maps | The original source | 54,715 files | All trace back |
| Fuzzing | Crashes and out-of-memory | 3,000,000 inputs a run | No crash |
The counts are from December 2026, and grow as the suite syncs with upstream.
The corpus
parser-test-suite collects the tests of Test262, the TypeScript compiler, and Babel, synced with upstream daily.
| Language | pass | fail | semantic |
|---|---|---|---|
| JavaScript | 38,977 | 5,267 | 4,200 |
| TypeScript | 8,687 | 291 | |
| JSX | 88 | 25 | 3 |
Twelve real codebases, each pinned to a commit, add 6,953 files of production code: the TypeScript compiler, Node.js, Vue, Svelte, Preact, three.js, Zod, date-fns, Excalidraw, NestJS, webpack, and Vite. Analysis and codegen run over all 54,715 passing and codebase files.
Parser
| Category | Expectation |
|---|---|
pass | Parses with no diagnostics, and the AST matches a snapshot exactly |
fail | Produces a syntax error |
semantic | Parses, then fails semantic analysis with an early error |
The snapshots come from an independent parser, Oxc, and must match down to every field, position, and comment. Passing files must also walk in source order and analyze without a false positive. The suite runs through the yuku package built from local source, so it checks the whole chain from the Zig parser to the JavaScript AST. Another 283 fixtures of Yuku’s own pin down diagnostics and AST shapes.
Semantic analysis
Every one of the 54,715 files is analyzed and compared with independent tools.
| Compared with | Must agree on | Agreed |
|---|---|---|
| The TypeScript checker | The declaration every reference resolves to, values and types alike | 3,094,649 |
| TypeScript’s syntax tree and symbols | Every import and export record, and the flags of every binding | 12,626,106 |
| TypeScript’s emit | Which imports are removed as type-only, in 12,996 files | 30,549 |
| scope-manager | Every runtime reference and write, every declaration and its scope | 6,164,515 |
| TypeScript programs | Every import, re-export, exported name, and relative path | 82,370 |
The last row links each codebase as one project, across files. Where the reference tool is the one that differs, such as tsc resolving a require binding to the wrong block, the difference is listed by file with its reason, 16 reasons in all, and the suite fails if one changes or a new one appears.
Each file’s model must also be consistent with itself: every lookup agrees with resolution, every binding and reference maps back to its node, parents agree with the walk, every export has its record, analysis is deterministic, and reanalyze() leaves the model unchanged.
Codegen
Every one of the 54,715 files is printed pretty, compact, and minified, from a parse without parentheses, so the printer must rebuild every one that precedence needs.
- The output parses with no diagnostics.
- Pretty and compact output parse back to the same AST.
- No comment is lost or duplicated.
- Printing the output again gives the same code.
The JavaScript print encodes a tree back for the Zig printer, and must agree with printing the parsed tree byte for byte, source maps included: 57,800 inputs under 9 option sets, 520,200 comparisons.
Source maps
For every one of the 54,715 files, every identifier in the output must map back to its original name and position.
Platforms
The packed npm package is installed and run on macOS, Linux, and Windows, each on arm64 and x64, and on Linux with musl, natively and as WebAssembly. It also runs on the oldest Node.js it supports.
Fuzzing
A fuzzer throws 3,000,000 mutated inputs at the parser in every language mode, and parses and analyzes every 20,000th input again with each of its allocations failing in turn. The parser must never crash, and any failure dumps a self-contained reproducer. With everything in one arena, a parse has nothing to leak even when memory runs out.