arXiv:2610.02624cs.PLOct 2026

Manuscript Offprint

arXiv:2610.02624

Bao: Automatic Region Placement and Memory Allocation for Intermittent Computing

Byeongjee Kang, Jan Hoffmann, Limin Jia, Brandon Lucia, Feras A. Saad

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Byeongjee Kang

Carnegie Mellon University

Pittsburgh, PA, USA

byeongjee@cmu.edu

Jan Hoffmann

Carnegie Mellon University

Pittsburgh, PA, USA

jhoffmann@cmu.edu

Limin Jia

Carnegie Mellon University

Pittsburgh, PA, USA

liminjia@andrew.cmu.edu

Brandon Lucia

Carnegie Mellon University

Pittsburgh, PA, USA

Efficient Computer

Pittsburgh, PA, USA

blucia@andrew.cmu.edu

Feras A. Saad

Carnegie Mellon University

Pittsburgh, PA, USA

fsaad@cmu.edu

Abstract

Intermittent computing enables batteryless embedded devices to operate in harsh environment, but frequent power failures interrupt program execution and require careful management of state across power cycles. The core challenge is to guarantee both memory consistency and forward progress while minimizing the energy overhead of checkpointing. Recent compile-time approaches identify regions that fit in the energy buffer. At runtime, the device waits and recharges between the regions. However, they still rely on greedy or path-local heuristics that commit to local decisions and can miss globally lower-overhead boundary placements.

To address this limitation, we present BAO, a system that jointly finds optimal energy-aware region formation and memory allocation decisions with formal correctness guarantees, by formulating it as a mixed-integer linear program. We prove that any feasible solution guarantees energy safety and implement our approach in LLVM. Our evaluation on 13 benchmarks across 3 capacitor sizes shows that BAO outperforms existing baselines, achieving 10% faster execution and 52% fewer region boundary hits on average compared to the best baseline.

CCS Concepts: • Software and its engineering → Compilers; • Computer systems organization → Embedded systems; • Hardware → Power estimation and optimization.

Keywords: Intermittent Computing, Checkpointing, Memory Allocation, Compilation, Energy Modeling, Mixed-Integer Linear Programming

Figure

This work is licensed under a Creative Commons Attribution 4.0 International License.

ASPLOS '27, Heraklion, Greece.

© 2027 Copyright held by the owner/author(s).

ACM ISBN 979-8-4007-3012-2/2027/04

https://doi.org/10.1145/3845814.3850041

ACM Reference Format:

Byeongjee Kang, Jan Hoffmann, Limin Jia, Brandon Lucia, and Feras A. Saad. 2027. BAO: Automatic Region Placement and Memory Allocation for Intermittent Computing. In Proceedings of the 32nd ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1 (ASPLOS '27), April 11–15, 2027, Heraklion, Greece. ACM, New York, NY, USA, 17 pages. https://doi.org/10.1145/3845814.3850041

1 Introduction

Intermittent computing enables batteryless embedded devices to operate in environments where replacing or recharging batteries is impractical, such as implanted medical sensors, satellites, and remote environmental monitors. These devices harvest energy from ambient sources and store it in small capacitors. Due to limited stored energy, program execution is frequently interrupted by power failures. It is challenging to ensure correctness and energy efficiency in the presence of frequent power failures and reboots [20][20].

To guarantee forward progress, prior work has developed intermittent system support to save execution state in checkpoints and restore the state upon reboot from a power failure [3–5, 10, 11, 21, 23, 23–25, 28, 30, 36]. The content and placement of these checkpoints impact both correctness and energy efficiency of the intermittent execution. Checkpointing the entire volatile memory (VM) and non-volatile memory (NVM) ensures correctness, but consumes significant energy; while checkpointing only the VM state may introduce memory consistency bugs [21, 33]. Frequent checkpointing helps ensure forward progress, but the energy overhead of checkpointing and state restoration can consume a substantial portion of a device's limited energy budget. Conversely, infrequent checkpointing risks exhausting available energy before reaching the next checkpoint, undermining progress.

Prior work investigates statically-placed checkpoints [3, 10, 11, 16, 17, 19, 21, 23, 36] and voltage-triggered, dynamically placed checkpointing systems [4–6, 22, 24, 25, 28]. Some systems roll back to the most recently checkpointed

Byeongjee Kang, Jan Hoffmann, Limin Jia, Brandon Lucia, and Feras A. Saad

Figure

Figure 1. Overview of BAO's pipeline. Steps 1 and 3 are detailed in §5; Steps 2 and 4–7 in §4.

state upon reboot [10, 21, 23, 24, 36]; while others save the state right before power-off and are thus rollback-free [4, 5, 25]. To address both memory consistency and forward progress, recent rollback-free systems, ROCKCLIMB [8] and SCHEMATIC [29], divide a program into energy-aware regions at compile time, each of which is guaranteed to complete within a single charge cycle. The device recharges between them, and state is saved and restored only at region boundaries. Their energy efficiency depends critically on where region boundaries are placed, which are decided using heuristics. ROCKCLIMB [8] forms regions through a greedy traversal of the control-flow graph. SCHEMATIC [29] co-optimizes region boundaries with memory allocation (i.e., whether each variable resides in VM or NVM), since the allocation affects both the cost of ordinary execution and the cost of saving and restoring state at each boundary. Both, however, commit to local decisions rather than optimizing over the entire control-flow graph, which can miss lower-overhead placements from a global view, or insert unnecessary boundaries.

Intermittent computing is a compile-once, run-many setting: batteryless devices are deployed for long-lived operation in environments where updates are difficult or impossible, so additional compile-time effort is worthwhile when it lowers steady-state overhead and strengthens forward progress guarantees. Moreover, post-deployment debugging is infeasible, which raises the bar for correctness: the compiler should produce binaries that are guaranteed to be correct under all possible execution scenarios. These considerations motivate solving boundary placement optimally with formal correctness guarantees, rather than heuristically.

This Work. We present Boundary Allocation Optimizer (BAO), a novel compilation pipeline for intermittent computing that formulates region-boundary placement and memory allocation as a mixed-integer linear program (MILP). Our key idea is to encode energy-feasibility and variable checkpointing constraints directly in the optimization problem. Given a control-flow graph with estimated basic block execution frequencies and energy cost parameters, BAO produces a boundary placement and variable allocation that minimizes expected energy overhead, and instruments the program accordingly. By construction, an optimal solution minimizes overhead among all instrumentations representable by the MILP. We further provide a formal cost semantics and prove that any feasible solution guarantees no execution path exceeds the energy budget. Figure 1 illustrates the pipeline: the compiler profiles energy costs, chunks loops, builds a summarized control-flow graph, formulates and solves a MILP, and instruments the program with optimal region boundaries.

We assume that programs do not use recursion or indirect calls and that maximum loop trip counts are annotated. These assumptions are typical in embedded software. In our prototype, we further assume that the program is fully inclined and therefore a single function. §4.6 describes how the formulation can be extended to function calls.

We implement BAO as an LLVM IR-level compiler pass together with an energy estimation pipeline that assigns conservative energy costs to LLVM basic blocks. We also introduce a loop-chunking strategy that transforms large loops into bounded chunks that can be treated as a single node in the MILP, improving the quality of the instrumentation.

Our evaluation on 13 benchmarks across three capacitor sizes shows that BAO reduces region boundary overhead and improves execution time over both baselines while keeping MILP solve times within seconds. For evaluation, we reimplement ROCKCLIMB and SCHEMATIC as LLVM-based baselines for direct comparison. At 10 μF, compared to SCHEMATIC with LLVM 03 optimizations, BAO is 10% faster and encounters 52% fewer region boundaries on average. Under intermittent power on recorded energy-harvesting traces, BAO is 1.73×−17.81× faster than the baselines.

Key Contributions. The contributions of this paper are:

(1) We formulate region-boundary placement and memory allocation as a mixed-integer linear program that encodes energy-feasibility and memory-consistency constraints and optimizes for expected energy consumption ( §3§3 and §4§4).

(2) We introduce a formal cost semantics modeling energy consumption, and use it prove that any feasible solution of the MILP guarantees energy safety ( §4.4\S4.4).

(3) We develop a loop-chunking strategy that soundly summarizes loop energy costs for integration into the MILP formulation ( §4.5\S4.5).

(4) We implement an open-source LLVM-based compilation pipeline that formulates and solves the MILP and instruments LLVM IR, along with an energy profiling pipeline for deriving basic block-level energy estimates from hardware measurements ( §5\S5).

(5) We reimplement ROCKCLIMB and SCHEMATIC as LLVM passes with bug fixes and evaluate all three systems on thirteen benchmarks across three capacitor sizes and on recorded energy-harvesting traces, showing that BAO reduces region boundary overhead and execution time compared to both baselines ( §6\S6).

References (18)