Exercise MST concurrency safety (#201) - #225
Draft
leynos wants to merge 1 commit into
Draft
Conversation
Exercise the striped-lock union-find from simultaneous worker threads and compare its final partition with a scalar oracle. Verify that parallel Kruskal returns the identical forest from dedicated one- and eight-thread Rayon pools, independent of the coverage-ratchet thread pin.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can activate billing to continue. Comment |
Reviewer's GuideThe PR closes the MST concurrency-coverage gap by adding a barrier-synchronized, contended union-find stress test and explicit one-versus-eight-thread Rayon determinism properties, while retaining the CI Rayon pin solely for reproducible coverage-ratchet results. Sequence diagram for concurrent union-find stress testsequenceDiagram
participant Test
participant Workers as std::thread workers
participant Barrier
participant UnionFind as ConcurrentUnionFind
participant Oracle as Sequential oracle
Test->>Workers: spawn thread_count workers
Test->>Barrier: wait()
Workers->>Barrier: wait()
Barrier-->>Workers: release simultaneously
loop assigned edges
Workers->>UnionFind: try_union(left, right)
UnionFind-->>Workers: Result<bool, MstError>
end
Workers-->>Test: join()
Test->>UnionFind: root_of(node)
Test->>Oracle: sequential_oracle(edges)
Test->>Test: compare normalized labels and components
Sequence diagram for Rayon thread-pool determinism propertysequenceDiagram
participant Property
participant OnePool as Rayon pool: 1 thread
participant EightPool as Rayon pool: 8 threads
participant Kruskal as parallel_kruskal
Property->>OnePool: install(|| parallel_kruskal(...))
OnePool->>Kruskal: parallel_kruskal(node_count, harvest)
Kruskal-->>OnePool: one_thread_forest
OnePool-->>Property: result
Property->>EightPool: install(|| parallel_kruskal(...))
EightPool->>Kruskal: parallel_kruskal(node_count, harvest)
Kruskal-->>EightPool: eight_thread_forest
EightPool-->>Property: result
Property->>Property: assert forests are equal
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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
This branch makes MST concurrency coverage exercise real parallel execution,
closing #201. It adds a striped-lock union-find stress test using
std::thread, verifies exact Kruskal output across dedicated one- andeight-thread Rayon pools, and preserves the CI coverage-ratchet pin.
Closes #201.
The two-pool determinism check completes the relevant Milestone 2 scope from
PR #198.
Review walkthrough
RAYON_NUM_THREADS: '1'remains in CI despite the explicit concurrency coverage.Validation
make check-fmt: passed.make lint: passed (Rustdoc, Clippy, and Whitaker).make test: passed (1,101 passed; 1 skipped).make markdownlint: passed (0 errors).make nixie: passed.coderabbit review --agent: completed with zero findings.References
Summary by Sourcery
Exercise MST concurrency behavior under real parallel execution and verify deterministic results across Rayon thread counts.
Enhancements:
CI:
Tests: