blob: e60e35de4dccd370505240033de831eef287e8fa [file] [log] [blame]
// 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
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package tint.fuzzers.ast_fuzzer.protobufs;
message Mutation {
oneof mutation {
MutationReplaceIdentifier replace_identifier = 1;
MutationChangeBinaryOperator change_binary_operator = 2;
message MutationSequence {
repeated Mutation mutation = 1;
message MutatorState {
// Contains the state of the fuzzer.
// The program that is being fuzzed. This can be either
// the original program (if mutation sequence is available) or
// the mutated version (if mutations are being recorded).
string program = 1;
// The sequence of mutations that was applied to the `program`.
// This may not have any mutations if they are not being recorded.
MutationSequence mutation_sequence = 2;
message MutationReplaceIdentifier {
// This transformation replaces a use of one variable with another.
// The id of the use of a variable in the AST.
uint32 use_id = 1;
// The id of a definition of a variable to replace the use with.
uint32 replacement_id = 2;
message MutationChangeBinaryOperator {
// This transformation replaces one binary operator with another.
// The id of a binary expression in the AST.
uint32 binary_expr_id = 1;
// A BinaryOp representing the new binary operator.
uint32 new_operator = 2;