Repository navigation
perf(engine): parallel union-find (Afforest) for algo.wcc (#9133) - #9135
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthrough
ChangesConnected Components
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to Connected components now uses a faster parallel union-find while keeping the minimum-node-ID component results. Broad regression tests check its results against reference implementations. The review found no concrete defect. The benchmark measurements against the LDBC Graphalytics reference graphs are still pending. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new computation preserves the existing inputs, outputs, and access path. No privilege expansion or broader data exposure was identified. Failure cleanup and execution against concurrently changing graph views remain incompletely validated. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 16 |
🟢 Coverage 100.00% diff coverage · -5.68% coverage variation
Metric Results Coverage variation ✅ -5.68% coverage variation Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (33605b7) 210213 178315 84.83% Head commit (c57c8ee) 243402 (+33189) 192652 (+14337) 79.15% (-5.68%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#9135) 73 73 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Review: parallel union-find (Afforest) for
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9135 +/- ##
============================================
+ Coverage 76.57% 76.74% +0.16%
- Complexity 3906 3914 +8
============================================
Files 2117 2118 +1
Lines 210213 210802 +589
Branches 44483 44645 +162
============================================
+ Hits 160981 161771 +790
+ Misses 31938 31683 -255
- Partials 17294 17348 +54 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…hase, add re-hook test (#9133)
Review: parallel union-find (Afforest) for
|
…), Javadoc wording (#9133)
|
Review: parallel union-find (Afforest) for Overall this is a solid change. I traced the algorithm and the concurrency and found no correctness bugs. Correctness (checked)
Tests
Performance / nits
No security concerns. The change adds no dependencies and keeps memory at one |
Review: parallel union-find (Afforest) for
|
…s case, Javadoc (#9133)
Review: parallel union-find (Afforest) for
|
…test sampling dependency (#9133)
Review: parallel union-find (Afforest) for
|
Review: parallel union-find (Afforest) for
|
Review: parallel union-find (Afforest) for
|
Fixes #9133
Replaces the synchronous min-label propagation in
GraphAlgorithms.connectedComponentswith a lock-free parallel union-find with neighbour sampling (Afforest): sample 2 forward neighbours per node and type, pick the dominant root from 1024 sampled nodes, then finish only the nodes outside it using the remaining forward edges plus backward edges. Larger roots are always CAS-hooked under smaller ones, so the component id stays the min node id and callers are unchanged. Memory: oneint[n]. The kernel now also exists as a package-private overload over raw CSR arrays so tests control node ids exactly.The backward direction in the finish phase is required for correctness on directed CSRs: a node reachable from the giant component only by an incoming edge would otherwise be skipped. The giant root is re-resolved per node because phase 3 can re-hook it under a smaller id.
Tests (GraphAlgorithmsTest, 29 green, AlgoWCCTest green): randomized parallel-sized graphs checked against a sequential reference (end-to-end through a GAV with two edge types, and at CSR level for: giant with incoming-only satellites, lowest-id satellite re-hooking the giant root, many small components above the parallel threshold), plus self-loops, parallel edges, single node, and an edge type subset.
Local measurement (300k nodes, 3M skewed edges, warm): about 7.5 ms before, about 2.5 ms after. LDBC graph500-22 and datagen-7_5-fb numbers still to be measured with the Graphalytics harness.
Summary by CodeRabbit