Repository navigation
fix: preserve Cargo context in parallel Rust resolution - #1850
Merged
Merged
Conversation
Signed-off-by: Martin Vogel <[email protected]>
DeusData
force-pushed
the
fix/issue-56-rust-parallel-cargo-context-resume
branch
from
August 27, 2026 19:17
bafe4f3 to
0f1e65d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
References #56.
Root cause
The sequential cross-LSP driver built Cargo workspace context, but direct cbm_parallel_resolve workers had no manifest in their thread-local resolver state. In addition, the parallel eligibility heuristic skipped cross-LSP when a same-named local function had already produced a high-confidence result. That local result could then out-rank the correct workspace-member target.
Alternatives and trade-offs
Selected: build the manifest once on the coordinator, borrow it read-only for the worker lifetime, install it in worker TLS, and clear TLS before teardown. This preserves the existing cbm_parallel_resolve public signature, avoids repeated filesystem parsing, and matches the resolver's existing thread-local interface.
Alternatives considered:
The selected fix adds a cross-LSP pass for Rust workspace files with semantic sites even when per-file results appear complete. That is bounded extra work in exchange for Cargo-qualified correctness; generated-file exclusions remain intact, and the manifest is parsed only once.
Deterministic proof
On exact main 909051c:
Validation
Platform caveat
The full local-CI run completed on macOS arm64. Linux arm64/amd64 and real-Windows local legs were not run in this isolated package; the PR remains unmerged for downstream platform CI and review.