Remove SPIR-V reader fuzzers

Fuzzers that exercise the SPIR-V reader are being moved to OSS-Fuzz.
This change removes them from the Chromium build so that they cease to
be run by ClusterFuzz. The change also applies a small refactoring to
the fuzzer build rules, so that the tint_ast_clone fuzzer is specified
together with other fuzzers that require the WGSL reader and writer.

Bug: chromium:1243084
Change-Id: I4f5d12a679366634c7cad3e7ac18075bb046a8ba
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62800
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Alastair Donaldson <afdx@google.com>
This commit is contained in:
Alastair Donaldson 2021-08-25 16:14:43 +00:00 committed by Tint LUCI CQ
parent 87cce20f67
commit a96dce9c89
2 changed files with 9 additions and 203 deletions

View File

@ -32,25 +32,6 @@ if (build_with_chromium) {
outputs = [ fuzzer_corpus_wgsl_dir ]
}
fuzzer_corpus_spirv_dir = "${target_gen_dir}/fuzzer_corpus_spirv"
action("tint_generate_spirv_corpus") {
# The spirv-as tool is used to turn SPIR-V assembly files into binary form.
# When cross compiling, it is important that spirv-as is built for the
# *host* tool chain, and that the host version of spirv-as is used to
# prepare the corpus.
spirv_as_target = "${tint_spirv_tools_dir}/:spirv-as(${host_toolchain})"
spirv_as_out_dir = get_label_info(spirv_as_target, "root_out_dir")
deps = [ spirv_as_target ]
script = "generate_spirv_corpus.py"
sources = [ "generate_spirv_corpus.py" ]
args = [
rebase_path("${tint_root_dir}/test", root_build_dir),
rebase_path(fuzzer_corpus_spirv_dir, root_build_dir),
rebase_path("${spirv_as_out_dir}/spirv-as", root_build_dir),
]
outputs = [ fuzzer_corpus_spirv_dir ]
}
tint_ast_fuzzer_common_libfuzzer_options = [
"cross_over=0",
"max_len=1000000",
@ -59,20 +40,6 @@ if (build_with_chromium) {
"tint_mutation_batch_size=5",
]
tint_spirv_tools_fuzzer_common_libfuzzer_options = [
"cross_over=0",
"max_len=1000000",
"mutate_depth=1",
"tint_enable_all_fuzzer_passes=true",
"tint_enable_all_reduce_passes=true",
"tint_mutator_cache_size=30",
"tint_mutator_type=fuzz,opt,reduce",
"tint_opt_batch_size=5",
"tint_reduction_batch_size=5",
"tint_repeated_pass_strategy=looped",
"tint_transformation_batch_size=5",
]
tint_regex_fuzzer_common_libfuzzer_options = [
"cross_over=0",
"max_len=100000",
@ -120,6 +87,14 @@ if (build_with_chromium) {
}
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
fuzzer_test("tint_ast_clone_fuzzer") {
sources = [ "tint_ast_clone_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
dict = "dictionary.txt"
seed_corpus = fuzzer_corpus_wgsl_dir
seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
}
fuzzer_test("tint_ast_wgsl_writer_fuzzer") {
sources = []
deps = [ "tint_ast_fuzzer:tint_ast_fuzzer" ]
@ -295,93 +270,6 @@ if (build_with_chromium) {
}
}
if (tint_build_spv_reader) {
fuzzer_test("tint_spv_reader_fuzzer") {
sources = [ "tint_spv_reader_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
}
if (tint_build_spv_reader && tint_build_wgsl_writer) {
fuzzer_test("tint_spv_reader_wgsl_writer_fuzzer") {
sources = [ "tint_spv_reader_wgsl_writer_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
fuzzer_test("tint_spirv_tools_wgsl_writer_fuzzer") {
sources = []
deps = [ "tint_spirv_tools_fuzzer:tint_spirv_tools_fuzzer" ]
libfuzzer_options = tint_spirv_tools_fuzzer_common_libfuzzer_options +
[ "tint_fuzzing_target=wgsl" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
}
if (tint_build_spv_reader && tint_build_spv_writer) {
fuzzer_test("tint_spv_reader_spv_writer_fuzzer") {
sources = [ "tint_spv_reader_spv_writer_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
fuzzer_test("tint_spirv_tools_spv_writer_fuzzer") {
sources = []
deps = [ "tint_spirv_tools_fuzzer:tint_spirv_tools_fuzzer" ]
libfuzzer_options = tint_spirv_tools_fuzzer_common_libfuzzer_options +
[ "tint_fuzzing_target=spv" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
}
if (tint_build_spv_reader && tint_build_hlsl_writer) {
fuzzer_test("tint_spv_reader_hlsl_writer_fuzzer") {
sources = [ "tint_spv_reader_hlsl_writer_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
fuzzer_test("tint_spirv_tools_hlsl_writer_fuzzer") {
sources = []
deps = [ "tint_spirv_tools_fuzzer:tint_spirv_tools_fuzzer" ]
libfuzzer_options = tint_spirv_tools_fuzzer_common_libfuzzer_options +
[ "tint_fuzzing_target=hlsl" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
}
if (tint_build_spv_reader && tint_build_msl_writer) {
fuzzer_test("tint_spv_reader_msl_writer_fuzzer") {
sources = [ "tint_spv_reader_msl_writer_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
fuzzer_test("tint_spirv_tools_msl_writer_fuzzer") {
sources = []
deps = [ "tint_spirv_tools_fuzzer:tint_spirv_tools_fuzzer" ]
libfuzzer_options = tint_spirv_tools_fuzzer_common_libfuzzer_options +
[ "tint_fuzzing_target=msl" ]
seed_corpus = fuzzer_corpus_spirv_dir
seed_corpus_deps = [ ":tint_generate_spirv_corpus" ]
}
}
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
fuzzer_test("tint_ast_clone_fuzzer") {
sources = [ "tint_ast_clone_fuzzer.cc" ]
deps = [ ":tint_fuzzer_common_with_init" ]
dict = "dictionary.txt"
seed_corpus = fuzzer_corpus_wgsl_dir
seed_corpus_deps = [ ":tint_generate_wgsl_corpus" ]
}
}
group("fuzzers") {
testonly = true
deps = []
@ -391,6 +279,7 @@ if (build_with_chromium) {
}
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
deps += [
":tint_ast_clone_fuzzer",
":tint_ast_wgsl_writer_fuzzer",
":tint_regex_wgsl_writer_fuzzer",
":tint_wgsl_reader_wgsl_writer_fuzzer",
@ -425,36 +314,6 @@ if (build_with_chromium) {
":tint_wgsl_reader_msl_writer_fuzzer",
]
}
if (tint_build_spv_reader) {
deps += [ ":tint_spv_reader_fuzzer" ]
}
if (tint_build_spv_reader && tint_build_wgsl_writer) {
deps += [
":tint_spirv_tools_wgsl_writer_fuzzer",
":tint_spv_reader_wgsl_writer_fuzzer",
]
}
if (tint_build_spv_reader && tint_build_spv_writer) {
deps += [
":tint_spirv_tools_spv_writer_fuzzer",
":tint_spv_reader_spv_writer_fuzzer",
]
}
if (tint_build_spv_reader && tint_build_hlsl_writer) {
deps += [
":tint_spirv_tools_hlsl_writer_fuzzer",
":tint_spv_reader_hlsl_writer_fuzzer",
]
}
if (tint_build_spv_reader && tint_build_msl_writer) {
deps += [
":tint_spirv_tools_msl_writer_fuzzer",
":tint_spv_reader_msl_writer_fuzzer",
]
}
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
deps += [ ":tint_ast_clone_fuzzer" ]
}
}
} else {
group("fuzzers") {

View File

@ -1,53 +0,0 @@
# Copyright 2021 The Tint Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build_overrides/build.gni")
import("../../tint_overrides_with_defaults.gni")
if (build_with_chromium) {
source_set("tint_spirv_tools_fuzzer") {
public_configs = [
"${tint_root_dir}/src:tint_config",
"${tint_root_dir}/src:tint_common_config",
]
include_dirs = [ "${root_gen_dir}/third_party/vulkan-deps/spirv-tools/src" ]
deps = [
"${tint_root_dir}/fuzzers:tint_fuzzer_common",
"${tint_spirv_tools_dir}/:spvtools_fuzz",
"${tint_spirv_tools_dir}/:spvtools_opt",
"${tint_spirv_tools_dir}/:spvtools_reduce",
"//third_party/protobuf:protobuf_full",
]
sources = [
"cli.cc",
"cli.h",
"fuzzer.cc",
"mutator.cc",
"mutator.h",
"mutator_cache.cc",
"mutator_cache.h",
"spirv_fuzz_mutator.cc",
"spirv_fuzz_mutator.h",
"spirv_opt_mutator.cc",
"spirv_opt_mutator.h",
"spirv_reduce_mutator.cc",
"spirv_reduce_mutator.h",
"util.cc",
"util.h",
]
}
}