Skip to content

[Fuzzing] Default BINARYEN_CORES=4 in fuzz_opt.py - #9304

Open
tlively wants to merge 1 commit into
mainfrom
fuzzer-throughput-cores
Open

tlively wants to merge 1 commit into
mainfrom
fuzzer-throughput-cores

Conversation

@tlively

@tlively tlively commented Oct 24, 2026

Copy link
Copy Markdown
Member

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.

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.
@tlively
tlively requested a review from a team as a code owner October 24, 2026 02:02
@tlively
tlively requested review from aheejin and removed request for a team October 24, 2026 02:02

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant