Wings aims to achieve both higher sustained throughput and lower whole-machine memory footprint than BEAM under identical stateful workloads. Functional correctness does not imply benchmark completion; every claim must report workload parameters, host environment, and tail-latency bounds.
Reference Workloads & Correctness Suites
The repository maintains semantically equivalent Wings and Erlang/OTP workloads under scripts/ and crates/wings-vm/examples/:
- State & Protocol Equivalence: Covers single/multi-actor counters, legal two-sender interleavings, 64 KiB
bytesTCP framing & pipelining (verify_tcp_bytes.py), concurrent request cancellation, divide-by-zero faults, and out-of-process supervision soak tests (verify_recovery_soak.py,verify_failure_soak.py). - Scheduled Open-Loop Throughput & Service Latency (
measure_open_loop.py):- Uses a fixed-schedule open-loop generator (preventing closed-loop clients from masking queueing delay), reporting end-to-end latency (
observed - planned), true service latency (observed - sent), and generator schedule slip alongsidemailbox_fullrejections, timeouts, and process-tree memory samples. - Evaluates
mixed(sparse active sessions) andhot-queue(single-recipient high contention) across 5 alternating paired runs (30s warmup + 60s measurement each).
- Uses a fixed-schedule open-loop generator (preventing closed-loop clients from masking queueing delay), reporting end-to-end latency (
- Preemptive Fairness & Heartbeat Tail Latency (
measure_fairness.py): Injects bursty lightweight heartbeat requests alongside compute-saturated actors, verifying p99 / p999 heartbeat latency, zero timeouts, and full resource reclamation. - Bounded Fault Injection: Runs real system-allocator
nullinjection (verify_allocation_failures.py) and infinite-loop atomic yield regressions (verify_atomic_progress.py) inside isolated child processes bounded byRLIMIT_CPU, wall-clock timeouts, and disabled core dumps.
Current Measured Status (Dual-Platform Paired CI & CPU-Quota Runs)
Automated paired runs in .github/workflows/benchmark.yml compare Wings and Erlang/OTP 28 across hot-queue, sparse-256 (10,000 actors), mixed-4k (1,000 actors), and fairness (101 actors) on both Linux x86-64 under cgroup v2 hard CPU quotas (cpu.max = 20000 10000, cpu.max.burst = 0, 3s warmup / 5s sample × 3 alternating pairs) and macOS AArch64 (macos-15, 5s warmup / 5s sample × 3 alternating pairs):
- Linux x86-64 (
cgroup v22.0-vCPU Hard Quota, OTP 28):- Open-Loop Suites: Wings passes 3/3 clean runs with zero rejections/timeouts across
hot-queue(10,000on-time RPS, median service p99~3.4 µsvs. BEAM~6.6 µs, process-tree peak PSS~26.4 MBvs.~67.9 MB),sparse-256(1,000RPS, 10,000 actors, service p99~3.5 µsvs.~8.9 µs, process-tree PSS~36.4 MBvs.~94.0 MB, standalone VM peak usable heap~20.2 MB), andmixed-4k(1,000RPS, 1,000 actors, service p99~3.9 µsvs.~32.5 µs, process-tree PSS~20.8 MBvs.~64.2 MB). - Preemptive Fairness: Wings passes 3/3 clean runs with zero rejections/timeouts, CPU completion rate
~2,690.8/svs. BEAM~126.0/s(~21.4×), median heartbeat p99~187 µsvs. BEAM~458 µs, and process-tree peak PSS~19.9 MBvs.~59.0 MB(the Python driver itself accounts for ~19 MB of the process-tree baseline).
- Open-Loop Suites: Wings passes 3/3 clean runs with zero rejections/timeouts across
- macOS AArch64 (Local Apple Silicon, OTP 29):
- Paired runs (3s warmup / 5s sample × 3 pairs, 3/3 clean runs) pass across
hot-queue(service p99~5.4 µsvs.~14.5 µs),sparse-256(~7.9 µsvs.~19.0 µs),mixed-4k(~11.8 µsvs.~20.6 µs), andfairness(CPU completion rate~1,079.6/svs.~68.2/s, heartbeat p99~218 µsvs.~445 µs). After the compact slot/mailbox/heap layout updates, standalone Apple Silicon VM memory measures~20.1 MBpeak usable heap /~6.0 MBOS physical footprint onsparse-256(10,000 actors) and~5.9 MBpeak usable heap onmixed-4k.
- Paired runs (3s warmup / 5s sample × 3 pairs, 3/3 clean runs) pass across
- Remaining Boundaries & Caveats:
- Wings is still in
0.0.xpre-release evolution; current benchmark numbers reflect the four micro-workloads above under bounded 3–5s windows (WINGS_BENCH_WINDOW) rather than a final release sign-off. - Manual benchmark CI uses bounded 3–5s windows (
WINGS_BENCH_WINDOW) on shared cloud VMs; shared virtualizedmacos-15runners (3 vCPUs) can experience hypervisor scheduling jitter that induces millisecond-scale tail spikes in both Wings and BEAM, so dedicated bare-metal 30s warmup + 60s sample × 5-pair runs remain the authoritative sign-off. Routineci.ymlruns incremental correctness checks only, and.github/workflows/benchmark.ymlis manual-only. WingsAllocatorandnative_memory_ledgerreport exact Rust heap requested/usable/fragmentation bytes alongside OS PSS/physical footprint, while OS dynamic-loader (dyld/ld.so) internal metadata outside the Rust allocator is observed at whole-process granularity.
- Wings is still in
Optimization Discipline
Aggressive throughput or memory optimizations (superblock check coalescing, fiber reuse, lock-free mailbox batching, buffer pooling, compact object layouts, or future generational/compacting GC) must follow three rules:
- Never Trade Away Safety Boundaries: Mandatory safepoints, native stack bounds checks, and 3-level resource admission must never be disabled to inflate benchmark numbers.
- Attribute Before Changing: Optional
--observe-locksreports scheduler mutex wait/hold by phase, worker-thread CPU, and FastSlot/mailbox spin contention (contended acquisitions, failed attempts, yields, and wait time), with configurable power-of-two timing sampling (SchedulerConfig::lock_statistics_sample_stride) to keep timing overhead bounded. It preserves direct and batch fast paths. Treat observed runs as diagnostic evidence only, not performance acceptance. - Paired A/B Validation & Decisive Rollback: Evaluate each candidate across 5 alternating paired runs measuring throughput, p99/p999, rejections, and platform memory (Linux RSS/PSS, macOS RSS/physical footprint); revert any change that adds complexity without durable gains.
Incremental Development Checks
python3 scripts/verify_incremental.py selects checks for staged, unstaged, deleted, renamed, and untracked files. --base <ref> also includes committed changes since the merge-base; an invalid base fails rather than silently skipping changes. --plan prints the task graph, --all selects all incremental checks, and --no-cache forces fresh execution. None of these options runs release or performance acceptance.
- Rust changes select the owning crate and transitive workspace dependents using Cargo metadata, then run formatting, dependency isolation, all-target scoped Clippy, and library/binary/integration test harnesses under the existing CPU/wall/core limits. Changed example targets also run their harnesses; other examples are compile-checked, with all-target execution reserved for release. No individual tests within a selected harness are filtered out.
- Changes affecting compilation or execution add a bounded counter/session AOT smoke check, including TCP/HTTP serving and recovery. Shared build steps run once, with Cargo incremental artifacts reused. The full AOT suite stays in release verification.
- Script/workflow changes run Python regression tests; documentation/site changes build the website. Unknown paths conservatively expand to every incremental check. Tasks run serially, and a local lock prevents overlapping scheduler runs.
- Successful local task evidence is keyed by relevant file contents, deletions, file modes, dependencies, runner scripts, lockfiles, tool versions, platform, Cargo configuration, and an environment digest. Failed/interrupted tasks are not cached; edits during execution make the run inconclusive. Cache files and reports live under ignored
target/incremental-validation/and are local convenience evidence, not trusted release attestations. - Routine pull requests and pushes to
mainrun the same scheduler on Linux with--no-cache. Theincrementalcheck replaces daily full native/MSRV/site jobs. Pages publishing remains separate. Full dual-platform, MSRV, doctest, and AOT verification is manual through.github/workflows/release.ymlbefore publishing; BEAM comparisons are manual throughbenchmark.yml. Incremental success never means release or performance acceptance.
Pre-Release Verification Commands
# 1. Formatting, lints, and workspace unit/integration tests
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
# 2. Resource-bounded workspace test runner
python3 scripts/verify_workspace.py --output target/workspace-validation/debug
# 3. Full end-to-end native AOT verification (Debug & Release)
cargo build --locked -p wings-compile -p wings-vm --bins --examples
python3 scripts/verify_scalar_aot.py
cargo build --release --locked -p wings-compile -p wings-vm --bins --examples
WINGS_PROFILE=release python3 scripts/verify_scalar_aot.py