Rename `EvaluationState.changed()` to `EvaluationState.versionChanged()`.

This is a more accurate name for the method, as it indicates that the node's version changed at the current version, regardless of whether its value changed.

PiperOrigin-RevId: 686173970
Change-Id: I6502aa611e286dcca3bccf3cbb7712e7794cecc4
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
index 3c9ce5a..d684b87 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java
@@ -1488,7 +1488,7 @@
       if (!(skyKey instanceof ActionLookupKey)) {
         return;
       }
-      if (!state.changed()) {
+      if (!state.versionChanged()) {
         // ActionLookupValue subclasses don't implement equality, so must have been marked clean.
         dirtiedActionLookupKeys.remove(skyKey);
       } else if (state.succeeded()) {
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
index a9bceab..550dcad 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeExecutor.java
@@ -3085,7 +3085,7 @@
         }
       }
 
-      if (state.changed()) {
+      if (state.versionChanged()) {
         skyKeyStateReceiver.evaluated(skyKey);
       }
       if (ignoreInvalidations) {
diff --git a/src/main/java/com/google/devtools/build/skyframe/EvaluationProgressReceiver.java b/src/main/java/com/google/devtools/build/skyframe/EvaluationProgressReceiver.java
index 27b4c95..109bc36 100644
--- a/src/main/java/com/google/devtools/build/skyframe/EvaluationProgressReceiver.java
+++ b/src/main/java/com/google/devtools/build/skyframe/EvaluationProgressReceiver.java
@@ -26,26 +26,26 @@
 
   /** The state of a node after it was evaluated. */
   enum EvaluationState {
-    SUCCESS_CHANGED(true, true),
-    SUCCESS_UNCHANGED(true, false),
-    FAIL_CHANGED(false, true),
-    FAIL_UNCHANGED(false, true);
+    SUCCESS_VERSION_CHANGED(true, true),
+    SUCCESS_VERSION_UNCHANGED(true, false),
+    FAIL_VERSION_CHANGED(false, true),
+    FAIL_VERSION_UNCHANGED(false, true);
 
-    static EvaluationState get(@Nullable SkyValue valueMaybeWithMetadata, boolean changed) {
+    static EvaluationState get(@Nullable SkyValue valueMaybeWithMetadata, boolean versionChanged) {
       boolean success = ValueWithMetadata.justValue(valueMaybeWithMetadata) != null;
-      if (changed) {
-        return success ? SUCCESS_CHANGED : FAIL_CHANGED;
+      if (versionChanged) {
+        return success ? SUCCESS_VERSION_CHANGED : FAIL_VERSION_CHANGED;
       } else {
-        return success ? SUCCESS_UNCHANGED : FAIL_UNCHANGED;
+        return success ? SUCCESS_VERSION_UNCHANGED : FAIL_VERSION_UNCHANGED;
       }
     }
 
     private final boolean succeeded;
-    private final boolean changed;
+    private final boolean versionChanged;
 
-    EvaluationState(boolean succeeded, boolean changed) {
+    EvaluationState(boolean succeeded, boolean versionChanged) {
       this.succeeded = succeeded;
-      this.changed = changed;
+      this.versionChanged = versionChanged;
     }
 
     /**
@@ -60,15 +60,16 @@
     /**
      * Whether the node's {@link NodeEntry#getVersion} changed as a result of this evaluation.
      *
-     * <p>If {@code true}, the node was built during the current evaluation and its {@link
-     * NodeEntry#getVersion} changed. Parents need to be rebuilt.
+     * <p>If {@code true}, the node was built at the current version and its {@link
+     * NodeEntry#getVersion} changed, either because it was built incrementally and changed or was
+     * built as part of a clean build. Parents need to be rebuilt.
      *
      * <p>If {@code false}, the node's {@link NodeEntry#getVersion} did not change, either because
-     * it was deemed up-to-date and not built or was built and evaluated to the same value as its
-     * prior evaluation. Parents do not necessarily need to be rebuilt.
+     * it was deemed up-to-date and not built or was built incrementally and evaluated to the same
+     * value as its prior evaluation. Parents do not necessarily need to be rebuilt.
      */
-    public boolean changed() {
-      return changed;
+    public boolean versionChanged() {
+      return versionChanged;
     }
   }
 
@@ -127,9 +128,9 @@
    * Notifies that the node for {@code skyKey} has been evaluated.
    *
    * @param state the current state of the node for {@code skyKey}
-   * @param newValue the node's value if {@link EvaluationState#changed()} and {@link
+   * @param newValue the node's value if {@link EvaluationState#versionChanged()} and {@link
    *     EvaluationState#succeeded()}, otherwise {@code null}
-   * @param newError the node's error if it has one and {@link EvaluationState#changed()}
+   * @param newError the node's error if it has one and {@link EvaluationState#versionChanged()}
    * @param directDeps direct dependencies of {@code skyKey} if the node was just built, otherwise
    *     {@code null}
    */
diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java
index b2a5fab..b1648ce 100644
--- a/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java
+++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryMemoizingEvaluator.java
@@ -117,7 +117,7 @@
 
       if (directDeps == null) {
         // In this case, no actual evaluation work was done so let's not record it.
-      } else if (state.changed()) {
+      } else if (state.versionChanged()) {
         built.add(skyKey.functionName(), 1);
       } else {
         cleaned.add(skyKey.functionName(), 1);
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeAwareActionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeAwareActionTest.java
index 7fd421c..6e2046e 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeAwareActionTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/SkyframeAwareActionTest.java
@@ -470,11 +470,11 @@
       assertThat(newEntry).isNotNull();
       if (expectActionIs.actuallyClean()) {
         // Action was dirtied but verified clean.
-        assertThat(newEntry.state.changed()).isFalse();
+        assertThat(newEntry.state.versionChanged()).isFalse();
       } else {
         // Action was dirtied and rebuilt. It was either reexecuted or was an action cache hit,
         // doesn't matter here.
-        assertThat(newEntry.state.changed()).isTrue();
+        assertThat(newEntry.state.versionChanged()).isTrue();
       }
     } else {
       // Action was not dirtied.
diff --git a/src/test/java/com/google/devtools/build/skyframe/TrackingProgressReceiver.java b/src/test/java/com/google/devtools/build/skyframe/TrackingProgressReceiver.java
index 914bd01..5924513 100644
--- a/src/test/java/com/google/devtools/build/skyframe/TrackingProgressReceiver.java
+++ b/src/test/java/com/google/devtools/build/skyframe/TrackingProgressReceiver.java
@@ -75,7 +75,7 @@
     evaluated.add(skyKey);
     if (checkEvaluationResults && state.succeeded()) {
       deleted.remove(skyKey);
-      if (!state.changed()) {
+      if (!state.versionChanged()) {
         dirty.remove(skyKey);
       }
     }