threads: Honour `JULIA_CPU_THREADS` for `auto`, pin `JULIA_EXCLUSIVE` threads within the affinity mask #64613
All Vouch review confidence checks passed
Residual risk 0.13 = Change Risk (0.36) × (1 − Review Confidence (0.64)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 191 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 70%
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.315
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #64613"
general
weight: 0.35
maleadt
--threads=autoignoredJULIA_CPU_THREADS, unlikeSys.EFFECTIVE_CPU_THREADS:On a 128-core CI host with
cpu.weightshares andJULIA_CPU_THREADS=12, tests that startjulia --threads=autoran 128 compute plus 127 GC threads, and i686 ran out of address space at startup.First commit.
jl_effective_threads()now also takes the minimum withJULIA_CPU_THREADS, parsed as Base parses it. That fixes--threads=auto,JULIA_NUM_THREADS=auto,--procs=auto, the default GC thread count and the AOT compilation thread count.Second commit.
JULIA_EXCLUSIVE=1pinned default-pool threads to CPUs 0 to N-1, ignoring the inherited affinity mask. It now uses the mask's CPUs in order:The default-pool size is now checked against the mask's CPU count, not against
Sys.EFFECTIVE_CPU_THREADS: pinning needs a CPU per thread, not a share of theautobudget. SoJULIA_CPU_THREADS=1 JULIA_EXCLUSIVE=1 julia -t2works when the mask has two CPUs. Where the mask can't be read (macOS), threads still go to CPUs 0 to N-1, now checked against the hardware CPU count.This does not address the issue's proposal to cap compute plus GC threads on 32-bit systems.
Fixes #64612
Assisted by: Opus 5.5, Sol 6.1