Experiment: Make all data flow incremental#20028
Conversation
To ensure good performance, always run data flow overlay-informed unless the configuration has opted in to being diff-informed. This change affects only databases with an overlay and therefore has no immediate production consequences.
This won't work for other languages until we can annotate a `forceLocal` call with `local?`.
| // ensures that we re-evaluate flow that passes from a file in the | ||
| // diff (but in the base), through a file in the overlay with | ||
| // possibly important changes, back to the base. | ||
| isDiffFileNode(source) |
There was a problem hiding this comment.
This breaks a bunch of caching in a subtle way. In the base this disjunction is equivalent to any(). However we don't have any ability to optimise this. So it ends up depending on isDiffFileNode(source) which depends on the extensible predicate which changes. We therefore can't cache it.
I don't see an easy way to fix this, without exposing isEvaluatingInOverlay as a hop (i.e. a bit like the isOverlayModeElse RA hop) and also have the evaluator implemented like Hennings idea. Fundermentally we need to depend on isDiffFileNode in the overlay and we have no way to have different dependecies between overlay and base until after expansion.
On the other hand deleting it mostly gets the performance we expect (but maybe with the accuracy problems as noted by the comment)..
There was a problem hiding this comment.
It sounds like we should delete this disjunct for now since it's only there to deal with a very rare corner case.
To recover accuracy in those corner cases, how about we change the Action to include files in the overlay if they are in the diff?
|
Superseded by #20386. |
I've polished up this branch for testing and to communicate a proof-of-concept for what it would look like to have all data flow incremental, either diff-informed or "overlay-informed". The last commit uses
forceLocalto add in the base-to-base results, but it has some problems:forceLocalis in use. Alex is on it.forceLocalcan't currently be marked aslocal?. The shared code in this PR won't compile for other languages than Java because it requiresNodeto be local.To achieve the full vision of incrementality, the type tracking library also needs to be overlay-aware. That library seems to be the main performance bottleneck that we know how to address in QL.
As I'm going out on holiday now, I want to leave this PR for @alexet and @aschackmull to work from or take inspiration from.