Repository navigation
docs(audits): static analysis of drain_parallel Mutex contention - #3699
Merged
Merged
Conversation
Captures the load-bearing facts a runtime profile of #1679 will then quantify: every Mutex::lock() site reachable from drain_parallel is enumerated, the per-thread Vec mitigation from #1680 is shown to be contention-free in steady state, and three alternative designs (single Mutex, per-thread Vec, lock-free MPSC) are compared with file:line citations. Recommends deferring #1681 until #1679 measures the sharded design at W=32 / 64.
3 tasks
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…nalysis (#1192) Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace, focused on the parallel stat hot path. Confirms parallel stat does not allocate any shared mutex-guarded accumulator: map_blocking delegates to rayon's into_par_iter().map().collect() with per-task buffers internal to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel shards), only the third is on a rayon hot path and is sharded already. Cites the just-merged drain-side audit (PR #3699) for the drain-shards analysis, scopes #1192 to runtime profiling needed for closure, and lists mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
…nalysis (#1192) (#3727) Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace, focused on the parallel stat hot path. Confirms parallel stat does not allocate any shared mutex-guarded accumulator: map_blocking delegates to rayon's into_par_iter().map().collect() with per-task buffers internal to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel shards), only the third is on a rayon hot path and is sharded already. Cites the just-merged drain-side audit (PR #3699) for the drain-shards analysis, scopes #1192 to runtime profiling needed for closure, and lists mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
3 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Captures the load-bearing facts a runtime profile of #1679 will then quantify: every Mutex::lock() site reachable from drain_parallel is enumerated, the per-thread Vec mitigation from #1680 is shown to be contention-free in steady state, and three alternative designs (single Mutex, per-thread Vec, lock-free MPSC) are compared with file:line citations. Recommends deferring #1681 until #1679 measures the sharded design at W=32 / 64.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
…nalysis (#1192) (#3727) Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace, focused on the parallel stat hot path. Confirms parallel stat does not allocate any shared mutex-guarded accumulator: map_blocking delegates to rayon's into_par_iter().map().collect() with per-task buffers internal to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel shards), only the third is on a rayon hot path and is sharded already. Cites the just-merged drain-side audit (PR #3699) for the drain-shards analysis, scopes #1192 to runtime profiling needed for closure, and lists mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
5 tasks
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Captures the load-bearing facts a runtime profile of #1679 will then quantify: every Mutex::lock() site reachable from drain_parallel is enumerated, the per-thread Vec mitigation from #1680 is shown to be contention-free in steady state, and three alternative designs (single Mutex, per-thread Vec, lock-free MPSC) are compared with file:line citations. Recommends deferring #1681 until #1679 measures the sharded design at W=32 / 64.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…nalysis (#1192) (#3727) Static analysis of every Arc<Mutex<Vec<...>>> remaining in the workspace, focused on the parallel stat hot path. Confirms parallel stat does not allocate any shared mutex-guarded accumulator: map_blocking delegates to rayon's into_par_iter().map().collect() with per-task buffers internal to rayon. Three production sites remain (SSH stderr drain x2, drain_parallel shards), only the third is on a rayon hot path and is sharded already. Cites the just-merged drain-side audit (PR #3699) for the drain-shards analysis, scopes #1192 to runtime profiling needed for closure, and lists mitigations to evaluate only if profiling surfaces a residual Mutex<Vec>.
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
docs/audits/drain-parallel-contention-static-analysis.md,a code-grounded static analysis of
drain_parallelMutexcontention that addresses task Fix Windows GNU EH shim exports #1679 ahead of runtime profiling.
Mutex::lock()site reachable from the resultcollection path with file:line citations, distinguishing hot-path
(per-result), batched, and shutdown-class acquisitions.
Mutex<Vec>, per-thread Vecwith final merge, lock-free MPSC channel) with code-grounded
evidence for and against each, derives a parameterised contention
formula at W=8/16/32/64, and recommends deferring Refactor daemon CLI into dedicated module #1681 until
Fix Windows GNU EH shim exports #1679 has measured the sharded design at W=32 / 64.
Touches docs only. No code changes.
Test plan
hyphen prose style).
commit (
crates/engine/src/concurrent_delta/work_queue/drain.rs,consumer.rs,delta_pipeline.rs, bench harnesses).run since no Rust source is touched.