Towards Transparent Checkpointing with AI-driven Code Generation

Hai Duc Nguyen, Tekin Bicer, Kyle Chard, Ian T. Foster, Bogdan Nicolae

TL;DR

This paper demonstrates that frontier Large Language Models (LLMs) can autonomously engineer production-grade fault tolerance for complex scientific applications. By using an iterative generate-validate-repair loop, the authors show that Claude Opus 4.7 can successfully integrate application-level checkpointing into unmodified Message Passing Interface (MPI) codes with zero human intervention, achieving performance and efficiency comparable to human-written baselines.

What Problem Does This Paper Address?

High-Performance Computing (HPC) applications often run for days or weeks across thousands of compute nodes, making them highly vulnerable to hardware failures. To prevent losing all progress when a node crashes, developers use checkpoint/restart (C/R)—periodically saving the application's state to storage so it can resume later.

However, writing efficient application-level checkpointing is incredibly difficult. It requires an expert to deeply understand the codebase, identify exactly which data structures are critical (and which can be recomputed), and find safe synchronization points to save data without destroying performance. Automated "transparent" tools exist, but they blindly copy the entire memory space, creating massive, unscalable checkpoint files. The authors investigate whether an LLM coding agent can bridge this gap: can an AI autonomously analyze an unfamiliar scientific codebase and inject efficient, application-level checkpointing?

Methods

The authors developed a closed-loop, automated generate–validate–repair pipeline driven by Anthropic’s Claude Opus 4.7 via the OpenCode CLI agent framework.

End-to-end LLM-driven pipeline for adding checkpoint/restart resilience to an unmodified MPI application.

The pipeline operates in four distinct phases:

  1. Reconnaissance: The LLM explores the source tree to locate the main simulation loop and reads the documentation for VeloC (a high-performance multi-level checkpointing runtime).
  2. Critical-State Identification: The agent analyzes data structures to separate "rebuildable" data (like static grids or input parameters) from "evolving" data (like particle positions or loop counters) that must be saved.
  3. Implementation: The agent injects VeloC API calls to initialize the runtime, declare memory regions for evolving data, trigger checkpoints at regular intervals, and add restart logic.
  4. Validation & Correction: An independent automated harness attempts to compile and run the modified code. It tests both a failure-free run and a failure-injected run (where an MPI rank is killed mid-execution). If the code fails to compile, outputs incorrect results, or fails to recover, the error logs are fed back to the LLM to trigger a repair iteration.

Datasets

The approach was evaluated on a benchmark suite of six diverse, open-source MPI scientific applications representing different domains, programming languages (C and C++), and data structures:

  • HPCG: A sparse linear solver (fixed-size arrays).
  • CoMD: A molecular dynamics proxy (dynamic atom migration).
  • OpenLB: A lattice-Boltzmann fluid solver (complex internal object layouts).
  • SPARTA: A Monte Carlo code for rarefied gases (variable-per-rank particle counts).
  • Athena++: An astrophysical magnetohydrodynamics code (adaptive mesh refinement trees).
  • LAMMPS: A massive, production-grade molecular dynamics simulator (highly complex topological connectivity).

For each application, the authors stripped out any existing resilience code to create a "vanilla" baseline for the LLM, while retaining the original human-engineered implementation as a "reference" benchmark.

Key Insights and Ideas

  • The "Minimalist" Strategy: Instead of conservatively saving everything, the LLM agent naturally defaults to a minimalist approach. It identifies a small, sufficient set of evolving variables, defends its choices in its text logs, and only expands coverage if forced to by validator failures. This keeps checkpoint sizes remarkably lean.
  • Opportunistic Code Reuse: Rather than writing complex serialization logic from scratch, the LLM actively searches the codebase for existing internal utilities. For instance, in OpenLB, it discovered and reused built-in inter-process communication buffers to serialize complex objects as a black box.
  • Input Context Dominates Cost: In agentic workflows, the financial and token cost is heavily skewed toward input tokens rather than output generation. The agent repeatedly re-reads large portions of the source tree across iterations, meaning code pre-summarization or chunking is critical for cost-efficiency.

Key Results

  • Fast Convergence: The loop successfully generated working, correct checkpoint/restart code for all six applications. It took a median of just 2 iterations and an average of 50 minutes of wall-clock time per application.
Time consumed by the LLM iterative loop to produce a working checkpoint/restart implementation, per app.
  • Negligible Overhead: In failure-free runs, the AI-generated code imposed essentially 0% runtime overhead (within $\pm2\%$ measurement noise) on five out of six applications, matching the human reference implementations.
  • Effective Recovery: When a failure was injected mid-run, the LLM-modified applications successfully detected the checkpoint, restored state, and resumed execution. The total runtime was roughly one-third faster than restarting from scratch, performing within $\pm6\%$ of the expert human-engineered reference.
Per-app end-to-end execution time with a failure injected mid-run.

Limitations and Future Work

While highly promising, the authors note several limitations:

  • Token Consumption: The pipeline consumed an average of 3.4 million tokens per application, translating to roughly \$50–\$400 in API costs per run. For massive codebases, this brute-force context scanning will become prohibitively expensive without smart code chunking.
  • Simplified Evaluation Environment: Testing was restricted to a single development host running 4 MPI ranks. Real-world HPC environments involve multi-node scaling, complex parallel file systems, and irregular distributed states that might expose edge cases the validator missed.
  • Auditability: Automatically generated resilience code must be easily auditable and maintainable by human developers before it can be safely integrated into production scientific workflows.

Summary updated

BibTeX
@inproceedings{nguyen2026towards,
  author = {Hai Duc Nguyen and Tekin Bicer and Kyle Chard and Ian T. Foster and Bogdan Nicolae},
  title = {{Towards Transparent Checkpointing with AI-driven Code Generation}},
  booktitle = {HPDC},
  year = {2026},
  doi = {10.1145/3806645.3816239},
}
Figure