Repository navigation
gate: class 1a's critical path halved: static's checks at once on cpus-16, unit in four shards (unit k/4) - #108
Merged
Merged
Conversation
static ran its checks one after another (pnpm typecheck's five tsc projects, eslint, pnpm build, the gate scripts' tests), each a single thread, so its 4-core box sat mostly idle for 437-524 s. They now start together. gate-bg.sh starts each one in the background, and each keeps a step of its own that streams its log and adds its gate-run summary. Each project of `pnpm typecheck` is its own process, read from the script. The box moves to cpus-16. At once, the checks peak at about 15 GB, and on cpus-8 they peaked at 14.3 GB of 16. Over three runs each, static took 147-161 s (median 147) against 437-511 s (median 447). Two fixes the overlap needed: - the background subshell holds none of the step's output, so the runner no longer waits about 5 s for it to close; - eslint ignores electron-vite's transient bundled config (electron.vite.config.<ms>.mjs). eslint listed it while the build was loading its config, then failed ENOENT (run 39599150487). Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
One vitest process keeps its box's cores only 55-70% busy, because its main process transforms modules for every worker. On cpus-16 the unit job took 311-349 s, against 486-494 s on cpus-8. Separate processes on separate boxes scale further. On the pool, gate-plan.mjs now plans the full suite as UNIT_SHARDS=4 jobs on cpus-8, named `unit 1/4` to `unit 4/4`. Each runs `pnpm test --shard=<k>/4`, and each uploads its JUnit report as test-results-unit-<k>of4-<attempt>. ci-kit's collector (#69, merged) reads those reports together as one `unit` report. A selected run that tests only the related suites stays the one job `unit`, and so does a run off the pool. A selected run that falls back to the whole suite is sharded like any other. The shapes measured: - 2x8 and 3x8: every run green. - 4x8: 3 of 4 runs green. The red one was desk-hub reply-chain.test.ts, which also failed once at 3x8. - 5x8, 6x8, 3x16 and 4x16: red in every run. Suites that wait on cold transforms failed, chiefly renderer-compiled TranscriptSlot.test.tsx's hooks (10 s). - 6x4: green, but slower than 3x8. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
…luded settle_run kept the preempted jobs it had pending, retried, preempted twice and refused in space-separated lists, and its summary split them on spaces. A preempted `unit 2/4` (unit's shards on the pool) became `unit` and `2/4`, neither of them a job: nothing was rerun, the run stayed red, and the summary read `preempted by GCE (0):`. The lists now hold one whole name a line, and reach the summary's awk through the environment, since awk's -v takes no newline. The jobs are sorted on their tab-separated name field, where `sort -k2` split on blanks and held only because its key ran to the end of the line. ci-gate-preemptions.test.mjs plays a preempted `unit 2/4` rerun alone to green, and three shards at once: one green on its rerun, one preempted again, one whose rerun GitHub refuses. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
The relaunch line copied each refused or red job's name into --gates, so a run with a red `unit 2/4` printed `--gates e2e:library,unit 2/4`, which the CLI cannot parse and the plan would refuse. A job named `unit <k>/<n>` now relaunches as the gate `unit`, named once however many shards were red or refused; the plan shards it again. The refused list is kept one whole name a line, as settle_run's now are, where it was split on spaces. ci-gate-refusals.test.mjs pins both: a refused e2e group beside two red shards relaunches as `--gates e2e:library,unit`, and a refused shard is matched by its whole name. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
static's job also runs on `Class1a: linux`, the hosted runner (7 GB on a private repository), and on `Class1a: macos`, the 16 GB mini that e2e shares. Together its checks peak at about 15 GB, measured on the pool, so gate-bg.sh now decides from the machine: at once with 24 GiB or more of memory (the pool's 16-core box has 32), otherwise one at a time, each `start` running its command to its end before it returns and writing the same log, summary and status, so the wait steps read them unchanged. The job's first start reads the memory (/proc/meminfo's MemTotal on Linux, `sysctl -n hw.memsize` on macOS), says which mode in its output, and the later starts keep its decision. GATE_BG_MEMORY, in bytes, stands in for the reading in a test. A start step whose check is red still goes on; that check's wait step is red. .github/scripts/gate-bg.test.mjs, which static's gate-scripts check collects, plays both modes on a fake package.json and fake checks: at 32 GiB every start returns while its check runs, at 16 GiB they run in order, and the wait steps read the same in both. A third case checks that the decision without the stand-in follows the machine's own memory, as node's os.totalmem() reads it. Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
added a commit
that referenced
this pull request
Oct 21, 2026
…s checks at once on the 16-core box, unit in four shards 'unit k/4'; plan to last job 586 s -> 310 s; 4x8 the measured edge, TranscriptSlot's hooks red past it), a §3.5 line on the shard names; tracker +2 (desk-hub reply-chain flake, TranscriptSlot's cold-transform hooks) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts class 1a's wall on the pool roughly in half: from the plan's end to the last job, 586 s becomes 310 s (median of three green runs each, same base, same 22,457 tests).
For the architect's records: the unit job is now
unit k/4on the pool. The whole suite runs as four jobs,unit 1/4tounit 4/4. Each ispnpm test --shard=k/4on its own cpus-8 box, and each uploads its JUnit report astest-results-unit-<k>of4-<attempt>. ci-kit's test-history collector reads the four reports as oneunitline per run attempt (ci-kit #69, merged as f57799687 and live from the 00:40Z collection). The job stays the oneunitin two cases: a--affectedrun in vitest's related mode, and any run off the pool (hosted Linux or the Mac).--gates unit, the plan'sunitswitch and every script keep the gate name; only the job's display name changes. No Mac job changes.What changes
.github/scripts/gate-bg.sh).pnpm buildand the gate scripts' tests ran one after another, each single-threaded, on a cpus-4 box.electron.vite.config.<ms>.mjs. electron-vite writes that bundle beside its config while loading it, then deletes it. Linting beside the build once listed the file, then failed ENOENT (run 39599150487).gate-plan.mjsemits the matrix asunit_shards, withUNIT_SHARDS = 4andUNIT_CPUS = 8.unit k/4is rerun alone.ci-gate-preemptions.shused to split job names on spaces.unitonce, however many shards were red (ci-gate-refusals.sh).Class1a: linux(the hosted runner's 7 GB) andClass1a: macos(the 16 GB mini, which e2e shares).Review: doperpowers:reviewer-medium on the branch found three P2s, items 4 and 5 above. A fix wave added a test for each that fails before its fix. A delta reviewer-medium on the fix commits found nothing material.
Measurements
Base: master 21fc073 for every arm and its baseline. A 2 s memory and CPU sampler ran in every arm's jobs, the baseline's included. Each run was
scripts/ci-gate.sh <sha> --gates static,unit,probes --class1a pool, on scratchci/cp-*refs that have since been deleted. Arms ran in waves paired with baseline runs.The adoption rule: 3 green runs, equal test counts, and a median gain larger than the baseline's spread and at least 15 s. Times are in seconds. "unit" is the longest shard, and "plan→last" runs from the plan job's end to the last job's end.
eslint --concurrency)Not built: incremental tsc from a master-built
.tsbuildinfo. After S1, static's longest check is electron-vite's own build (111-131 s, the renderer's React Compiler pass). tsc's longest project is 77-102 s, and static (147 s) is no longer the run's longest job.The final class 1a run on this head (54fbf84, rebased on master 7c52489) was green: 39613754154. plan→last was 341 s and the wall 366 s. static took 168 s (gate-bg read 31.3 GiB and ran the checks at once). The shards took 275/183/230/241 s, after VM waits of 66-73 s. 22,459 tests passed in total across the shards (master gained two since the base). The artifacts are
test-results-unit-1of4-1to-4of4-1. The same tree before the review fixes (c6a7660) was green too: 39610724951, plan→last 324 s.Flakes the shards surfaced (for the tracker)
renderer-compiled src/renderer/src/transcript/view/TranscriptSlot.test.tsx: "Hook timed out in 10000ms", in every cpus-16 shard set (39597646480, 39597659332, 39599157286, 39599171772); test failures at 5x8 (39607168767);renderer-compiled src/renderer/src/tools/scm/ScmShell.test.tsx: "draws the selected file's hunks…" (39597659332, 39599157286);apps/desk-hub/test/reply-chain.test.tsfails at 3 and 4 shards: "a hello whose have the stream does not take (D1) > stops its opening bundle: 503 with frames 0…" (39607160893 at 4x8, 39608865906 at 3x8). This is the one red this shape has shown, 1 run in 4.desk-hub reconnect.test.tsandorg-directory.test.ts(5x8, 39604097046);src/main/connectors/oauth-provider.test.ts's rotation race (6x8);src/engine-host/fs/service.test.ts's 200 ms bound (4x16). provisioning-sweep and session-plane also failed, but desk-hub: fix two test flakes (the offline sweep's 401, the lease test's margin) #107 fixed those on master.Cost and capacity
A class 1a run now asks for 50 vCPU (16 + 4x8 + 2), against 14 before. The pool admits 192 at once (max_vcpus, the C3D quota), so three concurrent class 1a runs fit and a fourth waits for VMs. Raises for C4D us-west4 and for all regions are filed with CI-opt. Busy vCPU-seconds per run rise about 1.5x, from a median of 5,850 to 8,780 (job time × box size; VM boot not counted). The owner has ruled cost no constraint.
What is left of the 310 s
build:main-preload.Sminos-Session: CI-opt#a45b97a3 (doperpowers on macbook)