Skip to content

[WASM R4] Add stdlib acceptance with official-Go reference hosts - #234

Closed
cpunion wants to merge 3 commits into
codex/wasm-r3-stdlib-ci-20260905from
codex/wasm-r4-stdlib-reference-20260905
Closed

cpunion wants to merge 3 commits into
codex/wasm-r3-stdlib-ci-20260905from
codex/wasm-r4-stdlib-reference-20260905

Conversation

@cpunion

@cpunion cpunion commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Scope

First bounded R4 acceptance slice for xgo-dev#2152, stacked on #231. This PR adds executable standard-library behavior checks and official-Go reference hosts, not an implementation of LLGo's GJS/GWASI ABI.

  • Run the complete repository packages test/std/errors, test/std/sort, and test/std/encoding/binary, without test-name filters or blanket skips.
  • Exercise five independent CI lanes: LLGo EC32/EC64/WC32, official Go JS reference, and official Go WASI reference. The reference lanes use the selected GOROOT's actual host helpers and run Go output, not LLGo output.
  • Discover the source inventory independently of build tags. Persist per-package JSON results after each run; keep unexecuted packages and source-excluded directories visible instead of counting them as compatible.
  • Require successful process exit, exactly one terminal PASS, a package-specific test witness, and no FAIL/SKIP records. Clear inherited GOFLAGS to prevent external filters from silently reducing coverage.
  • Add command-driver tests, real five-lane CI execution, report artifacts, and documentation of the remaining compatibility boundary.

Verification

  • Actual local execution passed all five lanes: 15 package runs, with the same 29 top-level tests per lane (errors 14, sort 7, encoding/binary 8).
  • Each report contains 180 source-test packages: 3 passed, 175 not run, 2 source-excluded/unclassified. The excluded directories are plugin and syscall; this is not a claim that either entire API is host-inapplicable.
  • Driver tests pass with 92.9% statement coverage; go vet and actionlint pass. Failure-path tests cover empty execution, missing witnesses, duplicate PASS records, skips, nonzero exit after PASS, external-command failures, report failures, and source-selection failures.
  • Reran the actual Go JS reference with inherited GOFLAGS=-run=TestAs; all 29 tests still execute.
  • Local tools: Go 1.27.0, Node 26.8.1, Wasmtime 48.0.1, Emscripten 6.0.8. CI separately checks the pinned Node 24 / Wasmtime 39.0.1 / Emscripten 4.0.21 setup.

Still pending in R4

Broader standard-library classification and execution; LLGo's official Go data model and JS/WASI host ABI; browser-specific coverage; applicable goroot acceptance. This slice is not R4 completion and does not count official-Go reference successes as LLGo official-profile compatibility.

@cpunion

cpunion commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Follow-up 9ba1e905a fixes two independently reproduced accounting problems:

  • GOFLAGS="" alone still read filters saved by go env -w. An isolated saved witness-only filter made the real JS reference run just 3/29 tests and report success. The driver now also uses GOENV=off; the same reproduction executes all 29 tests. Explicit process environment such as GOPROXY remains available.
  • Failure before test execution could leave a previous passing report unchanged. Reports now initialize before preparation; failed Go environment/source selection preserves all discovered packages as unvalidated and records the actual top-level error. Summary-write failures likewise cannot leave a successful run result.

Unit tests, race tests, vet and workflow lint pass; statement coverage is now 93.5%. A real missing-executable run produced a failed report retaining all 180 discovered packages. The actual official Go JS reference was rerun with the saved filter and passed all 29 tests.

The initial revision's EC32 CI lane passed, but the new commit must complete its own matrix; other lane results are not yet claimed green.

@cpunion
cpunion force-pushed the codex/wasm-r4-stdlib-reference-20260905 branch from 9ba1e90 to e79eba5 Compare September 5, 2026 14:47
@cpunion
cpunion force-pushed the codex/wasm-r3-stdlib-ci-20260905 branch from 80a4818 to e0aef00 Compare September 5, 2026 14:47
@cpunion
cpunion force-pushed the codex/wasm-r4-stdlib-reference-20260905 branch from e79eba5 to ecd2e88 Compare September 5, 2026 15:22
@cpunion
cpunion force-pushed the codex/wasm-r3-stdlib-ci-20260905 branch from e0aef00 to c8c31fb Compare September 5, 2026 15:22
@cpunion

cpunion commented Sep 5, 2026

Copy link
Copy Markdown
Owner Author

Rebased in dependency order onto LLVM 22 main bf3071fdd.

  • This PR's new head: ecd2e8865; current dependency: codex/wasm-r3-stdlib-ci-20260905.
  • R2's 28 patches and R2.1's six lifecycle patches remain equivalent. R3/R4 inherit the independent fork-runner repair ci: keep hosted runners available to forks #236; upstream continues using Qiniu, forks use hosted runners. R4's separate stdlib workflow now also installs LLVM 22.
  • LLVM 22 integration validation passed: 30 single-worker checks (7 expected failure paths, 1 timeout, no unexpected failures/skips); nine R3 stdlib package runs; five R4 lanes with six packages / 74 top-level tests per lane. Go-reference lanes remain Go output, not LLGo official-Go-ABI evidence.

To keep CI load bounded, this intermediate PR retains Format/Targets. Repeated functional matrices are canceled here and kept on the updated stack tip #235. Per-layer benchmark reruns are deferred, not replaced by the top PR's performance comparison. Canceled checks are not passing checks, and the integration result is not independent complete validation of every intermediate revision.

@cpunion

cpunion commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Consolidated into #235, now rebased onto upstream main d98438f. All changes from this PR are preserved there; validation continues on the consolidated PR.

@cpunion cpunion closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant