Skip to content

Commit

Permalink
Generate random seed for fuzzer experiments.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottslaughter committed Jul 30, 2024
1 parent 7338ac7 commit bbbcc02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion experiment/sapling/run_all_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ function run_fuzzer_config {
exit 1
fi

FUZZER_EXE="$fuzzer_exe" FUZZER_MODE=$mode FUZZER_TEST_COUNT=$test_count FUZZER_LAUNCHER="$launcher" sbatch --nodes 1 "experiment/$FUZZER_MACHINE/sbatch_fuzzer.sh"
# Generate a random seed so we explore a novel part of the state space.
seed="$(( 16#$(openssl rand -hex 4) * test_count ))"

FUZZER_EXE="$fuzzer_exe" FUZZER_MODE=$mode FUZZER_TEST_COUNT=$test_count FUZZER_SEED=$seed FUZZER_LAUNCHER="$launcher" sbatch --nodes 1 "experiment/$FUZZER_MACHINE/sbatch_fuzzer.sh"
}

run_fuzzer_config debug_single single
Expand Down
1 change: 1 addition & 0 deletions experiment/sapling/sbatch_fuzzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fuzzer_flags=(
-j${FUZZER_THREADS:-4}
-n${FUZZER_TEST_COUNT:-1000}
-o${FUZZER_OP_COUNT:-1000}
-s${FUZZER_SEED:-0}
--extra="$FUZZER_EXTRA_FLAGS"
)

Expand Down

0 comments on commit bbbcc02

Please sign in to comment.