One Behavior, Out of Order: Deterministic Execution and Parallel Simulation of ROS 2 Applications

Chengzi Huang, Behnam Khodabandeloo, Duc Anh Nguyen, Chuanchao Gao, Wang YiarXiv 2026

Imagine you’re debugging a self-driving car in a simulator. One time, it brakes perfectly for a pedestrian; the next time, with the exact same inputs, it misses. This "Heisenbug" isn't a ghost in the machine—it’s the result of how modern robotics software handles time.

This paper introduces a way to make these simulations perfectly predictable (deterministic) and then exploits that predictability to run them incredibly fast by executing tasks "out of order" across hundreds of CPU cores.

TL;DR

By forcing every component in a ROS 2 application to read and write data at fixed, "scripted" time intervals, the authors eliminate the randomness of asynchronous communication. Because the timing is now predictable, they can run simulation tasks out of chronological order across multiple cores, achieving massive speedups (up to 228x) without ever breaking the logic of the robot.

What Problem Does This Paper Address?

The Robot Operating System 2 (ROS 2) is the industry standard for building robots. It relies on an asynchronous "publish-subscribe" model: components (nodes) shout data to each other whenever they’re ready.

The catch? In a simulation, the order in which these messages arrive depends on your computer's CPU speed, what else you're running, and how the OS schedules tasks. This leads to nondeterminism. As shown in the figure below, a slight delay in a "Detector" node can cause a "Planner" node to use an old image instead of a new one, changing the robot's behavior entirely between two identical runs.

Fig. 1. Running example. Detector’s execution time changes the behavior.

Existing solutions are either slow (running everything on one thread to keep it simple) or incredibly complex (using "optimistic" execution that has to "roll back" time if a message arrives late).

Methods

The authors propose a two-step solution:

  1. Logical Execution Time (LET) Coordination: They introduce a lightweight scheme where every component—even event-driven ones—reads its inputs and writes its outputs at predefined time instants. It’s like a relay race where the baton is only handed over at specific marks on the track, regardless of how fast the runner gets there. This makes the application's behavior independent of the underlying hardware.
  2. Out-of-Order Parallel Simulation: Normally, simulators process events in chronological order (1ms, then 2ms, etc.). But because the read/write times are now fixed, the "who depends on whom" is known before the simulation even starts.
  3. The authors represent these dependencies as a Directed Acyclic Graph (DAG) of "jobs."
    • A job can start as soon as its dependencies (the previous state of the node and the specific input messages it needs) are ready, even if that job is technically "in the future" relative to other tasks.
The dependencies between jobs form a predictable graph, allowing them to run out of order.

Datasets

The researchers evaluated their simulator using:

  • Industrial Use Cases: The Autoware reference system (a full autonomous driving stack), fleets of multiple vehicles, and a stereo vision pipeline.
  • Synthetic Graphs: 1,385 randomly generated ROS 2 application graphs to test the limits of their algorithm across different complexities.

Key Insights and Ideas

  • The Power of "Empty Records": To keep the dependency graph predictable, components must "write" an output even if they have no new data to send. This "empty record" tells the next component in line, "I have nothing for you at this timestamp, you can proceed."
  • Determinism Enables Parallelism: Usually, parallelizing a simulation is hard because you don't know if a future event will affect a past one. By enforcing strict timing (determinism), the authors turned a chaotic timing problem into a static scheduling problem.
  • Zero-Change Integration: They implemented this as a layer beneath the standard ROS 2 C++ library (rclcpp). This means developers can use this high-speed, deterministic simulator without changing a single line of their original robot code.

Key Results

  • Massive Scaling: On a 256-core machine, the simulator was up to 228x faster than a standard sequential simulation. This reached 91% of the theoretical maximum speedup possible.
  • Beating the Competition: It was up to 2.6x faster than "synchronous" parallel simulators (which force all cores to wait at a barrier after every time step).
  • Memory Efficiency: It used an order of magnitude less memory for message buffering compared to "asynchronous" parallel simulators, thanks to a clever cyclic storage system for records.

Limitations and Future Work

  • Single Publishers Only: The current coordination scheme assumes each topic has only one publisher. If multiple nodes publish to the same topic, the order becomes ambiguous again.
  • Static Structure: The system doesn't yet support applications that change their structure (e.g., adding or removing nodes) while the simulation is running.
  • Future Directions: The authors aim to extend the system to handle these dynamic changes and multi-publisher scenarios.

Summary updated

Abstract

System-level simulation is widely used to validate robotic applications before hardware deployment. However, Robot Operating System 2 (ROS 2), a popular middleware for such applications, uses asynchronous publish-subscribe communication, which can make application behavior depend on scheduling and the platform. The behavior can then vary across runs and machines even with the same inputs. This nondeterminism makes faults hard to reproduce and tests unreliable. In this paper, we first give ROS 2 applications a lightweight coordination scheme in which every component, including event-driven ones, reads its inputs and writes its outputs at predefined time instants. By decoupling computation and communication, the scheme makes an application deterministic, that is, it always has one behavior for given inputs. Tests are thus repeatable, but for large applications they still take a long time. To speed up these tests, we then present an out-of-order parallel simulation algorithm. From the predefined read and write instants, it knows before the run which activations of components depend on which. It starts each activation as soon as those it depends on have finished. Finally, we implement the algorithm in a simulator that runs existing ROS 2 applications without any change to them or to ROS 2. We evaluate the simulator on industrial use cases and synthetic graphs. On the industrial use cases, it is up to 2.6 times faster than synchronous parallel simulation and needs an order of magnitude less memory for messages than asynchronous parallel simulation.
BibTeX
@misc{huang2026one,
  author = {Chengzi Huang and Behnam Khodabandeloo and Duc Anh Nguyen and Chuanchao Gao and Wang Yi},
  title = {{One Behavior, Out of Order: Deterministic Execution and Parallel Simulation of ROS 2 Applications}},
  year = {2026},
  eprint = {2611.26676},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26676},
}
Figure