[maglev] Add and enable --stress-maglev on fyi bots

.. which sets the --interrupt-budget-for-maglev to a very low value
s.t.  that tiering to Maglev happens very early. Note this affects
both normal tierup and OSR.

Also add flag handling to fuzzer.py, both as added globally with
probability 0.1, and added to InterruptBudgetFuzzer (which I also
updated with other tiering-related flags).

Bug: v8:7700
Change-Id: I844cf53a6a2da459565d0ad0ccae02b04853cd26
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3878165
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83033}
This commit is contained in:
Jakob Linke 2022-09-07 13:09:25 +02:00 committed by V8 LUCI CQ
parent d15d4ec4f8
commit 7beee00565
4 changed files with 22 additions and 5 deletions

View File

@ -431,6 +431,8 @@
{'name': 'mjsunit', 'variant': 'stress_snapshot'},
# Maglev.
{'name': 'mjsunit', 'variant': 'maglev'},
# Stress maglev.
{'name': 'mjsunit', 'variant': 'stress_maglev'},
# Experimental regexp engine.
{'name': 'mjsunit', 'variant': 'experimental_regexp'},
# Wasm write protect code space.
@ -1386,6 +1388,8 @@
{'name': 'mjsunit', 'variant': 'stress_snapshot'},
# Maglev.
{'name': 'mjsunit', 'variant': 'maglev'},
# Stress maglev.
{'name': 'mjsunit', 'variant': 'stress_maglev'},
# Experimental regexp engine.
{'name': 'mjsunit', 'variant': 'experimental_regexp'},
# Wasm write protect code space.
@ -1450,6 +1454,8 @@
{'name': 'mjsunit', 'variant': 'stress_snapshot'},
# Maglev.
{'name': 'mjsunit', 'variant': 'maglev'},
# Stress maglev.
{'name': 'mjsunit', 'variant': 'stress_maglev'},
# Experimental regexp engine.
{'name': 'mjsunit', 'variant': 'experimental_regexp'},
# Wasm write protect code space.

View File

@ -455,9 +455,16 @@ DEFINE_BOOL(maglev_inlining, false,
"enable inlining in the maglev optimizing compiler")
DEFINE_BOOL(maglev_reuse_stack_slots, false,
"reuse stack slots in the maglev optimizing compiler")
// We stress maglev by setting a very low interrupt budget for maglev. This
// way, we still gather *some* feedback before compiling optimized code.
DEFINE_BOOL(stress_maglev, false, "trigger maglev compilation earlier")
DEFINE_IMPLICATION(stress_maglev, maglev)
DEFINE_VALUE_IMPLICATION(stress_maglev, interrupt_budget_for_maglev, 128)
#else
#define V8_ENABLE_MAGLEV_BOOL false
DEFINE_BOOL_READONLY(maglev, false, "enable the maglev optimizing compiler")
DEFINE_BOOL_READONLY(stress_maglev, false, "trigger maglev compilation earlier")
#endif // V8_ENABLE_MAGLEV
DEFINE_STRING(maglev_filter, "*", "optimization filter for the maglev compiler")

View File

@ -16,6 +16,7 @@ ALL_VARIANT_FLAGS = {
"jitless": [["--jitless"]],
"sparkplug": [["--sparkplug"]],
"maglev": [["--maglev"]],
"stress_maglev": [["--maglev", "--stress-maglev"]],
"turboshaft": [["--turboshaft"]],
"concurrent_sparkplug": [["--concurrent-sparkplug", "--sparkplug"]],
"always_sparkplug": [["--always-sparkplug", "--sparkplug"]],
@ -80,6 +81,7 @@ INCOMPATIBLE_FLAGS_PER_VARIANT = {
"sparkplug": ["--jitless", "--no-sparkplug"],
"concurrent_sparkplug": ["--jitless"],
"maglev": ["--jitless"],
"stress_maglev": ["--jitless"],
"always_sparkplug": ["--jitless", "--no-sparkplug"],
"code_serializer": [
"--cache=after-execute", "--cache=full-code-cache", "--cache=none"

View File

@ -17,6 +17,7 @@ EXTRA_FLAGS = [
(0.1, '--force-slow-path'),
(0.2, '--future'),
(0.1, '--interrupt-budget=100'),
(0.1, '--interrupt-budget-for-maglev=100'),
(0.1, '--liftoff'),
(0.1, '--maglev'),
(0.2, '--no-analyze-environment-liveness'),
@ -319,17 +320,18 @@ class CompactionFuzzer(Fuzzer):
class InterruptBudgetFuzzer(Fuzzer):
def create_flags_generator(self, rng, test, analysis_value):
while True:
# Half with half without lazy feedback allocation. The first flag
# Half with, half without lazy feedback allocation. The first flag
# overwrites potential flag negations from the extra flags list.
flag1 = rng.choice(
'--lazy-feedback-allocation', '--no-lazy-feedback-allocation')
# For most code paths, only one of the flags below has a meaning
# based on the flag above.
flag2 = '--interrupt-budget=%d' % rng.randint(0, 135168)
flag3 = '--interrupt-budget-for-feedback-allocation=%d' % rng.randint(
flag3 = '--interrupt-budget-for-maglev=%d' % rng.randint(0, 40960)
flag4 = '--interrupt-budget-for-feedback-allocation=%d' % rng.randint(
0, 940)
flag5 = '--interrupt-budget-factor-for-feedback-allocation=%d' % rng.randint(
1, 8)
yield [flag1, flag2, flag3]
yield [flag1, flag2, flag3, flag4, flag5]
class StackSizeFuzzer(Fuzzer):