Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,8 @@
# Copyright 2022 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
copy("v8_clusterfuzz_resources") {
sources = [ "clusterfuzz_trials_config.json" ]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
}

View File

@ -0,0 +1,67 @@
# Copyright 2022 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
# This line is 'magic' in that git-cl looks for it to decide whether to
# use Python3 instead of Python2 when running the code in this file.
USE_PYTHON3 = True
def _CheckTrialsConfig(input_api, output_api):
def FilterFile(affected_file):
return input_api.FilterSourceFile(
affected_file,
files_to_check=(r'.+clusterfuzz_trials_config\.json',))
results = []
for f in input_api.AffectedFiles(
file_filter=FilterFile, include_deletes=False):
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:
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):
results.append('trial {} probability is not a float'.format(trial))
if not (0 <= trial['probability'] <= 1):
results.append(
'trial {} has invalid probability value'.format(trial))
if not isinstance(trial['app_args'], str) or not trial['app_args']:
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))
return [output_api.PresubmitError(r) for r in results]
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
checks = [
_CheckTrialsConfig,
]
return sum([check(input_api, output_api) for check in checks], [])
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)

View File

@ -0,0 +1,18 @@
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.

View File

@ -0,0 +1,60 @@
[
{"app_args": "--always-sparkplug", "app_name": "d8", "probability": 0.05},
{"app_args": "--assert-types", "app_name": "d8", "probability": 0.25, "contradicts": ["--stress-concurrent-inlining", "--stress-concurrent-inlining-attach-code"]},
{"app_args": "--force-slow-path", "app_name": "d8", "probability": 0.05},
{"app_args": "--future", "app_name": "d8", "probability": 0.25},
{"app_args": "--harmony", "app_name": "d8", "probability": 0.5},
{"app_args": "--harmony-struct", "app_name": "d8", "probability": 0.1},
{"app_args": "--jit-fuzzing", "app_name": "d8", "probability": 0.25},
{"app_args": "--jitless", "app_name": "d8", "probability": 0.1, "contradicts": ["--maglev-future", "--stress-concurrent-inlining", "--stress-concurrent-inlining-attach-code", "--stress-maglev"]},
{"app_args": "--js-staging", "app_name": "d8", "probability": 0.5},
{"app_args": "--maglev", "app_name": "d8", "probability": 0.1, "contradicts": ["--jitless"]},
{"app_args": "--maglev-future", "app_name": "d8", "probability": 0.05, "contradicts": ["--jitless"]},
{"app_args": "--minor-ms", "app_name": "d8", "probability": 0.1},
{"app_args": "--random-gc-interval=2000", "app_name": "d8", "probability": 0.05},
{"app_args": "--optimize-on-next-call-optimizes-to-maglev", "app_name": "d8", "probability": 0.5},
{"app_args": "--noanalyze-environment-liveness", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-avx", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-bmi1", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-bmi2", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-fma3", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-lzcnt", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-popcnt", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-sahf", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-sse3", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-sse4_1", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-sse4_2", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-enable-ssse3", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-lazy-feedback-allocation", "app_name": "d8", "probability": 0.35},
{"app_args": "--no-use-ic", "app_name": "d8", "probability": 0.25},
{"app_args": "--no-wasm-generic-wrapper", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-liftoff", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-turbofan", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-wasm-tier-up --no-wasm-dynamic-tiering", "app_name": "d8", "probability": 0.1},
{"app_args": "--regexp-interpret-all", "app_name": "d8", "probability": 0.1},
{"app_args": "--regexp-tier-up-ticks=0", "app_name": "d8", "probability": 0.1},
{"app_args": "--regexp-tier-up-ticks=10", "app_name": "d8", "probability": 0.1},
{"app_args": "--regexp-tier-up-ticks=100", "app_name": "d8", "probability": 0.1},
{"app_args": "--shared-string-table", "app_name": "d8", "probability": 0.1},
{"app_args": "--shared-heap", "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.25, "contradicts": ["--assert-types", "--jitless"]},
{"app_args": "--stress-concurrent-inlining-attach-code", "app_name": "d8", "probability": 0.05, "contradicts": ["--assert-types", "--jitless"]},
{"app_args": "--stress-flush-code", "app_name": "d8", "probability": 0.25},
{"app_args": "--stress-maglev", "app_name": "d8", "probability": 0.05, "contradicts": ["--jitless"]},
{"app_args": "--stress-marking=100", "app_name": "d8", "probability": 0.05},
{"app_args": "--stress-scavenge=100", "app_name": "d8", "probability": 0.05},
{"app_args": "--turboshaft", "app_name": "d8", "probability": 0.2},
{"app_args": "--turbolev", "app_name": "d8", "probability": 0.1},
{"app_args": "--turbo-instruction-scheduling", "app_name": "d8", "probability": 0.1},
{"app_args": "--turbo-stress-instruction-scheduling", "app_name": "d8", "probability": 0.1},
{"app_args": "--stress-wasm-code-gc", "app_name": "d8", "probability": 0.1},
{"app_args": "--lazy", "app_name": "d8", "probability": 0.1},
{"app_args": "--no-stress-lazy-source-positions", "app_name": "d8", "probability": 0.1},
{"app_args": "--wasm-staging", "app_name": "d8", "probability": 0.25},
{"app_args": "--stress-wasm-memory-moving", "app_name": "d8", "probability": 0.1},
{"app_args": "--stress-scavenger-conservative-object-pinning-random", "app_name": "d8", "probability": 0.1},
{"app_args": "--precise-object-pinning", "app_name": "d8", "probability": 0.1},
{"app_args": "--ephemeron-fixpoint-iterations=0", "app_name": "d8", "probability": 0.1}
]