Skip to content

Bump wasix-libc to v2026-07-03.1 (page-granular mmap) and add mmap emulation tests - #6772

Merged
Arshia001 merged 2 commits into
mainfrom
warp69-mman-tests
Jul 3, 2026
Merged

Bump wasix-libc to v2026-07-03.1 (page-granular mmap) and add mmap emulation tests#6772
Arshia001 merged 2 commits into
mainfrom
warp69-mman-tests

Conversation

@Arshia001

Copy link
Copy Markdown
Member

Summary

Bumps the pinned wasix-libc sysroot to v2026-07-03.1, which contains the page-granular mmap emulation rewrite (WARP-69, wasix-org/wasix-libc#126), and adds/uprades the WASIX mmap test coverage accordingly.

New test: libc/mmap-page-granular

Covers the rewritten emulation end to end: page-aligned results, zero-fill of fresh and recycled pages, partial munmap with region splitting and coalescing (including the over-allocate-and-trim pattern used by allocators like PHP's Zend MM), shared-file writeback via msync/munmap with correct fragment offsets after splits, error semantics (EINVAL/EBADF/ENOMEM cases), and large (128 MiB) anonymous mappings.

Un-ignored: the seven file-writeback tests

msync-{start,middle,end}-of-file, munmap-sync-{start,middle,end}-of-file, and read-after-munmap were all Ignored: file-backed mmap writeback does not currently persist under WasiRunner. The actual cause was an inverted PROT_WRITE check in the old emulation's msync — writeback never happened. The rewrite fixes it, so they now run, gated with MinimalLibc: v2026-07-03.1 (the back-compat pinned sysroot runs skip them).

Four of them mapped files at non-page-aligned offsets (2 or 3), which POSIX/Linux reject with EINVAL and the new emulation correctly rejects too; they now map from offset 0 and address the middle/end through the mapping pointer.

Test results

  • All 10 mmap-family tests pass against the released v2026-07-03.1 sysroot (verified locally with WASIXCC_SYSROOT_PREFIX pointing at the downloaded release), with the v2026-05-12.1 back-compat configs correctly skipped via MinimalLibc.
  • Full wasm_tests sweep against a sysroot built from the wasix-libc branch: zero regressions vs the old pinned sysroot (all failures identical on both and attributable to a missing local wasm32-wasip1 rustup target for the Rust-source fixtures).

Context

The libc rewrite makes anonymous mappings lazily committed (a 128 MiB mapping costs ~0 RSS until written; previously fully committed by an eager memset). Measured on PHPIX: idle RSS −125 MiB, and with Zend MM re-enabled on top (unlocked by partial munmap), allocation-heavy PHP requests run 2.9× faster. ECO-263 has the details.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 3, 2026 12:10
@Arshia001
Arshia001 force-pushed the warp69-mman-tests branch from 54d20e1 to 14cbbc8 Compare July 3, 2026 12:14

Copilot AI 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.

Pull request overview

This PR updates Wasmer’s pinned wasix-libc sysroot to v2026-07-03.1 (page-granular mmap emulation rewrite) and adjusts/adds WASIX mmap-family tests so the new semantics (especially file-backed writeback) are exercised in CI.

Changes:

  • Bump pinned wasix-libc sysroot tag to v2026-07-03.1.
  • Un-ignore and gate existing file-writeback msync/munmap tests with //#MinimalLibc: v2026-07-03.1, updating mappings to use page-aligned file offsets.
  • Add a new end-to-end test libc/mmap-page-granular covering page-granular behavior, partial munmap, coalescing, and writeback semantics.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/wasix/tests/wasm_tests/libc/read-after-munmap/main.c Gate test on new libc and adjust mapping to use offset 0 while writing at the intended in-file offset.
lib/wasix/tests/wasm_tests/libc/munmap-sync-start-of-file/main.c Un-ignore via MinimalLibc gating for the fixed writeback behavior.
lib/wasix/tests/wasm_tests/libc/munmap-sync-middle-of-file/main.c Switch to page-aligned mapping (offset 0) and adjust write location; gate on new libc.
lib/wasix/tests/wasm_tests/libc/munmap-sync-end-of-file/main.c Switch to page-aligned mapping (offset 0) and adjust write location; gate on new libc.
lib/wasix/tests/wasm_tests/libc/msync-start-of-file/main.c Un-ignore via MinimalLibc gating for the fixed writeback behavior.
lib/wasix/tests/wasm_tests/libc/msync-middle-of-file/main.c Switch to page-aligned mapping (offset 0) and adjust write location; gate on new libc.
lib/wasix/tests/wasm_tests/libc/msync-end-of-file/main.c Switch to page-aligned mapping (offset 0) and adjust write location; gate on new libc.
lib/wasix/tests/wasm_tests/libc/mmap-page-granular/main.c New comprehensive test suite for the page-granular mmap emulation rewrite.
.github/ci-constants.env Update pinned WASIX_LIBC_SYSROOT_TAG to v2026-07-03.1.

Comment thread lib/wasix/tests/wasm_tests/libc/mmap-page-granular/main.c Outdated
Arshia001 and others added 2 commits July 3, 2026 12:19
Adds libc/mmap-page-granular, covering the rewritten mmap emulation in
wasix-libc v2026-07-03.1: page-aligned results, zero-fill of fresh and
recycled pages, partial munmap with region splitting and coalescing
(including the over-allocate-and-trim pattern used by allocators like
PHP's Zend MM), shared-file writeback via msync/munmap with correct
fragment offsets after splits, error semantics, and large (128 MiB)
anonymous mappings.

Un-ignores the seven file-backed writeback tests (msync-*,
munmap-sync-*, read-after-munmap). They were ignored because the old
emulation's msync had an inverted PROT_WRITE check, so writeback never
happened; the rewrite fixes that. They are now gated with
MinimalLibc: v2026-07-03.1 so the wasix-libc back-compat runs skip
them.

Four of those tests mapped with non-page-aligned file offsets (2 or 3),
which POSIX and Linux reject with EINVAL and the rewritten emulation
now correctly rejects too; they are updated to map from offset 0 and
address the middle/end of the file through the mapping pointer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pulls in the page-granular mmap emulation rewrite (WARP-69,
wasix-org/wasix-libc#126), required by the mmap tests in the previous
commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Arshia001
Arshia001 force-pushed the warp69-mman-tests branch from 14cbbc8 to 5e094e6 Compare July 3, 2026 12:19
@Arshia001
Arshia001 enabled auto-merge (squash) July 3, 2026 12:38
@Arshia001
Arshia001 merged commit 39d6406 into main Jul 3, 2026
62 checks passed
@Arshia001
Arshia001 deleted the warp69-mman-tests branch July 3, 2026 12:51
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.

3 participants