Hash partition contents and compare again hashes from previous efforts #34037
Labels
A-incr-comp
Area: Incremental compilation
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
For each partition, we need to hash its contents (the symbol names of the items it contains, basically) and save them. Then, in the next compilation, we will recompute the partitions, rehash the contents, and compare against the previous hashes (alternatively, we could just save the list of symbol names). This will allow us to determine if the contents of a partition have changed from the previous compilation.
Note: an alternative would be to use the dependency graph edges to determine when a partition is invalidated. Basically we would create dep-nodes representing the partition map and so forth. However, we decided not to do this because the resulting graph would be quite coarse and not effective in practice without manual intervention. For example, when computing the partitioning, we enumerate all the items, which means that we wind up tracing from a function F to its callees. However, if the body of one of those callees changes, it does not imply that the partition containing F would (necessarily) need to be rebuilt. Moreover, just adding edges after the fact is a bit tricky, since we have to be careful that if new items are added to the partition, we will regenerate it.
So TL;DR it seems simplest to always regenerate the partitions and then compare the results.
cc @michaelwoerister
The text was updated successfully, but these errors were encountered: