Skip to content

Test Core merge-queue legs restore a cache HIT and still replay only ~1/85 tasks, while main-push legs replay ~50/83 — #5401's queue tax is unpaid for Test Core, and none of the three known mechanisms explain it #10378

Description

@qq9340100

Unclaimed finding, no pm:* / domain:* labels — left for triage to rate and route. Produced while verifying #10228's two stated mechanisms (both measured false, see the report comment there); this is the signature that survived the falsification.

The measurement

Same day (2026-08-20), same workflow, same shard, Test Core:

eventrun / jobshardCached:wall
merge_group (pr-10291)job 9648644874831 / 8519m15s
merge_group (pr-10276)job 9649308930821 / 7912m50s
push main (9a1ed7a0)job 96502967114355 / 8310m44s
push main (9a1ed7a0)job 96502967129144 / 79

Merge-queue legs — the ones that gate every merge — replay ~1% of their task graph. Main-push legs on the same shards replay 55-66%.

Why the three known mechanisms do NOT explain it

All three were measured and ruled out (method and n in the #10228 report comment):

  1. Not the writer being cancelled (Test Core 的 Turbo 缓存有两条独立的失效机制,#5401 只覆盖了其中零条 —— 写入方 43% 被取消,且缓存键按 shard 分命名空间 #10228 mechanism one). Save Turbo cache (main only) carries if: always(), and GitHub runs always() steps on a cancelled job. Over 151 Test Core legs on main-push runs, 138 saves concluded success; among the 88 legs whose job was cancelled, 82 (93%) still wrote the cache. Individually verifiable: job 96493855475 was cancelled at 5m29s and its Save Turbo cache (main only) step still concluded success.
  2. Not shard-namespace aging (Test Core 的 Turbo 缓存有两条独立的失效机制,#5401 只覆盖了其中零条 —— 写入方 43% 被取消,且缓存键按 shard 分命名空间 #10228 mechanism two). Across 105 merge_group consumer legs, the freshest completed own-shard main-push save was p50 5.0 min / p90 9.1 min / max 15.6 min old. No shard is ever starved. (The cross-shard fallback key ${{ runner.os }}-turbo-${{ github.job }}- that Test Core 的 Turbo 缓存有两条独立的失效机制,#5401 只覆盖了其中零条 —— 写入方 43% 被取消,且缓存键按 shard 分命名空间 #10228 proposes adding is already present — ci.yml:226 for Test Core, ci.yml:905 for Dogfood.)
  3. Not a restore MISS — this is what distinguishes it from merge_group 条目在前一次 main 合并后 ~4 分钟内入队时永远吃不到 Turbo 缓存 —— 连续合并每条多付数分钟冷构建(实测) #5401. In merge_group 条目在前一次 main 合并后 ~4 分钟内入队时永远吃不到 Turbo 缓存 —— 连续合并每条多付数分钟冷构建(实测) #5401 the lint typecheck step literally missed (0 秒, MISS). Here every leg hits: over 59 sampled legs the Restore Turbo cache step ran p50 17s (push) / 18s (merge_group), min 3.0s, and 0 of 59 were ≤1s (MISS-shaped). A real multi-hundred-MB entry is downloaded every time.

So: the cache is written, is fresh, and is restored — and the merge-queue leg still cannot use it. Cache age explains none of the spread: Pearson r(own-shard save age, leg duration) = −0.05 (n=105); within-shard −0.18 / +0.07 / −0.24. A leg starting 0.0 min after a completed shard-3 save still took 20.1 min at 1/85 cached.

What that leaves

The restored entry's task hashes do not match the merge-queue tree, near-universally, while they match ~60% for a main-push tree restoring the same namespace. Candidate causes, none verified:

  • the queue tree is main + one or more stacked PRs, so the batch's combined diff invalidates far more of the graph than a single landed commit does;
  • something in the hash inputs varies with the ref/event rather than with content (turbo.jsonglobalDependencies is only tsconfig.json + tsup.config.ts, so that is not it on its face);
  • lockfile / ^build cascade: test is dependsOn: ["^build"], so one invalidated root package takes the whole closure with it.

Closing this needs a per-task hash diff (turbo run test --dry=json on a queue tree vs the main tree whose entry it restored), which is a different investigation from #10228's.

Why it is worth a card

Related


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions