Commit 6b4079e0 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Use json for flags and experiments

This will allow sharing the configs between Python and JavaScript
based fuzzers.

No-Try: true
Bug: chromium:1044942
Change-Id: Idd47ad31430cfed0629dbb5b9dd5fd2ef8c764f6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2051951Reviewed-by: 's avatarLiviu Rau <liviurau@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66243}
parent 6a9a67d9
...@@ -11,6 +11,8 @@ if (v8_correctness_fuzzer) { ...@@ -11,6 +11,8 @@ if (v8_correctness_fuzzer) {
"v8_foozzie.py", "v8_foozzie.py",
"v8_foozzie_harness_adjust.js", "v8_foozzie_harness_adjust.js",
"v8_fuzz_config.py", "v8_fuzz_config.py",
"v8_fuzz_experiments.json",
"v8_fuzz_flags.json",
"v8_mock.js", "v8_mock.js",
"v8_mock_archs.js", "v8_mock_archs.js",
"v8_mock_webassembly.js", "v8_mock_webassembly.js",
......
...@@ -2,62 +2,23 @@ ...@@ -2,62 +2,23 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import json
import os
import random import random
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
# List of configuration experiments for correctness fuzzing. # List of configuration experiments for correctness fuzzing.
# List of <probability>, <1st config name>, <2nd config name>, <2nd d8>. # List of <probability>, <1st config name>, <2nd config name>, <2nd d8>.
# Probabilities must add up to 100. # Probabilities must add up to 100.
FOOZZIE_EXPERIMENTS = [ with open(os.path.join(THIS_DIR, 'v8_fuzz_experiments.json')) as f:
[10, 'ignition', 'jitless', 'd8'], FOOZZIE_EXPERIMENTS = json.load(f)
[10, 'ignition', 'slow_path', 'd8'],
[5, 'ignition', 'slow_path_opt', 'd8'],
[25, 'ignition', 'ignition_turbo', 'd8'],
[2, 'ignition_no_ic', 'ignition_turbo', 'd8'],
[2, 'ignition', 'ignition_turbo_no_ic', 'd8'],
[15, 'ignition', 'ignition_turbo_opt', 'd8'],
[2, 'ignition_no_ic', 'ignition_turbo_opt', 'd8'],
[4, 'ignition_turbo_opt', 'ignition_turbo_opt', 'clang_x64_pointer_compression/d8'],
[5, 'ignition_turbo', 'ignition_turbo', 'clang_x64_pointer_compression/d8'],
[4, 'ignition_turbo_opt', 'ignition_turbo_opt', 'clang_x86/d8'],
[4, 'ignition_turbo', 'ignition_turbo', 'clang_x86/d8'],
[4, 'ignition', 'ignition', 'clang_x86/d8'],
[4, 'ignition', 'ignition', 'clang_x64_v8_arm64/d8'],
[4, 'ignition', 'ignition', 'clang_x86_v8_arm/d8'],
]
# Additional flag experiments. List of tuples like # Additional flag experiments. List of tuples like
# (<likelihood to use flags in [0,1)>, <flag>). # (<likelihood to use flags in [0,1)>, <flag>).
ADDITIONAL_FLAGS = [ with open(os.path.join(THIS_DIR, 'v8_fuzz_flags.json')) as f:
(0.1, '--stress-marking=100'), ADDITIONAL_FLAGS = json.load(f)
(0.1, '--stress-scavenge=100'),
(0.1, '--stress-compaction-random'),
(0.1, '--random-gc-interval=2000'),
(0.2, '--noanalyze-environment-liveness'),
(0.1, '--stress-delay-tasks'),
(0.01, '--thread-pool-size=1'),
(0.01, '--thread-pool-size=2'),
(0.01, '--thread-pool-size=4'),
(0.01, '--thread-pool-size=8'),
(0.1, '--interrupt-budget=1000'),
(0.25, '--future'),
(0.2, '--no-regexp-tier-up'),
(0.1, '--regexp-interpret-all'),
(0.1, '--regexp-tier-up-ticks=10'),
(0.1, '--regexp-tier-up-ticks=100'),
(0.1, '--turbo-instruction-scheduling'),
(0.1, '--turbo-stress-instruction-scheduling'),
(0.1, '--no-enable-sse3'),
(0.1, '--no-enable-ssse3'),
(0.1, '--no-enable-sse4_1'),
(0.1, '--no-enable-sse4_2'),
(0.1, '--no-enable-sahf'),
(0.1, '--no-enable-avx'),
(0.1, '--no-enable-fma3'),
(0.1, '--no-enable-bmi1'),
(0.1, '--no-enable-bmi2'),
(0.1, '--no-enable-lzcnt'),
(0.1, '--no-enable-popcnt'),
]
class Config(object): class Config(object):
def __init__(self, name, rng=None): def __init__(self, name, rng=None):
......
[
[10, "ignition", "jitless", "d8"],
[10, "ignition", "slow_path", "d8"],
[5, "ignition", "slow_path_opt", "d8"],
[25, "ignition", "ignition_turbo", "d8"],
[2, "ignition_no_ic", "ignition_turbo", "d8"],
[2, "ignition", "ignition_turbo_no_ic", "d8"],
[15, "ignition", "ignition_turbo_opt", "d8"],
[2, "ignition_no_ic", "ignition_turbo_opt", "d8"],
[4, "ignition_turbo_opt", "ignition_turbo_opt", "clang_x64_pointer_compression/d8"],
[5, "ignition_turbo", "ignition_turbo", "clang_x64_pointer_compression/d8"],
[4, "ignition_turbo_opt", "ignition_turbo_opt", "clang_x86/d8"],
[4, "ignition_turbo", "ignition_turbo", "clang_x86/d8"],
[4, "ignition", "ignition", "clang_x86/d8"],
[4, "ignition", "ignition", "clang_x64_v8_arm64/d8"],
[4, "ignition", "ignition", "clang_x86_v8_arm/d8"]
]
\ No newline at end of file
[
[0.1, "--stress-marking=100"],
[0.1, "--stress-scavenge=100"],
[0.1, "--stress-compaction-random"],
[0.1, "--random-gc-interval=2000"],
[0.2, "--noanalyze-environment-liveness"],
[0.1, "--stress-delay-tasks"],
[0.01, "--thread-pool-size=1"],
[0.01, "--thread-pool-size=2"],
[0.01, "--thread-pool-size=4"],
[0.01, "--thread-pool-size=8"],
[0.1, "--interrupt-budget=1000"],
[0.25, "--future"],
[0.2, "--no-regexp-tier-up"],
[0.1, "--regexp-interpret-all"],
[0.1, "--regexp-tier-up-ticks=10"],
[0.1, "--regexp-tier-up-ticks=100"],
[0.1, "--turbo-instruction-scheduling"],
[0.1, "--turbo-stress-instruction-scheduling"],
[0.1, "--no-enable-sse3"],
[0.1, "--no-enable-ssse3"],
[0.1, "--no-enable-sse4_1"],
[0.1, "--no-enable-sse4_2"],
[0.1, "--no-enable-sahf"],
[0.1, "--no-enable-avx"],
[0.1, "--no-enable-fma3"],
[0.1, "--no-enable-bmi1"],
[0.1, "--no-enable-bmi2"],
[0.1, "--no-enable-lzcnt"],
[0.1, "--no-enable-popcnt"]
]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment