Skip to content

Incremental Dataflow Graph - #2713

Draft
stimjannik wants to merge 6 commits into
mainfrom
incremental-dataflow-graph
Draft

Incremental Dataflow Graph#2713
stimjannik wants to merge 6 commits into
mainfrom
incremental-dataflow-graph

Conversation

@stimjannik

@stimjannik stimjannik commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@stimjannik stimjannik self-assigned this Aug 12, 2026
…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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not have immutability guarantees (e.g. source can register new files dynamically uncovered during the DFA)

Comment thread src/dataflow/extractor.ts
hash = hashAst(completeAst.ast);
const oldAst = ctx.inc.getOldNormalizedAst();
if(oldAst !== undefined){
const updateResult = new IncrementalDataflowUpdateTypeDetector(oldAst, completeAst, ctx).determineUpdateTypes();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want a walker class object per compare?

Comment thread src/dataflow/extractor.ts
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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise here. why initialize the object if it may default?

Comment thread src/dataflow/extractor.ts
for(let i = 1; i < files.length; i++) {
/* source requests register automatically */
df = standaloneSourceFile(i, files[i], dfData, df);
if(!df) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid chained filters like this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants