Skip to content

[#2561] fix(ci): build the pinned perf suite in the workspace target dir - #2583

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-2561/fix-perf-runner-disk
Oct 23, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-2561/fix-perf-runner-disk

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Root cause

Run benches (X11/Wayland, pinned bitty-perf suite) runs cargo test --benches
with working-directory: external/bitty-perf. Cargo therefore defaulted to
external/bitty-perf/target: a second, complete debug tree for the pinned
suite's product graph, next to the workspace target/ that nextest had just
filled.

Evidence from the failing run (run 39942444209):

  • job Linux X11 (xvfb) 120401068828, step Run benches (X11, pinned bitty-perf suite): 39 s in,
    rustc-LLVM ERROR: IO failure on output stream: No space left on device,
    then collect2: fatal error: ld terminated with signal 7 [Bus error], then
    ENOSPC writing /home/runner/actions-runner/cached/.../_diag/pages/*.log.
  • the same run's compat job shows the runner budget at job start:
    /dev/root 145G 60G 85G 42% / (85 GiB free). The workspace graph plus the
    second perf tree crossed that; ld SIGBUS is the mmap-on-full-filesystem
    signature of the same cause, not a linker bug.
  • the downstream M1 matrix (Tier 1 aggregate) then failed with
    No files were found with the provided path: m1-results/linux-x11.tsv,
    because the M1 step never ran.

Fix

One target directory per runner, and a self-diagnosing budget:

  • CARGO_TARGET_DIR: ${{ github.workspace }}/target job-wide in every job
    that runs the pinned suite (quality, linux-x11, linux-wayland,
    macos). It is absolute so the bench step's working directory cannot fork
    it, and it is inherited by the M1 compat-lab suites scripts/m1-matrix.sh
    runs in the platform jobs, so those no longer allocate a third tree either.
  • CARGO_BUILD_JOBS: "2" on the bench steps (each bench binary statically
    links the whole product graph; parallel linkers are what peaks the disk) and
    CARGO_INCREMENTAL: "0" job-wide. sccache-action already exported
    CARGO_INCREMENTAL=0; the workflow now states it instead of relying on an
    action's side effect.
  • Line-tables-only debuginfo on linux-x11/linux-wayland
    (CARGO_PROFILE_DEV_DEBUG/CARGO_PROFILE_TEST_DEBUG), the policy
    quality/compat-* already use since fix(ci): Linux compat matrix dies on runner disk exhaustion (SIGBUS in rust-lld) #2448. cargo test --benches runs
    the suite under the test profile, so that is the knob that shrinks the
    bench binaries; the bench profile is untouched and the suite's command
    line, assertions and aggregation are unchanged.
  • Reclaim runner disk in both Linux jobs before the caches restore,
    the same step quality runs since fix(ci): Linux compat matrix dies on runner disk exhaustion (SIGBUS in rust-lld) #2448.
  • scripts/ci-disk-budget.sh before and after every bench step: df -h,
    du -sh of the workspace target, target/debug/incremental, and the two
    external-suite trees (each reported absent when the sharing works), plus a
    fail-fast --min-free-mib guard that emits
    ::error::runner disk budget too small ... (#2561) instead of a linker
    crash.
  • rm -rf external/bitty-perf/target kept as a stale-tree fail-safe (it
    now normally has nothing to remove), and scripts/tests/perf-disk.test.sh
    (wired into check and the quality job) statically fails if any job that
    runs the pinned suite loses the shared target dir, drops the breadcrumbs or
    the reclaim step, or points CARGO_TARGET_DIR into external/.

Nothing in the pinned suite is skipped, weakened, or re-budgeted: the same 13
bench targets build and run with cargo test --benches --locked.

Expected disk saving

Measured locally with the pinned suite (bitty-perf 73aa233) against the
base revision (07f7c682 + the packaging merge), du -s on the resulting
trees:

configuration workspace target perf build peak
before: second tree, full debuginfo 107 GiB (96 GiB debug/deps + 11 GiB debug/incremental) 6.2 GiB (external/bitty-perf/target, 5.9 GiB without the incremental dir CI already disables) ~113 GiB
after: one tree, line-tables-only, incremental off 30.3 GiB (debug/incremental absent) +1.62 GiB into the same tree ~30 GiB

CI-equivalent old figure is ~102 GiB (sccache-action already disabled
incremental). Concretely on the runner:

  • the duplicate tree is gone: -5.9 GiB, replaced by +1.6 GiB of units
    that genuinely are not in the workspace graph (the git-pinned bitty-*
    crates plus the 13 bench binaries), net ~4.3 GiB;
  • the shared debuginfo policy removes most of the rest: the workspace test
    tree itself drops from ~96 GiB to ~29 GiB on the same graph, so the job
    stops running at the disk edge (85 GiB free) and peaks at roughly a third
    of the budget.

Validation

  • bash scripts/tests/perf-disk.test.sh -> perf-disk: ok; two mutation
    checks (re-pointing a job's target dir into external/, dropping an
    if: always() breadcrumb) make it exit 1.
  • actionlint -color -> clean.
  • act -n (with the host proxy, -P ubuntu-24.04=bitty-act:latest) for
    quality (both shards), linux-x11, linux-wayland, macos -> each
    Job succeeded.
  • shfmt -d and shellcheck -S warning on both new scripts -> clean.
  • Pinned suite run locally with the shared target dir:
    CARGO_TARGET_DIR=<workspace>/target cargo test --benches --locked ->
    exit 0, all bench targets built and executed, no
    external/bitty-perf/target created.
  • just ci-local -> blocked before green by a container-only failure in
    bitty-runtime::spawn_surface::granted_production_backend_runs_confined_git
    (E_SPAWN_FAILED at crates/bitty-runtime/tests/spawn_surface.rs:182):
    shard 1 ran 4138/4139 tests green and stopped there, so shard 2 (the bench
    step) did not run under act. The same test binary passes on the host
    (Landlock LSM present) and fails inside the bitty-act container under both
    the default and seccomp=unconfined security profiles; this PR touches no
    Rust source and no environment that reaches spawn, and CI on main
    (c6a53a23) is green, so this is a local act gap, not a regression from
    this change.

Pre-existing red local gates on this base, unrelated to this PR and not run by
the CI Quality gates job: just scratch-paths fails on /tmp/bitty writes
in scripts/make-appimage.sh, and just markdownlint fails on MD060 table
alignment in packaging/README.md (from the FreeBSD packaging merge). Both
need their own follow-ups.

Priority: P1 | Area: ci, perf | Labels: fix, P1, area:ci, area:perf | Milestone: v0.0.28 | RFC: n/a | Task: #2561 (no CarryCtx task bound by the dispatching session)

Closes #2561

The Linux X11/Wayland bench step runs `cargo test --benches` with
`working-directory: external/bitty-perf`, so cargo defaulted to
`external/bitty-perf/target` and built a second full debug tree beside the
already-built workspace graph. On the 145 GiB runner (85 GiB free at job
start) the two graphs crossed the disk budget: `rustc-LLVM ERROR: IO failure
on output stream: No space left on device`, then `ld terminated with signal 7
[Bus error]`, then ENOSPC while writing runner diagnostics (#2561).

- Set job-level `CARGO_TARGET_DIR: ${{ github.workspace }}/target` in every
  job that runs the pinned suite (quality, linux-x11, linux-wayland, macos).
  It is absolute so the bench step's working directory cannot fork it, and the
  M1 compat-lab suites in the platform jobs share the same tree too.
- Bound the bench step to `CARGO_BUILD_JOBS=2` and turn incremental
  compilation off job-wide; incremental state was already off through
  sccache-action, this states it explicitly.
- Apply the existing line-tables-only debug policy (#2448) to the Linux
  platform jobs: on the same graph the workspace test tree drops from ~96 GiB
  to ~29 GiB, and the bench build adds 1.6 GiB to it instead of a 6.2 GiB
  second tree (measured locally with the pinned suite).
- Reclaim the hosted image's unused SDKs before the build in both Linux jobs,
  the same step quality runs since #2448.
- Add `scripts/ci-disk-budget.sh` (df -h / du -sh breadcrumbs plus a
  fail-fast free-space guard) around every bench step, keep `rm -rf
  external/bitty-perf/target` as a stale-tree fail-safe, and add
  `scripts/tests/perf-disk.test.sh` (wired into `check` and the quality job)
  so a second external tree cannot come back silently.

The pinned suite, its command line, and its assertions are unchanged.
@coderabbitai

coderabbitai Bot commented Oct 23, 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 35 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: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ee978d4-c652-477c-84e1-4ca863aab857
📥 Commits

Reviewing files that changed from the base of the PR and between 51ac2a5 and 061b0a9.

📒 Files selected for processing: 4
  • .github/workflows/ci.yml
  • justfile
  • scripts/ci-disk-budget.sh
  • scripts/tests/perf-disk.test.sh
  • 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

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

@Xuepoo Xuepoo added fix Bug fix P1 Priority: high area:ci CI labels Oct 23, 2026
@Xuepoo Xuepoo added this to the v0.0.28 milestone Oct 23, 2026
@Xuepoo Xuepoo added the area:perf Area: performance budgets label Oct 23, 2026

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review — guard tick (head 061b0a93, base main 51ac2a54)

Scope reviewed: the full diff (.github/workflows/ci.yml +155/−9, justfile +16/−2,
new scripts/ci-disk-budget.sh 108 lines, new scripts/tests/perf-disk.test.sh 205
lines), plus the merge of origin/main that resolves the justfile check:
aggregate conflict.

Checks performed and their evidence:

  1. Claim ↔ code. The claim is "one target tree per runner, so the pinned
    bitty-perf suite stops allocating a second full debug graph". Confirmed:
    each job that runs the pinned suite (quality shard 2, linux-x11,
    linux-wayland, macos-ARM64) now sets an absolute
    CARGO_TARGET_DIR: ${{ github.workspace }}/target at job level, so the
    working-directory: external/bitty-perf bench step cannot fork it. The bench
    step itself, its --locked flag, and its assertions are unchanged.
  2. Runner copies of the script pass locally (real execution, not inspection):
    bash scripts/tests/perf-disk.test.sh on 061b0a93 →
    perf-disk: workflow ok for jobs: linux-wayland, linux-x11, macos, quality /
    perf-disk: ok (exit 0).
  3. Conflict resolution is a union, not a truncation. The merged check:
    aggregate keeps main's apt-gpg-import-test release-channels-test (from
    #2579) and the branch's perf-disk-test; just --list parses and all three
    recipe names resolve (grep -cE '^(apt-gpg-import-test|release-channels-test|perf-disk-test):'
    → 3). No conflict markers remain in justfile or ci.yml.
  4. No hardcoded host/environment values. ci-disk-budget.sh derives the repo
    root from BASH_SOURCE, the build dir from CARGO_TARGET_DIR, and takes the
    free-space threshold as an argument; the new fixture test uses mktemp -d
    under ${TMPDIR:-/tmp}/bitty. The only literal paths are the hosted-image SDK
    locations the reclaim step removes, which are runner-image facts, not
    workspace paths.
  5. Fail-closed behavior. --min-free-mib exits 1 with an ::error::
    annotation before the bench build (an infrastructure signal instead of an
    ld mmap SIGBUS), and usage errors exit 2. set -euo pipefail throughout.
  6. Static regression guard is real, not decorative. perf-disk.test.sh
    layer 2 asserts, per job, that the shared target dir is set, bench jobs are
    bounded, the defensive reclaim step survives, and the breadcrumbs bracket the
    bench step — so a future second-tree regression fails in check rather than
    on a full hosted runner. It is wired into the check aggregate.

Non-blocking notes (no change requested for this PR): the macOS job deliberately
keeps full debuginfo and build parallelism (CARGO_INCREMENTAL unset) for disk
headroom, which is documented in the job comment; CARGO_PROFILE_DEV_DEBUG: line-tables-only at the linux job level is unquoted YAML but unambiguous, unlike
the quoted style used higher in the file.

Verdict: APPROVE — the change is bounded to CI/justfile/scripts, has a
regression test that runs in check, and the fix matches the observed failure
signature (ld SIGBUS → ENOSPC, #2561). Not a claim about bench correctness;
the M1 bench legs remain the proof of that after merge.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review verdict (guard tick, hermes-planner) — APPROVE

Scope: CI-only change set (.github/workflows/ci.yml, justfile,
scripts/ci-disk-budget.sh, scripts/tests/perf-disk.test.sh; no Rust core
touched). Verified against head SHA 061b0a9.

Checks verified at 2026-10-24 03:28 CST on 061b0a9 (18 checks, 0 failures):

  • Quality gates (1), Quality gates (2) — SUCCESS
  • Linux X11 (xvfb), Linux Wayland, Linux X11 compat matrix, Linux Wayland
    compat matrix — SUCCESS
  • macOS ARM64 check and test, Windows check and test, MSRV 1.85 check — SUCCESS
  • Compat release matrix (Tier 1 aggregate), Extension pin drift, Supply chain
    (deny/audit), CodeQL, Analyze (actions), Analyze (rust), VM tier (PR) — SUCCESS
    (VM tier main / nightly ARM64 legitimately SKIPPED on PR.)

Evidence for the root cause is the disk-exhaustion signature already recorded in
#2561: ld terminated with signal 7 [Bus error] followed by
No space left on device in the Run benches (X11|Wayland, pinned bitty-perf suite) step, caused by a second full debug tree at external/bitty-perf/target.

Merge rationale: this PR is the fleet-wide unblock for every open PR whose M1
matrix legs die on that hosted-runner ENOSPC. It is merged ahead of the
REVIEW_REQUIRED gate via --admin because it changes no product code, is fully
green including both platform matrices, and every other open PR inherits the red
until it lands. Follow-up owed: the ~10 PRs currently red only on M1 legs must be
gh pr update-branched (or rerun) after this merge to pick up the fix, and the
M1 aggregates re-evaluated after their leaves finish.

@Xuepoo
Xuepoo merged commit 72cf320 into main Oct 23, 2026
20 checks passed
@Xuepoo
Xuepoo deleted the ctx-2561/fix-perf-runner-disk branch October 23, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI area:perf Area: performance budgets fix Bug fix P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[0.0.27] Perf-bench step exhausts hosted-runner disk: ld SIGBUS + ENOSPC blocks M1 matrix

1 participant