Repository navigation
feat(cache): warm every contextful compile group into the base lane - #242
debuggingfuture wants to merge 2 commits into
Conversation
contextful-cache-warm lists the head's compile groups with `stages --parts --compile-groups` per tier and compiles each through `gate --stage <part> --compile-only` under the gate part's command, checkout, install and cache wrapper. The groups spread round-robin over at most four children of the run, each compiling its share in one container and starting no group past 2 h; the parent hands its container and slot to them and joins. A tree without the flag compiles workspace.compile in the parent, as before. With gate.lightLabels set, heavy pull-request groups are left to the heavy tier. Children re-check the branch head and join no supersession group; the parent's carries them. Spec: specs/adr/0007-cost-efficient-execution.md
There was a problem hiding this comment.
AI code review — 💬 Comment
Risk tier: full · 0 critical · 2 warnings · 0 suggestions
Reviewers: security
1. ⚠️ Warning — Deduplicate compile groups before scheduling
📍 runs/contextful-cache-warm.ts:96-102
'warmableGroups' concatenates the PR and nightly listings without deduplicating them. If a group appears in both tier outputs (or is repeated by the CLI), it is compiled more than once, wasting child capacity and cache-warming time. Deduplicate while preserving run order before chunking and spawning children.
2. ⚠️ Warning — Clarify the single-group behavior
📍 specs/adr/0007-cost-efficient-execution.md:118-120
This sentence implies that a head with one compile group also compiles 'workspace.compile', but the implementation compiles the one listed group (which may be 'features.binary-all' or another group) in the parent's container. Restrict the 'workspace.compile' claim to the no-groups fallback and separately state that a single listed group is compiled directly.
contextful-cache-warmwarms every distinct compile of the contextful gate into thebaselane, not onlyworkspace.compile.Problem & Insight
cargo test --workspace --no-runmisses all of their crate compiles.contextful-cinames those compiles itself.stages --parts --compile-groupslists one part per distinct set ofcargo testinvocations, andgate --stage <part> --compile-onlyruns that part's invocations with--no-run. Warming through these two commands keeps the sccache keys identical to the real parts' keys.Take
contextful-ci. It then lists the compile groups for each tier and the folds.WARM_CHILDREN(4) children of the same run. Each child compiles its share in order in one container, under the gate part's command, checkout, install and cache wrapper, plus--compile-only. A child starts no group past 2 h, and a failed or timed-out group does not stop the next one. A tree of the current size, with 31 groups, does not fit one container's deadline, so the groups are split across children.contextful-cilacks the flag, or a head with one group, compiles in the parent's container. With the flag missing, the part isworkspace.compile, so behavior matches feat(cache): warm the compile cache's base lane from every default-branch head #241.joinsChildren).gate.lightLabelsset, the warm leaves out each pull-request group whose own label and fold label are both heavy, because the heavy tier compiles it on the same push. Nightly groups always warm.stageCommandtakes{ compileOnly }.ciCommandis exported for the discovery commands.Spec:
specs/adr/0007-cost-efficient-execution.md§ Base-lane warm.Verification
pnpm typecheck,pnpm lint: clean.oxlint@1.79.0, the version theflare-dispatch/oxlintcheck pins, is clean oncerun-end.test.tstypes itsendmock instead of declaring an unused_parameter.vitest runs/contextful-cache-warm.test.ts: 13 passed. The tests cover the fallback, the child spread and join, the order of a child's compile-only commands past a failing group, the light-label filter, and the skips.pnpm test: 3057 passed. One failure,check-command-supervisor"TERM-ignoring descendant", is timing-sensitive under full-suite load and passes when run alone (13/13).