From 5910ec1e8afc0af016278edc2e16d86b9a2fc6a1 Mon Sep 17 00:00:00 2001 From: James Price Date: Wed, 8 Sep 2021 18:08:36 +0000 Subject: [PATCH] Output WGSL instead of SPIR-V in transform fuzzers Generating SPIR-V can cause validation failures when out-of-bounds accesses are performed, since we are not running the robustness transform. Bug: chromium:1246061 Change-Id: Ied58d77d90079d10d5579d2d55854c3cfbc18db5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/63640 Kokoro: Kokoro Reviewed-by: Ben Clayton Commit-Queue: James Price --- fuzzers/tint_binding_remapper_fuzzer.cc | 2 +- fuzzers/tint_first_index_offset_fuzzer.cc | 2 +- fuzzers/tint_inspector_fuzzer.cc | 2 +- fuzzers/tint_renamer_fuzzer.cc | 2 +- fuzzers/tint_robustness_fuzzer.cc | 2 +- fuzzers/tint_single_entry_point_fuzzer.cc | 2 +- fuzzers/tint_vertex_pulling_fuzzer.cc | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fuzzers/tint_binding_remapper_fuzzer.cc b/fuzzers/tint_binding_remapper_fuzzer.cc index 5a8f0cd96f..a4d489ab7c 100644 --- a/fuzzers/tint_binding_remapper_fuzzer.cc +++ b/fuzzers/tint_binding_remapper_fuzzer.cc @@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform_manager.Add(); - fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetDumpInput(GetCliParams().dump_input); diff --git a/fuzzers/tint_first_index_offset_fuzzer.cc b/fuzzers/tint_first_index_offset_fuzzer.cc index bb7f910761..7cf5890fa9 100644 --- a/fuzzers/tint_first_index_offset_fuzzer.cc +++ b/fuzzers/tint_first_index_offset_fuzzer.cc @@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform_manager.Add(); - tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetDumpInput(GetCliParams().dump_input); diff --git a/fuzzers/tint_inspector_fuzzer.cc b/fuzzers/tint_inspector_fuzzer.cc index 5812faf26c..9175ea2bd8 100644 --- a/fuzzers/tint_inspector_fuzzer.cc +++ b/fuzzers/tint_inspector_fuzzer.cc @@ -23,7 +23,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform::DataMap transform_inputs; transform_manager.Add(); - tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.EnableInspector(); fuzzer.SetDumpInput(GetCliParams().dump_input); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); diff --git a/fuzzers/tint_renamer_fuzzer.cc b/fuzzers/tint_renamer_fuzzer.cc index 771487b94f..7528915909 100644 --- a/fuzzers/tint_renamer_fuzzer.cc +++ b/fuzzers/tint_renamer_fuzzer.cc @@ -22,7 +22,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform::Manager transform_manager; transform_manager.Add(); - fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, {}); fuzzer.SetDumpInput(GetCliParams().dump_input); diff --git a/fuzzers/tint_robustness_fuzzer.cc b/fuzzers/tint_robustness_fuzzer.cc index 66cf0d5bed..3ae61211b8 100644 --- a/fuzzers/tint_robustness_fuzzer.cc +++ b/fuzzers/tint_robustness_fuzzer.cc @@ -22,7 +22,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { tint::transform::Manager transform_manager; transform_manager.Add(); - tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, {}); fuzzer.SetDumpInput(GetCliParams().dump_input); diff --git a/fuzzers/tint_single_entry_point_fuzzer.cc b/fuzzers/tint_single_entry_point_fuzzer.cc index 13b9d33af6..cc5dbce712 100644 --- a/fuzzers/tint_single_entry_point_fuzzer.cc +++ b/fuzzers/tint_single_entry_point_fuzzer.cc @@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform_manager.Add(); - tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetDumpInput(GetCliParams().dump_input); diff --git a/fuzzers/tint_vertex_pulling_fuzzer.cc b/fuzzers/tint_vertex_pulling_fuzzer.cc index d6c39154c2..a92f9b2964 100644 --- a/fuzzers/tint_vertex_pulling_fuzzer.cc +++ b/fuzzers/tint_vertex_pulling_fuzzer.cc @@ -30,7 +30,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { transform_manager.Add(); - tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kSpv); + tint::fuzzers::CommonFuzzer fuzzer(InputFormat::kWGSL, OutputFormat::kWGSL); fuzzer.SetTransformManager(&transform_manager, std::move(transform_inputs)); fuzzer.SetDumpInput(GetCliParams().dump_input);