Skip to content

agent-browser: drop codegen-units=1 and fat LTO; build under detbuild - #1743

Open
bryan-minimal wants to merge 1 commit into
mainfrom
agent-browser-build-speed
Open

bryan-minimal wants to merge 1 commit into
mainfrom
agent-browser-build-speed

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

What

agent-browser's Rust build ran on one core. RUSTFLAGS forced -C codegen-units=1 on every crate, on top of upstream's cli/Cargo.toml release profile (lto = true (fat), codegen-units = 1). agent-browser is one of the most often rebuilt packages, at about 118 builds in 2 weeks. This PR:

CONST_RANDOM_SEED=0, the Next.js generateBuildId pin, --remap-path-prefix, and upstream strip = true are unchanged.

This is independent of #1716 (the 0.45.0 bump): the two touch different lines, and the release profile is the same at 0.44.0 and 0.45.0.

Why

Under the codex precedent (#1713), cgu=1 isn't needed for reproducibility once the entropy shim is in place.

Build time

before (main) this PR
build-bot arm64 wall / CPU 305–358 s / 460–506 s 98 s / 548 s
build-bot amd64 wall / CPU 316–396 s / 475–592 s 105 s / 681 s
build-bot artifact bytes ~106–112 MB 120 MB
local min box (6 CPU), two runs - 100 s, 94 s

Build-bot numbers come from res-server's wall_s / cpu_lower_bound_s journal fields. The baseline is main's builds from the last 2 days; this PR's are from run ba23da9f. Both include the dashboard build.

Reproducibility evidence

I ran two clean local --rebuilds, each in a freshly activated session (arm64):

  • run 1: b6adcd5a282ba319794a69550354fa11f09c6f33cc02d31f5eee5fbdc266a0c2, 24,779,312 B
  • run 2: b6adcd5a282ba319794a69550354fa11f09c6f33cc02d31f5eee5fbdc266a0c2, 24,779,312 B

The two binaries are byte-identical, with the dashboard embedded.

Runtime trade-off

Fat LTO with cgu=1 usually gives a binary a few percent faster than thin LTO over 16 units. The CLI is mostly waiting on Chromium over CDP, so this PR accepts that.

🤖 Generated with Claude Code

…/detbuild

RUSTFLAGS forced -C codegen-units=1 on every crate on top of upstream's fat
LTO / cgu=1 release profile, so the Rust build ran on one core. Build at thin
LTO over 16 units with v0 mangling, fetch crates first, and run the offline
build under packages/detbuild, the codex recipe (#1713). The dashboard build
is not under the shim. build.sh echoes the binary's sha256 so two builds can
be compared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 48 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 59 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f44b00d and 7324f2a.

Files selected for processing: 2

  • packages/agent-browser/build.ncl
  • packages/agent-browser/build.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@bryan-minimal

Copy link
Copy Markdown
Member Author

Build-bot minimal build green (run ba23da9f): wall arm64 98 s (was 305–358 s), amd64 105 s (was 316–396 s), dashboard included. Local double build sha256 b6adcd5a…6a0c2 both runs (24,779,312 B), byte-identical.

@bryan-minimal
bryan-minimal marked this pull request as ready for review November 26, 2026 22:07
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 26, 2026 22:07
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