Skip to content

gate: the Mac's shared instances, inert until listed (ci-kit mac-lane concurrency, M2) - #103

Merged
SSFSKIM merged 5 commits into
masterfrom
mac-shared
Oct 21, 2026
Merged

SSFSKIM merged 5 commits into
masterfrom
mac-shared

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

M2 of ci-kit's mac-lane concurrency spec (SSFSKIM/ci-kit docs/doperpowers/specs/2026-10-21-mac-lane-concurrency-design.md): MAWS's side of running proven-safe Mac jobs two at a time on the mini, on separate runner instances, while every other Mac job keeps running alone. Nothing shares until a later PR puts a group on MAC_SHARED_E2E on trial evidence (the spec's M4).

Routing (gate-plan.mjs, gate.yml).

  • MAC_SHARED_E2E (empty here) names e2e groups, and unit:darwin, that ask for [ci-kit-mac-shared], the only label ci-kit's shared instances carry. Every other Mac job asks for today's [self-hosted, macOS, ARM64], which only the exclusive instance carries, so an unlisted group, an old commit's run or a rerun never shares.
  • A MEASURED_E2E group, or a foreground one (its script sets MAWS_E2E_FOREGROUND=1: default, widgets, to-human, document-app), stays exclusive whatever the list says; the run's summary names it. A static test holds the committed list to class-1 Mac groups that are neither.
  • unit:darwin's runner now comes from the plan (unit_darwin_runner).

Timeouts. ci-kit's job-started hook may wait before a job starts, and the wait counts against timeout-minutes. Exclusive Mac jobs get +10 (30 → 40, measured 45 → 55; class 1a under --class1a macos, unit:darwin, packaged and the plan job on the Mac too). Shared jobs get +60. The plan writes these (timeouts, each e2e entry's timeout); Linux and pool jobs keep 30.

Steps past a refused start. ci-kit's hook refuses a job by failing its start, which does not abort it. A later step whose condition holds after a failure still runs, on the last job's workspace, beside the jobs the hook kept it from. ci-kit's contract is that such a step of a Mac job is an artifact upload, or waits on a step only an admitted job runs.

  • A test in gate-plan.test.mjs walks every job whose runs-on can resolve to a Mac and holds those steps to the contract.
  • e2e, unit, unit:darwin and packaged already held.
  • static did not: under --class1a macos its lint, build and gate-script tests ran on !cancelled(). They now also wait on steps.checkout.outcome == 'success'.

Shared state (the spec's audit, H1/H3/H6/H7).

  • H1: the e2e build cache is ~/Library/Caches/maws-e2e-build/$RUNNER_NAME, one directory per runner.
  • H3: the clipboard lock is /tmp/maws-e2e-clipboard.lock instead of $TMPDIR's, so it holds across instances.
  • H6: under CI_KIT_SHARED_DESKTOP=1, a launch's first window moves to a corner of the primary display's work area. The corner comes from the instance number that ends RUNNER_NAME (ci-kit-mac-<machine>-<n>), so the mini's two shared instances sit opposite (e2e/support/window-origin.ts). Main windows the app opens later follow window.main. Without the flag, nothing moves.
  • H7: the latency budget treats CI_KIT_SHARED_DESKTOP=1 as loaded. The raw bounds the audit names now go through it: panel's 1 s change line (latencyWait, since the wait is the bound), agent-tools' stop settle, scm's 150 ms git.changed, browser's 200 ms palette, and browser-comment's 200 ms disarm.

Unchanged with the list empty and the flag unset.

  • The plan's tests pin today's labels for every Mac job over gate.yml's own lists.
  • Outside the PR, origin/master's plan and this one were run over 768 trailer/variable/live combinations. Every output and summary is identical, apart from the new timeouts and unit_darwin_runner keys and the entries' timeout.
  • The budget's existing tests pass unchanged.

One behaviour change: static's lint, build and gate-script tests no longer run when checkout itself failed. They would have failed anyway.

Two deliberate differences in the routed bounds:

  • (a) On a host loaded past its core count, the five routed bounds now loosen to 5×, like every other budgeted bound.
  • (b) A routed bound now passes at exactly its value: ≤ where the old checks used <.

Mac-set proof (scheduled by CI-opt). One full Mac set at the head on the exclusive instance. Check that:

  • every e2e and unit:darwin job ran on the exclusive runner, with timeouts of 40 (55 measured) in the job settings;
  • the first e2e job of each build variant logs e2e-build: … built and stored in …/maws-e2e-build/<runner name>/…, and the later ones restored from that path;
  • clipboard groups (browser, panel, terminal, presentations) pass;
  • no latency bound loosened annotation appears unless the load read ≥ cores.

Not done here.

  • browser-chrome's 34 ms "no hole" check is the product's STILL_SETTLE_MS, not a test bound, so it cannot go through the budget without voiding the case. The M4 trial has to settle it.
  • unit:darwin's --maxWorkers is not halved when shared (the audit suggests it).
  • scripts/ci-gate-alerts.mjs will read a shared runner ci-kit-mac-mini-2 as a machine mini-2. This needs folding before M3 enables the shared instances.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T10:22:04.382819Z 1983a06 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

… concurrency, M2)

The plan sends the groups on gate.yml's new MAC_SHARED_E2E (and unit:darwin, when
listed) to [ci-kit-mac-shared], the only label ci-kit's shared runner instances
carry; every other Mac job asks for today's [self-hosted, macOS, ARM64], which
only the exclusive instance carries. A MEASURED_E2E or foreground group (its
script sets MAWS_E2E_FOREGROUND=1) stays exclusive whatever the list says, and
the summary names it. The list is empty, so every run places its jobs as before.

Timeouts carry the waits of ci-kit's job-started hook: an exclusive Mac job +10
(30 -> 40, measured 45 -> 55; the plan job on the Mac and packaged too), a shared
one +60. The plan writes them (`timeouts`, each e2e entry's `timeout`) and
unit:darwin's runner (`unit_darwin_runner`).

The shared state the audit found (H1, H3, H6, H7):
- the e2e build cache is one directory per runner ($RUNNER_NAME);
- the clipboard lock is /tmp/maws-e2e-clipboard.lock, not $TMPDIR's;
- under CI_KIT_SHARED_DESKTOP=1 a launch's first window goes to a corner of the
  display its runner's instance number (RUNNER_NAME's -<n>) picks, the mini's two
  shared instances opposite (e2e/support/window-origin.ts);
- the latency budget counts CI_KIT_SHARED_DESKTOP=1 as loaded, and the raw bounds
  of panel, agent-tools, scm, browser and browser-comment go through it
  (latencyWait for panel's, whose wait is the bound).

Unset, the flag changes nothing: the window stays, the budget's verdicts are
today's (its tests unchanged and passing).

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
… for it

gate.yml's unit-darwin job now runs where the plan's unit_darwin_runner says
(the exclusive instance, or the shared label when MAC_SHARED_E2E names it); the
test reads that wiring, and counts either label set as a Mac.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…i-kit mac-lane concurrency, M2)

ci-kit's job-started hook refuses a job by failing its start, which does not abort
it: a later step whose condition holds after a failure still runs, on the last
job's workspace, beside the jobs the hook kept it from. ci-kit's contract: such a
step of a Mac job is an artifact upload, or waits on a step only an admitted job
runs. gate-plan.test.mjs walks every job whose runs-on can resolve to a Mac (the
plan's outputs read from plans that put every gate on a Mac, exclusive and shared)
and holds each of those steps to it.

The e2e, unit, unit:darwin and packaged steps already held. static's four wait
steps (typecheck, lint, build and the gate scripts' tests, each reading its check
from gate-bg.sh; `!cancelled()`, on a Mac under --class1a macos) did not: its
checkout now has `id: checkout` and those four wait on its success. In an
admitted job each still runs whatever the check before it did; they no longer run
when checkout itself failed, where they would have failed anyway.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…mma expression (lint)

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…f:, success(), || over &&)

Review found three steps that would run after ci-kit's hook refused their job's
start, yet the walk passed: an `if: >-` read as `>-` (its id counted as admitted
too); `!success()`, since success() drops the implicit `success() &&` like any
status check; and `failure() || x && steps.checkout.outcome == 'success'`, whose
guard holds one alternative only.

The walk is now a function over the workflow's text, and fails closed. A condition
is the whole `if:` value, a block scalar's lines or a plain one's continuation;
any of success(), failure(), always() or cancelled() lets it run after a failed
start. Such a step passes only as an upload, or when every top-level || alternative
has a top-level && conjunct that guards: an admitted-only step's outcome compared
with success or failure, or a parenthesized || of those alone. Parentheses come off
only when the opening one closes at the very end, and string literals are skipped.
What the walk cannot read fails: an unbalanced or negated guard, a quoted, tagged or
interpolated value, a step key that is no plain `key:`, a job it cannot read, and a
runs-on other than a literal list or label or fromJSON over a plan output or the
matrix runner, which now counts as a Mac (a label set is a Mac's when the exclusive
or the shared instances carry every label, case aside).

A second test rewrites today's gate.yml in memory, each rewrite matched once:
static's typecheck wait with its guard dropped (a bare !cancelled()); its lint
wait's `if:` as a folded always(), as !success() and as the || slip; verify:fuses
taking a skipped build; e2e's build behind always(); static's checkout behind
always(), which leaves all four of its waits unguarded; packaged's runs-on as an
expression over a variable. Each such step comes back unsafe, and the Mac jobs
stay the seven.

Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 0833fba into master Oct 21, 2026
SSFSKIM added a commit that referenced this pull request Oct 21, 2026
…7 (the Mac's shared runner instances wired, inert until listed; the Mac set at the head standing for the merge), the tracker's row for e2e:side case 12's one miss

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 21, 2026
…oks)

The one conflict: gate.yml keeps this branch's MEASURED_E2E line with
presentations-drag beside master's new MAC_SHARED_E2E.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 21, 2026
… desk #112)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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