[1/3] Remove the term "sanity" in comments.

Code references are not changed.

PiperOrigin-RevId: 334518842
diff --git a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
index 3ceccee..218aae2 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java
@@ -371,7 +371,7 @@
    * <p>If the path refers to a directory, recursively removes the contents of the directory.
    *
    * @param path the output to remove
-   * @param root the root containing the output. This is used to sanity-check that we don't delete
+   * @param root the root containing the output. This is used to check that we don't delete
    *     arbitrary files in the file system.
    */
   public static void deleteOutput(Path path, @Nullable ArtifactRoot root) throws IOException {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
index b4cb8dc..1ef93b5 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -920,7 +920,7 @@
       ImmutableList<String> transitionKeys = t.getTransitionKeys();
       if (transitionKeys.isEmpty()) {
         // The split transition is not active, i.e. does not change build configurations.
-        // TODO(jungjw): Investigate if we need to do a sanity check here.
+        // TODO(jungjw): Investigate if we need to do a check here.
         return ImmutableMap.of(Optional.absent(), deps);
       }
       for (String key : transitionKeys) {
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java
index e90a9db..1aba00b 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkRuleConfiguredTargetUtil.java
@@ -543,10 +543,11 @@
 
     if (context.getRuleContext().getRule().isAnalysisTest()) {
       // The Starlark Build API should already throw exception if the rule implementation attempts
-      // to register any actions. This is just a sanity check of this invariant.
+      // to register any actions. This is just a check of this invariant.
       Preconditions.checkState(
           context.getRuleContext().getAnalysisEnvironment().getRegisteredActions().isEmpty(),
-          "%s", context.getRuleContext().getLabel());
+          "%s",
+          context.getRuleContext().getLabel());
 
       executable = context.getRuleContext().createOutputArtifactScript();
     }
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/ninja/actions/NinjaActionsHelper.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/ninja/actions/NinjaActionsHelper.java
index f83a22d..a877dea 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/ninja/actions/NinjaActionsHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/ninja/actions/NinjaActionsHelper.java
@@ -122,7 +122,7 @@
           }
           enqueuer.accept(target.getAllInputs());
         } else {
-          // Sanity check that the Ninja action we're skipping (because its outputs are already
+          // Verify that the Ninja action we're skipping (because its outputs are already
           // being symlinked using output_root_inputs) has only symlink outputs specified in
           // output_root_inputs. Otherwise we might skip some other outputs.
           List<PathFragment> outputsInOutputRootInputsSymlinks = new ArrayList<>();
diff --git a/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetStore.java b/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetStore.java
index d0a94d6..c62b833 100644
--- a/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetStore.java
+++ b/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetStore.java
@@ -217,7 +217,7 @@
               fingerprintToContents.put(fingerprint, contents);
               // There may already be an entry here, but it's better to put a fingerprint result
               // with an immediate future, since then later readers won't need to block
-              // unnecessarily. It would be nice to sanity check the old value, but Cache#put
+              // unnecessarily. It would be nice to check the old value, but Cache#put
               // doesn't provide it to us.
               contentsToFingerprint.put(
                   contents,
diff --git a/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java b/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java
index 2a7b3bf..596cd3d 100644
--- a/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java
+++ b/src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java
@@ -112,7 +112,7 @@
    * @param branchDone semaphore that is expected to receive a permit once {@code branch} terminates
    *     (after {@link InterruptedException} bubbles up through its call stack)
    * @param cancellingStrategy identifier of the strategy that is performing the cancellation. Used
-   *     to prevent cross-cancellations and to sanity-check that the same strategy doesn't issue the
+   *     to prevent cross-cancellations and to check that the same strategy doesn't issue the
    *     cancellation twice.
    * @param strategyThatCancelled name of the first strategy that executed this method, or a null
    *     reference if this is the first time this method is called. If not null, we expect the value
diff --git a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
index 98c7e9f..715d6ba 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/RuleClass.java
@@ -2020,7 +2020,7 @@
   }
 
   /**
-   * Same as {@link #createRule}, except without some internal sanity checks.
+   * Same as {@link #createRule}, except without some internal checks.
    *
    * <p>Don't call this function unless you know what you're doing.
    */
diff --git a/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java b/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java
index ae4543c0..3a3849d 100644
--- a/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java
+++ b/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java
@@ -385,9 +385,10 @@
     this.actionCountTimeSeries =
         new TimeSeries(Duration.ofNanos(actionCountStartTime).toMillis(), ACTION_COUNT_BUCKET_MS);
 
-    // sanity check for current limitation on the number of supported types due
-    // to using enum.ordinal() to store them instead of EnumSet for performance reasons.
-    Preconditions.checkState(TASK_COUNT < 256,
+    // Check for current limitation on the number of supported types due to using enum.ordinal() to
+    // store them instead of EnumSet for performance reasons.
+    Preconditions.checkState(
+        TASK_COUNT < 256,
         "The profiler implementation supports only up to 255 different ProfilerTask values.");
 
     // reset state for the new profiling session
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
index 3b31ce7..ac13289 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCommon.java
@@ -304,9 +304,8 @@
   }
 
   /**
-   * Returns the files from headers and does some sanity checks. Note that this method reports
-   * warnings to the {@link RuleContext} as a side effect, and so should only be called once for any
-   * given rule.
+   * Returns the files from headers and does some checks. Note that this method reports warnings to
+   * the {@link RuleContext} as a side effect, and so should only be called once for any given rule.
    */
   public static List<Pair<Artifact, Label>> getHeaders(RuleContext ruleContext) {
     Map<Artifact, Label> map = Maps.newLinkedHashMap();
@@ -352,9 +351,8 @@
   }
 
   /**
-   * Returns the files from headers and does some sanity checks. Note that this method reports
-   * warnings to the {@link RuleContext} as a side effect, and so should only be called once for any
-   * given rule.
+   * Returns the files from headers and does some checks. Note that this method reports warnings to
+   * the {@link RuleContext} as a side effect, and so should only be called once for any given rule.
    */
   public List<Pair<Artifact, Label>> getHeaders() {
     return getHeaders(ruleContext);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java
index ec9b0e1..6aca8e5 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java
@@ -217,7 +217,7 @@
             && (appearsToHaveObjectFiles(ruleContext.attributes())
                 || featureConfiguration.isEnabled(CppRuleClasses.HEADER_MODULE_CODEGEN));
     if (soFilename != null) {
-      if (!soFilename.getPathString().endsWith(".so")) { // Sanity check.
+      if (!soFilename.getPathString().endsWith(".so")) {
         ruleContext.attributeError("outs", "file name must end in '.so'");
       }
       if (createDynamicLibrary) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java
index c92c868..49da74f 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCommon.java
@@ -301,8 +301,8 @@
   }
 
   /**
-   * Sanity checks the given runtime dependencies, and emits errors if there is a problem. Also
-   * called by {@link #initCommon()} for the current target's runtime dependencies.
+   * Checks the given runtime dependencies, and emits errors if there is a problem. Also called by
+   * {@link #initCommon()} for the current target's runtime dependencies.
    */
   public static void checkRuntimeDeps(
       RuleContext ruleContext, List<TransitiveInfoCollection> runtimeDepInfo) {
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
index af50237..ae8ac90 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommand.java
@@ -787,7 +787,7 @@
    * *_test rules, *_binary rules, aliases, generated outputs, and inputs.
    *
    * <p>Determining definitively whether a rule produces an executable can only be done after
-   * analysis; this is only an early sanity check to quickly catch most mistakes.
+   * analysis. This is only an early check to quickly catch most mistakes.
    */
   private static boolean isExecutable(Target target) {
     return isPlainFile(target)
diff --git a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
index d6c50f9..c3ca10f 100644
--- a/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/AbstractExceptionalParallelEvaluator.java
@@ -170,7 +170,7 @@
         informProgressReceiverThatValueIsDone(skyKey, batch.get(skyKey));
       }
       // Note that the 'catastrophe' parameter doesn't really matter here (it's only used for
-      // sanity checking).
+      // checking).
       return constructResultExceptionally(skyKeySet, null, /*catastrophe=*/ false);
     }
 
@@ -190,7 +190,7 @@
       // Errors, even cached ones, should halt evaluations not in keepGoing mode.
       if (!cachedErrorKeys.isEmpty()) {
         // Note that the 'catastrophe' parameter doesn't really matter here (it's only used for
-        // sanity checking).
+        // checking).
         return constructResultExceptionally(cachedErrorKeys, null, /*catastrophe=*/ false);
       }
     }
diff --git a/src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java b/src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java
index ca2e6c4..3ad32ab 100644
--- a/src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java
+++ b/src/main/java/com/google/devtools/common/options/IsolatedOptionsData.java
@@ -222,9 +222,9 @@
   }
 
   /**
-   * Constructs an {@link IsolatedOptionsData} object for a parser that knows about the given
-   * {@link OptionsBase} classes. No inter-option analysis is done. Performs basic sanity checking
-   * on each option in isolation.
+   * Constructs an {@link IsolatedOptionsData} object for a parser that knows about the given {@link
+   * OptionsBase} classes. No inter-option analysis is done. Performs basic validity checks on each
+   * option in isolation.
    */
   static IsolatedOptionsData from(Collection<Class<? extends OptionsBase>> classes) {
     // Mind which fields have to preserve order.
diff --git a/src/main/java/com/google/devtools/common/options/OptionsBase.java b/src/main/java/com/google/devtools/common/options/OptionsBase.java
index 8208442..cb5c8ba 100644
--- a/src/main/java/com/google/devtools/common/options/OptionsBase.java
+++ b/src/main/java/com/google/devtools/common/options/OptionsBase.java
@@ -51,11 +51,9 @@
   private static final Escaper ESCAPER = new CharEscaperBuilder()
       .addEscape('\\', "\\\\").addEscape('"', "\\\"").toEscaper();
 
-  /**
-   * Subclasses must provide a default (no argument) constructor.
-   */
+  /** Subclasses must provide a default (no argument) constructor. */
   protected OptionsBase() {
-    // There used to be a sanity check here that checks the stack trace of this constructor
+    // There used to be a validation here that checks the stack trace of this constructor
     // invocation; unfortunately, that makes the options construction about 10x slower. So be
     // careful with how you construct options classes.
   }
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
index 62606f8..6d42378 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidBinaryTest.java
@@ -3549,7 +3549,7 @@
     assertThat(getConfiguredTarget("//java/com/google/android/foo:foo")).isNotNull();
     // the package_group is busted, so we would have failed to get this far if we depended on it
     assertNoEvents();
-    // sanity check time: does this test actually test what we're testing for?
+    // Check time: does this test actually test what we're testing for?
     reporter.removeHandler(failFastHandler);
     assertThat(getConfiguredTarget("//tools/allowlists/config_feature_flag:config_feature_flag"))
         .isNull();
diff --git a/src/test/shell/integration/execution_phase_tests.sh b/src/test/shell/integration/execution_phase_tests.sh
index 9905faf..fb40a39 100755
--- a/src/test/shell/integration/execution_phase_tests.sh
+++ b/src/test/shell/integration/execution_phase_tests.sh
@@ -221,8 +221,8 @@
       || fail "External change to action cache misdetected"
 
   # For completeness, make the changes to the same output file visibile and
-  # ensure Blaze notices them.  This is to sanity-check that we actually
-  # modified the right output file above.
+  # ensure Blaze notices them.  This is to check that we actually modified the
+  # right output file above.
   touch "${output_file}"
   bazel build package:foo >>"${TEST_log}" 2>&1 || fail "Should build"
   [[ "$(cat "${output_file}")" == foo ]] \