Skip to content

fix(bindgen): align zero-length stream semantics with component model - #2362

Merged
vados-cosmonic merged 1 commit into
bytecodealliance:mainfrom
vados-cosmonic:fix/zero-length-stream-semantics
Oct 31, 2026
Merged

vados-cosmonic merged 1 commit into
bytecodealliance:mainfrom
vados-cosmonic:fix/zero-length-stream-semantics

Conversation

@vados-cosmonic

Copy link
Copy Markdown
Collaborator

Zero-length stream reads and writes currently skip pointer alignment checks and allow same-instance non-numeric transfers that copy no elements. Align these operations with WebAssembly/component-model#755.

Validate guest buffer alignment and the full requested range, including empty buffers and operations whose peer has dropped. Allow an empty buffer at the end of memory and preserve the ignored pointer for unit streams. Check the same-instance non-numeric restriction whenever both ends provide buffers, regardless of length.

Import the PR's zero-length and same-component WAST fixtures at commit 3e016227fbe8992dd1d54ca5efdfca543ad53b01, update the existing resource-stream regression, and add boundary and dropped-peer tests. Document the semantics in the Preview 3 stream guide.

Validation:

  • Rebuilt the transpiler; 338 runtime tests passed across 11 suites, with one existing skip.
  • All 96 js-component-bindgen Rust library tests passed.
  • Formatting, lint, and git diff --check passed.
  • Confirmed the new regression tests fail against the previous transpiler.

@vados-cosmonic
vados-cosmonic added this pull request to the merge queue Oct 31, 2026
Merged via the queue into bytecodealliance:main with commit d994db3 Oct 31, 2026
67 checks passed
@vados-cosmonic
vados-cosmonic deleted the fix/zero-length-stream-semantics branch October 31, 2026 06:41
@jco-release-bot

Copy link
Copy Markdown
Collaborator

🎉 The code in this PR was made available in the following release:
https://github.com/bytecodealliance/jco/releases/tag/js-component-bindgen-v2.18.0

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.

2 participants