Skip to content

pkgs/atlas-search: split dependency compilation out of the package build with crane (code#8392) - #8560

Merged
dezren39 merged 1 commit into
mainfrom
buildperf/atlas-crane-split-20261111
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
buildperf/atlas-crane-split-20261111

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

What

pkgs/atlas-search now compiles its registry dependencies as their own derivation (crane buildDepsOnly → cargoArtifacts) whenever a craneLib is supplied. The package flake passes one, pinned to the crane rev the root lock already carries (01bc1d40). Callers that do not pass craneLib (home/common/default.nix) keep the existing monolithic buildRustPackage build — same sources, same checks, no split — via a craneLib ? null fallback in default.nix.

Two source tiers, deliberately:

  • deps tier (manifests, lockfile, crates/, schema/ — atlas-core include_str!s the stage DDL): keys the dependency layer. Crane's dummy-source normalization means a .rs content change does not change this derivation.
  • package tier (deps tier + fixtures/): the test suite reads fixtures by relative path (crates/atlas-core/src/eval.rs opens ../../fixtures/eval-smoke.json), so the check phase needs them in the tree — but a fixture edit must not rebuild the dependency layer, so they stay out of the deps tier.

Behaviour preserved: test suite runs in the check phase (doCheck = true), smoke installCheckPhase unchanged, ATLAS_SEARCH_ORT_LIB_DEFAULT wiring unchanged.

Measured (laptop, through ~/tools/fleet-build-lock, 2026-11-11)

Build Before (monolith) After (crane split)
Cold 352s, single derivation recompiles everything deps layer paid once per manifest/lock change
One-line source change new single derivation, full recompile — 103s to reach the test phase dry-run: exactly 1 derivation to build (deps path w2840sl7…-atlas-search-deps-0.1.0 untouched), 34s, green
Pristine repo tree (this branch) — dry-run: 1 derivation; deps layer reused from a different tree whose sources differed only by comments

CI checks were queued (runner fleet saturated); the package flake build above is the verification, run on the exact tree in this PR (green on retry — see the flake note).

Known flake, pre-existing (not this change)

crates/atlas-search/tests/cli_parity.rs races under load in BOTH build systems: a spawned CLI reads its qvec JSON file empty (ATLAS_SEARCH_QVEC_FILE: bad JSON vector … EOF while parsing). Across tonight's runs it failed 3 times (monolith once, crane twice, different tests each time) and passed on retry each time. Recorded on code#8392 for a follow-up fix; it is not caused by the split.

Refs code#8392.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 06:30
@dezren39
dezren39 merged commit 5131eb2 into main Nov 11, 2026
0 of 10 checks passed
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 02794fe4-9712-43be-b3a5-3ffb4bfb754c
Commits

Reviewing files that changed from the base of the PR and between 42429a3 and cb3ec28.

Files ignored due to path filters: 1

  • pkgs/atlas-search/flake.lock is excluded by !**/*.lock
Files selected for processing: 2

  • pkgs/atlas-search/default.nix
  • pkgs/atlas-search/flake.nix
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 deleted the buildperf/atlas-crane-split-20261111 branch November 11, 2026 06:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T06:31:19.624493Z cb3ec28 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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