xln

Mac Studio test machine

The Mac Studio is the only machine for builds, tests, stands and agents (AGENTS.md). The MacBook controls it remotely. This page records how to reach it, what it should measure, and how to recognise and fix the throttled state found on 2026-10-26.

Hardware and access

Expected performance

Benchmark, single Bun process (bun -e) running a 1e8-iteration modulo loop:

bun -e 'let t=performance.now();let x=0;for(let i=0;i<1e8;i++)x=(x+i*7)%1000003;console.log(Math.round(performance.now()-t))'
Machine / state 1 copy 16 copies (each) 24 copies (each) taskpolicy -c background
Studio, healthy (after reboot 2026-10-26) ~350 ms ~360 ms ~365 ms ~800 ms
Studio, throttled (before) ~1030 ms ~2400 ms ~3300 ms ~1040 ms (same as default)
MacBook M1 Max ~550 ms n/a n/a ~1160 ms

E2E on a healthy Studio (bun run test:e2e:full, 16 lanes, MM x4, reset x4):

Throttled state: symptoms and fix

Symptoms, all measured on 2026-10-26 after 12 days of uptime:

Ruled out:

Fix: a FileVault-preserving reboot that the owner starts and authenticates:

ssh -t mac-studio 'sudo fdesetup authrestart'

It asks for the sudo password, then the FileVault user name (zigota, not root) and that user’s password. SSH returns about 1-2 minutes later.

After the reboot, log zigota into the GUI (RustDesk or Jump Desktop) before any browser E2E. Without a GUI session there is no display/notification service and Chrome for Testing crashes mid-test (NSNotificationCenter connection invalid, CVDisplayLinkCreateWithCGDisplay failed, then signal 10 BUS_ADRALN). User services also start only after this login, including the Red Shield VPN app: without it Codex fails with workspace routing discovery failed, OpenRouter returns 403 Access denied by security policy and Z.ai times out, so every quorum leg is INCOMPLETE.

Before rebooting:

Housekeeping

Driving the Studio from a control Mac

Set up a new control machine:

Remote shell:

Verify a change without touching ~/xln:

  1. git -C ~/xln worktree add --detach ~/xln-<job> <sha>, then apply the patch there.
  2. A fresh worktree lacks two things outside git: copy ~/xln/jurisdictions/lib/forge-std to the same path (as lib/forge-std, not into lib/ itself), and run bun install --frozen-lockfile in the root, frontend/ and ui/.
  3. Build the Rust binary before the unit tests, or the real-Rust tests fail: (cd rscore && cargo build -q --release -p xln-rscore-process --bin xlnrs).
  4. Run bun run contracts:sync after any Solidity change and commit the regenerated artifacts, then bun run check (about 30 s), bun run test:contracts:full (about 50 s), (cd rscore && cargo test -q --workspace), each folder under core/__tests__/ with bun test --timeout 180000 (about 10 min in total), and bun test ui/src tests/frontend.
  5. bun run check runs gates in parallel and stops at the first failure; the later FAIL lines in its log are gates it killed, so read the first one.
  6. Test folders hold at most ten source files (check:folder-width); put a new test in a folder with room.

Land:

  1. Commit in the worktree with explicit paths and no wip: subject.
  2. cd ~/xln && git merge --ff-only <sha> && git push origin main. The hook takes about ten minutes and prints VERIFY_PASS:<sha>. Run it detached.
  3. On the control Mac: git fetch origin && git merge --ff-only origin/main. git pull refuses when any tracked file is modified.

Looking at a page without a dev server: Playwright’s headless Chromium is installed under ~/Library/Caches/ms-playwright/; a ten-line script that opens a file:// page and saves screenshots is enough to check layout in both colour schemes.