Skip to content

ci: Linux free suite on 10 standard-8 machines with 4 sub-shards each (GSTA-203 PR 3) - #3771

Closed
garrytan wants to merge 12 commits into
mainfrom
gsta203-pr3-subshards
Closed

garrytan wants to merge 12 commits into
mainfrom
gsta203-pr3-subshards

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3771,
  "head": "1c7aac096fd68379dcc5e8cb0d16211bc258902e",
  "version": "1.92.61.0",
  "base": "main",
  "gate": {
    "listed": 16,
    "read": 11,
    "findings": 0,
    "kept": 0,
    "restored": 0,
    "open": 0
  },
  "spend_usd": 3.37,
  "session_kind": "unattended",
  "head_tree": "25e8b085111dc6572ae6653dac54cc3e562be430",
  "product_patch_id": "23e71a8b62dc1cd8d938521aebb52bcfeb5f243e",
  "gstack_version": "1.92.60.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 132,
    "rules": "97c1e5fe49607f73",
    "base": "dd9834d44d2650818cb6d8e17c57f795cb56bf98",
    "registry": "dd9834d44d2650818cb6d8e17c57f795cb56bf98",
    "gate_scan": {
      "tagged": 0,
      "head": "1c7aac096fd68379dcc5e8cb0d16211bc258902e"
    },
    "reasons": [
      "gate-class",
      "runtime=132"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @25e8b085111d (1 checks, current for 1c7aac096fd6)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41397944617/job/125123588251",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41397944617/job/125123588452",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/41397944617/job/125123588099",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41397944586",
    "pregate.json/remote_gate: remote-gate tree=25e8b085111d tests=27014"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      3806
    ],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, AGENTS.md, CONTRIBUTING.md (sub-shard sizing, --shard-jobs, FREE_SUITE_JOBS, WINDOWS_FREE_JOBS)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 1,
    "noted": 4,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 3,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  }
}

What changed

Free Tests before and after: slowest shard and dollars per run, three A/B runs per arm at 12407a3f4

The Linux free suite moves from main's 20 × ubicloud-standard-4 machines running one file at a time to 10 × ubicloud-standard-8 machines, each running 4 sandboxed sub-shards side by side. Both use 80 vCPUs. Windows stays at one child per shard.

Text version
Arm Machines k Slowest shard (3 runs) Median $ per run (mean)
C, control (main today) 20 × standard-4 1 389, 428, 450 s 428 s $0.392
A, adopted 10 × standard-8 4 258, 224, 233 s 233 s $0.315
B 20 × standard-4 2 329, 338, 319 s 329 s $0.316
W1, Windows k=1 (kept) 6 × windows-latest 1 685, 631, 558 s 631 s $0
W2, Windows k=2 6 × windows-latest 2 510, 528, 516 s 516 s $0

Why

Garry: "First apply these principles to all our tests" (GSTA-203, from "How I made our CI 20x faster"). PR 2 (#3730) taught one CI job to run k sub-shards in parallel; this PR measures where that pays off and turns it on. The Linux free suite's slowest shard drops by about 45% and each run costs about 20% less on the same vCPU count.

Blast radius

This changes .github/workflows/free-tests.yml (runner label, shard count, a FREE_SUITE_JOBS constant and a free_jobs dispatch input) and windows-free-tests.yml (a windows_jobs dispatch input, default 1, so Windows behavior is unchanged). The workflow edits add no network calls, secrets, permissions or dependencies; they only change machine size, shard count and k. A k=1 plan keeps the same id as before, the exclusive TREE_MUTATING shard is always k=1, and --ci-verify rejects a shard that ran at a different k than planned (tests in test/shard-jobs.test.ts and test/free-tests-workflow-wiring.test.ts; the same code ran the 15 CI runs listed below).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the GSTA-203 CI-speed plan (v2), including PR 3's pre-registered sub-shard A/B “Do it” (Garry (via GStack Minder)) approved the reviewed plan, every recommendation; PR 3 adopts the cheapest arm that passes none
2026-11-01 GSTA-149 sign-off on #3771 changing FREE_SUITE_RUNNER/SHARDS (owner of the runner constants) “signed off #3771 as written: arm A on Linux, k=1 on Windows, the row 6 reading” (GSTA-149 (relayed by GStack Minder)) approved FREE_SUITE_RUNNER ubicloud-standard-8, FREE_SUITE_SHARDS 10, FREE_SUITE_JOBS 4; condition: 7-day flaky-retry watch with a one-constant revert none

Source: gstack-approvals record for gsta203-pr3-subshards (display only; not an approval citation).

GSTA-149 owns FREE_SUITE_RUNNER and FREE_SUITE_SHARDS and signed off this change as written, with one condition. For 7 days after this merges, watch main's Free Tests flaky-retry rate. If a new failure appears that the sub-shards share (a file lock, a port or a temp dir), revert to 20 × ubicloud-standard-4 at k=1, which is a one-constant change.

Summary

The free CI suite spent most of its wall time waiting on a few long shards, and small machines left cores idle. With PR 2's sub-shards, a bigger machine runs 4 test files at once, each still sandboxed. The pre-registered A/B (plan item 3, three runs per arm at one commit, 12407a3) picked the cheapest arm that passed every bar: Linux Free Tests now uses 10 × standard-8 at k=4.

Windows stays at k=1. Since #3806, that applies to the nightly Windows suite, not to a PR gate; the required Windows PR check is windows-smoke. W2 (k=2) was faster, but two of its three runs needed the flaky retry for new Windows file-lock failures (browse/test/stealth-webdriver.test.ts EBUSY in run 41249397760; browse/test/cookie-import-native-job.test.ts "Native fixture root cleanup failed" in run 41250570447), which fails the "zero new failures" bar. PR 1 (waiting on #3585) may retune the Windows shard count later; the windows_jobs input stays for that experiment.

A/B evidence (all at 12407a3, every run concluded success)

Arm Run Run wall Slowest shard Median shard $ Tests expect()
C 41248010805 751 s 389 s 242 s $0.404 32635 273145
C 41249395592 541 s 428 s 240 s $0.408 32635 273148
C 41250565282 576 s 450 s 210 s $0.364 32635 273148
A 41248013509 493 s 258 s 171 s $0.312 32635 273145
A 41249389952 375 s 224 s 167 s $0.296 32635 273145
A 41250567176 521 s 233 s 185 s $0.336 32635 273147
B 41248016018 730 s 329 s 170 s $0.316 32635 273145
B 41249393462 429 s 338 s 172 s $0.316 32635 273146
B 41250562387 454 s 319 s 180 s $0.316 32635 273141
W1 41248018292 1041 s 685 s 501 s $0 16442 123914
W1 41249400236 940 s 631 s 557 s $0 16442 123914
W1 41250568851 759 s 558 s 493 s $0 16442 123914
W2 41248020712 910 s 510 s 342 s $0 16442 123914
W2 41249397760 938 s 528 s 424 s $0 16442 123914
W2 41250570447 858 s 516 s 395 s $0 16443 123914

A met every pre-registered bar. It had zero new failures, and its slowest-shard median (233 s) is below the control's minimum (389 s). Its weekly cost at premium prices is below the control's. Over the 1330 Free Tests runs from 2026-10-24T23:15Z to 2026-10-31T23:15Z, C would cost $521, A $419 and B $420. Per-file test counts are identical (1452 files, 32635 tests in every Linux run). Per-file expect() counts vary from run to run inside the control itself (qa-only-cleanup 134/136, test-free-shards-settlement-lifecycle 188/189, cso-scanner-cli 50/51). A's only difference (qa-only-cleanup 136, run 41250567176) is inside the control's own spread; B's qa-only-cleanup 130 (run 41250562387) is not.

Targets (reported, not gating): Free Tests p50 ≤ 340 s is not met by run wall: A's median run wall is 493 s while its slowest shard is 233 s, so setup and queueing are the rest. PR path p50 ≤ 9 min was not measured in this PR.

Plan: GSTA-203 plan v2, PR 3 (GStack Minder drive, handoffs/ci-20x/GSTA-203-plan-v2.md).

Test Coverage

All new code paths have test coverage: per-shard k in the plan, the TREE_MUTATING k=1 rule, the unchanged k=1 plan id, --ci-run defaulting to the plan's k with --jobs overriding it, --ci-verify's k mismatch, and the workflow wiring for FREE_SUITE_JOBS, free_jobs, WINDOWS_FREE_JOBS and windows_jobs.

Tests ran: typecheck count unavailable
Tests ran: focused 148

Pre-Landing Review

No blocking issue needed a code fix; one changelog wording item was auto-fixed.

REVIEW_LOOP: passes=1 blocking_found=1 deferred=1 noted=4 fixed=1 scope=frozen fix_checks=2 dispatches=2

Gate edits: 16 listed, 11 read, 0 findings — 0 kept, 0 restored, 0 open

Outside review: clean (openai/gpt-6.1-sol, cross-family).

After the main merge, gstack-ship-receipt carry refused (RECEIPT_CARRY_PRODUCT_CHANGED: the base moved from PR 2's branch to main). Under R51 the carry took the light route: one scoped fix-check of the conflict resolution (no findings) and a docs re-audit that named the nightly Windows lane in TESTING_INTERNALS and the changelog. No new review loop.

Deferred findings

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • INFORMATIONAL .github/workflows/free-tests.yml:382 the runner's own wall for a 10-shard plan (3326 s) sits behind the job's timeout-minutes: 20, so a hung parallel sub-shard is killed by GitHub and loses the FREE_SUBSHARD_TIMEOUT diagnostics. It still fails loudly. This already existed at base (1663 s wall at 20 shards).
  • INFORMATIONAL scripts/lib/free-ci-health.ts:1 shardOverruns compares a k>1 shard's wall against its serial predictedMs × 1.5, so the overrun warning rarely fires at k=4.
  • INFORMATIONAL docs/TESTING_INTERNALS.md:1571 stale sentence about --jobs; fixed in this PR by the docs audit.
  • INFORMATIONAL .github/workflows/free-tests.yml:530 four sub-shards share one xvfb display and the host's ports; watch the flake ledger after landing.

Exploratory QA

Not run: no user-facing surface. The 15 A/B CI runs above are the behavioral check.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

PR 3 of GSTA-203 plan v2, built as planned: A/B at one commit with 3 runs per arm on Linux (C, A, B) and Windows (k=1, k=2); the cheapest passing arm adopted on Linux; Windows left at k=1 because its k=2 arm did not pass.

Issues

Refs #3806

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One stale sentence about the sub-shard default was corrected in docs/TESTING_INTERNALS.md; no blockers.

Scope: base 84f93c9 to d80db6f on gsta203-pr3-subshards (3 commits, 9 files; nothing staged, unstaged or untracked). The audit covered the committed workflow, runner and doc changes plus a search of every tracked and new doc and template for free-suite sizing, --jobs and --shard-jobs claims.

Documentation health:
  docs/TESTING_INTERNALS.md  Updated (the sub-shards section now says --ci-run defaults to the plan's per-shard k, not k = 1)
  changelog.d/gsta203-pr3-subshards.md  Current (matches the diff)
  README.md        Current (no free-suite sizing claims)
  CLAUDE.md        Current (no free-suite sizing claims)
  AGENTS.md        Current (Windows six-job count unchanged)
  CONTRIBUTING.md  Current (GSTACK_FREE_JOBS describes local runs only)
  ARCHITECTURE.md  Current (no free-suite sizing claims)
  docs/TEST_PORTFOLIO.md  Current (dated audit record; its 20-machine line describes that refactor)
  CHANGELOG.md     Skipped (ship-owned)
  TODOS.md         Skipped (ship-owned)

Documentation coverage:

  [entity]                          [reference] [how-to] [tutorial] [explanation]
  --ci-plan --shard-jobs k          yes         yes      no         yes
  FREE_SUITE_JOBS / free_jobs       yes         yes      no         yes (A/B rationale is only in the changelog and PR)
  WINDOWS_FREE_JOBS / windows_jobs  yes         yes      no         yes (why k stays 1)
  --ci-verify per-shard k check     yes         no       no         no

Debt: the --ci-verify per-shard k rejection has reference coverage only. Diagram drift: none.

Test plan

  • bun run typecheck: exit 0
  • bun test (8 focused files, after the main merge): 154 pass, 0 fail
  • Remote pregate (Ubicloud, tree 25e8b085111d after the main merge): 27014 tests, 0 failed, $0.09
  • actionlint: ok

The focused lane failed once at this tree in test-free-shards: exit 0 WITH the terminal summary passes and passed on its one rerun. Cause: PR 2's real-home check inside runFreeShard sees /ship's own lane log growing under ~/.gstack (reproduced in 1 of 3 runs with the log under ~/.gstack, 0 of 3 with it elsewhere). It is a test-isolation issue in the base PR, not this diff; CI does not log there.

garrytan and others added 10 commits October 31, 2026 18:09
… default), per-file JUnit counts (GSTA-203 PR 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ister shard-jobs.ts in ship-measure touchfiles

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…icter --ci-verify records, unique count paths, no serial launch without wall

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s FREE_ONLY entry is non-behavioral

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…text names the wall the parallel phase left

Adversarial pass 2 (GSTA-203 PR 2): a plain relative path now matches a planned
file exactly, and an absolute or ../-prefixed path matches only when its prefix is
the child's root, so an unplanned browse/test/x.test.ts is never credited to
test/x.test.ts. The serial sub-shard's FREE_SUBSHARD_TIMEOUT text says how much of
the shard wall the parallel phase left it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ds (docs audit docs-203-1)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…obs and windows_jobs dispatch inputs (k=1 defaults)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…STA-203 PR 3 A/B winner); Windows stays at k=1

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… baseline and the unchanged 80 vCPUs)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…t docs-pr3-2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

garrytan and others added 2 commits November 2, 2026 05:56
…rant, GSTA-203 PR 3)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	.github/workflows/free-tests.yml
#	docs/TESTING_INTERNALS.md
#	scripts/harness-version.json
#	scripts/lib/shard-jobs.ts
#	scripts/test-free-shards.ts
#	test/shard-jobs.test.ts
#	test/windows-native-workflows.test.ts
…udit after the main merge)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Frozen in wave github-99ae73c79d3c (branch wave/github-99ae73c79d3c) at 1c7aac0. Push nothing here: a moved head drops this PR from the wave. Fixes go on the wave branch through its integrator.

@garrytan garrytan mentioned this pull request Nov 2, 2026
4 of 5 tasks
capy-ai Bot added a commit that referenced this pull request Nov 2, 2026
* test-free-shards: --ci-run --jobs k sub-shards inside one CI job (k=1 default), per-file JUnit counts (GSTA-203 PR 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(ci): ship ffmpeg in the eval image so the marathon design-motion case can run (#3687)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* shard-jobs: serial sub-shard gets what is left of the shard wall; register shard-jobs.ts in ship-measure touchfiles

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* shard-jobs: validate every sub-shard summary, bounded JUnit read, stricter --ci-verify records, unique count paths, no serial launch without wall

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* shard-jobs tests: non-hex plan id fixture; harness-version: shard-jobs FREE_ONLY entry is non-behavioral

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(test:free): exact root-bound JUnit path matching; serial timeout text names the wall the parallel phase left

Adversarial pass 2 (GSTA-203 PR 2): a plain relative path now matches a planned
file exactly, and an absolute or ../-prefixed path matches only when its prefix is
the child's root, so an unplanned browse/test/x.test.ts is never credited to
test/x.test.ts. The serial sub-shard's FREE_SUBSHARD_TIMEOUT text says how much of
the shard wall the parallel phase left it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(testing): real-home tripwire covers --jobs k>1 parallel sub-shards (docs audit docs-203-1)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(free): per-shard sub-shard k in the CI plan (--shard-jobs), free_jobs and windows_jobs dispatch inputs (k=1 defaults)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(free-tests): 10 x ubicloud-standard-8 at 4 sub-shards per shard (GSTA-203 PR 3 A/B winner); Windows stays at k=1

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pre-landing review fixes (changelog names main's 20 x standard-4 baseline and the unchanged 80 vCPUs)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(testing): sub-shard default is the plan's per-shard k (docs audit docs-pr3-2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* ci(free): run the #3680/#3679 BSD-userland regression on macos-named-regressions

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* changelog: macos-named-regressions runs the BSD-userland ubi-runner regression (#3680)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: Windows k=1 applies to the nightly suite since #3806 (docs re-audit after the main merge)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Landed in wave #3846 as v1.92.77.0 (4bbad24), merged from this PR's pin 1c7aac0. Integrator changes touching this PR's files: none.

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