"Red/Green dependency tracking" is what we call the improved tracking algorithm for incremental compilation. The main difference to the algorithm used at the moment is improved accuracy because it can recover from "false positives", that is, it can stop cache invalidation short if a potentially changed value turns out to not have changed after all. A (work-in-progress) description of the system can be found at https://github.com/nikomatsakis/rustc-on-demand-incremental-design-doc/blob/master/0000-rustc-on-demand-and-incremental.md. Implementing this new tracking and caching system will happen in a few phases:
Phase 1 - Red/Green without additional caching
In the first phase the core infrastructure for red/green tracking will be implemented. We do not cache any additional intermediate results but at the end of this phase, we will already have reached peak tracking accuracy.
Phase 2 - Caching ty::TypeckTables
In the second phase, support for caching ty::TypeckTables will be added, which allows the compiler to skip type checking.
Phase 3 - Caching MIR
The third phase will support for caching MIR, which should be straight forward at that point. It remains to be verified though if it actually is a performance gain to do so.
cc @nikomatsakis, @eddyb, and @rust-lang/compiler in general
"Red/Green dependency tracking" is what we call the improved tracking algorithm for incremental compilation. The main difference to the algorithm used at the moment is improved accuracy because it can recover from "false positives", that is, it can stop cache invalidation short if a potentially changed value turns out to not have changed after all. A (work-in-progress) description of the system can be found at https://github.com/nikomatsakis/rustc-on-demand-incremental-design-doc/blob/master/0000-rustc-on-demand-and-incremental.md. Implementing this new tracking and caching system will happen in a few phases:
Phase 1 - Red/Green without additional caching
In the first phase the core infrastructure for red/green tracking will be implemented. We do not cache any additional intermediate results but at the end of this phase, we will already have reached peak tracking accuracy.
DepTrackingMap::write()(incr.comp.: Remove DepGraph::write() and its callers #42192)DepNodeto use a stable hash that does not need "re-tracing" (incr.comp.: Use ICH-based DepNodes in order to make them PODs #42294)CachingPolicysupport for queries and use for CGUsty::queries::{}::try_get()Phase 2 - Caching
ty::TypeckTablesIn the second phase, support for caching
ty::TypeckTableswill be added, which allows the compiler to skip type checking.NodeIdreferenced byty::TypeckTablesover toHirId([incremental] don't useNodeIdin the HIR, but something local to an item #40303)ty::TypeckTables(incr.comp.: Implement query result cache and use it to cache type checking tables. #46004)Phase 3 - Caching MIR
The third phase will support for caching MIR, which should be straight forward at that point. It remains to be verified though if it actually is a performance gain to do so.
cc @nikomatsakis, @eddyb, and @rust-lang/compiler in general