ra-jit for our Rust builds
Answer me with artifact · 2026-10-21 00:04

New version 0.5.6

You have 0.5.5. Found when this page was made.

What's new:

Run in a terminal:

npx skills update answer-me-with-html -y

Or tell your agent:

Update answer-me-with-html
See what's new

ra-jit for our Rust builds

A

Build in the main checkout instead?

Faster, but it builds the wrong code

The main checkout already has a warm 31 GB target/, so a build there is fast. But that checkout is shared. It has 1,050 uncommitted changes from other sessions, so a build there does not build your branch. It is also one build directory, so builds wait in line for its lock.

B

Why each worktree starts from scratch

Fact Effect
Each worktree gets its own target/ All dependencies compile again
31 worktrees, 3 with a target/ (5.6, 14, 31 GB) Cleanup removes the warm caches
54 GB free, disk 94% full We can't keep a warm copy per worktree
C

Fix 1: shared compiler cache

sccache keeps each compiled dependency once, for the whole Mac. A new worktree reuses those results and does not compile them again. Its own crates still compile. It plugs into our existing rustc-gate limit, so the 8-slot cap stays. Not installed yet.

D

Fix 2: clone the warm cache into new worktrees

APFS can copy the main target/ instantly, without using extra disk until files change. A new worktree then starts warm. This needs a test to confirm that cargo reuses the copied dependencies.

E

Does the copy fill the disk?

Test on this Mac Free space change
Write a 1 GB file -0.9 GB
Clone it (cp -c) about 0 (128 KB)

The clone shares the same blocks on disk. A worktree uses new space only for files it rebuilds, mostly its own crates. That is less than a fresh build writes today (5.6–31 GB). du counts every clone at full size, so check space with df.

Caveats: the shared blocks stay on disk until every copy that uses them is deleted. sccache saves time, not space: each worktree still writes a full target/, and the cache adds about 20 GB.

F

Dropped: faster linker

This Mac already uses Apple's new linker (ld-1115), which is fast. A different linker would save little, so it's not worth it.

G

Next step

  • A release build is running now, so the test waits until it ends.
  • Test: build one fresh worktree three ways (cold, with sccache, with a cloned cache) and compare the times.
  • Then turn on the winner for all agents. This changes ~/.cargo/config.toml and rustc-gate for everyone, so you OK it first.