Skip to content

test: fix Wasm stdlib stack budgets and source accounting - #3065

Open
cpunion wants to merge 2 commits into
xgo-dev:mainfrom
cpunion:fix/compat-wasm-stdlib-20261112
Open

cpunion wants to merge 2 commits into
xgo-dev:mainfrom
cpunion:fix/compat-wasm-stdlib-20261112

Conversation

@cpunion

@cpunion cpunion commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Fix the Wasm failures reported in llgo-compat/ci#120:

# escape, crypto/mldsa and go/types need larger fixed Fiber stacks:
llgo test -target=emscripten -goroutine-stack-size=1MB ./test/escape

Apply that budget only to these three packages on JS profiles. Recognize native-only test/cgo/c11 as not applicable, and include test/std/simd in the experimental suites already tested by native/W32-WASI jobs. Neither classification reports a pass.

Validation: the original ML-DSA stack overflow reproduces locally; all three affected packages pass on GoJS, Emscripten32 and Emscripten64 with the budget. Full acceptance-runner unit tests pass, including profile isolation and source accounting.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

This is a small, well-scoped change to the dev/wasmstdlib test-orchestration harness: it raises the WebAssembly goroutine stack to 1MB for three stack-heavy js packages, excludes test/cgo/c11 from wasm source selection, and classifies test/std/simd as a separately-executed experimental SIMD suite. Tests are updated accordingly, and TestFullLargeStackCommandsAreTargeted is a well-designed addition that exercises the full six-profile matrix including a negative control (test/std/fmt).

I verified:

  • The -goroutine-stack-size flag is a real build flag accepting values like 1MB (cmd/internal/flags/flags.go:231).
  • The guard !p.Reference && p.GOOS == "js" correctly scopes the flag to J32-GoJS, J32-Emscripten, and J64-Emscripten only (not W32-WASI or reference profiles).
  • The test/cgo/c11 and test/std/simd reason strings accurately match the packages' build constraints.
  • Package tests pass (go test ./dev/wasmstdlib/).

No security, performance, or correctness issues were found. One minor comment-wording nit is noted inline.

Optional (non-blocking): the two adjacent blocks at full.go:93 and full.go:103 share the identical !p.Reference && p.GOOS == "js" guard and could be merged, though the current grouping-by-concern is defensible.

Comment thread dev/wasmstdlib/full.go Resolved
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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