Skip to content

ci: develop cache warm + tower-defense handshake fix - #414

Merged
jonit-dev merged 3 commits into
developfrom
ci/speed-followups
Oct 3, 2026
Merged

jonit-dev merged 3 commits into
developfrom
ci/speed-followups

Conversation

@jonit-dev

Copy link
Copy Markdown
Contributor

TL;DR: two CI speed and reliability fixes, one PR.

  • Cache warm (PRD-481 phase 2): ci.yml now also runs on pushes to develop, as a warm selection that runs only build-artifacts and test-native. Before this, nothing ran on develop, so no PR could read a base-branch cache and every PR rebuilt the native host (~3.3 min) and V8/QuickJS (~2 min) from cold. A warm run is never a reuse source.
  • tower-defense flake: the playtest bridge describe/ready handshake had the same 15 s budget as the first-use shader compile, so it lost the race about half the time (Bridge operation 'ready' exceeded 15000ms, frames 0). It now uses bridgeWaitTimeoutMs, as advance and wait already did.
  • rain diagnostics: requestAdapter rejections now keep their reason in TN_PLAYTEST_CAPTURE_PROVENANCE_MISSING.

Evidence: ci-needs, ci-structure, ci-efficiency, ci-local, ci-fast: 266 passed; bridge specs 19 passed; lint clean. provenance.spec.ts needs the CI browser lane (3 baseline cases fail the same way locally).

Hold: do not merge until #400 (develop→main) lands.

… develop reads

`ci.yml` ran on `push: main` only, so nothing ever ran on develop and no base-branch
cache was ever published. GitHub scopes a pull request's cache to
`refs/pull/N/merge`, which no other pull request reads, so every pull request into
develop missed `native-build-*` and rebuilt the native host (199 s of host plus ~120 s
of V8/QuickJS contract executables) and missed `workspace-dist-*` and built the
workspace itself. Only a base-branch run publishes a key every pull request can read.

`ci.yml` now listens to `push: develop`, and `classify` turns a push whose target is
develop into the new `warm` selection: `build-artifacts` and `test-native` run —
they are the only two jobs whose product is those caches — and every other job is
skipped and not required. `scope`, `ci-required` and `run-summary` read `warm` as an
ordinary selection, so the verdict is `build-artifacts` + `test-native` green.
A push to main, a pull request, a merge group, the nightly, a dispatch and
`TN_CI_FORCE_FULL` all keep their existing selection.

No save step had to change: the shared workspace-dist action publishes on a cache
miss with `save-bundles` left true in its one producer, and `test-native`'s three
`actions/cache` steps save in the action's own post step, which no selection gates.
Both jobs' `if:` now also accept `warm`, and nothing else changed about them —
`runs-on` included.

A warm run verifies nothing, so it is never reuse evidence: `findReusableRun` skips
it and keeps looking for the run that really tested the tree, and `sourceVerdict`
refuses one as a source. Concurrency is untouched — every push run gets its own
group and `cancel-in-progress` is true only for a pull request, so a second push to
develop cannot kill the first one mid-save.

Evidence: `pnpm exec vitest run scripts/__tests__/ci-needs.spec.ts
scripts/__tests__/ci-structure.spec.ts scripts/__tests__/ci-efficiency.spec.ts
scripts/__tests__/ci-local.spec.ts` — 238 passed, 0 failed, across the four files;
the nine new cases were red first (5 failures, then the two existing push-policy
cases once the classifier changed). `pnpm lint` exits 0. The PRD-481 phase 2 cache
box stays unticked: its proof is a hosted `test-native` log with a restore from a
develop-warmed key, which nothing here can produce.
…ter rejections say why

tower-defense failed about half its runs with "Bridge operation 'ready' exceeded
15000ms": the handshake had the same 15 s budget as the first-use shader compile
bound. describe/ready now use bridgeWaitTimeoutMs, as advance and wait already do.
requestAdapter rejections keep their reason in TN_PLAYTEST_CAPTURE_PROVENANCE_MISSING
(rain lane), so the next failure names its cause. bridge specs green locally;
provenance.spec needs the CI browser lane (3 baseline cases fail the same way here).
@jonit-dev
jonit-dev merged commit 13aa938 into develop Oct 3, 2026
46 of 68 checks passed
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