Stencil-Lifting: Hierarchical Recursive Lifting System for Extracting Summary of Stencil Kernel in Legacy Codes
We introduce Stencil-Lifting, a novel system for automatically converting stencil kernels written in low-level languages in legacy code into semantically equivalent Domain-Specific Language (DSL) implementations. Targeting the efficiency bottlenecks of existing verified lifting systems, Stencil-Lifting achieves scalable stencil kernel abstraction through two key innovations. First, we propose a hierarchical recursive lifting theory that represents stencil kernels, structured as nested loops, using invariant subgraphs, which are customized data dependency graphs that capture loop-carried computation and structural invariants. Each vertex in the invariant subgraph is associated with a predicate-based summary, encoding its computational semantics. By enforcing self-consistency across these summaries, Stencil-Lifting ensures the derivation of correct loop invariants and postconditions for nested loops, eliminating the need for external verification. Second, we develop a hierarchical recursive lifting algorithm that guarantees termination through a convergent recursive process, avoiding the inefficiencies of search-based synthesis. The algorithm efficiently derives the valid summaries of stencil kernels, and its completeness is formally proven. We evaluate Stencil-Lifting on diverse stencil benchmarks from two different suites and on four real-world applications. Experimental results demonstrate that Stencil-Lifting achieves 31.62× and 5.8× speedups compared to the state-of-the-art verified lifting systems STNG and Dexter, respectively, while maintaining full semantic equivalence. Our work significantly enhances the translation efficiency of low-level stencil kernels to DSL implementations, effectively bridging the gap between legacy optimization techniques and modern DSL-based paradigms.
Authors
- Guangming Tan (ORCID: https://orcid.org/0000-0002-6361-5948)
- Junmin Xiao (ORCID: https://orcid.org/0000-0003-0457-4709)
- Peihua Bao
- Liang Yuan (ORCID: https://orcid.org/0000-0003-3406-2907)
- Siyan Chen (ORCID: https://orcid.org/0009-0008-3778-5995)
- Hui Ma (ORCID: https://orcid.org/0000-0002-7083-9552)
- Mingyi Li (ORCID: https://orcid.org/0000-0003-4266-908X)
- Xi Chen (ORCID: https://orcid.org/0009-0009-6180-4524)
Institutions
- Chinese Academy of Sciences (CN)
- Institute of Computing Technology (CN)
- University of Chinese Academy of Sciences (CN)
Publication Details
- Journal
- Proceedings of the ACM on Programming Languages
- Published
- 2025-10-09
- DOI
- https://doi.org/10.1145/3763159
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00