Skip to content

Rust: Size the proc-macro server pool from the extraction threads - #23333

Open
redsun82 wants to merge 2 commits into
redsun82-congenial-potatofrom
redsun82-turbo-garbanzo
Open

redsun82 wants to merge 2 commits into
redsun82-congenial-potatofrom
redsun82-turbo-garbanzo

Conversation

@redsun82

@redsun82 redsun82 commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 3d17a2400083818bf742985ff86285b83922222f

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Pinned rust-analyzer 0.0.358 pool serializes requests per process and routes to the least-loaded live one.
↑ Unit test pins pool size for 0/1/2/4/32 threads; fails if hardcoded back to 1.
↑ path-resolution results identical at 1 and 8 threads (1 vs 4 server processes, none left over).
↓ No benchmark of this layer alone; proc-macro QL tests not re-run on this exact head; CI pending.
↑ Restacked unchanged onto L3 4d971dc (L2 CI step plus L3 log wording only); fmt, clippy and 23/23 unit tests pass on this head.
↓ CI on this head pending.

Stacked on #23330.

Parallel extraction workers otherwise all queue on a single proc-macro server. proc_macro_processes now follows the extraction threads, capped at 4 because every server process loads every proc-macro dylib. A single thread still uses one process.

@redsun82
redsun82 requested review from a team as code owners December 2, 2026 14:56
Copilot AI adaptive review requested due to automatic review settings December 2, 2026 14:56
@github-actions github-actions Bot added the Rust Pull requests that update Rust code label Dec 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Running up to four proc-macro processes per workspace changes expansion concurrency and replicates dylib memory, requiring broader validation of correctness and resource use.

No open issues 🎉

What changed in this PR

Sizes the Rust extractor’s proc-macro server pool to support parallel extraction while limiting memory overhead.

Changes:

  • Pass the extraction thread count into configuration creation.
  • Clamp the pool size to 1–4 processes.
File Description
rust/​extractor/​src/​main.rs Passes extraction threads into configuration creation.
rust/​extractor/​src/​config.rs Sizes and caps the proc-macro server pool.

Review effort: Max (adaptive)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Tests do not verify pool sizing for 1, 2, and >4 threads or macro expansion with multiple servers, allowing a regression to one process to go undetected.

1 open issue

Review effort: Max (adaptive)

Comment thread rust/extractor/src/config.rs Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Moving to multiple proc-macro processes changes execution isolation and scheduling while multiplying dylib memory use, exceeding the limited-consequence approval scope.

No open issues 🎉

1 resolved since last review

Review effort: Balanced (adaptive)

Paolo Tranquilli and others added 2 commits December 3, 2026 10:17
Parallel extraction workers otherwise all queue on a single proc-macro
server. Use up to four server processes, as each loads every proc-macro
dylib.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Concurrent proc-macro expansion across up to four server processes changes process-local state sharing and multiplies dylib memory use, requiring runtime validation beyond a limited-scope review.

No open issues 🎉

Review effort: Max (adaptive)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants