)]}'
{
  "commit": "cc1e0a6ba439764fea48e1f8035419aa44313f05",
  "tree": "4229f61bd6d1ebf2d1f2dffb77f72cbce43ffbd2",
  "parents": [
    "4bf9dc097f7afa8bd5b0c5e792192784ac939841"
  ],
  "author": {
    "name": "jhorvitz",
    "email": "jhorvitz@google.com",
    "time": "Mon Jan 19 07:08:00 2026 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Jan 19 07:09:38 2026 -0800"
  },
  "message": "Call `resetDiscoveredInputs()` on `unused_inputs_list` actions to free the flattened set of used inputs.\n\nThe flat `NestedSet` of used inputs is memory-inefficient because the original `NestedSet` structure is lost. Note that this change does not save memory on builds with `--notrack_incremental_state` or `--nokeep_state_after_build` because those already call `resetDiscoveredInputs()`.\n\nIn the new implementation:\n\n* New method `Action#prunedInputs` communicates whether the action detected unused inputs.\n* `resetDiscoveredInputs()` is called after execution to return the action to a pre-input-discovery state.\n\nOther changes:\n\n* The map of inputs in `EnhancedStarlarkAction#afterExecute` is initialized lazily to reduce garbage when there are no unused inputs.\n* `ActionCacheAwareAction` is no longer necessary because `prunedInputs()` tells `ActionCacheChecker` to store all inputs\u0027 exec paths in the action cache.\n* `ActionExecutionFunction` calls `prunedInputs()` to determine whether to request action inputs up front or wait until input discovery[*]. Actions that pruned inputs can get an action cache hit without requesting unused inputs.\n* `addDiscoveredInputs()` uses `ActionInputMapHelper` to handle aggregation artifacts, which can now be \"discovered\" (when we avoid requesting the inputs up front). This is cleaner anyway.\n\nThe only behavior change is that `aquery --noinclude_pruned_inputs` still reports unused inputs, even after a build. This seems like an acceptable compromise for the memory savings.\n\n[*]The initial execution of the action always requests the full set of inputs up front in order to take advantage of `ArtifactNestedSetKey` dependency structure. Discovered inputs are always requested directly, not via `ArtifactNestedSetKey` (although I don\u0027t know of a fundamental reason why).\n\nPiperOrigin-RevId: 858177876\nChange-Id: I72a952e70c7afe8341185304434f1424c827ca05\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "58d565be9ffb60f60618b56bf1f1dfb9f417a2e2",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java",
      "new_id": "0d413eaf5c67f78edc886a1ff569df7bcc1e92d1",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java"
    },
    {
      "type": "modify",
      "old_id": "b55824245936468624bc3de9130b8d308dfa11ee",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/Action.java",
      "new_id": "1255bc62c87fe189cac3a504f4e22fd64b775904",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/Action.java"
    },
    {
      "type": "delete",
      "old_id": "256414b4cc68de822737a9c5928c50c0742f36a1",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/ActionCacheAwareAction.java",
      "new_id": "0000000000000000000000000000000000000000",
      "new_mode": 0,
      "new_path": "/dev/null"
    },
    {
      "type": "modify",
      "old_id": "65b26f8a8bc502f61d4565e0cb5c70634f6f3e09",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java",
      "new_id": "d7b3354ab72082c5242451249a47c347e65c281b",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/ActionCacheChecker.java"
    },
    {
      "type": "modify",
      "old_id": "2d056ca55fc4423b2b9772971fb6b65a3454cf63",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/BUILD",
      "new_id": "bb65a4ac2bf556b669f90efd30e9a9ab2dec250d",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/BUILD"
    },
    {
      "type": "modify",
      "old_id": "13fcd0dbfe5a8d14f4653feba607b6a52fd68a5f",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java",
      "new_id": "d41741fc11efdf8a2bdd47ff0fd06c51b5a23bd6",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/cache/ActionCache.java"
    },
    {
      "type": "modify",
      "old_id": "467f991c64183316563abc0d8f8255b8d3fa012d",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java",
      "new_id": "47b0e46cb1c06e4b3430f712ffcce238c693fb1a",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/actions/cache/CompactPersistentActionCache.java"
    },
    {
      "type": "modify",
      "old_id": "c50a50227f3bc903a7c79388375f12182351f088",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java",
      "new_id": "cee832a6b9050e8f3145520df8c7131ad83a873b",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/analysis/actions/StarlarkAction.java"
    },
    {
      "type": "modify",
      "old_id": "abfc2f04d0942bae944621284a829d5f27b863b2",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/query2/aquery/AqueryUtils.java",
      "new_id": "1dca214d3209ede438194b81bd897fad8d40ad45",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/query2/aquery/AqueryUtils.java"
    },
    {
      "type": "modify",
      "old_id": "b12093b94ebd0071b2ff7836a206e9c01c931c7c",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java",
      "new_id": "9dd7041c8a671c8e29f653d123f7cae08281fed3",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/skyframe/ActionExecutionFunction.java"
    },
    {
      "type": "modify",
      "old_id": "867794436054272af9e7f10797389d5f000cebcb",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java",
      "new_id": "be6256ff30fa747808c815fccad51c2f91567cdb",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/skyframe/SkyframeActionExecutor.java"
    },
    {
      "type": "modify",
      "old_id": "d57d65b70cee6152334aead6b25410766d576a2e",
      "old_mode": 33261,
      "old_path": "src/test/shell/integration/aquery_test.sh",
      "new_id": "0f719f419854ecc70de225106349e11da39bab83",
      "new_mode": 33261,
      "new_path": "src/test/shell/integration/aquery_test.sh"
    }
  ]
}
