Parent: #459
Goal
Define and implement the representative, dependency-free benchmark matrix that must be won before zig-js can claim broad performance leadership.
The completed #44 matrix is rigorous but deliberately narrow: ten small kernels centered on numeric loops, properties, object churn, arrays, calls, closures, arguments, and recursion. It does not measure large or mixed application behavior.
Scope
- Add repository-owned workloads for strings/Unicode, RegExp, JSON parse/stringify, Map/Set/Weak collections, typed arrays/DataView, promises/async/microtasks, modules and dynamic import, classes/private fields, iterators/generators, proxies/accessors, Intl, Temporal, WebAssembly scalar/SIMD/memory, and mixed long-lived object graphs.
- Pre-register and freeze the workload manifest, per-row success criteria, exclusions, and non-regression floors before implementation work uses a row as an optimization target. A later methodology change creates a versioned new baseline; it never rewrites a losing row in place.
- Include cold startup, warm steady state, tier-up, deoptimization, context lifecycle, latency distribution, peak/retained RSS, generated-code bytes, GC pauses, and 1/2/4/8-lane scaling where meaningful.
- Integrate work-efficiency/thermal panels from #503 and independent out-of-tree suite validation from #504 without making either a library/build dependency.
- Use exact identical source/input bytes and deterministic checksums across zig-js and JSC. Where the public programming models differ, publish separate capability panels rather than false ratios.
- Keep workloads authored in zig-js or another zig-utils-owned local repository. Do not vendor or download a benchmark suite as a production/dev dependency.
- Add anti-specialization variants that change identifiers, source layout, data distributions, receiver shapes, loop structure, and call graph while preserving equal work.
- Version the workload manifest, job counts, warmup protocol, hardware/toolchain metadata, and acceptance floors.
No-workaround rules
- No source string, function name, benchmark name, checksum, fixed input, or call-site recognition.
- No disabling GC, barriers, checks, watchdogs, debugger hooks, or synchronization on scored paths unless the same public mode disables them for both engines.
- No unbounded caches/pools and no hidden precomputation outside the declared timed boundary.
- No aggregate-only success: every row remains visible and must meet its own gate.
Acceptance
- A machine-readable manifest defines every workload, mode, jobs, warmups, expected checksum, and metric.
- The manifest and row-level win/non-regression criteria are checked in and reviewed before optimization begins; revisions preserve the prior matrix as history.
- Full runs enforce a 50 ms timing floor or an explicitly justified latency protocol, alternating order, repeated samples, dispersion, and exact checksum equality.
- Raw evidence and generated reports are reproducible from a clean worktree.
- Anti-specialization variants produce equivalent tier attribution and no benchmark recognizer exists.
- #504 corroborates the repository-owned matrix with independent workloads and explicit applicable/excluded inventories.
- The original #44 matrix remains unchanged and green as a permanent compatibility panel.
- The expanded matrix is reviewed and frozen before #459 evaluates “win every benchmark.”
Foundation
- Harness symmetry and publication: #45 and #50.
- Completed comparison win: #44; publication commit.
- Existing Wasm SIMD method: #283.