Fix non-deterministic ordering in ParallelAnalyzer#445
Merged
Conversation
…ering/determinism tests Use indexed items and a buffered channel to collect files and subdirs with their original indices, then append them in-order to preserve the original file/directory interleaving when running the parallel analyzer. This makes output deterministic and consistent with the sequential analyzer. Also add tests and helper: - TestParallelAnalyzerDeterminism - TestParallelVsSequentialConsistency - TestFileDirectoryInterleaving - getFileNames helper
Contributor
Author
|
@rafl please verify for the same by having a building yourself of my fork. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #445 +/- ##
==========================================
- Coverage 83.88% 83.72% -0.17%
==========================================
Files 46 47 +1
Lines 3792 3919 +127
==========================================
+ Hits 3181 3281 +100
- Misses 537 561 +24
- Partials 74 77 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
We need to do proper performance benchmarks for this PR before merging. |
Owner
|
I will introduce this as a new analyzer, because there's a performance penalty (approx 1-5%) for keeping the stable sorting. |
Contributor
Author
|
@dundee i will try to improve the performance. |
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.
Fixes #444
Problem
The ParallelAnalyzer produced non-deterministic results due to processing subdirectories in parallel and adding them to the parent directory in completion order rather than filesystem order.
Solution
Changes
Testing