Skip to content

ci: Rust tests per affected crate, in parallel (card 44a3c460) - #5330

Merged
joelteply merged 3 commits into
canaryfrom
fable/ci-by-crate
Oct 24, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/ci-by-crate

Conversation

@joelteply

@joelteply joelteply commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Plan line 1 (the build loop, edit-to-checked) and the rule "CI changes subtract": a crate-local PR verifies the crates it can affect, in parallel, instead of one serial 35-minute job (canary run 39957318217).

Selection (tools/scripts/ci-change-scope.cjs)

  • Crates to test = every crate a changed path lies in + all its dependents, from the Cargo.toml path-dependency graph read at selection time (readWorkspace). No hand-kept dependents list.
  • Cargo.lock, root Cargo.toml, rust-toolchain.toml, any .cargo/, any build.rs, core/vendor/**, and any path outside a workspace member (protocol/, tools/scripts/, workflows, docs/genome/...) select every crate.
  • Docs/markdown and Windows-installer-only changes select none (existing rules kept).
  • Pushes to canary/main run every crate (the post-merge net and cache save).
  • CLI handoff regressions: only when core/continuum-cli-lifecycle/** or core/continuum-core/src/bin/continuum{.rs,/**} change, or on a full selection.

Workflow

  • crate-tests matrix: one job per selected crate, fail-fast: false, same shared cache key; only the core job saves, only on pushes.
  • Fixtures moved with their owners: cuda_train_test.py -> genome; C++ lease test + fs2/native interop -> engine; --doc guards -> mind; perception and genome (cut on canary during review) get their own jobs; Postgres steps dropped with Delete unused Postgres support (SQLite is the only store) #5333; script tests, warning ratchet, core lib binary, CLI handoff -> core. Each job checks ts-rs drift for what it regenerated.
  • cargo test -p continuum-core --lib is now the aggregate (required name kept); ts-rs binding drift detector still mirrors it.

Measured

Baseline: canary push 39957318217, 36.0 min wall (one serial job); today's PR runs took 26-54 min (median ~36).
All runs below are ubuntu-latest PR runs, at 7d94201 (before the rebase onto canary, which added perception and genome).

case run wall per-job (wall)
(a) full selection 40027103941 21.0 min core 20.5 (lib 736 s + CLI handoff 326 s), engine 19.2 (apt stall 463 s), mind 14.9, live 11.7, hands 9.3, kernel 5.6
(a') full, rerun 40029662839 30.6 min hands 30.0 (apt stall 1,177 s), core 19.6 (lib 705 s + CLI 307 s), mind 14.0, engine 10.4, live 9.6, kernel 5.5
(b) mind-only (draft #5334) 40029681946 23.1 min core 22.3 (apt stall 425 s, lib 721 s, no CLI), mind 11.3
(c) docs-only (draft #5335) 40029684737 0.5 min no Rust; required contexts green

The variance is apt, not the build. The System deps step normally takes 11-27 s and stalled for 425/463/1,177 s on 3 of 13 jobs. Without the stall, (b)'s core path is ~15 min: checkout+toolchain 24 s, cache restore 158 s, core lib build+run 721 s.

The 8 min target is not met. The floor of any run that includes core is cache restore (2-5 min, 7.4 GB) plus core's lib test build (~12 min). Cargo fingerprints workspace crates by mtime, and a fresh checkout makes every one look dirty, so every unchanged workspace crate is recompiled from the cache's external deps on every run. Jobs that do not build core finish near the target (kernel 5.5 min), but every selection includes core, because core depends on every tested crate.

Re-run on the rebased head: 40043838338.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

@joelteply

Copy link
Copy Markdown
Contributor Author

Review at exact head 7d94201: the required aggregate rejects a failed selector or failed selected matrix; I found no fail-open in that aggregation.

One reproducible graph gap remains: readWorkspace ignores inherited workspace path dependencies. With root [workspace.dependencies] continuum-kernel = { path = "kernel" }, and continuum-core declaring continuum-kernel.workspace = true, a kernel/src/lib.rs change selects only continuum-kernel and omits continuum-core. I executed this against the exact selector in a minimal filesystem fixture, without compiling. Resolve inherited local paths (including aliases), or fail closed when graph completeness cannot be established, and add this regression. This is a supported-manifest regression scenario, not a claim that the current core/kernel edge already uses inheritance.

Integration reminder: when Perception #5331 lands, preserve its own lib suite with --features test-fixtures; dependency compilation does not run those 38 tests. Apply the same rule to Genome when its crate cut lands. Current canary does not yet expose core/continuum-genome, so this is an integration condition, not a claim that Genome already merged. Trial execution/timing receipts still needed before final clearance.

joelteply and others added 3 commits October 23, 2026 21:58
The selector derives the crates to test from the workspace's Cargo.toml graph:
every crate a changed path lies in plus all of its dependents. Workspace-wide
inputs (Cargo.lock, root Cargo.toml, .cargo, build.rs, core/vendor) and any path
outside a member select every crate; docs and installer-only changes select none.
Pushes to canary/main run every crate. The CLI handoff regressions run only for the
CLI and lifecycle paths or a full selection.

The single serial job becomes one matrix job per selected crate; each crate's own
fixtures move with it (training script with the genome, native custody interop with
the engine, doc guards with the mind, CLI handoff and the warning ratchet with core).
The required context "cargo test -p continuum-core --lib" is now an aggregate that
passes when every selected crate job passed or none was selected.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 3ec3692 into canary Oct 24, 2026
24 checks passed
@joelteply
joelteply deleted the fable/ci-by-crate branch October 24, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant