Skip to content

Add macOS arm64 sys-vm JIT and update CI runners - #12

Merged
huangminghuang merged 19 commits into
masterfrom
feature/macos-arm64-jit-sysvm-infra
Jun 11, 2026
Merged

Add macOS arm64 sys-vm JIT and update CI runners#12
huangminghuang merged 19 commits into
masterfrom
feature/macos-arm64-jit-sysvm-infra

Conversation

@huangminghuang

@huangminghuang huangminghuang commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Change Description

Adds the macOS arm64 sysio::vm::jit backend and the supporting runtime, test, benchmark, and CI changes needed to make it usable on Apple Silicon.

Concrete changes in this PR:

  • Adds include/sysio/vm/aarch64.hpp, an AArch64 machine-code writer for WASM constants, params/locals, globals, memory load/store/size/grow, integer arithmetic and bit operations, integer division/remainder traps, structured control flow, br_table, direct internal calls, imported host calls, call_indirect, and softfloat-backed floating-point arithmetic/conversions.
  • Wires the AArch64 writer into the normal sysio::vm::jit backend on macOS arm64 while keeping jit_profile limited to x86_64.
  • Adds platform capability gates and public compile-time flags in config.hpp for x86_64, arm64, Apple, generic JIT availability, AArch64 JIT availability, and JIT profiling availability.
  • Updates parser/writer interfaces so branch emitters know whether a target is a loop target, which lets the AArch64 backend generate the right stack-drop and timeout-poll behavior for structured branches.
  • Preserves JIT metadata needed by AArch64 runtime dispatch, including tables, type aliases, and fast-function mappings used for checked call_indirect execution.
  • Updates jit_execution_context for the AArch64 trampoline ABI, argument-array entry point, 16-byte stack-slot alignment, remaining_call_depth_offset() support for generated inline call-depth accounting, and call-depth restoration after execution.
  • Updates executable-code allocation for Apple Silicon with MAP_JIT, pthread_jit_write_protect_np write windows, instruction-cache flushing after code emission/patching, and explicit generated-code enabled/disabled state tracking.
  • Reworks timed execution and signal handling so AArch64 JIT uses thread-local timeout state, generated timeout polls, SIGILL handling, interrupted-PC inspection, and safe previous-handler chaining, while preserving existing page-revocation timeout behavior where supported.
  • Adds AArch64 JIT regression coverage for constants, locals, large frames, memory offsets, direct/imported/indirect calls, control flow, br_table, globals, memory growth, softfloat operations, and trap behavior.
  • Adds watchdog, allocator, signal, and backend regression tests for timeout delivery, cooperative timeout mode, concurrent shared-code interruption, late signals, repeated trap races, Apple JIT page permissions, and backend capability flags.
  • Makes the generic watchdog interrupt test scheduler-tolerant by waiting for the watchdog callback instead of cancelling the guard after a fixed sleep, addressing the macOS 26 hosted-runner flake in run 27368839657 / job 80875404820.
  • Adds an AArch64 interpreter-vs-JIT microbenchmark and benchmark report for the scalar sum_to workload.
  • Updates the GitHub Actions workflow to run direct CMake/vcpkg builds on hosted Ubuntu 24.04 and macOS 26 runners with recursive checkout, ccache, bounded parallelism, and parallel CTest.
  • Bumps the sys-vm package version from 1.1.1 to 1.2.0.

API Changes

  • API Changes

No runtime WASM, host-function, or backend call API changes are intended. The PR does add public compile-time capability flags/macros so integrations can distinguish x86_64 JIT, Apple AArch64 JIT, and JIT profiling support.

Documentation Additions

  • Documentation Additions

Includes the AArch64 JIT benchmark report. The downstream Wire development/full-suite testing process was also documented in the integration repository for local validation, but that documentation is not part of this eos-vm PR.

Testing

  • PR head e95ba4b: rebuilt unit_tests in build/macos-arm64-port.
  • PR head e95ba4b: watchdog CTest subset passed: 9/9 tests.
  • PR head e95ba4b: exact failing watchdog interrupt test passed 50/50 repeats with ctest --repeat until-fail:50.
  • PR head aee4e44: rebuilt unit_tests and aarch64_jit_benchmark in build/macos-arm64-port.
  • PR head aee4e44: focused CTest slice for AArch64 JIT, watchdog, signal, allocator, null backend, and capability-flag coverage: 47/47 tests passed.
  • Earlier full eos-vm CTest at 608e3dc, before the final unused-helper/test-flake cleanups: 5151/5151 tests passed.
  • Wire downstream release configure/build at 608e3dc completed with:
    • CMAKE_BUILD_TYPE=Release
    • SYSIO_TEST_FORBIDDEN_PORTS=11434
    • VCPKG_TARGET_TRIPLET=arm64-osx
    • wire-sys-vm 1.2.0#10
  • Wire standalone interrupt_trx_test at 608e3dc: 1/1 passed in 111.03 sec.
  • Wire full long-running + nonparallelizable integration suite at 608e3dc: 105/105 passed with ctest -j9 in 1876.75 sec real time.

@huangminghuang
huangminghuang force-pushed the feature/macos-arm64-jit-sysvm-infra branch from b4fc934 to 0df72da Compare June 8, 2026 14:00
@huangminghuang
huangminghuang requested a review from heifner June 8, 2026 16:41
Comment thread include/sysio/vm/backend.hpp
@huangminghuang
huangminghuang requested a review from heifner June 9, 2026 19:11
Comment thread include/sysio/vm/execution_context.hpp Outdated
@huangminghuang
huangminghuang merged commit 54e3d02 into master Jun 11, 2026
2 checks passed
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