fix(rustc): stop seeding incremental state from other checkouts #943
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.48) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 502 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #943"
general
weight: 0.35
jbellis
mbx used to seed a checkout's first private incremental compile of a unit by copying another checkout's incremental state for the same unit. This PR removes seeding. Each checkout now keeps only its own incremental state.
Why: rustc does not treat a finished incremental session as immutable. With local ThinLTO, a new session hard-links the previous finished session's files and then rewrites
thin-lto-past-keys.binand each recompiled unit's.pre-lto.bcin place. A seed copied while the donor's rustc was doing that mixed files from two sessions. On a host running many agent worktrees, that produced rlibs that failed to link, with undefined symbols such asanon.<hash>.<n>.llvm.<n>, or drop glue and generic methods. Earlier, hard-linked seeds corrupted their donors (#784). Meanwhile, on real agent lanes, seeded compiles measured no faster than compiles that started empty: only about a third of first private compiles found a donor at all. Keeping seeding correct would need a writer protocol layered over rustc's internal session format, so this PR removes it instead.Removed:
-Zremap-cwd-prefix=.flag mbx injected to make state portable, together with the child-scopedRUSTC_BOOTSTRAP, the probe that checked rustc accepts the flag, the related-Zrules, and the retries it needed;A
-Zremap-cwd-prefixyou pass yourself goes to rustc unchanged.Kept:
target.seed, which copies registry build units between managed target directories and is unrelated.Upgrading:
-Zremap-cwd-prefixthemselves, is never reused. Each checkout's next private compile of a unit starts empty, and collection removes the old units.seed_incrementalandMBX_SEED_INCREMENTALare still accepted, so existing configuration stays valid. They have no effect. Setting either in the configuration file or the environment makes mbx commands log a warning, "seed_incremental has no effect; seeding from other checkouts was removed", in the same way as the retiredlearned_incremental_max_size.incremental_statenow records onlyexistingorcold, andmbx analyzereports state reused from the checkout versus started empty.Validation:
mise run cion Linux passes apart from three bats tests that fail the same way onmainon the same host: C object restore, gdb debug objects, and objects keeping absolute source paths. Specifically:cargo test -p mbx --lib(1340),-p mbx-cache-core, and--test build(141) pass;This conflicts with #942 in
crates/mbx/tests/build.rs, since both edit the seeding end-to-end tests. Whichever merges second needs a small update.AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.
🤖 Generated with Claude Code
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Behavior Changes
Cross-checkout reuse of private incremental state has been removed. Incremental state now comes from the current checkout’s saved state or starts empty.
The
seed_incrementalsetting remains accepted for compatibility but has no effect.State collection now uses active checkout leases to protect in-use data. Reports describe empty starts without seeded-state details.
Documentation
Updated configuration, analysis, incremental-state, managed-target, and troubleshooting guidance to reflect these changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->