Not sure about for Shark, but for Spark, RDD dependencies can be shared among parents, so you may be counting the same ancestor dependency more than once here.  See spark.scheduler.DAGSheduler.getParentStages