Add a comment clarifying the soundness of not doing edge filtering during the DTC construction of the universe argument to 'rdeps'.
RELNOTES: None
PiperOrigin-RevId: 207884395
diff --git a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
index 0c759a8..8918af1 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/SkyQueryEnvironment.java
@@ -1208,6 +1208,9 @@
QueryExpressionContext<Target> context,
Callback<Target> callback) {
return transformAsync(
+ // Even if we need to do edge filtering, it's fine to construct the rdeps universe via an
+ // unfiltered DTC visitation; the subsequent rdeps visitation will perform the edge
+ // filtering.
getUnfilteredUniverseDTCSkyKeyPredicateFuture(universe, context),
unfilteredUniversePredicate -> ParallelSkyQueryUtils.getRdepsInUniverseUnboundedParallel(
this, expression, unfilteredUniversePredicate, context, callback, packageSemaphore));
@@ -1236,6 +1239,9 @@
QueryExpressionContext<Target> context,
Callback<Target> callback) {
return transformAsync(
+ // Even if we need to do edge filtering, it's fine to construct the rdeps universe via an
+ // unfiltered DTC visitation; the subsequent rdeps visitation will perform the edge
+ // filtering.
getUnfilteredUniverseDTCSkyKeyPredicateFuture(universe, context),
universePredicate -> ParallelSkyQueryUtils.getRdepsInUniverseBoundedParallel(
this, expression, depth, universePredicate, context, callback, packageSemaphore));