Skip to content

Automatic rebaseline of codesize expectations. NFC - #1

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
rebaseline_tests
Open

Automatic rebaseline of codesize expectations. NFC#1
github-actions[bot] wants to merge 1 commit into
mainfrom
rebaseline_tests

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 5, 2025

Copy link
Copy Markdown

This is an automatic change generated by tools/maint/rebaseline_tests.py.

The following (16) test expectation files were updated by
running the tests with --rebaseline:

code_size/random_printf_wasm.json: 12506 => 12498 [-8 bytes / -0.06%]
code_size/random_printf_wasm2js.json: 17186 => 17215 [+29 bytes / +0.17%]
other/codesize/test_codesize_cxx_ctors1.size: 129756 => 129749 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_ctors2.size: 129141 => 129134 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_except.size: 171426 => 171419 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_except_wasm.size: 144872 => 144865 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_except_wasm_legacy.size: 142462 => 142455 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_lto.size: 121986 => 121979 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_mangle.size: 235490 => 235483 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_noexcept.size: 132129 => 132122 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_wasmfs.size: 169999 => 169992 [-7 bytes / -0.00%]
other/codesize/test_codesize_hello_O0.size: 15170 => 15163 [-7 bytes / -0.05%]
other/codesize/test_codesize_hello_dylink.size: 18550 => 18543 [-7 bytes / -0.04%]
other/test_unoptimized_code_size.wasm.size: 15170 => 15163 [-7 bytes / -0.05%]
other/test_unoptimized_code_size_no_asserts.wasm.size: 12251 => 12244 [-7 bytes / -0.06%]
other/test_unoptimized_code_size_strict.wasm.size: 15170 => 15163 [-7 bytes / -0.05%]

Average change: -0.01% (-0.06% - +0.17%)

This is an automatic change generated by tools/maint/rebaseline_tests.py.

The following (16) test expectation files were updated by
running the tests with `--rebaseline`:

```
code_size/random_printf_wasm.json: 12506 => 12498 [-8 bytes / -0.06%]
code_size/random_printf_wasm2js.json: 17186 => 17215 [+29 bytes / +0.17%]
other/codesize/test_codesize_cxx_ctors1.size: 129756 => 129749 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_ctors2.size: 129141 => 129134 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_except.size: 171426 => 171419 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_except_wasm.size: 144872 => 144865 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_except_wasm_legacy.size: 142462 => 142455 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_lto.size: 121986 => 121979 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_mangle.size: 235490 => 235483 [-7 bytes / -0.00%]
other/codesize/test_codesize_cxx_noexcept.size: 132129 => 132122 [-7 bytes / -0.01%]
other/codesize/test_codesize_cxx_wasmfs.size: 169999 => 169992 [-7 bytes / -0.00%]
other/codesize/test_codesize_hello_O0.size: 15170 => 15163 [-7 bytes / -0.05%]
other/codesize/test_codesize_hello_dylink.size: 18550 => 18543 [-7 bytes / -0.04%]
other/test_unoptimized_code_size.wasm.size: 15170 => 15163 [-7 bytes / -0.05%]
other/test_unoptimized_code_size_no_asserts.wasm.size: 12251 => 12244 [-7 bytes / -0.06%]
other/test_unoptimized_code_size_strict.wasm.size: 15170 => 15163 [-7 bytes / -0.05%]

Average change: -0.01% (-0.06% - +0.17%)
```
arsnyder16 pushed a commit that referenced this pull request Jul 21, 2026
…ore#27284)

$doReadv reads iovec-by-iovec via `FS.read`. On a non-blocking socket,
`FS.read` (nodeSockOps.recvmsg) throws EAGAIN when the queue is empty,
unlike a regular file which returns 0. If an earlier iovec already
consumed data and filled exactly to its length (so the `if (curr < len)
break` doesn't fire), the loop advances to the next iovec, whose
`FS.read` throws EAGAIN. The exception escaped `doReadv`, discarding the
accumulated `ret`, so the whole `readv(2)` failed with EAGAIN even
though bytes were read.

POSIX readv/writev are single gather operations: they return the
available byte count and never fail after partial success.

Observed with an mio `TcpStream` (NODERAWSOCKETS + PROXY_TO_PTHREAD +
JSPI) where an echo returned as two TCP chunks: `read_vectored` with two
iovecs hit recvmsg on iovec #1 (12 bytes, drains recvq) then recvmsg
EMPTY on iovec emscripten-core#2 (next chunk not yet arrived), throwing WouldBlock for
the whole call. A single-buffer read never hits it — matching "read
works, readv fails". It is timing-sensitive: if both chunks are queued
before the read, iovec emscripten-core#2 succeeds.

- `doReadv` and `doWritev` now catch `EAGAIN`/`EWOULDBLOCK`
`FS.ErrnoError` from a subsequent iovec and return the accumulated count
when `ret > 0`, only rethrowing when `ret == 0` (nothing transferred
yet, so the would-block belongs to the first iovec).

Adds `test/fs/test_readv_eagain.c` (wired up as `test_fs_readv_eagain`),
which registers custom devices that satisfy the first iovec fully then
throw EAGAIN, asserting both `readv` and `writev` return the partial
count rather than failing. The test aborts without the fix and passes
with it.
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