Commit 1ca89b8c authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[foozzie] Enable passing extra flags on command line

Currently, probabilities for extra flags are calculated in the correctness
fuzzer harness, which makes the RNG fragile when bisecting backwards, when
the script's config changes during bisection.

This adds the possibility to pass extra flags on command line to the
script. After a grace period, we will migrate the flag calculation to
clusterfuzz.

NOTRY=true

Bug: chromium:813833
Change-Id: I515181847474515089b847f8aaffc7c6560d9390
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1675945Reviewed-by: 's avatarTamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62359}
parent e101b9c0
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
# Compared x64,ignition with x64,ignition_turbo # Compared x64,ignition with x64,ignition_turbo
# #
# 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 --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 --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 --stress-scavenge=100
# #
# Difference: # Difference:
- unknown - unknown
......
...@@ -192,6 +192,12 @@ def parse_args(): ...@@ -192,6 +192,12 @@ def parse_args():
'--first-config', help='first configuration', default='ignition') '--first-config', help='first configuration', default='ignition')
parser.add_argument( parser.add_argument(
'--second-config', help='second configuration', default='ignition_turbo') '--second-config', help='second configuration', default='ignition_turbo')
parser.add_argument(
'--first-config-extra-flags', action='append', default=[],
help='Additional flags to pass to the run of the first configuration')
parser.add_argument(
'--second-config-extra-flags', action='append', default=[],
help='Additional flags to pass to the run of the second configuration')
parser.add_argument( parser.add_argument(
'--first-d8', default='d8', '--first-d8', default='d8',
help='optional path to first d8 executable, ' help='optional path to first d8 executable, '
...@@ -328,9 +334,13 @@ def main(): ...@@ -328,9 +334,13 @@ def main():
# Set up runtime arguments. # Set up runtime arguments.
common_flags = FLAGS + ['--random-seed', str(options.random_seed)] common_flags = FLAGS + ['--random-seed', str(options.random_seed)]
first_config_flags = common_flags + CONFIGS[options.first_config] first_config_flags = (common_flags + CONFIGS[options.first_config] +
second_config_flags = common_flags + CONFIGS[options.second_config] options.first_config_extra_flags)
second_config_flags = (common_flags + CONFIGS[options.second_config] +
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. # Add additional flags to second config based on experiment percentages.
for p, flag in ADDITIONAL_FLAGS: for p, flag in ADDITIONAL_FLAGS:
if rng.random() < p: if rng.random() < p:
......
...@@ -138,7 +138,10 @@ class SystemTest(unittest.TestCase): ...@@ -138,7 +138,10 @@ class SystemTest(unittest.TestCase):
with open(os.path.join(TEST_DATA, 'failure_output.txt')) as f: with open(os.path.join(TEST_DATA, 'failure_output.txt')) as f:
expected_output = f.read() expected_output = f.read()
with self.assertRaises(subprocess.CalledProcessError) as ctx: with self.assertRaises(subprocess.CalledProcessError) as ctx:
run_foozzie('test_d8_1.py', 'test_d8_3.py', '--skip-sanity-checks') run_foozzie('test_d8_1.py', 'test_d8_3.py', '--skip-sanity-checks',
'--first-config-extra-flags=--flag1',
'--first-config-extra-flags=--flag2=0',
'--second-config-extra-flags=--flag3')
e = ctx.exception e = ctx.exception
self.assertEquals(v8_foozzie.RETURN_FAIL, e.returncode) self.assertEquals(v8_foozzie.RETURN_FAIL, e.returncode)
self.assertEquals(expected_output, cut_verbose_output(e.output)) self.assertEquals(expected_output, cut_verbose_output(e.output))
......
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