fix: 98% CPU on WSL2 ARM + 10 correctness fixes#32
Merged
Conversation
Root cause: unmuzzled scavenger walks entire workdir tree (including .cargo/registry/ with 50K+ files) through WSL2's 9p (10-100x slower). 12-core Oryon oversubscription (24 tokio+rayon threads) amplifies it. Fixes (6): 1. Filter scavenger WalkDir — skip dep/cache dirs (.cargo, .npm, .cache, etc) 2. Muzzle scavenger by default (AtomicBool::new(true)) 3. Adaptive scavenger backoff (double sleep up to 30min if cycle >60s) 4. Skip heal cargo test on WSL2 drvfs (/mnt/ paths) 5. Cap tokio worker threads to 4 (was 12 on 12-core ARM) 6. Cap rayon global pool to 4 threads (was 12) Correctness fixes (4): - e2e_auth_routing: strip RELIARY_UPSTREAM_URL from daemon spawn env - try_prefetch: spawn_blocking for filesystem I/O in SSE hot path - GUARD_CACHE: add 60s TTL eviction to bound memory growth - GATE_VERSION: align to workspace version, remove false '6 mechanisms' claim All 78 unit + 38 e2e tests pass.
alderpath
added a commit
that referenced
this pull request
Jun 22, 2026
fix: 98% CPU on WSL2 ARM + 10 correctness fixes
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.
Root Cause
Scavenger walks entire workdir tree (including
.cargo/registry/with 50K+ files) through WSL2's 9p filesystem (10-100x slower). 12-core Oryon oversubscription amplifies it — 24 tokio+rayon threads compete for 12 cores.Fixes (6)
cargo testsubprocess on /mnt/ pathsCorrectness fixes (4)
e2e_auth_routing: stripRELIARY_UPSTREAM_URLfrom daemon spawn envtry_prefetch: wrap filesystem I/O inspawn_blockinginside SSE hot pathGUARD_CACHE: add 60s TTL eviction to bound memory growthGATE_VERSION: align to workspace v0.6.5, remove false '6 mechanisms' claimAll 78 unit + 38 e2e tests pass.