Verification Toolchain for Floating-Point Programs.

Ariel Kellison, Andrew W. Appel, David Bindel, Heidi Thornquist, Geoffrey C. Hulette2022

Numerical algorithms are the backbone of scientific computing, yet they are notoriously difficult to verify. As developers push for higher performance, they often employ complex optimizations like mixed-precision arithmetic and reduced communication. Traditional software testing is insufficient in these contexts because it can only check a finite set of inputs; it cannot prove the absence of catastrophic rounding errors or subtle bugs in how a high-level algorithm is translated into machine instructions.

This research, presented by Ariel E. Kellison and Andrew W. Appel, outlines a comprehensive formal verification framework designed to bridge the "logical gap" between high-level mathematical models and low-level executable code. By integrating specialized tools within a proof assistant, the framework provides a "chain of trust" that guarantees numerical accuracy and program reliability in high-performance computing environments.

The Multi-Layered Verification Toolchain

The researchers propose a three-layer verification toolchain implemented within the Coq proof assistant. This approach ensures that verification is not a monolithic, insurmountable task, but rather a series of composable proofs.

The three-layer verification framework linking domain-specific specifications to machine-language programs.
  1. Domain-Specific Layer (Layer 3): This layer deals with high-level mathematical abstractions, such as matrices or derivatives. It proves properties like discretization error—ensuring the "ideal" mathematical model actually solves the real-world problem.
  2. Floating-Point Layer (Layer 2): This layer bridges ideal arithmetic with floating-point reality. It uses specialized tools to prove that a floating-point specification accurately approximates the ideal mathematical specification.
  3. Language-Level Layer (Layer 1): Focuses on standard program correctness. It leverages the Verified Software Toolchain (VST) and the CompCert C Compiler to prove that the imperative source code correctly implements the floating-point specification and that the compiler correctly translates that code into machine language.

Automating Floating-Point Analysis with VCFloat

Floating-point error analysis is famously tedious and error-prone for humans. To address this, the framework utilizes VCFloat, a tool that automates the generation of provably correct rounding error bounds.

The VCFloat workflow for generating provable rounding error bounds from functional specifications.

VCFloat works by "reifying" functional code into an abstract syntax tree (AST). It then applies a formal rounding error model to compute a bound ($|f - \hat{f}| \le err$). This automation removes a major barrier to formalizing numerical code, allowing researchers to focus on high-level properties rather than manual error tracking.

Key Insights and Results

The most significant insight of this work is the power of compositionality. By breaking the problem into language, floating-point, and domain layers, the authors make it possible to use specialized tools (like CompCert for the compiler and VCFloat for the math) while maintaining a single, unbroken chain of formal proof. Unlike software testing, this framework provides a mathematical guarantee of reproducibility and correctness for all valid inputs.

The framework has already been applied to verify a symplectic solver for an Ordinary Differential Equation (ODE). Symplectic solvers are designed to preserve physical properties, such as energy, over long periods. Proving they maintain these properties in the presence of floating-point rounding is a significant milestone for formal methods in scientific computing.

Future Directions

While the toolchain significantly advances numerical verification, challenges remain in proof automation and scaling to more complex algorithms. Future work aims to apply the framework to:

  • Pipelined Conjugate Gradient (CG) solvers.
  • Multiple precision iterative solvers.
  • Higher-precision arithmetic packages (double-double and quad-double).
  • Formalizing complex error bounds on conserved physical quantities and symplectic error.

Summary updated

BibTeX
@misc{kellison2022verification,
  author = {Ariel Kellison and Andrew W. Appel and David Bindel and Heidi Thornquist and Geoffrey C. Hulette},
  title = {{Verification Toolchain for Floating-Point Programs.}},
  year = {2022},
  doi = {10.2172/2004015},
}
Figure