Abstract Interpretation Framework#13003
Conversation
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
|
Hi @samuel-malec , could you provide some context on this PR? Is this work coordinated with someone in the GraalVM compiler or native image team? Is there a writeup on the general design of this framework and the kinds of results it achieves? |
|
Hi, This work builds on my previous research on integrating abstract interpretation into GraalVM Native Image (done as part of my bachelor’s thesis. The goal of this framework is to enable static analyses that can operate directly within the Native Image analysis pipeline. The design is currently exploratory and aimed at evaluating what kinds of analyses (e.g., dataflow analyses, bounds checking, resource leaks tracking, etc...) can be expressed and made practical in this setting. I’m working on a more complete write-up of the architecture and intended use-cases, which I’m happy to share once it’s in a presentable state. Right now I created this pr so that @d-kozak can look more in-depth into the implementation.
|
|
Hi David @d-kozak and Samuel @samuel-malec, Christoph (@00asdf) has been working on something somewhat similar. @d-kozak I believe you two talked about it in Vienna at some point. We have a draft write up describing it an could probably share it offline. |
Overview
A static program analysis framework for GraalVM Native Image that uses abstract interpretation to discover compile-time optimizations.
Quick Start
Enable with a single flag (runs intraprocedural analysis by-default):
Enable interprocedural analysis:
Key Classes for Code Review
Entry Points (Start Here)
AbstractInterpretationDriver.java- Configures and launches the frameworkAbstractInterpretationEngine.java- Orchestrates analysis executionAIFOptions.java- All configuration optionsAnalysis Engine
IntraProceduralAnalyzer.java- Single-method analysisInterProceduralAnalyzer.java- Cross-method context-sensitive analysisAbstract Domains (The Math)
AbstractDomain.java- Lattice operations interfaceAbstractMemory.java- Main domain combining environment + storeIntInterval.java- Integer interval domain [lower, upper]Transfer Functions (The Logic)
DataFlowIntervalAbstractInterpreter.java- Interprets some Graal IR node types and performs numerical dataflow analysisOptimization Discovery
ConstantValueChecker.java- Finds constant valuesIfConditionChecker.java- Finds dead branchesFixpoint Algorithm
FixpointIterator.java- Iterates until stable solutionWeakTopologicalOrdering.java- Efficient CFG traversal for loopsMethod Summaries (Performance)
SummaryManager.java: Method summary cacheSummary.java: Encapsulates method behaviorSummaryFactory.java: Factory for creating summariesDataFlowIntervalAnalysisSummaryFactoryfor interval-based summaries