Incremental Dataflow Graph - #2713
Conversation
…graph # Conflicts: # README.md # package-lock.json # package.json # src/dataflow/graph/graph.ts # wiki/Abstract Interpretation.md # wiki/Analyzer.md # wiki/Capabilities.md # wiki/Control Flow Graph.md # wiki/Core.md # wiki/Dataflow Graph.md # wiki/Interface.md # wiki/Linting and Testing.md # wiki/Query API.md # wiki/Signature Database.md # wiki/[Query] Call-Context.md # wiki/[Query] Config.md # wiki/[Query] Dataflow Cluster.md # wiki/[Query] Guess Dependency Versions.md # wiki/[Query] Signature.md
| } | ||
|
|
||
| public storeOldNormalizedAst(ast: NormalizedAst): void { | ||
| this.oldNormalizedAst = ast; |
There was a problem hiding this comment.
this does not have immutability guarantees (e.g. source can register new files dynamically uncovered during the DFA)
| hash = hashAst(completeAst.ast); | ||
| const oldAst = ctx.inc.getOldNormalizedAst(); | ||
| if(oldAst !== undefined){ | ||
| const updateResult = new IncrementalDataflowUpdateTypeDetector(oldAst, completeAst, ctx).determineUpdateTypes(); |
There was a problem hiding this comment.
do we want a walker class object per compare?
| const oldAst = ctx.inc.getOldNormalizedAst(); | ||
| if(oldAst !== undefined){ | ||
| const updateResult = new IncrementalDataflowUpdateTypeDetector(oldAst, completeAst, ctx).determineUpdateTypes(); | ||
| df = new IncrementalDataflowOrchestrator(oldAst, completeAst, ctx, dfDataBase as unknown as DataflowProcessorInformationBase<ParentInformation>).tryIncrementalUpdate(updateResult); |
There was a problem hiding this comment.
likewise here. why initialize the object if it may default?
| for(let i = 1; i < files.length; i++) { | ||
| /* source requests register automatically */ | ||
| df = standaloneSourceFile(i, files[i], dfData, df); | ||
| if(!df) { |
There was a problem hiding this comment.
and potentially duplicate the logic here? like maybe outsource this into multi-staged functions for the steps?
| } | ||
|
|
||
| public tryIncrementalUpdate(update: IncrementalUpdateResult): DataflowInformation | undefined { | ||
| switch(update.types[0]) { |
There was a problem hiding this comment.
- why just use 0? maybe a monoid/merge?
- this way its hard to extend, maybe a decision map/object mapping it to the handler similar to extractor?
| } | ||
| } | ||
|
|
||
| private handleNewFileAtEnd(filePath: string): DataflowInformation | undefined { |
There was a problem hiding this comment.
i think we should start with a diagram of all cases and an abstract description of what happens in that case because it is hard to follow (especially that quickly). And it is hard to decide generally whether all of these are.. correct?
| this.ctx = ctx; | ||
| } | ||
|
|
||
| determineUpdateTypes(): IncrementalUpdateResult { |
There was a problem hiding this comment.
ok this again is too much for now but maybe we should also put this into stages?
|
|
||
| return this.oldAst.files | ||
| .filter((_file, i) => !ignoreIndexes.includes(i)) | ||
| .filter(file => { |
There was a problem hiding this comment.
we should avoid chained filters like this
No description provided.