Simplify the controller command line interface related to FuzzTest.

fuzztest_only_replay is basically aliasing load_shards_only; popluate_binary_info is always set in the framework - no need to enforce it at the controller level.

PiperOrigin-RevId: 948393888
diff --git a/centipede/centipede_flags.inc b/centipede/centipede_flags.inc
index f6d6da2..78f644f 100644
--- a/centipede/centipede_flags.inc
+++ b/centipede/centipede_flags.inc
@@ -505,9 +505,6 @@
 CENTIPEDE_FLAG(std::string, fuzztest_workdir_root, "",
                "The root directory for Centipede workdirs for working on the "
                "corpus database.")
-CENTIPEDE_FLAG(bool, fuzztest_only_replay, false,
-               "If set, further steps are skipped after replaying with the "
-               "corpus database.")
 CENTIPEDE_FLAG(
     std::string, fuzztest_execution_id, "",
     "If set, will be used when working on a corpus database to resume "
diff --git a/centipede/centipede_interface.cc b/centipede/centipede_interface.cc
index 3305045..edac2eb 100644
--- a/centipede/centipede_interface.cc
+++ b/centipede/centipede_interface.cc
@@ -366,6 +366,7 @@
     return stamp;
   }();
 
+  const bool only_replay = env.load_shards_only;
   const bool is_workdir_specified = !env.workdir.empty();
   // When env.workdir is empty, the full workdir paths will be formed by
   // appending the fuzz test names to the base workdir path. We use different
@@ -373,10 +374,9 @@
   const auto base_workdir_path =
       is_workdir_specified
           ? std::filesystem::path{}  // Will not be used.
-          : workdir_root_path /
-                absl::StrFormat("workdir%s.%03d",
-                                env.fuzztest_only_replay ? "-replay" : "",
-                                test_shard_index);
+          : workdir_root_path / absl::StrFormat("workdir%s.%03d",
+                                                only_replay ? "-replay" : "",
+                                                test_shard_index);
   // There's no point in saving the binary info to the workdir, since the
   // workdir is deleted at the end.
   env.save_binary_info = false;
@@ -495,7 +495,7 @@
     return;
   }
 
-  FUZZTEST_LOG(INFO) << (env.fuzztest_only_replay ? "Replaying " : "Fuzzing ")
+  FUZZTEST_LOG(INFO) << (only_replay ? "Replaying " : "Fuzzing ")
                      << env.test_name << " for " << time_limit
                      << "\n\tTest binary: " << env.binary;
 
@@ -531,8 +531,7 @@
 
   // TODO(xinhaoyuan): Have a separate flag to skip corpus updating instead
   // of checking whether workdir is specified or not.
-  const bool skip_corpus_db_update =
-      env.fuzztest_only_replay || is_workdir_specified;
+  const bool skip_corpus_db_update = only_replay || is_workdir_specified;
   if (skip_corpus_db_update && !env.report_crash_summary) return;
 
   // Deduplicate and optionally update the crashing inputs.
diff --git a/centipede/environment.cc b/centipede/environment.cc
index 37d2189..42abe31 100644
--- a/centipede/environment.cc
+++ b/centipede/environment.cc
@@ -245,7 +245,6 @@
   fuzztest_binary_identifier = config.binary_identifier;
   fuzztest_stats_root = config.stats_root;
   fuzztest_workdir_root = config.workdir_root;
-  fuzztest_only_replay = config.only_replay;
   fuzztest_execution_id = config.execution_id.value_or("");
   fuzztest_replay_coverage_inputs = config.replay_coverage_inputs;
   fuzztest_time_limit_per_test = config.GetTimeLimitPerTest();
@@ -316,14 +315,11 @@
       << VV(stack_limit_kb) << VV(config.stack_limit);
   stack_limit_kb = bytes_to_kb(config.stack_limit);
 
-  if (fuzztest_only_replay) {
-    load_shards_only = true;
-    populate_binary_info = false;
-  }
-
   if (test_name.empty() && config.fuzz_tests_in_current_shard.size() == 1) {
     test_name = config.fuzz_tests_in_current_shard[0];
   }
+
+  load_shards_only = config.only_replay;
 }
 
 void Environment::UpdateTimeoutPerBatchIfEqualTo(size_t val) {
diff --git a/centipede/environment_test.cc b/centipede/environment_test.cc
index 259a848..50f48e8 100644
--- a/centipede/environment_test.cc
+++ b/centipede/environment_test.cc
@@ -186,7 +186,7 @@
                "stack_limit in the target binary");
 }
 
-TEST(Environment, UpdatesFuzzTestFieldsFromTargetConfig) {
+TEST(Environment, UpdatesFieldsFromTargetConfig) {
   Environment env;
   fuzztest::internal::Configuration config;
   config.corpus_database = "db";
@@ -198,6 +198,8 @@
   config.replay_coverage_inputs = true;
   config.time_limit = absl::Seconds(10);
   config.time_budget_type = TimeBudgetType::kPerTest;
+  config.fuzz_tests_in_current_shard = {"some_test"};
+  config.jobs = 6;
 
   env.UpdateWithTargetConfig(config);
 
@@ -205,19 +207,12 @@
   EXPECT_EQ(env.fuzztest_binary_identifier, "bin");
   EXPECT_EQ(env.fuzztest_stats_root, "stats");
   EXPECT_EQ(env.fuzztest_workdir_root, "workdir");
-  EXPECT_TRUE(env.fuzztest_only_replay);
   EXPECT_EQ(env.fuzztest_execution_id, "exec");
   EXPECT_TRUE(env.fuzztest_replay_coverage_inputs);
   EXPECT_EQ(env.fuzztest_time_limit_per_test, absl::Seconds(10));
-}
-
-TEST(Environment, UpdatesReplayOnlyConfiguration) {
-  Environment env;
-  fuzztest::internal::Configuration config;
-  config.only_replay = true;
-  env.UpdateWithTargetConfig(config);
   EXPECT_TRUE(env.load_shards_only);
-  EXPECT_FALSE(env.populate_binary_info);
+  EXPECT_EQ(env.test_name, "some_test");
+  EXPECT_EQ(env.j, 6);
 }
 
 }  // namespace fuzztest::internal