Skip to content

ci: keep the Bun crash loop inside its budget and default to the focused file - #312

Merged
roodboi merged 2 commits into
nextfrom
wf/bun-loop-b9
Oct 12, 2026
Merged

roodboi merged 2 commits into
nextfrom
wf/bun-loop-b9

Conversation

@roodboi

@roodboi roodboi commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

The HACK-1211 hosted experiment (PR #297) ran on Bun 1.3.9 and 1.4.2 with a 30-minute budget. Each run produced only 2 iterations: one focused pass (~16.5 s) and one full bun test that ran into the deadline (overrun, ~1783 s). The full suite was started on a 600 s estimate, but it takes about 30-35 minutes on hosted macOS.

What changes

Budget (scripts/bun-crash-loop.ts)

  • An iteration starts only when its estimate ends at or before the deadline. Before a command completes a run, its estimate is a conservative prior: 120 s for focused, and now 2400 s for full (up from 600 s). After that, the estimate is the longest completed run times 1.2.
  • A command that does not fit is recorded once in summary.json → skippedForBudget (with the estimate and the remaining time), and it leaves the rotation. Without a run its estimate cannot change, and the remaining budget only shrinks, so it could never fit again.
  • The deadline stop stays as a safety net. It is still recorded as overrun and never counts as a crash unless the crash banner is in the log.

Modes

  • --mode=focused|full|alternate, default focused. Focused mode runs only tests/native-https-owner.test.ts, the file where both original segfaults happened.
  • --role=baseline|candidate (optional). It is used only in the verdict.

Workflow (.github/workflows/bun-crash-experiment.yml)

  • New mode choice input for dispatch. The plan job validates it and rejects full with a budget_minutes under 40, because no run could start.
  • The label-triggered matched pair uses focused, with roles baseline (1.3.9) and candidate (1.4.2). The matrix is now include entries of {bun_version, role}.
  • The job timeout is still budget + 15.

Summary

  • summary.json gains verdict, mode, role, counts per command (iterations, passes, crashes, failures (other failures), overruns, skippedForBudget) and skippedForBudget records. The step summary shows the same counts and the verdict.
  • Example verdicts: baseline 0/97 focused crashes, Bun 1.4.2 0/40 focused crashes, 0/1 full crashes, candidate 0/0 full crashes; no iteration fit the budget.

Classifier (scripts/lib/bun-crash-classify.ts)

  • Exit statuses 134 (SIGABRT) and 138 (SIGBUS) now count as crash exits, along with 133 and 139. Signal deaths were already crashes. The census shares this classifier, so a hosted job that exits with 134 or 138 now counts as a crash there too.

Test semantics, assertions and socket behavior of the tested suite are unchanged. The harness still runs plain bun test / bun test <file>.

Validation

  • bun test tests/bun-crash-loop.test.ts tests/ci-bun-crash-census.test.ts tests/agent-instruction-source.test.ts: 52 pass. New tests use an injected clock and an injected executor. The executor stops at the deadline, so starting a run that cannot fit would show up as an overrun. The tests cover:
    • the hosted shape (30-minute budget, alternate mode, 16.5 s focused, 35-minute full): 108 focused runs, the full suite never starts, both skips recorded, no overrun;
    • estimates moving from the prior to measured durations;
    • focused mode running only the owner file;
    • full mode below the prior starting nothing;
    • injected crashes (banner, SIGSEGV, SIGBUS, exit 134) counted as crashes, and exits 1 and 2 counted as other failures;
    • counts and verdict text;
    • JSON and Markdown summaries staying value-free.
  • Mutation check: when the start-fits-budget condition is removed, 8 tests fail.
  • No test sends a crash signal or runs a real loop. The existing executeWithLog test still checks that no bun*.ips report appears.
  • Pinned actionlint@1.7.12 on the CI workflow set: clean.
  • I ran the plan step's shell locally for the label, dispatch focused, dispatch full at 30 minutes (rejected), dispatch full at 45 minutes and an invalid mode. I also checked how the loop step expands its arguments: --role is passed only when a role is set.
  • bun run --cwd packages/cli typecheck, bun run --cwd packages/cli check, Biome on the changed files and bun run privacy:check: all pass.

Not done / gates

  • I have not dispatched the experiment or labelled any PR. The new behavior is proven by unit tests and a local run of the plan shell, not by a hosted run. A real matched pair still needs an explicit go-ahead, because it spends about 45 hosted macOS minutes per Bun version.
  • The workflow's full-mode budget floor (40 minutes) copies DEFAULT_FULL_ESTIMATE_SECONDS. If one changes, the other must change too (both places have a comment saying so).

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…sed file

The HACK-1211 experiment produced two iterations per Bun version: one
focused pass and one full `bun test` that started on a 600 s estimate and
overran the 30-minute budget, because the full suite takes 30-35 minutes
on hosted macOS.

- Never start an iteration whose estimate exceeds the remaining budget.
  The estimate is a conservative prior (focused 120 s, full 2400 s) until a
  run completes, then the longest completed run times 1.2. A command that
  does not fit is recorded once in summary.json `skippedForBudget` and
  leaves the rotation. Deadline stops remain a safety net (`overrun`).
- Add `--mode=focused|full|alternate` (default focused: only
  tests/native-https-owner.test.ts) and `--role=baseline|candidate`.
- The workflow gains a validated `mode` dispatch input; the label-triggered
  matched pair uses focused with baseline/candidate roles. Full mode needs a
  budget of at least 40 minutes. The job timeout stays budget + 15.
- summary.json gains per-command counts (iterations, passes, crashes, other
  failures, overruns, skipped-for-budget) and a one-line verdict such as
  "baseline 0/97 focused crashes".
- The shared classifier also treats exit 134 (SIGABRT) and 138 (SIGBUS) as
  crash exits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi roodboi added the bun-crash-experiment Runs the HACK-1211 Bun crash experiment (hosted macOS minutes) label Oct 12, 2026
@blacksmith-sh

This comment has been minimized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi
roodboi marked this pull request as ready for review October 12, 2026 21:10
@roodboi
roodboi merged commit e13501a into next Oct 12, 2026
14 of 17 checks passed
@roodboi
roodboi deleted the wf/bun-loop-b9 branch October 12, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bun-crash-experiment Runs the HACK-1211 Bun crash experiment (hosted macOS minutes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant