Skip to content

perf(ci): adopt mold linker and lift CARGO_BUILD_JOBS=1 on Reborn CI - #5089

Merged
serrrfirat merged 1 commit into
mainfrom
firat/ci-mold-reborn
Jun 19, 2026
Merged

serrrfirat merged 1 commit into
mainfrom
firat/ci-mold-reborn

Conversation

@serrrfirat

Copy link
Copy Markdown
Collaborator

Summary

Adopts the PR #5086-proven mold linker setup for the real Reborn CI workflows and removes the CARGO_BUILD_JOBS=1 serial-link tax so Cargo can use its default parallelism. PR #5086 measured mold on the heaviest Reborn build (--workspace --all-targets --all-features) and proved parallel linking succeeds with no OOM, unlocking the measured ~4x build potential without the prior lld bus-error workaround.

Workflow Changes

  • .github/workflows/reborn-tests.yml: adds global mold RUSTFLAGS, installs clang and mold in the Rust crate-test matrix and root partition jobs, removes the workflow-level build serialization, and removes the composition crate's local build-job serialization while preserving its CARGO_INCREMENTAL=0 disk guard.
  • .github/workflows/reborn-integration.yml: adds global mold RUSTFLAGS, installs clang and mold in the Rust crate-test matrix and root partition jobs, and removes the workflow-level build serialization.

Both workflows use the proven linker flags: -C linker=clang -C link-arg=--ld-path=/usr/bin/mold, with apt install via sudo apt-get update && sudo apt-get install -y clang mold.

Verification Step

Each workflow's root partition job now verifies mold is active by checking that clang --ld-path=/usr/bin/mold -Wl,--version reports mold during a real clang link invocation, then compiling and running a tiny Rust binary with rustc -C linker=clang -C link-arg=--ld-path=/usr/bin/mold. This avoids the false-negative pattern of grepping successful rustc linker stdout.

Fallback

If runner OOMs recur, the one-line fallback is to restore CARGO_BUILD_JOBS=1.

Local Validation

  • python3 -c "import yaml;[yaml.safe_load(open(f)) for f in ['.github/workflows/reborn-tests.yml','.github/workflows/reborn-integration.yml']];print('yaml ok')" -> yaml ok
  • ! grep -rn CARGO_BUILD_JOBS .github/workflows/reborn-tests.yml .github/workflows/reborn-integration.yml
  • Confirmed mold RUSTFLAGS, install steps, and root-job verification are present in both workflows.
  • git diff --check
  • git diff --name-only showed only .github/workflows/reborn-tests.yml and .github/workflows/reborn-integration.yml before commit.
  • actionlint was not available in this environment.

Automated agent-authored change.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@railway-app

railway-app Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the ironclaw-pr-5089 environment in ironclaw-ci-preview

Service Status Web Updated (UTC)
ironclaw ✅ Success (View Logs) Web Jun 19, 2026 at 3:08 pm

@railway-app
railway-app Bot temporarily deployed to ironclaw-ci-preview / ironclaw-pr-5089 June 19, 2026 14:56 Destroyed
@github-actions github-actions Bot added the size: M 50-199 changed lines label Jun 19, 2026
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b2fd81d0-7d83-41ac-88e5-564c48baeb2f

📥 Commits

Reviewing files that changed from the base of the PR and between ed53c2b and 763c829.

📒 Files selected for processing (2)
  • .github/workflows/reborn-integration.yml
  • .github/workflows/reborn-tests.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated CI build configuration to use an optimized linker, improving build performance and eliminating previous serialization constraints.
    • Added automated verification checks to ensure the optimized linker is properly configured and active across all build environments.

Walkthrough

Both reborn-integration.yml and reborn-tests.yml drop CARGO_BUILD_JOBS: "1" and set RUSTFLAGS to use clang with mold as the linker. Each workflow's crate-tests and root-reborn-parity-tests jobs gain apt-get install steps for clang/mold, and parity-test jobs gain a verification step that compiles C and Rust snippets to confirm mold is active.

Changes

mold+clang linker adoption across reborn CI workflows

Layer / File(s) Summary
Global RUSTFLAGS configuration
.github/workflows/reborn-integration.yml, .github/workflows/reborn-tests.yml
Workflow-level env blocks replace CARGO_BUILD_JOBS: "1" with RUSTFLAGS: -C linker=clang -C link-arg=--ld-path=/usr/bin/mold in both workflows.
clang/mold install steps and ironclaw_reborn_composition build change
.github/workflows/reborn-integration.yml, .github/workflows/reborn-tests.yml
crate-tests jobs add apt-get install clang mold; reborn-tests.yml also replaces CARGO_BUILD_JOBS=1 with CARGO_INCREMENTAL=0 for ironclaw_reborn_composition.
Linker verification in parity-tests
.github/workflows/reborn-integration.yml, .github/workflows/reborn-tests.yml
root-reborn-parity-tests jobs add install steps and a verification step that compiles C and Rust snippets, asserting mold is selected and linked binaries run correctly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🔗 No more jobs=1, the linker breaks free,
mold forges the symbols at blazing speed.
clang wields the path, /usr/bin/mold in hand,
a C snippet, a Rust snippet — both as planned.
CI now asserts what the flags command. ⚙️

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title follows Conventional Commits format and accurately summarizes the main change: adopting mold linker and removing CARGO_BUILD_JOBS=1.
Description check ✅ Passed Description is comprehensive with summary, detailed workflow changes, verification approach, and fallback plan, but omits required Change Type, Linked Issue, and Validation checkboxes from template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs scope: ci CI/CD workflows labels Jun 19, 2026
@serrrfirat
serrrfirat merged commit cf0a13f into main Jun 19, 2026
92 of 94 checks passed
@serrrfirat
serrrfirat deleted the firat/ci-mold-reborn branch June 19, 2026 15:26
@serrrfirat

Copy link
Copy Markdown
Collaborator Author

📈 Measured gain (post-merge)

Comparing the same reborn-tests jobs: latest successful main run (serial link, CARGO_BUILD_JOBS=1) vs this PR's run (mold + parallel linking).

Job main (=1) mold Faster
Reborn root tests (0) 1051s 659s 37%
Reborn root tests (1) 1063s 588s 45%
Reborn root tests (2) 984s 601s 39%
Reborn root tests (3) 1074s 601s 44%
Test ironclaw_reborn 640s 271s 58%
Test ironclaw_reborn_composition 845s 518s 39%
Test ironclaw_reborn_cli 620s 367s 41%
Test ironclaw_product_workflow 619s 205s 67%
Sum (compute) 6896s 3810s ~45%

Net effect:

  • These jobs run in parallel, so the reborn-tests gate wall-clock drops from ~18 min → ~11 min (~40% faster).
  • Total compute is ~45% lower (runner-cost win).
  • The mold apt install (~30–60s/job) is already included in the "mold" column and is dwarfed by the gain.
  • A consistent 37–67% across 8 independent jobs is well beyond CI noise — and these are exactly the link-heavy jobs that previously needed CARGO_BUILD_JOBS=1, so the cause is unambiguous (parallel linking, now safe under mold).

Validation: all four Reborn root tests partitions + Test ironclaw_reborn ran with mold and zero bus-error/OOM — the spike result (#5086) holds on the real heavy workflows. The one transient red during review was an unrelated flaky test (turn_runner_worker_emits_thread_run_correlated_operator_log), which passed on re-run and also flakes on main; tracked separately.

Caveat: reborn-integration.yml only triggers on the reborn-integration branch, so its identical mold change was not exercised by this PR's CI — it will validate on its first run against that branch. Fallback if any job ever OOMs: restore CARGO_BUILD_JOBS: "1" (one-line revert).

Provenance: derived from the measurement spikes in #5086 (mold proven to link the heaviest --all-features workspace build with no OOM).

This branch was successfully deployed

No deployments
ironclaw-ci-preview / ironclaw-pr-5089 — 763c8292 Deployed Jun 19, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: ci CI/CD workflows size: M 50-199 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant