)]}'
{
  "commit": "9dffa1db02bdc9701b500c322ee85b5091fde5a7",
  "tree": "dac8715af19389e6a97e2029659325b953870afe",
  "parents": [
    "5c76c31625f98d3db3adb0cccebb0810371aae87"
  ],
  "author": {
    "name": "Tamir Duberstein",
    "email": "tamird@gmail.com",
    "time": "Mon Oct 26 02:59:11 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Oct 26 03:00:48 2026 -0700"
  },
  "message": "Guard discovery using evaluated action inputs (#31998)\n\n### Description\n\nPass the inputs evaluated for the current invocation to the input-discovery guard, together with the action\u0027s scheduling dependencies. Previously pruned inputs restored on the action are evaluated after discovery, before the execution guard protects them.\n\n### Motivation\n\nA pruning action resets its original input set, while ActionExecutionFunction initially evaluates only inputs restored from its action cache. After a rewind switches the synchronizer to fine-grained locks, discovery can therefore try to expand a pruned runfiles tree whose metadata has not been requested. This crashes in RemoteRewoundActionSynchronizer.lockKeysFor, as observed while rebuilding a kernel with remote caching [1]. The existing metadata invariant remains enforced.\n\nThe crash stack from [1]:\n\n```text\njava.lang.RuntimeException: Unrecoverable error while evaluating node \u0027ActionLookupData{actionLookupKey\u003dActionTemplateExpansionKey{actionLookupKey\u003dConfiguredTargetKey{label\u003d//test/kernel:kernel_6_6_build, config\u003dBuildConfigurationKey[0358dac2367b24cc5bcd0c1c1892392ded9fb1c9afaef15f1292bc073297b5a5]}, actionIndex\u003d148}, actionIndex\u003d36}\u0027 (requested by nodes \u0027File:[[\u003cexecution_root\u003e]bazel-out/x86_64-unknown-linux-musl-fastbuild/bin]test/kernel/kernel_6_6_build.scans3\u0027)\n\tat com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.runCore(AbstractParallelEvaluator.java:555)\n\tat com.google.devtools.build.lib.concurrent.QuiescingTask.exec(QuiescingTask.java:78)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)\nCaused by: java.lang.NullPointerException: File:[[\u003cexecution_root\u003e]bazel-out/rbe_x86_64_linux-opt-exec/bin]external/pahole+/pahole.runfiles\n\tat com.google.common.base.Preconditions.checkNotNull(Preconditions.java:975)\n\tat com.google.devtools.build.lib.remote.RemoteRewoundActionSynchronizer.lockKeysFor(RemoteRewoundActionSynchronizer.java:411)\n\tat com.google.devtools.build.lib.remote.RemoteRewoundActionSynchronizer.lambda$inputKeysFor$0(RemoteRewoundActionSynchronizer.java:395)\n\tat com.google.common.collect.Iterators$6.transform(Iterators.java:830)\n\tat com.google.common.collect.TransformedIterator.next(TransformedIterator.java:51)\n\tat com.google.common.collect.TransformedIterator.next(TransformedIterator.java:51)\n\tat com.google.common.collect.Iterators$ConcatenatedIterator.hasNext(Iterators.java:1421)\n\tat com.github.benmanes.caffeine.cache.LocalLoadingCache.loadSequentially(LocalLoadingCache.java:72)\n\tat com.github.benmanes.caffeine.cache.LocalLoadingCache.getAll(LocalLoadingCache.java:65)\n\tat com.google.devtools.build.lib.remote.RemoteRewoundActionSynchronizer.lockArtifactsForConsumption(RemoteRewoundActionSynchronizer.java:369)\n\tat com.google.devtools.build.lib.remote.RemoteRewoundActionSynchronizer.enterInputDiscovery(RemoteRewoundActionSynchronizer.java:288)\n\tat com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.discoverInputs(SkyframeActionExecutor.java:1064)\n\tat com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:778)\n\tat com.google.devtools.build.lib.skyframe.ActionExecutionFunction.computeInternal(ActionExecutionFunction.java:355)\n\tat com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:207)\n\tat com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.runCore(AbstractParallelEvaluator.java:474)\n\t... 5 more\n```\n\nThe regression uses ordinary unused_inputs_list, a declared tool with an unused runfiles tree, a changed source, and an evicted remote blob. It forces rewinding before rediscovery and checks recovery with and without a disk cache. The existing synchronizer test continues to verify scheduling-dependency producer protection independently of the passed input set.\n\n### Build API Changes\n\nNo\n\n### Checklist\n\n- [x] I have added tests for the new use cases.\n- [x] I have updated the input-discovery contract and synchronization proof.\n\n### Release Notes\n\nRELNOTES: Fix a crash when input pruning and remote action rewinding interact with runfiles trees.\n\n[1]: https://github.com/aya-rs/aya/actions/runs/39850538176/job/120075173645\n\nWritten and submitted by Codex on behalf of Tamir Duberstein.\n\nCloses #31998\n\nCOPYBARA_INTEGRATE_REVIEW\u003dhttps://github.com/bazelbuild/bazel/pull/31998 from tamird:codex/pruned-input-discovery-locks 4244111d58f0a07584ccf3d4a1c52925d747c18b\nPiperOrigin-RevId: 1007136610\nChange-Id: I8bd94abad3244e72861b1cc1200452e6830d3000\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "fb6926a9c1e1386a3c02914734243a6137026be4",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/remote/BUILD",
      "new_id": "01ca797cf0c4018c0c57c0b6e43cf899758b8906",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/remote/BUILD"
    },
    {
      "type": "modify",
      "old_id": "b7b99d8d07d3b0ac790e3bf53366b4dafbd6d555",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/remote/RemoteRewoundActionSynchronizer.java",
      "new_id": "5483564b6e7ccba707c73d781a49dfdab106a4ae",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/remote/RemoteRewoundActionSynchronizer.java"
    },
    {
      "type": "modify",
      "old_id": "a1012f35ea8be42bb643322fd110ac12063bf579",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java",
      "new_id": "1548599262823c611835fb73d17aebd3be8f72ed",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java"
    },
    {
      "type": "modify",
      "old_id": "877defe7718e9b912b38dcb523b555651d60d0e9",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java",
      "new_id": "396930649fbed12cf69812548f18c131cd9b40a3",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java"
    },
    {
      "type": "modify",
      "old_id": "27c25dc4cc78a51b6a8620f98c0b29fcecae98e8",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/vfs/BUILD",
      "new_id": "1a5414432491bb66bb5619f3823c57d91b9e78a9",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/vfs/BUILD"
    },
    {
      "type": "modify",
      "old_id": "194499823c3bd36b66975c765cac618b472f48d1",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/vfs/OutputService.java",
      "new_id": "2bbd01d5125773e3daffd01f081b7b0edf5bd9e3",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/vfs/OutputService.java"
    },
    {
      "type": "modify",
      "old_id": "b1feb251b15465b8221d5482a6d9328cae671cdd",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/devtools/build/lib/remote/BuildWithoutTheBytesIntegrationTest.java",
      "new_id": "eef21e1725afdd1de79b0fdfff89e01fb1726b49",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/devtools/build/lib/remote/BuildWithoutTheBytesIntegrationTest.java"
    },
    {
      "type": "modify",
      "old_id": "5d26763174b27c2779bdcfd3f1072b9916f0f111",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/devtools/build/lib/remote/RemoteRewoundActionSynchronizerTest.java",
      "new_id": "71a758b401f5504e529701a34f7230a980d394b7",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/devtools/build/lib/remote/RemoteRewoundActionSynchronizerTest.java"
    }
  ]
}
