Skip to content

Dataflow: Expose stage 1's fwdFlow#21631

Open
MathiasVP wants to merge 1 commit intogithub:mainfrom
MathiasVP:expose-fwd-stage-1
Open

Dataflow: Expose stage 1's fwdFlow#21631
MathiasVP wants to merge 1 commit intogithub:mainfrom
MathiasVP:expose-fwd-stage-1

Conversation

@MathiasVP
Copy link
Copy Markdown
Contributor

@MathiasVP MathiasVP commented Apr 2, 2026

For some exploratory AI work we're doing (which combines CodeQL and AI) it's super useful to give the AI a set of nodes that are reachable from a given source node without locking down to a specific sink. Having access to stage 1's fwdFlow predicate would allow me to do just that.

I'm well aware of the precision implications of only running (half of) stage 1, but this seems to work out very well in practice.

@MathiasVP MathiasVP requested a review from a team as a code owner April 2, 2026 10:33
Copilot AI review requested due to automatic review settings April 2, 2026 10:33
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

Seems fine to me; with the usual caveat that this is in internal code, so no guarantees about API stability. @aschackmull : Do you have any concerns?

Comment on lines +94 to +96
predicate fwdFlow(Nd node);

predicate fwdFlow(Nd node, Ap ap);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need for the binary fwdFlow, right? It's only there for revFlow because this section of the signature is implicitly extending/including the StageSig signature, and we're not adding fwdFlow to that.

For the same reason, the unary fwdFlow signature should be moved a couple of lines up, so it's above the // begin StageSig comment.

(We don't yet have the proper QL language feature to do this kind of signature sharing, so there's just a comment bracketing the StageSig part).

Comment on lines +1300 to +1303
predicate fwdFlow(Nd node, Ap ap) {
Stage1::fwdFlow(node) and
exists(ap)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delete.


predicate fwdFlow(Nd node) { Stage1::fwdFlow(node.getNodeEx()) }

predicate fwdFlow(Nd node, Ap ap) { Stage1::fwdFlow(node.getNodeEx()) and exists(ap) }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Delete.

@aschackmull
Copy link
Copy Markdown
Contributor

Do you have any concerns?

Only a few minor points as noted.

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

Labels

DataFlow Library no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants