oficina / equipo Public

CI: compile without linking; progress log with hosted timings

The warm rerun spent 38 of its 100 s linking every test binary in the
compile step. It now only compiles packages (go build with the test
tags): a few seconds warm, and the shards still share the result cold.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev f3c5f69623a92664b0e220afe6aedc342ac0dd16 parent 42e4278
4 files changed, +86 −23
  • .amadan/ci.d/10-compile +1 −1
  • Makefile +6 −6
  • docs/superpowers/plans/HOSTED-CI-PROGRESS.md +74 −12
  • scripts/ci-test.py +5 −4
diff --git a/.amadan/ci.d/10-compile b/.amadan/ci.d/10-compile
index 9bcee5c8..afa597e6 100755
--- a/.amadan/ci.d/10-compile
+++ b/.amadan/ci.d/10-compile
@@ -1,4 +1,4 @@
#!/bin/sh
-# Build every package and test binary once, so the shards of the next
+# Compile every package once, so the shards of the next
# step do not each compile them. A few seconds when the cache is warm.
exec "$(dirname "$0")/../../scripts/ci-box.py" run make ci-compile
diff --git a/Makefile b/Makefile
index 9b85a1bc..d61a8bd4 100644
--- a/Makefile
+++ b/Makefile
@@ -98,12 +98,12 @@ test-lane:
ci-shard:
RASTRILLO='$(RASTRILLO)' python3 scripts/ci-test.py shard
-# ci-compile builds every package and every test binary once, before the
-# shards of 20-check start. Go does not share a compile between processes
-# that start together: 23 shards on an empty cache each compiled the same
-# packages, and every one of them took as long as the whole job used to.
-# After this the shards find their packages in the cache. With a warm
-# cache it takes a few seconds.
+# ci-compile compiles every package once, before the shards of 20-check
+# start. Go does not share a compile between processes that start
+# together: 23 shards on an empty cache each compiled the same packages,
+# and every one of them took as long as the whole job used to. After this
+# the shards find their packages in the cache. Nothing is linked, so with
+# a warm cache it takes a few seconds.
ci-compile:
go build ./...
python3 scripts/ci-test.py compile
diff --git a/docs/superpowers/plans/HOSTED-CI-PROGRESS.md b/docs/superpowers/plans/HOSTED-CI-PROGRESS.md
index 9bd87f6e..a5a29cf2 100644
--- a/docs/superpowers/plans/HOSTED-CI-PROGRESS.md
+++ b/docs/superpowers/plans/HOSTED-CI-PROGRESS.md
@@ -32,8 +32,10 @@ between two delegated cgroups. So:
0.165.0 on PATH, and codex, its code mode host and claude 2.1.312 in
`~/.local/share/equipo/try/bin`. The entry script gives `/etc` its own
filesystem (containment overlays `/etc`, and the kernel refuses an
- overlay over the container's overlay root) and makes a cgroup v2
- subtree the user may write, at the path a systemd user session has.
+ overlay over the container's overlay root), a machine id, a git
+ identity, and a cgroup v2 subtree the user may write, at the path a
+ systemd user session has. socat (Claude's own sandbox needs it) is
+ fetched and pinned like the rest.
- **On a runner host the box is skipped.** `ci-box.py run` runs the
command directly where `/usr/bin/bwrap` is already 0.11.0 and codex is
on PATH. `EQUIPO_CI_BOX=on|off` forces it.
@@ -63,30 +65,90 @@ between two delegated cgroups. So:
- `ci-box.py prepare` sets every tracked file's modification time from
its git blob and every directory's to one fixed time, so go test's
cached results (keyed on size and time of each file a test opened)
- hold on the next machine. A changed file gets a new time.
+ hold on the next machine. A changed file gets a new time. Measured: a
+ rerun on a fresh machine replayed every test package from the cache.
+- `ci-box.py prepare` also deepens the clone (hosted clones one commit;
+ gitleaks, the mixed-version test and a release test read history). It
+ runs on the machine, outside the box, where the job's git credential
+ is.
- `ci-box.py cache` (last step) reports the cache sizes and, past 4 GiB,
drops build cache entries the job did not read. A restore stamps every
- entry "now", so Go's own trim never fires on hosted.
+ entry "now", so Go's own trim never fires on hosted. One full run
+ leaves 1.96 GiB of build cache and 0.79 GiB of modules, under the
+ 6 GiB limit.
## Steps
| step | what |
|---|---|
| `00-prepare` | fetch and verify the pinned programs, pull the image, deepen the clone, set file times |
-| `10-lint@4` | build, vet, format, budgets, references, migration check; staticcheck; govulncheck; gitleaks |
-| `30-test@9` | the seven test lanes, the quarantine, and `runner-host` (bubblewrap build, pinned codex, namespaces, cgroup move, uncached) |
+| `10-compile` | compile every package once, link nothing |
+| `20-check@24` | 18 test lanes, the quarantine, `runner-host` (bubblewrap build, pinned codex, namespaces, cgroup move, uncached), and the static checks in four groups |
| `50-perf` | alone, it measures time |
| `90-cache` | report and trim the caches |
+Hosted runs steps one after another and only a step's shards side by
+side, so everything that can run together is one step.
+
+## What made it fast, in the order found
+
+1. **/tmp in memory.** With /tmp on the machine's disk every lane took
+ twice as long (thintest 35 to 78 s, directlive 88 to 168 s): the tests
+ sync small files and databases thousands of times. The installer
+ tests, which need user extended attributes a tmpfs refuses before
+ Linux 6.6, put their home under the user's home instead.
+2. **Compile once, then fan out.** 23 shards on an empty cache each
+ compiled the same packages (Go shares no compile between processes
+ that start together): every shard took 150 to 370 s and two
+ timing-sensitive tests failed under the load.
+3. **Lanes split by test name** (`scripts/ci-test.py` LANES), from
+ measured times: headless six lanes, runner three, equipotest four. A
+ lane that names no tests runs whatever its package's other lanes do
+ not, so a new test always lands somewhere. directlive stays whole:
+ two of its lanes side by side both failed with
+ `provider_account_containment`.
+4. **Static checks beside the tests**, not before them.
+
+To rebalance: each shard's log ends with its time and its five slowest
+tests; move names between lanes of a package, keep `20-check@N` equal to
+the lanes plus the extra shards (a test checks the count).
+
## Before (docs-t1)
Main c6319a5 on docs-t1 (load 26 to 44): failed after 512 s; the
headless lane ran 470 s and failed, thintest failed at 102 s. Best warm
docs-t1 run (ci-speed 5258905, nothing changed): 217 s.
-## Runs on hosted
-
-Proved first in the scratch repository `oficina/equipo-hostedci` (hosted
-is per repository, and main's old steps cannot pass there).
-
-(filled in below as runs come back)
+## Runs on hosted (32 CPUs, arm64)
+
+Proved in the scratch repository `oficina/equipo-hostedci` (hosted is
+per repository, and main's old steps cannot pass there). Times are the
+sum of steps; push to verdict adds the machine's boot and the cache
+restore, about 110 s, which is amadan's side.
+
+| run | what | steps | slowest shard |
+|---|---|---|---|
+| 0d5e136 | first full run, cold, 9 shards, old layout | 351 s, red | headless 265 s |
+| d4ea8db | /tmp on disk | 397 s, red | headless 312 s |
+| dd9e43c | 23 shards, no compile step | 384 s, red | equipotest 373 s |
+| dd7960c | compile step, /tmp in memory | 249 s, red | equipotest 196 s |
+| 42e4278 | rebalanced, 24 shards, cold | **202 s, green** | directlive 121 s |
+| 42e4278 rerun | nothing changed, fresh machine, warm cache | **100 s, green** | runner-host 26 s |
+
+In the cold green run: prepare 10 s, compile 42 s, checks 121 s, perf
+28 s. In the warm rerun: prepare 11 s, compile 38 s (it still linked
+every test binary; it no longer does), checks 26 s, perf 24 s.
+
+## Open
+
+- Timing budgets are reported, not enforced (`EQUIPO_CI_DEDICATED` is
+ unset). The machine is the job's own, but 24 shards share it; set the
+ variable once a week of hosted times says the budgets hold.
+- `provider_account_containment` in directlive when two of its lanes run
+ side by side: cause unknown, worked around by keeping it one lane.
+- Two tests failed once each under the load of the uncompiled 23 shard
+ run and not since: TestGateVerifyByMarkerAlone (runner/mac) and
+ TestCoordinatorRecoveryCallRefusalKeepsServing (runner).
+- The image is pinned by digest and pulled from the public ECR mirror of
+ Docker Hub each job (8 s). The pinned programs come from GitHub,
+ downloads.claude.ai and snapshot.debian.org each job (4 s).
diff --git a/scripts/ci-test.py b/scripts/ci-test.py
index fe95dffe..e148a643 100755
--- a/scripts/ci-test.py
+++ b/scripts/ci-test.py
@@ -5,7 +5,7 @@
scripts/ci-test.py lane NAME one lane (make test-lane LANE=NAME)
scripts/ci-test.py shard the shard AMADAN_SHARD names (make ci-shard)
scripts/ci-test.py quarantine the quarantined tests (make test-quarantine)
- scripts/ci-test.py compile build every test binary once (make ci-compile)
+ scripts/ci-test.py compile compile every package once (make ci-compile)
scripts/ci-test.py lanes print each lane and its packages
The slow packages each have a lane of their own and "rest" holds every
@@ -262,9 +262,10 @@ def run_all():
def run_compile():
- """Build every test binary and keep none: what stays is the build
- cache the shards then share."""
- cmd = ["go", "test", "-tags", TAGS, "-c", "-o", os.devnull, "./..."]
+ """Compile every package, as the tests build them, and link nothing:
+ what stays is the build cache the shards then share. Each shard still
+ compiles its own test files and links its own binary."""
+ cmd = ["go", "build", "-tags", TAGS, "./..."]
print("+ " + " ".join(cmd), flush=True)
return subprocess.call(cmd)