To speed up tree traversals, we want to skip traversing subtrees when we know the traversal will have no effect.
This is often the case for foreign accesses, since usually foreign accesses happen several times in a row, but also
foreign accesses are idempotent. In particular, see tests foreign_read_is_noop_after_foreign_write
and all_transitions_idempotent
.
Thus, for each node we keep track of the “strongest idempotent foreign access” (SIFA), i.e. which foreign access can be skipped.
Note that for correctness, it is not required that this is the strongest access, just any access it is idempotent under. In particular, setting
it to None
is always correct, but the point of this optimization is to have it be as strong as possible so that more accesses can be skipped.
This enum represents the kinds of values we store: