Workshops Archive

Verification of PETSc with CIVL using LLM-generated ACSL contracts and deterministic driver generation


Workshop: 10th International Workshop on Software Correctness for HPC Applications (Correctness '26)

Authors: Hansol Suh and Jan Hückelheim (Argonne National Laboratory) and Stephen Siegel (University of Delaware)

Abstract: PETSc is widely used in science and engineering applications where wrong results can have costly consequences. Despite this, numerical libraries are rarely formally verified. One challenge is the need for an expert to hand-write a specification and verification driver, which can introduce additional bugs. With modern large language models (LLMs), it is tempting to generate drivers and reference models automatically, but one-shot generation is brittle and produces unverified code that must be audited. We present an approach that uses LLMs in a limited setting to generate a small, human-certifiable ACSL contract from a function’s documentation. A deterministic toolchain supporting a restricted ACSL profile then generates a driver that uses CIVL to check the implementation against the contract. We demonstrate the pipeline end-to-end on three PETSc functions and discover a bug in MatAYPX.


Back to 10th International Workshop on Software Correctness for HPC Applications (Correctness '26) Archive Listing

Back to Full Workshop Archive Listing