Commit b0a3fedb authored by Al Muthanna Athamina's avatar Al Muthanna Athamina Committed by V8 LUCI CQ

Add flag contradictions for ClusterFuzz and a README

Add flag contradictions for "assert-types" flag and a README file for how
to add trials from the source side. Also restore "assert-types" and its
contradictions' probability since we can avoid contradictions now.

Bug: v8:1340816,v8:1336577
No-Try: true
Change-Id: I2a3af2d13cd2f9f542bec5c013c50bf26ff93cc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3787878
Commit-Queue: Almothana Athamneh <almuthanna@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82133}
parent 872b7faa
......@@ -21,10 +21,15 @@ def _CheckTrialsConfig(input_api, output_api):
with open(f.AbsoluteLocalPath()) as j:
try:
trials = json.load(j)
mandatory_properties = {'app_args', 'app_name', 'probability'}
optional_properties = {'contradicts'}
all_properties = mandatory_properties.union(optional_properties)
for trial in trials:
if not all(
k in trial for k in ('app_args', 'app_name', 'probability')):
results.append('trial {} is not configured correctly'.format(trial))
trial_keys = set(trial.keys())
if not mandatory_properties.issubset(trial_keys):
results.append('trial {} does not have mandatory propertie(s) {}'.format(trial, mandatory_properties - trial_keys))
if not trial_keys.issubset(all_properties):
results.append('trial {} has incorrect propertie(s) {}'.format(trial, trial_keys - all_properties))
if trial['app_name'] != 'd8':
results.append('trial {} has an incorrect app_name'.format(trial))
if not isinstance(trial['probability'], float):
......@@ -36,6 +41,11 @@ def _CheckTrialsConfig(input_api, output_api):
results.append(
'trial {} should have a non-empty string for app_args'.format(
trial))
contradicts = trial.get('contradicts', [])
if not isinstance(contradicts, list) or not all(
isinstance(cont, str) for cont in contradicts):
results.append(
'trial {} contradicts is not a list of strings'.format(trial))
except Exception as e:
results.append(
'JSON validation failed for %s. Error:\n%s' % (f.LocalPath(), e))
......
It is possible to add trials from the source code side by adding the below line
to `clusterfuzz_trials_config.json`:
```
{
"app_args": "FLAG_NAME",
"app_name": "APP_NAME",
"probability": PROBABILITY,
"contradicts": ["FLAG1", "FLAG2", ...]
}
```
- `app_args`: the name of the flag we want to add.
- `app_name`: the name of the app we are adding the flag for, this must be `d8` on `V8`.
- `probability`: the probability of this flag to be selected.
- `contradicts` (optional): the flags that contradict the flag referred to in `app_args`.
This will stop flags that contradict each other from being added in the same
trial.
[
{"app_args": "--assert-types", "app_name": "d8", "probability": 0.10},
{"app_args": "--assert-types", "app_name": "d8", "probability": 0.25, "contradicts": ["--stress-concurrent-inlining", "--stress-concurrent-inlining-attach-code"]},
{"app_args": "--interrupt-budget-for-feedback-vector-allocation=0", "app_name": "d8", "probability": 0.05},
{"app_args": "--compact-maps", "app_name": "d8", "probability": 0.25},
{"app_args": "--force-slow-path", "app_name": "d8", "probability": 0.05},
......@@ -28,8 +28,8 @@
{"app_args": "--regexp-interpret-all", "app_name": "d8", "probability": 0.1},
{"app_args": "--simulate-errors", "app_name": "d8", "probability": 0.001},
{"app_args": "--stress-compaction-random", "app_name": "d8", "probability": 0.05},
{"app_args": "--stress-concurrent-inlining", "app_name": "d8", "probability": 0.10},
{"app_args": "--stress-concurrent-inlining-attach-code", "app_name": "d8", "probability": 0.10},
{"app_args": "--stress-concurrent-inlining", "app_name": "d8", "probability": 0.25, "contradicts": ["--assert-types"]},
{"app_args": "--stress-concurrent-inlining-attach-code", "app_name": "d8", "probability": 0.25, "contradicts": ["--assert-types"]},
{"app_args": "--stress-flush-code", "app_name": "d8", "probability": 0.25},
{"app_args": "--stress-marking=100", "app_name": "d8", "probability": 0.05},
{"app_args": "--stress-scavenge=100", "app_name": "d8", "probability": 0.05},
......
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