Bump wasix-libc to v2026-07-03.1 (page-granular mmap) and add mmap emulation tests - #6772
Merged
Conversation
Arshia001
force-pushed
the
warp69-mman-tests
branch
from
July 3, 2026 12:14
54d20e1 to
14cbbc8
Compare
Contributor
There was a problem hiding this comment.
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-libcsysroot tag tov2026-07-03.1. - Un-ignore and gate existing file-writeback
msync/munmaptests with//#MinimalLibc: v2026-07-03.1, updating mappings to use page-aligned file offsets. - Add a new end-to-end test
libc/mmap-page-granularcovering page-granular behavior, partialmunmap, 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. |
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
force-pushed
the
warp69-mman-tests
branch
from
July 3, 2026 12:19
14cbbc8 to
5e094e6
Compare
theduke
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-granularCovers 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, andread-after-munmapwere allIgnored: file-backed mmap writeback does not currently persist under WasiRunner. The actual cause was an invertedPROT_WRITEcheck in the old emulation's msync — writeback never happened. The rewrite fixes it, so they now run, gated withMinimalLibc: 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
WASIXCC_SYSROOT_PREFIXpointing at the downloaded release), with thev2026-05-12.1back-compat configs correctly skipped viaMinimalLibc.wasm_testssweep 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 localwasm32-wasip1rustup 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