1. 19
  1. 7

    Reverse dependency tracking

    In salsa, we use a different approach to avoid costly validation. We assign a „durability“ to each of the input keys, and each derived key gets durability as the minimal durability among the deps. Then, when an input changes, we know that all queries with higher durability are fresh. Things like standard library and 3rd party packages get high durability, so only local keys need to be revalidated.

    We haven’t tried reversed deps, so it’s unclear which approach is better. A theoretical problem with revdeps is that they make modifications more costly, but accepting should keypresses is the highest-priority task. So, in theory, it makes sense to penalize reads to make writes faster.

    1. 3

      Thanks, this sounds like an interesting approach that I should consider! Is the durability assigned to input keys manually, or can that be automated? Have you written up the details somewhere?

      1. 3

        We assign keys manually at the moment. This certainly could be automated, but manual way works well enough for us :-) For details, see https://github.com/salsa-rs/salsa-rfcs/pull/6/files

        1. 2

          Ah, now I get it. That’s quite clever! :)