wasmstdlib

command
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

WebAssembly standard-library behavior and reference hosts

Full compatibility audit

-full discovers every test package below test/ independently of build tags, executes one deterministic shard, continues after individual failures, and preserves JSON accounting plus per-package logs. Source exclusions and host-only suites must be classified explicitly; an unknown exclusion remains a failure rather than becoming a compatibility pass.

go run ./dev/wasmstdlib -full -profile J32-GoJS -shard 0 -shards 2 -llgo /path/to/llgo -report /tmp/full.json

The full audit requires GNU timeout. Each package has a five-minute build/run budget and a separate 60-second guest deadline, extended only for reviewed finite slow packages. LLGo package compilation is cached within the job, but -count=1 keeps execution mandatory. The normally pattern-excluded _stress/runtime/timer package is named explicitly and runs with LLGO_STRESS_PROFILE=quick. other-shard, not-run, and interrupted incomplete results are never counted as passes. The audit runs the complete applicable GOROOT corpus on the Go-compatible J32-GoJS path, runs representative GOROOT sentinels on all four LLGo paths, and loads an asynchronous syscall/js callback artifact through HTTP in hosted headless Chrome; a missing browser is an error, not a skip.

Reviewed exclusions are reported as not-applicable with a profile-specific reason. Native-only signal, CPU-profiler, BDWGC finalizer and weak-reference stress suites; OS-only plugin, syscall and Windows suites; and the unsupported Go cgo frontend are not counted as passes. Official Go reference profiles also classify test/llgoext explicitly because those packages require LLGo-only build tags and runtime APIs. Dedicated target tests continue to cover LLGo's C ABI and host boundaries.

test/simd and test/simd/portable are reported as separate-suite: they require GOEXPERIMENT=simd and run in the regular Go workflow's dedicated native and W32-WASI SIMD jobs at O0 and O2. This does not claim SIMD acceptance on the JavaScript profiles or count those packages as standard-library passes. The native libc ABI and signal tests in test/std/runtime/abicall explicitly exclude wasm and are reported as not-applicable.

Focused standard-library slice

This bounded acceptance slice runs the complete repository test packages for errors, sort, encoding/binary, fmt, strconv, and io. It exercises error wrapping and assertion, reflection-based sorting, byte-order interfaces, structured encoding, varints, fixed- and native-width integer boundaries, formatting and scanning interfaces, readers and writers, and pipe goroutine/timer coordination.

No test-name filter or blanket skip is used. The driver clears inherited GOFLAGS and sets GOENV=off, so command-line or saved Go configuration cannot silently narrow the suite. Explicit process environment such as GOPROXY remains available.

Path Compiler and execution contract
J32-GoJS LLGo Memory32 with Go-compatible js/wasm source/API and the Emscripten-based JavaScript adapter, Node
J32-Emscripten LLGo Memory32 with the Emscripten JavaScript provider, Node
J64-Emscripten LLGo Memory64 with the Emscripten JavaScript provider, Node
W32-WASI LLGo Memory32 with WASI Preview 1; Wasmer with pthreads and threaded GC by default
GoJS-reference Official Go compiler and the selected GOROOT's go_js_wasm_exec
GoWASI-reference Official Go compiler and the selected GOROOT's go_wasip1_wasm_exec, Wasmtime

Run bash dev/install_wasmer.sh and place the pinned Wasmer CLI on PATH to run the W32-WASI row. Threads and the threaded collector are now the default; no opt-in is needed. The runner grants each package's absolute working directory and /tmp for filesystem tests; absolute mappings preserve working-directory restoration after testing.Chdir. The source inventory then includes llgo.wasi_threads; the report records the Wasmer execution contract.

The reference rows execute Go compiler output, not LLGo output. They establish the expected source behavior but do not substitute for any of the four LLGo paths. CI uses the repository-selected Go version and records it in every report.

From the repository root:

go test ./dev/wasmstdlib
go run ./dev/wasmstdlib -profile J64-Emscripten -llgo /path/to/llgo -report /tmp/j64.json
go run ./dev/wasmstdlib -profile GoJS-reference -report /tmp/go-js.json

Each package must exit successfully, print exactly one terminal PASS, execute its expected witness, and contain no failed or top-level skipped test record. Intentional skipped subtests remain valid only when their enclosing top-level test passes. A failure stops that profile; completed results and every unvalidated inventory entry remain in the JSON report.

Test binaries have a 60-second test deadline, extended only for reviewed finite slow packages in the full audit. LLGo compilation cache is shared within a profile run, while -count=1 ensures that every test binary executes. Threaded W32-WASI runs on Wasmer without Binaryen/Asyncify. Official Go reference commands force GOMAXPROCS=1 because the current Go wasm runtimes do not create operating-system threads.

The inventory walks test/std independently of profile build constraints and then records source selection from go list. pass and fail are actual execution results; not-run remains unvalidated; source-excluded requires later review or replacement coverage and is not treated as a compatibility pass. This focused slice is not a completeness claim. The full audit runs and classifies the applicable test/** and GOROOT corpus.

Documentation

Overview

Command wasmstdlib runs a bounded standard-library acceptance slice and records the rest of the source inventory as unvalidated, never as passing.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL