{
  "slug": "fork-64-sandboxes-one-mac",
  "question": "How fast can one Mac fork 64 sandboxes from a running checkpoint?",
  "answer": "With CUA_VM_VCPU_OVERCOMMIT raised from the default 8 to 12, one Mac forked 64 QEMU VMs (2 vCPU, 2 GiB each) from a running checkpoint in 7.34 s, first start to last fork ready, on a Mac Studio (Apple M2 Max, 96 GB), measured 2026-10-25. At the default setting the wave stops at fork 48.",
  "status": "measured",
  "url": "https://cua.ai/benchmarks/fork-64-sandboxes-one-mac",
  "csv": "https://cua.ai/benchmarks/fork-64-sandboxes-one-mac.csv",
  "markdown": "https://cua.ai/benchmarks/fork-64-sandboxes-one-mac.md",
  "group": "Fork and snapshot",
  "current": {
    "run": "2026-10-25",
    "schema": "cua.bench-result/v1",
    "bench": "fork-fanout.qemu",
    "slug": "fork-64-sandboxes-one-mac",
    "metric": "wave64_wall_s",
    "value": 7.34,
    "unit": "s",
    "stat": "max",
    "n": 64,
    "percentiles": {
      "fork_ms_p50": 4988.2,
      "fork_ms_p95": 6736.2,
      "fork_ms_max": 7050
    },
    "extra": {
      "private_mb_per_fork_64": 249.8,
      "shared_file_mb_64": 644.2,
      "checkpoint_ms": 648.4,
      "wave8_wall_s": 0.79,
      "wave32_wall_s": 3.09,
      "wave64_wall_s": 7.34,
      "wave8_fork_ms_p50": 736.2,
      "wave32_fork_ms_p50": 2075.9,
      "wave64_fork_ms_p50": 4988.2,
      "wave8_fork_ms_p95": 784.5,
      "wave32_fork_ms_p95": 2757.3,
      "wave64_fork_ms_p95": 6736.2,
      "default_settings_wave32_wall_s": 3.68,
      "default_settings_wave32_fork_ms_p50": 2770.7,
      "default_settings_wave8_wall_s": 0.75
    },
    "measured_at": "2026-10-25T01:30:00Z",
    "build": {
      "cua": "0.9.0",
      "cua_spacesd": "0.8.0",
      "app": "0.15.0",
      "source": "Cua Spaces 0.15.0 DMG (https://github.com/trycua/cua/releases/download/cua-spaces-v0.15.0/cua-spaces-0.15.0-darwin-universal.dmg, sha256 8725a09ba4132aa8a1667fa48c86416c91d5dec0d3c7dc93f88f5f3e29e0aba0): bundled cua 0.9.0, Helpers/cua-spacesd 0.8.0, cua-vz",
      "published": true,
      "harness": "opt-in test cua-daemon/tests/qemu_fork_fanout.rs, built from tag cua-spaces-v0.15.0 (cargo test --release, Rust 1.97.1) on the host"
    },
    "host": {
      "name": "Mac Studio",
      "model": "Mac14,13 (Mac Studio)",
      "chip": "Apple M2 Max",
      "cpus": 12,
      "memory_gb": 96,
      "os": "macOS 26.6.2 (25G83)",
      "where": "local"
    },
    "environment": {
      "kind": "vm (QEMU 10.2.2 on HVF, Homebrew)",
      "image": "ghcr.io/trycua/linux:24.04-slim-disk (arm64, sha256:829c1dcf57d5356425483eebf5fb6fef20f943a7690a69308dcba24925fbb78b)",
      "shape": "world and every fork 2 vCPU / 2048 MiB",
      "settings": "CUA_VM_VCPU_OVERCOMMIT=12 (NON-DEFAULT; default 8). FORKABLE=1, WARM=0, DIRTY_MB=300",
      "load_avg_before": [
        1.42,
        2.83,
        4.89
      ],
      "other_vms": 1,
      "network": "n/a (local)"
    },
    "method": "Non-default setting: CUA_VM_VCPU_OVERCOMMIT=12, the documented host CPU overcommit (default 8; see the Cua SDK local runtimes guide). At the default, 64 forks of 2 vCPU need 128 vCPUs and the release refuses the 48th fork (see caveats).\n\nDriver on the host: `bench/fork-fanout/run.sh` from tag cua-spaces-v0.15.0, which builds and runs the opt-in test `cua-daemon/tests/qemu_fork_fanout.rs` (release). It drives the release's QEMU runtime library directly (no daemon). A bake VM (2 vCPU / 2 GiB, published slim disk, forkable: RAM in a shareable file) dirties 300 MB of RAM, is checkpointed and pinned, then forked in waves of 8, 32 and 64 (every fork of a wave started at once). Per fork: fork + start until its cua-spacesd answers with its own token. The test checks every fork holds the world's RAM/disk state, its writes reach no other fork, and it shares the world's unwritten pages. Headline = wall time of the 64-wave (first start to last fork ready); private_mb_per_fork = host memory the wave added / forks.",
    "reproduce": "# On an Apple silicon Mac with Homebrew QEMU, crane and Rust:\ngit clone --depth 1 --branch cua-spaces-v0.15.0 https://github.com/trycua/cua && cd cua/libs/cua/bench/fork-fanout\nmkdir -p /tmp/disk && crane export --platform linux/arm64 ghcr.io/trycua/linux:24.04-slim-disk - | tar -x -C /tmp/disk disk/disk.img\nCUA_VM_VCPU_OVERCOMMIT=12 DISK=/tmp/disk/disk/disk.img WAVES=8,32,64 MEMORY_MB=2048 DIRTY_MB=300 FORKABLE=1 WARM=0 bash run.sh out.json\npython3 check.py out.json baseline.json --host macos-hvf",
    "caveats": [
      "Non-default setting: CUA_VM_VCPU_OVERCOMMIT=12. At the default (8), this 12-core Mac allows 96 vCPUs of VMs, so the 64-wave stops at fork 48. Same-day default run: 8 forks in 0.75 s, 32 forks in 3.68 s.",
      "One wave per size (n = forks in the wave), not repeated.",
      "Uses the QEMU runtime through a test binary built from the tag, not the daemon or CLI path."
    ],
    "sources": [],
    "status": "measured"
  },
  "earlier": []
}
