Repository navigation
Conversation
Every wasm-opt, wasm-merge, wasm-ctor-eval, and wasm-metadce subprocess spawned by fuzz_opt.py initializes a Binaryen ThreadPool sized to hardware_concurrency() (e.g. 128 threads on a 128-core workstation) and synchronizes across condition variables for each function-parallel pass. On small fuzzer modules, thread creation and barrier synchronization dominate execution time and cause severe contention when running multiple fuzzer workers in parallel. Default BINARYEN_CORES to 4 so parallel pass execution is still exercised without spawning a thread per hardware core in every subprocess. Steady-state throughput increases by +97.7% (1.37 -> 2.71 iters/s, 1.98x) for a single worker and +186.4% (25.77 -> 73.78 iters/s, 2.86x) across 32 parallel workers on a 128-thread machine.
There was a problem hiding this comment.
Code Review
This pull request updates scripts/fuzz_opt.py to set a default value of '4' for the BINARYEN_CORES environment variable. This limits the default thread pool size per subprocess, ensuring parallel passes are exercised without spawning a thread for every hardware core on each invocation. There are no review comments to address, and I have no additional feedback to provide.
This branch has not been deployed
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.
Every wasm-opt, wasm-merge, wasm-ctor-eval, and wasm-metadce subprocess spawned by fuzz_opt.py initializes a Binaryen ThreadPool sized to hardware_concurrency() (e.g. 128 threads on a 128-core workstation) and synchronizes across condition variables for each function-parallel pass. On small fuzzer modules, thread creation and barrier synchronization dominate execution time and cause severe contention when running multiple fuzzer workers in parallel. Default BINARYEN_CORES to 4 so parallel pass execution is still exercised without spawning a thread per hardware core in every subprocess.
Steady-state throughput increases by +97.7% (1.37 -> 2.71 iters/s, 1.98x) for a single worker and +186.4% (25.77 -> 73.78 iters/s, 2.86x) across 32 parallel workers on a 128-thread machine.