Data flow: Earlier pruning based on accessPathLimit - #22320
Open
hvitved wants to merge 1 commit into
Open
Conversation
hvitved
force-pushed
the
dataflow/ap-limit-check
branch
from
August 11, 2026 12:27
e0656b4 to
fec02fb
Compare
hvitved
marked this pull request as ready for review
August 12, 2026 06:53
Contributor
There was a problem hiding this comment.
Pull request overview
Adds earlier access-path pruning to improve data-flow analysis performance.
Changes:
- Computes lower bounds for forward and reverse access-path lengths.
- Prunes paths exceeding
accessPathLimitbefore stage 5.
Show a summary per file
| File | Description |
|---|---|
shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll |
Adds earlier forward and reverse access-path pruning. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll:1343
- Use the plural “stages” because this refers to both stage 1 and stage 2.
accessPathLimit() > 1 and // `accessPathLimit() <= 1` is already checked in stage 1 and 2
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
|
|
||
| pragma[nomagic] | ||
| private int getAPossibleMinimumLength(Ap ap) { | ||
| accessPathLimit() > 1 and // `accessPathLimit() <= 1` is already checked in stage 1 and 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
accessPathLimit = 0is checked in stage 1 andaccessPathLimit = 1is checked in stage 2, however all other access path limits are not checked until stage 5.While we cannot in general know the lengths of access paths in stages 4 and below, we can provide lower bounds, and then check those bounds against
accessPathLimit. This generalizes the check from stage 2, but unlike that check, it requires non-linear recursion, so I decided to keep the original check as-is and only apply the new check whenaccessPathLimit() > 1.DCA shows a massive 60 % reduction in total analysis time for
microsoft__vscode(down966 sfrom2,510 s).