Ulgen: A Runtime Assurance Framework for Programming Safe Cyber-Physical Systems

Beyazit Yalcinkaya, Hazem Torfah, Ankush Desai, Sanjit A. SeshiaIEEE TCAD 2023 · DOI

Introduction

Modern autonomous systems, such as self-driving vehicles and delivery drones, increasingly rely on Advanced Controllers (ACs) powered by complex AI and machine learning models. While these controllers offer high performance, their black-box nature makes formal verification nearly impossible. To mitigate risks, engineers employ Runtime Assurance (RTA) frameworks, most notably the Simplex architecture. Simplex uses a "Decision Module" to monitor the system and switch from an untrusted AC to a certified Safe Controller (SC) if the system nears a hazardous state.

However, traditional RTA implementations face significant challenges in real-world deployments. Most are restricted to either time-driven or event-driven logic, failing to accommodate the hybrid needs of complex robotics. Furthermore, in multi-threaded environments, race conditions between the monitor and the controller can create "safety gaps," where a dangerous command is executed before the monitor can intervene. ULGEN is introduced as a new programming framework designed to address these gaps by providing a generalized, language-level approach to RTA.

The ULGEN Framework

ULGEN (named after a protector deity in Turkic mythology) is built upon the P programming language, an asynchronous event-driven language used for building reliable distributed systems. Unlike the standard Simplex architecture which typically pairs one AC with one SC, ULGEN generalizes the RTA module to support multiple controllers tailored for varying environmental conditions.

The generalized ULGEN RTA architecture supporting multiple untrusted and trusted controllers.

Key technical innovations in ULGEN include:

  • Hybrid Semantics: Native support for both time-driven (fixed frequency) and event-driven (reactive) execution within a single system.
  • Priority-Based Communication: The introduction of event priorities ensures that critical safety signals, such as low battery alerts, are processed with higher precedence than routine navigation tasks.
  • Atomic Execution: To eliminate concurrency risks, ULGEN treats the monitor-and-control cycle as a single atomic operation, preventing the race conditions prevalent in earlier frameworks like SOTER.
  • Formal Well-Formedness: The framework includes a mathematical formalism to prove that if an RTA module satisfies specific safety and liveness properties, the system is guaranteed to remain within its safe operating region.

Operational Logic and Switching

The core of ULGEN’s safety guarantee lies in its ability to manage transitions between different operating regions. The system monitors the state and determines whether it resides in the Advanced Controller (AC) region or must transition to the Safe Controller (SC) region to maintain stability.

Visualization of a system trajectory switching between AC and SC regions to avoid entering an unsafe state.

As shown in the figure above, the Decision Module samples the system state at a frequency determined by the current controller. If the AC (Region 1-3) moves the system toward a boundary, the RTA module intervenes, switching to the SC (Region 4) to steer the system back into a safe state before potentially handing control back to the AC (Region 5).

Evaluation and Key Results

The framework was evaluated through a series of benchmarks, including robot braking, simulated surveillance in Webots, and real-world implementation on the iClebo Kobuki mobile platform.

  • Safety Reliability: In head-to-head multi-threaded tests against SOTER, ULGEN maintained 100% safety, whereas SOTER violated safety constraints in 82% of runs due to race conditions.
  • Programming Efficiency: ULGEN significantly reduced development overhead, requiring approximately 50% fewer lines of code than SOTER to implement identical logic.
  • Performance Optimization: Real-world tests demonstrated that ULGEN allowed robots to utilize high-performance PID controllers for speed while seamlessly reverting to safe trajectory followers only when necessary. This resulted in faster lap times compared to safety-only baselines without the crashing risks of AC-only configurations.
  • Robustness: Even under intense falsification testing using the VerifAI toolkit (over 150,000 simulation steps), no safety violations were detected in well-formed ULGEN modules.

Conclusion and Future Work

ULGEN demonstrates that embedding RTA logic directly into a programming language's syntax makes safe programming the "path of least resistance." While highly effective for soft real-time robotics, future iterations aim to address the microsecond precision required for hard real-time systems like flight control. Additionally, researchers are exploring automated synthesis of "safe regions" using reachability analysis to further simplify the developer's workflow.

Summary updated

BibTeX
@article{yalcinkaya2023ulgen,
  author = {Beyazit Yalcinkaya and Hazem Torfah and Ankush Desai and Sanjit A. Seshia},
  title = {{Ulgen: A Runtime Assurance Framework for Programming Safe Cyber-Physical Systems}},
  journal = {IEEE Trans. Comput. Aided Des. Integr. Circuits Syst.},
  year = {2023},
  doi = {10.1109/tcad.2023.3246386},
}
Figure