Commit ccd37472 authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Migrate extra-flags generation to clusterfuzz side

NOTRY=true

Bug: chromium:813833,chromium:983128
Change-Id: I449796b761f53bb15a3563604d5a4a9018035cb6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1697255Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62662}
parent 4786c5c8
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# Flags of x64,ignition: # Flags of x64,ignition:
--correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up --flag1 --flag2=0 --correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up --flag1 --flag2=0
# Flags of x64,ignition_turbo: # Flags of x64,ignition_turbo:
--correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --flag3 --stress-scavenge=100 --correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --flag3
# #
# Difference: # Difference:
- unknown - unknown
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# Flags of x64,ignition: # Flags of x64,ignition:
--correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up --correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --turbo-filter=~ --noopt --liftoff --no-wasm-tier-up
# Flags of x64,ignition_turbo: # Flags of x64,ignition_turbo:
--correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345 --stress-scavenge=100 --correctness-fuzzer-suppressions --expose-gc --allow-natives-syntax --invoke-weak-callbacks --omit-quit --es-staging --no-wasm-async-compilation --suppress-asm-messages --random-seed 12345
# #
# Difference: # Difference:
- unknown - unknown
......
...@@ -88,22 +88,6 @@ CONFIGS = dict( ...@@ -88,22 +88,6 @@ CONFIGS = dict(
], ],
) )
# Additional flag experiments. List of tuples like
# (<likelihood to use flags in [0,1)>, <flag>).
ADDITIONAL_FLAGS = [
(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'),
]
# Timeout in seconds for one d8 run. # Timeout in seconds for one d8 run.
TIMEOUT = 3 TIMEOUT = 3
...@@ -316,7 +300,6 @@ def print_difference( ...@@ -316,7 +300,6 @@ def print_difference(
def main(): def main():
options = parse_args() options = parse_args()
rng = random.Random(options.random_seed)
# Suppressions are architecture and configuration specific. # Suppressions are architecture and configuration specific.
suppress = v8_suppressions.get_suppression( suppress = v8_suppressions.get_suppression(
...@@ -339,13 +322,6 @@ def main(): ...@@ -339,13 +322,6 @@ def main():
second_config_flags = (common_flags + CONFIGS[options.second_config] + second_config_flags = (common_flags + CONFIGS[options.second_config] +
options.second_config_extra_flags) options.second_config_extra_flags)
# TODO(machenbach): Deprecate calculating flag experiements in this script
# and instead pass flags as extra flags on command line.
# Add additional flags to second config based on experiment percentages.
for p, flag in ADDITIONAL_FLAGS:
if rng.random() < p:
second_config_flags.append(flag)
def run_d8(d8, config_flags, config_label=None, testcase=options.testcase): def run_d8(d8, config_flags, config_label=None, testcase=options.testcase):
preamble = PREAMBLE[:] preamble = PREAMBLE[:]
if options.first_arch != options.second_arch: if options.first_arch != options.second_arch:
......
...@@ -41,8 +41,9 @@ class ConfigTest(unittest.TestCase): ...@@ -41,8 +41,9 @@ class ConfigTest(unittest.TestCase):
'--first-config=ignition', '--first-config=ignition',
'--second-config=ignition_turbo', '--second-config=ignition_turbo',
'--second-d8=d8', '--second-d8=d8',
'--second-config-extra-flags=--stress-scavenge=100',
], ],
v8_fuzz_config.Config('foo', Rng()).choose_foozzie_flags(), v8_fuzz_config.Config('foo', Rng(), 42).choose_foozzie_flags(),
) )
......
...@@ -23,6 +23,22 @@ FOOZZIE_EXPERIMENTS = [ ...@@ -23,6 +23,22 @@ FOOZZIE_EXPERIMENTS = [
[5, 'ignition', 'ignition', 'clang_x86_v8_arm/d8'], [5, 'ignition', 'ignition', 'clang_x86_v8_arm/d8'],
] ]
# Additional flag experiments. List of tuples like
# (<likelihood to use flags in [0,1)>, <flag>).
ADDITIONAL_FLAGS = [
(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'),
]
class Config(object): class Config(object):
def __init__(self, name, rng=None, random_seed=None): def __init__(self, name, rng=None, random_seed=None):
""" """
...@@ -36,12 +52,27 @@ class Config(object): ...@@ -36,12 +52,27 @@ class Config(object):
""" """
self.name = name self.name = name
self.rng = rng or random.Random() self.rng = rng or random.Random()
self.random_seed = random_seed
def choose_foozzie_flags(self): def choose_foozzie_flags(self):
"""Randomly chooses a configuration from FOOZZIE_EXPERIMENTS. """Randomly chooses a configuration from FOOZZIE_EXPERIMENTS.
Returns: List of flags to pass to v8_foozzie.py fuzz harness. Returns: List of flags to pass to v8_foozzie.py fuzz harness.
""" """
# TODO(machenbach): Temporarily use same RNG state for all test cases in one
# fuzz session. See also TODO above.
if self.random_seed is not None:
flags_rng = random.Random(self.random_seed)
else:
flags_rng = random.Random()
# Add additional flags to second config based on experiment percentages.
extra_flags = []
for p, flag in ADDITIONAL_FLAGS:
if flags_rng.random() < p:
extra_flags.append('--second-config-extra-flags=%s' % flag)
# Calculate flags determining the experiment.
acc = 0 acc = 0
threshold = self.rng.random() * 100 threshold = self.rng.random() * 100
for prob, first_config, second_config, second_d8 in FOOZZIE_EXPERIMENTS: for prob, first_config, second_config, second_d8 in FOOZZIE_EXPERIMENTS:
...@@ -51,5 +82,5 @@ class Config(object): ...@@ -51,5 +82,5 @@ class Config(object):
'--first-config=' + first_config, '--first-config=' + first_config,
'--second-config=' + second_config, '--second-config=' + second_config,
'--second-d8=' + second_d8, '--second-d8=' + second_d8,
] ] + extra_flags
assert False assert False
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