Skip to content

Native baseline: sky performance before the REPL host and engine are replaced (#114) - #133

Merged
SSFSKIM merged 5 commits into
mainfrom
feat/native-baseline
Oct 14, 2026
Merged

SSFSKIM merged 5 commits into
mainfrom
feat/native-baseline

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Records the native (sky) performance baseline #114 requires before the REPL host (#116) and the native engine (#117) are replaced. None existed under docs/evidence.

Method

  • scripts/native-baseline.mjs run --device mini --out <dir> drives the real pinned runtime (26.928.40906) as the browser parity harness does: cua serve of the parity clone on the mini over an ssh stdio pipe, an MCP client, js cells, every sample journaled (results.jsonl, meta.json). The surface is native only (CUA_SHIM_SURFACES=computer, session approvals, secrets off). The serve is started by its absolute script path, and the leftover and preflight checks match on that path.
  • Each sample records the harness's wall time around the MCP call and the in-cell performance.now() time separately. Cells return counts, lengths, booleans and hashes only. No AX text, window title or screenshot leaves a cell, and every observation passes emit:false.
  • A run:
    • 5 ssh round trips.
    • 5 cold connections, labelled by the handshake record they found. A failed end_task after a cold start gets its own row.
    • 30 each of warm no-op, getState and listApps.
    • The first getApp(TextEdit): launch, plus the vendor approval timed separately.
    • 30 each of full-tree getAXState and getScreenshot on an empty scratch document. A tree sample of any other window is invalidated. The screenshot series is bracketed by scratch-guard cells, outside the samples' timing.
    • 10 observe-act-verify tasks: new document, typeText a fixed sentence, verify in the full tree, then delete it. The keep-or-delete sheet is identified by ID: save-panel and ID: DontSaveButton and by naming the task document; only its Delete button is clicked, and any other window gets no input.
    • end_task.
  • Window transitions wait on a 10 s wall-clock deadline, not a count of observations. The harness refuses to start while TextEdit is running, and quits the TextEdit it launched from the unedited scratch document.
  • scripts/native-baseline.mjs summary <dir> pools the run-* directories into summary.md: median, p95 and max per operation, with OK, invalidated and error counts listed apart, observed sizes (including the screenshot format), and a problem list for incomplete or inconsistent runs.
  • Evidence: docs/evidence/2026-10-14-native-baseline/ (three sequential runs, after checking that no cua-116-spike process was running; the parity clone was at this branch's 2a59052). The mini is a Mac14,12 (M2 Pro, 16 GiB) on macOS 27.0 (26A428), with a virtual display of 2560 × 1440 points at scale 2. The helper that answered was the pinned runtime's Codex Computer Use.app, started by each run.

Result

All 3 runs complete: 663 rows, 0 failed and 0 invalidated samples, 30/30 tasks verified and deleted unsaved, nothing left running. Medians in ms:

Operation Samples Wall median Wall p95 In-cell median
ssh pipe open (ssh mini true) 15 504 705 –
cold start, handshake record missing: spawn → first js result 6 1,123 2,314 –
cold start, handshake record present 9 1,165 1,775 –
warm no-op cell (1+1) 90 21.5 116 0.02
cua.getState({emit:false}) 90 70 217 22
cua.listApps({emit:false}) 90 51 176 22
first cua.getApp(TextEdit), launch and approval included 3 1,431 1,597 1,410
approval request arrives (from the start of getApp) 3 57 169 –
getAXState full tree (empty document: 2,810 chars, 53 elements) 90 112 221 51
getScreenshot (window, 1172 × 976 JPEG, 49,975 bytes) 90 115 221 53
task: new document, type, verify, delete unsaved (3 cells, 4 actions, 6 observations) 30 4,225 4,471 4,039
of which task.close (super+w, the sheet's Delete button, back to the scratch document) 30 2,789 2,873 2,718
end_task 3 16.5 114 –

Full table (p95, max, observed sizes): docs/evidence/2026-10-14-native-baseline/summary.md.

Caveats

  • Wall time is measured on the MacBook. It includes the ssh pipe and the MCP and REPL dispatch: a warm no-op is 21.5 ms wall and 0.02 ms in the cell, so roughly 20 ms per call is transport, not sky. Read sky's own cost from the in-cell columns; read what a model on this topology waits from the wall columns. A local client would see less transport. Each cold start includes opening ssh (ssh.roundtrip, about 500 ms), which a local cua serve would not pay.
  • The handshake record moves the runtime's launch; it does not remove it. With the record, initialize is answered without a runtime (674 ms, mostly ssh and cua serve start) and the runtime launches at the first js call (470 ms); without it, initialize launches the runtime (813 ms) and the first call is 272 ms. End to end the two are within noise of each other here (1,123 vs 1,165 ms median); what the record saves is a runtime for a session that never calls js.
  • First-call outliers are kept. The first getState of each run includes starting the computer-use helper (none was running at any run's start; the helper that answered was started by the run, 6 to 8 s old when checked), up to 825 ms wall. That is why getState's max is far above its p95.
  • One small, fixed target. AX and screenshot samples read an empty TextEdit document (53 elements). Larger trees cost more; this is a reference point to compare the replacement against on the same target, not a workload average. The screenshot is of the window (1172 × 976), not the display.
  • The display is virtual. The mini runs headless with a virtual 16:9 display, 2560 × 1440 points at scale 2. The owner was on the console session; nothing else drove the GUI during the runs (the cua-116-spike work had finished; the resident agent's serves stayed idle).
  • System language is Korean. Role names in the AX text and TextEdit's window titles ("무제") are Korean; the typed sentence is English and correctly spelled, so autocorrection had nothing to change.
  • The approval is the harness's. The vendor asks once per connection before using TextEdit; the harness answers that exact pinned request at once, for the session. The 57 ms is how soon the request arrives, not a human's response time.
  • The launch path is variable. In two of three exploratory launches before these runs, the first getApp of a not-running TextEdit failed after about 5.5 s with Computer Use server error -10005: timeoutReached and the next call bound in about 1.6 s; in the three recorded runs it bound first time (about 1.5 s). The harness retries once on that error and records both calls (bind.getApp, bind.getApp.retry), so a later run that hits it shows it.
  • The helper is shared and keeps the configuration of whoever launched it. During exploration earlier the same night, every native call failed with Computer Use server error -10005: invalid configuration: invalid type: map, expected a boolean in features while a helper started by another client was running. The owner's ~/.codex/config.toml (changed 2026-10-14 22:56 KST) has a [features] entry with a dotted key (context_management.…), which the pinned release's parsers reject (the pinned codex CLI fails on it too); the helper launched through cua's runtime reads cua's own CODEX_HOME and works. The runs record the helpers at start and after binding; a run that meets a misconfigured helper fails every inventory call and stops before touching any app.
  • Element count is a line count. elements counts AX lines that start with an element index; chars and lines are also recorded. Nothing of the text is.
  • Closing costs what the harness's close does. The task's close clicks the identified sheet's Delete button (about 2.8 s for the whole close cell). A first recording, replaced by this one after review, pressed super+BackSpace on whatever window followed super+w and closed in about 1.8 s; that path did not check which window it answered, so it is not the baseline. Compare a replacement engine on this harness, not against that number.
  • Three runs on one machine in one sitting (18:13 to 18:17 UTC), back to back.

Changes

  • scripts/native-baseline.mjs and scripts/native-baseline/{cells,remote,summary}.mjs; tests in test/native-baseline/:
    • the summariser with fixture runs;
    • the cells against a scripted TextEdit double (the sheet, a foreign window, a delayed transition, invalid samples);
    • the remote scripts and the serve detector.
      No runtime is needed for the tests.
  • scripts/browser-parity/mcp.mjs: StdioClient takes an elicitation answer policy and a clientName. The parity harness keeps its accept-all default.

Gates: HOME=/tmp/cua-scratch-home npm test 1704 pass / 0 fail / 8 skip (main 1688 + 16); npm run test:mods 32 pass; claude plugin validate . passes with the known warning.

… summariser (#114)

scripts/native-baseline.mjs drives the pinned runtime's native surface through
cua serve on the device over ssh, as the browser parity harness does: cold
connections labelled by the handshake record they found, warm no-op, getState,
listApps, the first getApp (approval timed apart), full-tree getAXState,
screenshot and a TextEdit observe-act-verify task, each sample journaled with
harness wall time and in-cell performance.now() time. The summariser pools
run-* directories into summary.md. StdioClient takes an elicitation answer
policy and a client name; the parity harness keeps accept-all.
…uitting from the scratch document; helper ages

Measured on the mini: TextEdit launched with no document shows its Open panel,
served out of process, which takes no keys sent to TextEdit; the scratch
document comes from its New Document button. Closing an edited untitled
document raises a sheet as the front window, answered with super+BackSpace;
TextEdit the run launched is quit from the unedited scratch document. A first
getApp that times out while launching is retried and both are recorded. The
helper's age attests whether the run launched it.
- The keep-or-delete sheet is identified (save panel, its Delete button, the
  task document's name) and only its Delete button is clicked; any other
  window after super+w gets no input.
- Window transitions wait on a 10 s wall-clock deadline, not a count of
  observations, so a faster engine is not penalised.
- A full-tree sample of another window is invalidated; the screenshot series
  is bracketed by a scratch guard and invalidated when the guard fails; the
  summariser lists invalidated samples apart and keeps string details such
  as the screenshot format.
- cua serve is launched by its absolute path, which the leftover and
  preflight detectors match; the old pattern never matched the harness's own
  serve.
- A failed end_task after a cold start is its own row, not a second total.
Three runs on the mini at 2a59052 replace the first recording: 663 rows, no
failed or invalidated sample, 30/30 tasks deleted through the identified
keep-or-delete sheet, nothing left running. README describes the sheet
identification, the deadline, the invalidation and the JPEG screenshots.
@SSFSKIM
SSFSKIM merged commit fae28d6 into main Oct 14, 2026
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.

1 participant